Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: RTL8192CU on ARM not working
From: Richard Genoud @ 2013-06-27 12:13 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Larry.Finger, chaoming_li, linville, linux-wireless, netdev,
	linux-kernel, linux-arm-kernel, Alexandre Belloni, Brian Lilly,
	Brent-Crosby, Jim Wall, Thomas Petazzoni
In-Reply-To: <20130627081225.GJ5803@lukather>

2013/6/27 Maxime Ripard <maxime.ripard@free-electrons.com>:
> Hi everyone,
>
> I'm currently trying to use a RTL8192CU on an ARM (Freescale imx28,
> armv5) platform, using 3.10-rc3.
>
> Trouble is, while the chip is correctly detected and you can use iw on it
> without any problem it seems, once you start an association to an access
> point, the association goes on, seems to associate, displaying a WARN()
> message [1] and then, after what looks like a random amount of time (could
> be right away, could be after a few minutes), deassociate [2].
>
> During the time where it's associated, we never seem to transmit any
> packets, while iw reports packets being sent, I guess we can assume that
> they are actually never transmitted as well [3].
>
> What seems odd to me as well is that the signal power reported for the access
> point is excessively high when using iw scan (10 dbm), and once connected, the
> signal strength is -64dbm, which makes quite a huge difference.
>
> Do you have any suggestions on how to solve this issue?
>
> Thanks,
> Maxime
>
>
> [1]:
> # iw wlan0 connect FreeWifi 2447
> # [  485.010858] wlan0: authenticate with f4:ca:e5:c9:f5:91
> [  485.065514] wlan0: send auth to f4:ca:e5:c9:f5:91 (try 1/3)
> [  485.075963] wlan0: authenticated
> [  485.088915] wlan0: associate with f4:ca:e5:c9:f5:91 (try 1/3)
> [  485.117137] wlan0: RX AssocResp from f4:ca:e5:c9:f5:91 (capab=0x401 status=0 aid=1)
> [  485.130607] wlan0: associated
> [  486.917555] ------------[ cut here ]------------
> [  486.922277] WARNING: at kernel/workqueue.c:1365 __queue_work+0x1f0/0x2f4()
> [  486.929175] Modules linked in:
> [  486.932284] CPU: 0 PID: 615 Comm: kworker/0:2 Not tainted 3.10.0-rc3 #2
> [  486.938958] Workqueue: rtl92c_usb rtl_watchdog_wq_callback
> [  486.944548] [<c00147dc>] (unwind_backtrace+0x0/0xf0) from [<c00120a0>] (show_stack+0x10/0x14)
> [  486.953132] [<c00120a0>] (show_stack+0x10/0x14) from [<c001d2ec>] (warn_slowpath_common+0x4c/0x68)
> [  486.962140] [<c001d2ec>] (warn_slowpath_common+0x4c/0x68) from [<c001d324>] (warn_slowpath_null+0x1c/0x24)
> [  486.971844] [<c001d324>] (warn_slowpath_null+0x1c/0x24) from [<c003769c>] (__queue_work+0x1f0/0x2f4)
> [  486.981025] [<c003769c>] (__queue_work+0x1f0/0x2f4) from [<c0037830>] (queue_work_on+0x80/0x88)
> [  486.989777] [<c0037830>] (queue_work_on+0x80/0x88) from [<c0267ca4>] (rtl_watchdog_wq_callback+0x5dc/0x8bc)
> [  486.999572] [<c0267ca4>] (rtl_watchdog_wq_callback+0x5dc/0x8bc) from [<c0038cbc>] (process_one_work+0x1c0/0x4c8)
> [  487.009795] [<c0038cbc>] (process_one_work+0x1c0/0x4c8) from [<c0039684>] (worker_thread+0x140/0x3ac)
> [  487.019065] [<c0039684>] (worker_thread+0x140/0x3ac) from [<c003f914>] (kthread+0xa4/0xb0)
> [  487.027381] [<c003f914>] (kthread+0xa4/0xb0) from [<c000f0c0>] (ret_from_fork+0x14/0x34)
> [  487.035498] ---[ end trace 93341a0c249e647e ]---
>
>
> [2]:
>
> # [  786.086127] wlan0: deauthenticated from f4:ca:e5:c9:f5:91 (Reason: 2)
> [  786.126368] cfg80211: Calling CRDA to update world regulatory domain
>
>
> [3]:
> # iw wlan0 station dump
> Station f4:ca:e5:c9:f5:91 (on wlan0)
>         inactive time:  55430 ms
>         rx bytes:       77826
>         rx packets:     1026
>         tx packets:     2
>         tx retries:     0
>         tx failed:      0
>         signal:         -64 dBm
>         signal avg:     -63 dBm
>         tx bitrate:     1.0 MBit/s
>         authorized:     yes
>         authenticated:  yes
>         preamble:       long
>         WMM/WME:        yes
>         MFP:            no
>         TDLS peer:      no

Hi Maxime,

You should have a look at https://lkml.org/lkml/2013/6/11/300
(in short, use 3.10-rc7)

The warning is still there, but I managed use this device on ARM
(sam9g35) as a client.

Regards,
Richard

^ permalink raw reply

* [PATCH v13 2/2] cfg80211: P2P find phase offload
From: Vladimir Kondratiev @ 2013-06-27 11:17 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Vladimir Kondratiev, linux-wireless, Luis R . Rodriguez,
	John W . Linville, Jouni Malinen, Arend van Spriel, Peer, Ilan
In-Reply-To: <1372331863-14083-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;
- Driver indicate firmware or driver responds to the probe requests by setting
  feature NL80211_FEATURE_P2P_PROBE_RESP_OFFLOAD
- wpa_supplicant analyses methods supported to discover p2p offload support;
- wpa_supplicant analyses feature flags to discover p2p probe response
  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
- 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 |  14 +++
 net/wireless/nl80211.c       | 205 +++++++++++++++++++++++++++++++++++++++++++
 net/wireless/rdev-ops.h      |  19 ++++
 net/wireless/trace.h         |  44 ++++++++++
 5 files changed, 358 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index c6acc70..c2dace9 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1833,6 +1833,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
@@ -2071,6 +2101,24 @@ struct cfg80211_update_ft_ies_params {
  *	driver can take the most appropriate actions.
  * @crit_proto_stop: Indicates critical protocol no longer needs increased link
  *	reliability. This operation can not fail.
+ *
+ * @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);
@@ -2306,6 +2354,12 @@ struct cfg80211_ops {
 				    u16 duration);
 	void	(*crit_proto_stop)(struct wiphy *wiphy,
 				   struct wireless_dev *wdev);
+
+	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);
 };
 
 /*
@@ -2937,6 +2991,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));
 
@@ -4207,6 +4262,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 a042507..4c18cc7 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -810,6 +810,9 @@ enum nl80211_commands {
 	NL80211_CMD_CRIT_PROTOCOL_START,
 	NL80211_CMD_CRIT_PROTOCOL_STOP,
 
+	NL80211_CMD_START_P2P_FIND,
+	NL80211_CMD_STOP_P2P_FIND,
+
 	/* add new commands above here */
 
 	/* used to define NL80211_CMD_MAX below */
@@ -1440,6 +1443,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
  */
@@ -1742,6 +1749,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,
@@ -3598,6 +3608,9 @@ enum nl80211_ap_sme_features {
  *	interface. An active monitor interface behaves like a normal monitor
  *	interface, but gets added to the driver. It ensures that incoming
  *	unicast packets directed at the configured interface address get ACKed.
+ * @NL80211_FEATURE_P2P_PROBE_RESP_OFFLOAD: When in P2P find phase,
+ *	the device may respond to some probe-requests in hardware;
+ *	replied probe-requests may be not reported to the upper layers.
  */
 enum nl80211_feature_flags {
 	NL80211_FEATURE_SK_TX_STATUS			= 1 << 0,
@@ -3618,6 +3631,7 @@ enum nl80211_feature_flags {
 	NL80211_FEATURE_FULL_AP_CLIENT_STATE		= 1 << 15,
 	NL80211_FEATURE_USERSPACE_MPM			= 1 << 16,
 	NL80211_FEATURE_ACTIVE_MONITOR			= 1 << 17,
+	NL80211_FEATURE_P2P_PROBE_RESP_OFFLOAD		= 1 << 18,
 };
 
 /**
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 8c98083..a681247 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -349,6 +349,8 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
 	[NL80211_ATTR_IE_RIC] = { .type = NLA_BINARY,
 				  .len = IEEE80211_MAX_DATA_LEN },
 	[NL80211_ATTR_PEER_AID] = { .type = NLA_U16 },
+	[NL80211_ATTR_MIN_DISCOVERABLE_INTERVAL] = { .type = NLA_U32 },
+	[NL80211_ATTR_MAX_DISCOVERABLE_INTERVAL] = { .type = NLA_U32 },
 };
 
 /* policy for the key attributes */
@@ -1393,6 +1395,8 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
 		if (state->split) {
 			CMD(crit_proto_start, CRIT_PROTOCOL_START);
 			CMD(crit_proto_stop, CRIT_PROTOCOL_STOP);
+			CMD(start_p2p_find, START_P2P_FIND);
+			CMD(stop_p2p_find, STOP_P2P_FIND);
 		}
 
 #ifdef CONFIG_NL80211_TESTMODE
@@ -8337,6 +8341,152 @@ 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;
+
+	if (attr_freq) {
+		n_channels = validate_scan_freqs(attr_freq);
+		if (!n_channels)
+			return -EINVAL;
+	} else {
+		n_channels = ARRAY_SIZE(social_freqs);
+	}
+	params.channels = kzalloc(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);
+	}
+
+	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);
+
+	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
@@ -9010,6 +9160,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,
@@ -10677,6 +10843,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 9f15f0a..94ff98a 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -923,4 +923,23 @@ static inline void rdev_crit_proto_stop(struct cfg80211_registered_device *rdev,
 	trace_rdev_return_void(&rdev->wiphy);
 }
 
+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 e1534baf..d4e4886 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -1841,6 +1841,36 @@ TRACE_EVENT(rdev_crit_proto_stop,
 		  WIPHY_PR_ARG, WDEV_PR_ARG)
 );
 
+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		     *
  *************************************************************/
@@ -2520,6 +2550,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 v13 1/2] cfg80211: add 'flags' to cfg80211_rx_mgmt()
From: Vladimir Kondratiev @ 2013-06-27 11:17 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Vladimir Kondratiev, linux-wireless, Luis R . Rodriguez,
	John W . Linville, Jouni Malinen, Arend van Spriel, Peer, Ilan
In-Reply-To: <1372331863-14083-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 dc8059a..21c791e 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 7b0730a..c6acc70 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -3886,6 +3886,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
@@ -3897,7 +3898,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 861e5eb..a042507 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1436,6 +1436,10 @@ enum nl80211_commands {
  *	allowed to be used with the first @NL80211_CMD_SET_STATION command to
  *	update a TDLS peer STA entry.
  *
+ * @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
  */
@@ -1736,6 +1740,8 @@ enum nl80211_attrs {
 
 	NL80211_ATTR_PEER_AID,
 
+	NL80211_ATTR_RXMGMT_FLAGS,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
@@ -3758,4 +3764,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 23dbcfc..3f7fa49 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2635,8 +2635,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 7dc3343..8c98083 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -9994,7 +9994,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;
@@ -10017,7 +10017,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 a4073e8..3b51a76 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

* [PATCH v13 0/2] P2P find phase offload
From: Vladimir Kondratiev @ 2013-06-27 11:17 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Vladimir Kondratiev, linux-wireless, Luis R . Rodriguez,
	John W . Linville, Jouni Malinen, Arend van Spriel, Peer, Ilan

Addressing next round of input

- add more comments about NL80211_ATTR_RXMGMT_FLAGS
- always supply non-empty channel list for start_p2p_find();
  in case wpa_s don't provide one, build our own
- track p2p find state, similar to nl80211_start_p2p_device()
  and protect from multiple start/stop requests. For this,
  out-of context of stop_p2p_find call of cfg80211_p2p_find_notify_end
  now requires rtnl_lock()

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                  |  31 ++++
 net/mac80211/rx.c                             |   3 +-
 net/wireless/mlme.c                           |   4 +-
 net/wireless/nl80211.c                        | 211 +++++++++++++++++++++++++-
 net/wireless/nl80211.h                        |   2 +-
 net/wireless/rdev-ops.h                       |  19 +++
 net/wireless/trace.h                          |  44 ++++++
 12 files changed, 393 insertions(+), 17 deletions(-)

-- 
1.8.1.2


^ permalink raw reply

* [PATCH v2] mac80211: prevent the buffering or frame transmission to non-assoc mesh STA
From: Chun-Yeow Yeoh @ 2013-06-27 10:42 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, linville, devel, Chun-Yeow Yeoh

This patch is intended to avoid the buffering to non-assoc mesh STA
and also to avoid the triggering of frame to non-assoc mesh STA which
could cause kernel panic in specific hw.

One of the examples, is kernel panic happens to ath9k if user space
inserts the mesh STA and not proceed with the SAE and AMPE, and later
the same mesh STA is detected again. The sta_state of the mesh STA remains
at IEEE80211_STA_NONE and if the ieee80211_sta_ps_deliver_wakeup is called
and subsequently the ath_tx_aggr_wakeup, the kernel panic due to
ath_tx_node_init is not called before to initialize the require data
structures.

This issue is reported by Cedric Voncken before.
http://www.spinics.net/lists/linux-wireless/msg106342.html

[<831ea6b4>] ath_tx_aggr_wakeup+0x44/0xcc [ath9k]
[<83084214>] ieee80211_sta_ps_deliver_wakeup+0xb8/0x208 [mac80211]
[<830b9824>] ieee80211_mps_sta_status_update+0x94/0x108 [mac80211]
[<83099398>] ieee80211_sta_ps_transition+0xc94/0x34d8 [mac80211]
[<8022399c>] nf_iterate+0x98/0x104
[<8309bb60>] ieee80211_sta_ps_transition+0x345c/0x34d8 [mac80211]

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
---
v2: 
	change the subject to be less ath9k-centric (Johannes)
	push the checking higher to prevent buffering for non-assoc STA (Bob Copeland)

 net/mac80211/mesh_ps.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/mesh_ps.c b/net/mac80211/mesh_ps.c
index 3b7bfc0..22290a9 100644
--- a/net/mac80211/mesh_ps.c
+++ b/net/mac80211/mesh_ps.c
@@ -229,6 +229,10 @@ void ieee80211_mps_sta_status_update(struct sta_info *sta)
 	enum nl80211_mesh_power_mode pm;
 	bool do_buffer;
 
+	/* For non-assoc STA, prevent buffering or frame transmission */
+	if (sta->sta_state < IEEE80211_STA_ASSOC)
+		return;
+
 	/*
 	 * use peer-specific power mode if peering is established and the
 	 * peer's power mode is known
-- 
1.7.0.4


^ permalink raw reply related

* Re: Fwd: Re: TP-Link 8200ND - rtl8192cu module not loading / working
From: shiki.biomernok @ 2013-06-27 10:08 UTC (permalink / raw)
  To: Larry Finger; +Cc: linux-wireless
In-Reply-To: <51CB4E31.50502@lwfinger.net>

The closed source driver is not working either.
It compiled like a charm, and it loads perfectly.
(I even blacklisted the open-source one!)

But there is nothing in iwconfig or ifconfig.
Here is the dmesg: http://pastebin.com/EX8h1HfZ

I really don't want to waste your time guys by the way. If there is no 
way to fix it, let's just leave it. (Don't get me wrong I know things 
can be troublesome on Linux and I'm still willing to try anything. I 
just bet you have better things to do. :))

On 2013-06-26 22:25, Larry Finger wrote:
> On 06/26/2013 12:29 PM, shiki.biomernok wrote:
>> Hello Larry/Mailing list!
>>
>> I have compiled and installed the new wireless-testing kernel from git.
>> I'm sure I used the new kernel, as the device lighted up as soon as I 
>> plugged
>> in. (And I got some new atheros ac module at "make oldconfig".)
>> There was no need for manual echo or modprobe.
>>
>> Yet, the device is not working. It dies at the very same step.
>> Here is the dmesg: http://pastebin.com/C1MNdFiw
>>
>> Please, let me know if I can help with anything.
>> Any debug option, patch or things like that.
>>
>> My offer is still there Larry, I'm willing to give you a full SSH 
>> access to the
>> machine with this stuff plugged in.
>> Besides that, I have no other idea.
>>
>>
>> ! My router runs OpenWRT (latest stable), so I could also gather info 
>> from
>> there. If it's possible.
>> (I checked dmesg but there is nothing. Only some non-crucial info 
>> about the
>> generic eth ports and such.)
>>
>> Thank you for the help.
>>
>> (By the way if the chip is rare (no other people will benefit), then 
>> I can just
>> get it back and ask for a refund. But if others use it as well, then 
>> it's not a
>> waste of time... I guess.)
>
> I think the TP-Link 8200ND is relatively new. You have version 0x11 
> for your chip, and mine is 0x10. That could be a difference.
>
> Whay are you forcing the module loading? As indicated by the (F) in 
> the traceback, it looks as if all of them are being forced.
>
> [   13.111932] BUG: unable to handle kernel NULL pointer dereference 
> at 0000000000000005
> [   13.111943] IP: [<ffffffffa03196c7>] iwl_dbgfs_register+0x27/0x70 
> [iwldvm]
> [   13.111944] PGD 0
> [   13.111945] Oops: 0000 [#1] PREEMPT SMP
> [   13.111964] Modules linked in: arc4(F) snd_hda_codec(F) 
> snd_hwdep(F) snd_pcm(F) iwldvm(F+) snd_page_alloc(F) thinkpad_acpi(F) 
> nvram(F) mac80211(F) snd_seq_midi(F) i915(F+) snd_seq_midi_event(F) 
> drm_kms_helper(F) snd_rawmidi(F) drm(F) snd_seq(F) snd_timer(F) 
> coretemp(F) snd_seq_device(F) r592(F) i2c_algo_bit(F) snd(F) 
> iwlwifi(F) soundcore(F) tpm_tis(F) memstick(F) btusb(F) microcode(F) 
> psmouse(F) bluetooth(F) serio_raw(F) wmi(F) cfg80211(F) video(F) 
> lpc_ich(F) hid_generic(F) usbhid(F) hid(F) sdhci_pci(F) sdhci(F) 
> ahci(F) libahci(F) e1000e(F) ptp(F) pps_core(F)
> [   13.111967] CPU: 1 PID: 741 Comm: modprobe Tainted: GF 
> 3.10.0-rc7-wl-x1-1000hz-wifitesting #1
> [   13.111968] Hardware name: LENOVO 208252G/208252G, BIOS 6FET92WW 
> (3.22 ) 12/14/2011
> [   13.111969] task: ffff8801a3f5d640 ti: ffff8801a1b9e000 task.ti: 
> ffff8801a1b9e000
> [   13.111975] RIP: 0010:[<ffffffffa03196c7>] [<ffffffffa03196c7>] 
> iwl_dbgfs_register+0x27/0x70 [iwldvm]
>
> To help us debug this matter, the attached patch will let you compile 
> the vendor driver that you downloaded from the vendor site.
>
> Larry
>
>


^ permalink raw reply

* Re: Fwd: Re: TP-Link 8200ND - rtl8192cu module not loading / working
From: shiki.biomernok @ 2013-06-27  9:58 UTC (permalink / raw)
  To: Larry Finger; +Cc: linux-wireless, xose.vazquez
In-Reply-To: <51CB4E31.50502@lwfinger.net>

I have tried to patch my driver but it wouldn't work.
Sent only Larry a message, because I couldn't figure it out why it 
wouldn't work.

Only now I realized that I didn't patch the uncompressed driver itself, 
but this whole "package".
(Sorry when I tried it yesterday, it was already kinda late.)

I also sent him answers about the questions he asked:
- Forced module loading: I use Xubuntu with my own kernel config. (See: 
http://pastebin.com/MR0FHS9w)
- Iwlwifi problem: I did have kernel panic with -rc4, but it's gone 
since -rc6.
(Though I didn't test it that thorough.)

@Xose: What does that mean for me? Am I trying the wrong driver?

By the way guys... how will the closed-source driver help with the 
open-source one?
I mean, I'm sure it will work/load for the device. But people been 
complaining about it.
Thought I could help to fix it up for this specific chip.
(I curse the guy who said this will work under Linux. Argl.)

On 2013-06-26 22:25, Larry Finger wrote:
> On 06/26/2013 12:29 PM, shiki.biomernok wrote:
>> Hello Larry/Mailing list!
>>
>> I have compiled and installed the new wireless-testing kernel from git.
>> I'm sure I used the new kernel, as the device lighted up as soon as I 
>> plugged
>> in. (And I got some new atheros ac module at "make oldconfig".)
>> There was no need for manual echo or modprobe.
>>
>> Yet, the device is not working. It dies at the very same step.
>> Here is the dmesg: http://pastebin.com/C1MNdFiw
>>
>> Please, let me know if I can help with anything.
>> Any debug option, patch or things like that.
>>
>> My offer is still there Larry, I'm willing to give you a full SSH 
>> access to the
>> machine with this stuff plugged in.
>> Besides that, I have no other idea.
>>
>>
>> ! My router runs OpenWRT (latest stable), so I could also gather info 
>> from
>> there. If it's possible.
>> (I checked dmesg but there is nothing. Only some non-crucial info 
>> about the
>> generic eth ports and such.)
>>
>> Thank you for the help.
>>
>> (By the way if the chip is rare (no other people will benefit), then 
>> I can just
>> get it back and ask for a refund. But if others use it as well, then 
>> it's not a
>> waste of time... I guess.)
>
> I think the TP-Link 8200ND is relatively new. You have version 0x11 
> for your chip, and mine is 0x10. That could be a difference.
>
> Whay are you forcing the module loading? As indicated by the (F) in 
> the traceback, it looks as if all of them are being forced.
>
> [   13.111932] BUG: unable to handle kernel NULL pointer dereference 
> at 0000000000000005
> [   13.111943] IP: [<ffffffffa03196c7>] iwl_dbgfs_register+0x27/0x70 
> [iwldvm]
> [   13.111944] PGD 0
> [   13.111945] Oops: 0000 [#1] PREEMPT SMP
> [   13.111964] Modules linked in: arc4(F) snd_hda_codec(F) 
> snd_hwdep(F) snd_pcm(F) iwldvm(F+) snd_page_alloc(F) thinkpad_acpi(F) 
> nvram(F) mac80211(F) snd_seq_midi(F) i915(F+) snd_seq_midi_event(F) 
> drm_kms_helper(F) snd_rawmidi(F) drm(F) snd_seq(F) snd_timer(F) 
> coretemp(F) snd_seq_device(F) r592(F) i2c_algo_bit(F) snd(F) 
> iwlwifi(F) soundcore(F) tpm_tis(F) memstick(F) btusb(F) microcode(F) 
> psmouse(F) bluetooth(F) serio_raw(F) wmi(F) cfg80211(F) video(F) 
> lpc_ich(F) hid_generic(F) usbhid(F) hid(F) sdhci_pci(F) sdhci(F) 
> ahci(F) libahci(F) e1000e(F) ptp(F) pps_core(F)
> [   13.111967] CPU: 1 PID: 741 Comm: modprobe Tainted: GF 
> 3.10.0-rc7-wl-x1-1000hz-wifitesting #1
> [   13.111968] Hardware name: LENOVO 208252G/208252G, BIOS 6FET92WW 
> (3.22 ) 12/14/2011
> [   13.111969] task: ffff8801a3f5d640 ti: ffff8801a1b9e000 task.ti: 
> ffff8801a1b9e000
> [   13.111975] RIP: 0010:[<ffffffffa03196c7>] [<ffffffffa03196c7>] 
> iwl_dbgfs_register+0x27/0x70 [iwldvm]
>
> To help us debug this matter, the attached patch will let you compile 
> the vendor driver that you downloaded from the vendor site.
>
> Larry
>
>


^ permalink raw reply

* Re: TP-Link 8200ND - rtl8192cu module not loading / working
From: Xose Vazquez Perez @ 2013-06-27  9:18 UTC (permalink / raw)
  To: linux-wireless, shiki.biomernok, Larry Finger

Larry Finger wrote:

> I think the TP-Link 8200ND is relatively new. You have version 0x11 for your 
> chip, and mine is 0x10. That could be a difference.

It's a *2T2R* RTL8192CUS

http://wikidevi.com/wiki/TP-LINK_TL-WN8200ND

^ permalink raw reply

* Re: [PATCH] Documentation: dt: bindings: TI WiLink modules
From: Luciano Coelho @ 2013-06-27  8:47 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Nishanth Menon, grant.likely, rob.herring, devicetree-discuss,
	linux-doc, linux-kernel, linux-wireless, tony, linux-omap,
	linux-arm
In-Reply-To: <51CBC1C8.1040301@gmail.com>

(added mailing lists and everyone back to the thread)

On Wed, 2013-06-26 at 23:38 -0500, Nishanth Menon wrote:
> On 06/25/2013 03:35 AM, Luciano Coelho wrote:
> > +Optional properties:
> > +--------------------
> > +
> > +- refclock: the internal WLAN reference clock frequency (required for
> > +  WiLink6 and WiLink7; not used for WiLink8).  Must be one of the
> > +  following:
> > +	0 = 19.2 MHz
> > +	1 = 26.0 MHz
> > +	2 = 38.4 MHz
> > +	3 = 52.0 MHz
> > +	4 = 38.4 MHz, XTAL
> > +	5 = 26.0 MHz, XTAL
> > +
> > +- tcxoclock: the internal WLAN TCXO clock frequency (required for
> > +  WiLink7 not used for WiLink6 and WiLink8).  Must be one of the
> > +  following:
> > +	0 = 19.200 MHz
> > +	1 = 26.000 MHz
> > +	2 = 38.400 MHz
> > +	3 = 52.000 MHz
> > +	4 = 16.368 MHz
> > +	5 = 32.736 MHz
> > +	6 = 16.800 MHz
> > +	7 = 33.600 MHz
> >
> just a gentle query - why not use frequency itself here in Hz for 
> refclock and txoclk?

I thought about using the actual frequencies, but I decided not to do
so, because I'd have to convert them to these values anyway.  These
values are used to configure the firmware and it uses these
"enumerations".


> might not another option of using
> node {
> clocks=<&clk>;
> }
> 
> Usually refclock is an external clock source, no?

No.  In the WiLink case, both refclock and tcxoclock are internal
clocks.  They are in the module itself and what we need to do is tell
the WiLink chip what the module's clocks look like.


> the above allows you to do an devm_clk_get and clk_get_rate() to figure 
> out the exact clock frequency.

No, we can't use these calls, because they are internal clocks.

Please see my more complete explanation as an answer to Tony's email.

Thanks for your review!

--
Luca.


^ permalink raw reply

* [PATCH] nl80211: fix missing rtnl_unlock()
From: Johannes Berg @ 2013-06-27  8:18 UTC (permalink / raw)
  To: linux-wireless

In the new nl80211_dump_wiphy() handling I forgot to properly
unlock the RTNL (again!), fix that.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/wireless/nl80211.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 785761f..66382b1 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1568,8 +1568,10 @@ static int nl80211_dump_wiphy(struct sk_buff *skb, struct netlink_callback *cb)
 	rtnl_lock();
 	if (!state) {
 		state = kzalloc(sizeof(*state), GFP_KERNEL);
-		if (!state)
+		if (!state) {
+			rtnl_unlock();
 			return -ENOMEM;
+		}
 		state->filter_wiphy = -1;
 		ret = nl80211_dump_wiphy_parse(skb, cb, state);
 		if (ret) {
-- 
1.8.0


^ permalink raw reply related

* RTL8192CU on ARM not working
From: Maxime Ripard @ 2013-06-27  8:12 UTC (permalink / raw)
  To: Larry.Finger, chaoming_li, linville
  Cc: linux-wireless, netdev, linux-kernel, linux-arm-kernel,
	Alexandre Belloni, Brian Lilly, Brent-Crosby, Jim Wall,
	Thomas Petazzoni

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

Hi everyone,

I'm currently trying to use a RTL8192CU on an ARM (Freescale imx28,
armv5) platform, using 3.10-rc3.

Trouble is, while the chip is correctly detected and you can use iw on it
without any problem it seems, once you start an association to an access
point, the association goes on, seems to associate, displaying a WARN()
message [1] and then, after what looks like a random amount of time (could
be right away, could be after a few minutes), deassociate [2].

During the time where it's associated, we never seem to transmit any
packets, while iw reports packets being sent, I guess we can assume that
they are actually never transmitted as well [3].

What seems odd to me as well is that the signal power reported for the access
point is excessively high when using iw scan (10 dbm), and once connected, the
signal strength is -64dbm, which makes quite a huge difference.

Do you have any suggestions on how to solve this issue?

Thanks,
Maxime


[1]:
# iw wlan0 connect FreeWifi 2447
# [  485.010858] wlan0: authenticate with f4:ca:e5:c9:f5:91
[  485.065514] wlan0: send auth to f4:ca:e5:c9:f5:91 (try 1/3)
[  485.075963] wlan0: authenticated
[  485.088915] wlan0: associate with f4:ca:e5:c9:f5:91 (try 1/3)
[  485.117137] wlan0: RX AssocResp from f4:ca:e5:c9:f5:91 (capab=0x401 status=0 aid=1)
[  485.130607] wlan0: associated
[  486.917555] ------------[ cut here ]------------
[  486.922277] WARNING: at kernel/workqueue.c:1365 __queue_work+0x1f0/0x2f4()
[  486.929175] Modules linked in:
[  486.932284] CPU: 0 PID: 615 Comm: kworker/0:2 Not tainted 3.10.0-rc3 #2
[  486.938958] Workqueue: rtl92c_usb rtl_watchdog_wq_callback
[  486.944548] [<c00147dc>] (unwind_backtrace+0x0/0xf0) from [<c00120a0>] (show_stack+0x10/0x14)
[  486.953132] [<c00120a0>] (show_stack+0x10/0x14) from [<c001d2ec>] (warn_slowpath_common+0x4c/0x68)
[  486.962140] [<c001d2ec>] (warn_slowpath_common+0x4c/0x68) from [<c001d324>] (warn_slowpath_null+0x1c/0x24)
[  486.971844] [<c001d324>] (warn_slowpath_null+0x1c/0x24) from [<c003769c>] (__queue_work+0x1f0/0x2f4)
[  486.981025] [<c003769c>] (__queue_work+0x1f0/0x2f4) from [<c0037830>] (queue_work_on+0x80/0x88)
[  486.989777] [<c0037830>] (queue_work_on+0x80/0x88) from [<c0267ca4>] (rtl_watchdog_wq_callback+0x5dc/0x8bc)
[  486.999572] [<c0267ca4>] (rtl_watchdog_wq_callback+0x5dc/0x8bc) from [<c0038cbc>] (process_one_work+0x1c0/0x4c8)
[  487.009795] [<c0038cbc>] (process_one_work+0x1c0/0x4c8) from [<c0039684>] (worker_thread+0x140/0x3ac)
[  487.019065] [<c0039684>] (worker_thread+0x140/0x3ac) from [<c003f914>] (kthread+0xa4/0xb0)
[  487.027381] [<c003f914>] (kthread+0xa4/0xb0) from [<c000f0c0>] (ret_from_fork+0x14/0x34)
[  487.035498] ---[ end trace 93341a0c249e647e ]---


[2]:

# [  786.086127] wlan0: deauthenticated from f4:ca:e5:c9:f5:91 (Reason: 2)
[  786.126368] cfg80211: Calling CRDA to update world regulatory domain


[3]:
# iw wlan0 station dump
Station f4:ca:e5:c9:f5:91 (on wlan0)
	inactive time:	55430 ms
	rx bytes:	77826
	rx packets:	1026
	tx packets:	2
	tx retries:	0
	tx failed:	0
	signal:  	-64 dBm
	signal avg:	-63 dBm
	tx bitrate:	1.0 MBit/s
	authorized:	yes
	authenticated:	yes
	preamble:	long
	WMM/WME:	yes
	MFP:		no
	TDLS peer:	no


-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* RE: [RFC] mac80211: Use libnl-configurable values for retry counts
From: Jean-Pierre Tosoni @ 2013-06-27  8:09 UTC (permalink / raw)
  To: 'Felix Fietkau'; +Cc: linux-wireless
In-Reply-To: <51CB33D9.1070104@openwrt.org>

First, thanks for your prompt reply and for pointing out my mistakes.

> > Use wiphy->retry_short for management frames.
> > Use wiphy->retry_long for other frames.
> That seems a bit arbitrary.

Indeed.
Should I use the following?
  retry_long for data frames subject to RTS
  retry_short for all other frames.
That looks closer to the descriptions in 802.11-2012.
 
> > +	mp->max_retry = hw->conf.long_frame_max_tx_count;
> minstrel_alloc is called at rate control init time. You're not making
> max_retry configurable here, it'll pick the default value of
> hw->conf.long_frame_max_tx_count and never update it again.

Is it OK if I replace max_retry with the config values in minstrel_rate_init
and minstrel_update_rates instead?
Then we can get rid of max_retry completely?

(Sorry, I got mixed in the never-ending sequence of callbacks :)

> > diff --git a/net/mac80211/rc80211_minstrel.c
> b/net/mac80211/rc80211_minstrel.c
> > index ac7ef54..502d0c9 100644
> > --- a/net/mac80211/rc80211_minstrel.c
> > +++ b/net/mac80211/rc80211_minstrel.c
> > @@ -592,11 +592,7 @@ minstrel_alloc(
> >	/* maximum time that the hw is allowed to stay in one MRR  segment
*/
> >  	mp->segment_size = 6000;
> >
> > -	if (hw->max_rate_tries > 0)
> > -		mp->max_retry = hw->max_rate_tries;
> > -	else
> > -		/* safe default, does not necessarily have to match hw
properties */
> > -		mp->max_retry = 7;
> > +	mp->max_retry = hw->conf.long_frame_max_tx_count;> 
> - Felix

Jean-Pierre


^ permalink raw reply

* [PATCH V2] vlan priority handling in WMM
From: cedric.voncken @ 2013-06-27  7:52 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, cedric voncken

From: cedric voncken <cedric.voncken@acksys.fr>

If the VLAN tci is set in skb->vlan_tci use the priority field to determine the WMM priority.

V2 modifications :
	Fix indentation
	Use symbolic constant
	include the header linux/if_vlan.h

Signed-off-by: cedric Voncken <cedric.voncken@acksys.fr>
---
 net/wireless/util.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/net/wireless/util.c b/net/wireless/util.c
index 74458b7..13937db 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -10,6 +10,7 @@
 #include <net/cfg80211.h>
 #include <net/ip.h>
 #include <net/dsfield.h>
+#include <linux/if_vlan.h>
 #include "core.h"
 #include "rdev-ops.h"
 
@@ -685,6 +686,7 @@ EXPORT_SYMBOL(ieee80211_amsdu_to_8023s);
 unsigned int cfg80211_classify8021d(struct sk_buff *skb)
 {
 	unsigned int dscp;
+	unsigned char vlan_priority;
 
 	/* skb->priority values from 256->263 are magic values to
 	 * directly indicate a specific 802.1d priority.  This is used
@@ -694,6 +696,10 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb)
 	if (skb->priority >= 256 && skb->priority <= 263)
 		return skb->priority - 256;
 
+	vlan_priority = (skb->vlan_tci & VLAN_PRIO_MASK) >> VLAN_PRIO_SHIFT;
+	if (vlan_priority > 0)
+		return vlan_priority;
+
 	switch (skb->protocol) {
 	case htons(ETH_P_IP):
 		dscp = ipv4_get_dsfield(ip_hdr(skb)) & 0xfc;
-- 
1.7.2.5


^ permalink raw reply related

* Re: rtl8192cu: slow path warning
From: Richard Genoud @ 2013-06-27  7:33 UTC (permalink / raw)
  To: Larry Finger; +Cc: Chaoming Li, John W. Linville, linux-wireless, linux-kernel
In-Reply-To: <51CB0E9C.50408@lwfinger.net>

2013/6/26 Larry Finger <Larry.Finger@lwfinger.net>:
> On 06/26/2013 09:22 AM, Richard GENOUD wrote:
>>
>> Using 3.10-rc7, I'm still seeing the warning, BUT ONLY on the first
>> connection.
>>
>> [   40.312500] usb 2-2: default language 0x0409
>> [   40.312500] usb 2-2: udev 2, busnum 2, minor = 129
>> [   40.320312] usb 2-2: New USB device found, idVendor=0bda,
>> idProduct=8176
>> [   40.328125] usb 2-2: New USB device strings: Mfr=1, Product=2,
>> SerialNumber=3
>> [   40.328125] usb 2-2: Product: 802.11n WLAN Adapter
>> [   40.335937] usb 2-2: Manufacturer: Realtek
>> [   40.343750] usb 2-2: SerialNumber: 00e04c000001
>> [   40.343750] usb 2-2: usb_probe_device
>> [   40.351562] usb 2-2: configuration #1 chosen from 1 choice
>> [   40.351562] usb 2-2: adding 2-2:1.0 (config #1, interface 0)
>> [   40.500000] cfg80211: Calling CRDA to update world regulatory domain
>> [   40.648437] rtl8192cu 2-2:1.0: usb_probe_interface
>> [   40.656250] rtl8192cu 2-2:1.0: usb_probe_interface - got id
>> [   40.664062] rtl8192cu: Chip version 0x10
>> [   40.757812] rtl8192cu: MAC address: a0:f3:c1:1e:02:a0
>> [   40.765625] rtl8192cu: Board Type 0
>> [   40.773437] rtlwifi: rx_max_size 15360, rx_urb_num 8, in_ep 1
>> [   40.773437] rtl8192cu: Loading firmware rtlwifi/rtl8192cufw.bin
>> [   40.781250] usbcore: registered new interface driver rtl8192cu
>> [   40.835937] ieee80211 phy0: Selected rate control algorithm 'rtl_rc'
>> [   40.843750] rtlwifi: wireless switch is on
>> # ip link set wlan0 up
>> [   59.921875] rtl8192cu: MAC auto ON okay!
>> [   59.960937] rtl8192cu: Tx queue select: 0x05
>> # iw wlan0 connect test
>> [   75.390625] wlan0: authenticate with f8:1a:67:1a:df:88
>> [   75.421875] wlan0: send auth to f8:1a:67:1a:df:88 (try 1/3)
>> [   75.437500] wlan0: authenticated
>> [   75.453125] wlan0: associate with f8:1a:67:1a:df:88 (try 1/3)
>> [   75.460937] wlan0: RX AssocResp from f8:1a:67:1a:df:88 (capab=0x401
>> status=0 aid=2)
>> [   75.468750] wlan0: associated
>> [   76.375000] ------------[ cut here ]------------
>> [   76.375000] WARNING: at kernel/workqueue.c:1365
>> __queue_work+0x168/0x200()
>> [   76.375000] Modules linked in: rtl8192cu rtl8192c_common rtlwifi
>> mac80211 cfg80211 rfkill ehci_atmel ehci_hcd atmel_usba_udc udc_core
>> ohci_hcd
>> [   76.375000] CPU: 0 PID: 308 Comm: kworker/0:1 Not tainted 3.10.0-rc7
>> #36
>> [   76.375000] Workqueue: rtl92c_usb rtl_watchdog_wq_callback [rtlwifi]
>> [   76.375000] [<c000d9bc>] (unwind_backtrace+0x0/0xf0) from [<c000b9ec>]
>> (show_stack+0x10/0x14)
>> [   76.375000] [<c000b9ec>] (show_stack+0x10/0x14) from [<c0015c00>]
>> (warn_slowpath_common+0x4c/0x68)
>> [   76.375000] [<c0015c00>] (warn_slowpath_common+0x4c/0x68) from
>> [<c0015c38>] (warn_slowpath_null+0x1c/0x24)
>> [   76.375000] [<c0015c38>] (warn_slowpath_null+0x1c/0x24) from
>> [<c0029e40>] (__queue_work+0x168/0x200)
>> [   76.375000] [<c0029e40>] (__queue_work+0x168/0x200) from [<c0029f2c>]
>> (queue_work_on+0x44/0x50)
>> [   76.375000] [<c0029f2c>] (queue_work_on+0x44/0x50) from [<bf09bb54>]
>> (rtl_watchdog_wq_callback+0x320/0x404 [rtlwifi])
>> [   76.375000] [<bf09bb54>] (rtl_watchdog_wq_callback+0x320/0x404
>> [rtlwifi]) from [<c002b168>] (process_one_work+0x10c/0x354)
>> [   76.375000] [<c002b168>] (process_one_work+0x10c/0x354) from
>> [<c002b784>] (worker_thread+0x130/0x380)
>> [   76.375000] [<c002b784>] (worker_thread+0x130/0x380) from [<c0030330>]
>> (kthread+0xa4/0xb0)
>> [   76.375000] [<c0030330>] (kthread+0xa4/0xb0) from [<c00092f0>]
>> (ret_from_fork+0x14/0x24)
>> [   76.375000] ---[ end trace e116b4b3d671f3d2 ]---
>
>
> The WARNING is the result of a workqueue not being initialized for the USB
> driver.
>
> Please try the attached patch. As you have posted on a public mailing list,
> May I assume that it will be OK to use your address in Reported-by/Tested-by
> lines in the patch submission?
>
> Thanks,
>
> Larry
>
Yes, of course, you can add my
Reported-by: Richard Genoud <richard.genoud@gmail.com>

But the patch doesn't compile on my platform ( since I'm on ARM, I
haven't got a PCI bus, so rtlwifi/pci.c is not compiled ) :

ERROR: "rtl_lps_change_work_callback"
[drivers/net/wireless/rtlwifi/rtlwifi.ko] undefined!


Best regards,
Richard.

PS: duckducking the warning, I found this automated report also :
https://retrace.fedoraproject.org/faf/reports/142038/

-- 
for me, ck means con kolivas and not calvin klein... does it mean I'm a geek ?

^ permalink raw reply

* Re: [v3.10-rc2] iwlwifi regression
From: Sedat Dilek @ 2013-06-27  6:29 UTC (permalink / raw)
  To: Jörg Otte
  Cc: linux-wireless, Linux Kernel Mailing List, Johannes Berg,
	Linus Torvalds
In-Reply-To: <CA+icZUXJK2ks7TQbH0AiPYAWrFuQC85Uw2sSM6d_YD5yS7unhA@mail.gmail.com>

On Wed, Jun 26, 2013 at 6:37 PM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
> On Wed, Jun 26, 2013 at 6:16 PM, Jörg Otte <jrg.otte@gmail.com> wrote:
>> 2013/5/25 Jörg Otte <jrg.otte@gmail.com>:
>>> If iwlwifi/iwldvm are built into the kernel (no loadable modules)
>>> following error is written to console and syslog since v3.10-rc:
>>>
>>> iwlwifi 0000:08:00.0: failed to load module iwldvm (error -38), is
>>> dynamic loading enabled?
>>>
>>> reverting
>>> commit 1618b2b02a3a0ee7a6863fed4b0d22e697e7e97c
>>> Author: Johannes Berg <johannes.berg@intel.com>
>>> Date:   Thu Apr 4 10:35:23 2013 +0200
>>>     iwlwifi: print warning on request_module failure
>>>
>>> fixes the problem for me.
>>>
>>> Jörg
>>>
>>> I'm not subscribed,please CC me in answeres
>>
>> We have rc-7 now and it's still not fixed. What is the problem?
>>
>
> The patch is pending in wireless.git and is not in mainline, right.
> AFAICS there was a recent pull request... so should be in rc8.
>
> commit 8edf3fd6eb0649b0f19363baf23bca39c6fbdba4
> "iwlwifi: don't print module loading error if not modular"
>
> - Sedat -
>
> http://git.kernel.org/cgit/linux/kernel/git/linville/wireless.git/commit/?id=8edf3fd6eb0649b0f19363baf23bca39c6fbdba4
>

Hi Jörg,

the fix you are waiting for hit mainline several minutes ago.

Regards,
- Sedat -

[1] http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=98b6ed0f2bf4abfb759206aa70690636372bdee7

>> Thanks, Jörg
>> --
>> 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

* Re: pull-request: iwlwifi-next 2013-06-25
From: John W. Linville @ 2013-06-27  0:05 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless
In-Reply-To: <1372160186.8372.13.camel@jlt4.sipsolutions.net>

On Tue, Jun 25, 2013 at 01:36:26PM +0200, Johannes Berg wrote:
> Hi John,
> 
> This is hopefully going to be the last big pull request for
> iwlwifi-next, luckily it actually mostly removes code ;-)
> 
> Emmanuel removed some unneeded/unsupported module parameters and adds a
> Bluetooth 1x1 lookup-table for some upcoming products. From Alex I have
> an older patch to add low-power receive support, this depended on a
> mac80211 commit that only just came in with the merge from wireless-next
> I did. Ilan made beacon timings better, and Eytan added some debug
> statements for thermal throttling. I have a few cleanups, a fix for a
> long-standing but rare warning, and, arguably the most important patch
> here, the firmware API version bump for the 7260/3160 devices.
> 
> Let me know if there are any issues.
> 
> johannes
> 
> 
> 
> The following changes since commit 9fbdc75116f7a2b183464d42f3abccb616584105:
> 
>   Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next (2013-06-24 14:45:50 -0400)
> 
> are available in the git repository at:
> 
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git for-john
> 
> for you to fetch changes up to bd4ace2a36e7c87bb5f3eceb54d3b304d395dcf0:
> 
>   iwlwifi: mvm: Add support for Low Power RX (2013-06-25 12:21: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

* [PATCH] ath9k_htc: ifdef out IFTYPE_MESH advertisement
From: Thomas Pedersen @ 2013-06-26 22:06 UTC (permalink / raw)
  To: John W. Linville; +Cc: ath9k, linux-wireless, linux, Thomas Pedersen

This is needed so the interface combination can still be
validated when CONFIG_MAC80211_MESH is not enabled.
Otherwise wiphy registration fails.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
---
 drivers/net/wireless/ath/ath9k/htc_drv_init.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index bb0ba9e..07ca932 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -701,8 +701,10 @@ static const struct ieee80211_iface_limit if_limits[] = {
 	{ .max = 2,	.types = BIT(NL80211_IFTYPE_STATION) |
 				 BIT(NL80211_IFTYPE_P2P_CLIENT) },
 	{ .max = 2,	.types = BIT(NL80211_IFTYPE_AP) |
-				 BIT(NL80211_IFTYPE_P2P_GO) |
-				 BIT(NL80211_IFTYPE_MESH_POINT) },
+#ifdef CONFIG_MAC80211_MESH
+				 BIT(NL80211_IFTYPE_MESH_POINT) |
+#endif
+				 BIT(NL80211_IFTYPE_P2P_GO) },
 };
 
 static const struct ieee80211_iface_combination if_comb = {
-- 
1.7.10.4


^ permalink raw reply related

* Re: regression after, " ath9k_htc: Add support for mesh interfaces"
From: Thomas Pedersen @ 2013-06-26 21:45 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Johannes Berg, ath9k-devel@lists.ath9k.org,
	linux-wireless@vger.kernel.org, Javier Cardona
In-Reply-To: <51CB3E04.3000402@rempel-privat.de>

On Wed, Jun 26, 2013 at 12:16 PM, Oleksij Rempel <linux@rempel-privat.de> wrote:
> Am 26.06.2013 20:52, schrieb Thomas Pedersen:
> I just discovered one more issue with mesh on ath9k* devices.
> if i try to do "ifconfig mesh0 down" this task will freeze and after some
> time kernel will oops.
>
> Steps to reproduce:
> iw dev wlan2 interface add mesh0 type mp mesh_id mesh
> iwconfig mesh0 channel 1
> ifconfig mesh0 10.0.0.1 netmask 255.255.255.0 up
> sleep 30
> ifconfig mesh0 down

are you running wireless-testing master HEAD? There is a fix for that
deadlock in mac80211-next ("mac80211: update mesh beacon on
workqueue") still waiting to get into wireless-testing.

--
Thomas

^ permalink raw reply

* Re: Fwd: Re: TP-Link 8200ND - rtl8192cu module not loading / working
From: Larry Finger @ 2013-06-26 20:25 UTC (permalink / raw)
  To: shiki.biomernok; +Cc: linux-wireless
In-Reply-To: <51CB250A.3060900@gmail.com>

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

On 06/26/2013 12:29 PM, shiki.biomernok wrote:
> Hello Larry/Mailing list!
>
> I have compiled and installed the new wireless-testing kernel from git.
> I'm sure I used the new kernel, as the device lighted up as soon as I plugged
> in. (And I got some new atheros ac module at "make oldconfig".)
> There was no need for manual echo or modprobe.
>
> Yet, the device is not working. It dies at the very same step.
> Here is the dmesg: http://pastebin.com/C1MNdFiw
>
> Please, let me know if I can help with anything.
> Any debug option, patch or things like that.
>
> My offer is still there Larry, I'm willing to give you a full SSH access to the
> machine with this stuff plugged in.
> Besides that, I have no other idea.
>
>
> ! My router runs OpenWRT (latest stable), so I could also gather info from
> there. If it's possible.
> (I checked dmesg but there is nothing. Only some non-crucial info about the
> generic eth ports and such.)
>
> Thank you for the help.
>
> (By the way if the chip is rare (no other people will benefit), then I can just
> get it back and ask for a refund. But if others use it as well, then it's not a
> waste of time... I guess.)

I think the TP-Link 8200ND is relatively new. You have version 0x11 for your 
chip, and mine is 0x10. That could be a difference.

Whay are you forcing the module loading? As indicated by the (F) in the 
traceback, it looks as if all of them are being forced.

[   13.111932] BUG: unable to handle kernel NULL pointer dereference at 
0000000000000005
[   13.111943] IP: [<ffffffffa03196c7>] iwl_dbgfs_register+0x27/0x70 [iwldvm]
[   13.111944] PGD 0
[   13.111945] Oops: 0000 [#1] PREEMPT SMP
[   13.111964] Modules linked in: arc4(F) snd_hda_codec(F) snd_hwdep(F) 
snd_pcm(F) iwldvm(F+) snd_page_alloc(F) thinkpad_acpi(F) nvram(F) mac80211(F) 
snd_seq_midi(F) i915(F+) snd_seq_midi_event(F) drm_kms_helper(F) snd_rawmidi(F) 
drm(F) snd_seq(F) snd_timer(F) coretemp(F) snd_seq_device(F) r592(F) 
i2c_algo_bit(F) snd(F) iwlwifi(F) soundcore(F) tpm_tis(F) memstick(F) btusb(F) 
microcode(F) psmouse(F) bluetooth(F) serio_raw(F) wmi(F) cfg80211(F) video(F) 
lpc_ich(F) hid_generic(F) usbhid(F) hid(F) sdhci_pci(F) sdhci(F) ahci(F) 
libahci(F) e1000e(F) ptp(F) pps_core(F)
[   13.111967] CPU: 1 PID: 741 Comm: modprobe Tainted: GF 
3.10.0-rc7-wl-x1-1000hz-wifitesting #1
[   13.111968] Hardware name: LENOVO 208252G/208252G, BIOS 6FET92WW (3.22 ) 
12/14/2011
[   13.111969] task: ffff8801a3f5d640 ti: ffff8801a1b9e000 task.ti: ffff8801a1b9e000
[   13.111975] RIP: 0010:[<ffffffffa03196c7>]  [<ffffffffa03196c7>] 
iwl_dbgfs_register+0x27/0x70 [iwldvm]

To help us debug this matter, the attached patch will let you compile the vendor 
driver that you downloaded from the vendor site.

Larry



[-- Attachment #2: compile_warnings --]
[-- Type: text/plain, Size: 8899 bytes --]

Index: rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730/core/rtw_mlme_ext.c
===================================================================
--- rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730.orig/core/rtw_mlme_ext.c
+++ rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730/core/rtw_mlme_ext.c
@@ -1053,8 +1053,8 @@ unsigned int OnAuth(_adapter *padapter,
 	sa = GetAddr2Ptr(pframe);
 	
 	auth_mode = psecuritypriv->dot11AuthAlgrthm;
-	seq = cpu_to_le16(*(unsigned short *)((unsigned int)pframe + WLAN_HDR_A3_LEN + 2));
-	algorithm = cpu_to_le16(*(unsigned short *)((unsigned int)pframe + WLAN_HDR_A3_LEN));
+	seq = cpu_to_le16(*(unsigned short *)((unsigned long)pframe + WLAN_HDR_A3_LEN + 2));
+	algorithm = cpu_to_le16(*(unsigned short *)((unsigned long)pframe + WLAN_HDR_A3_LEN));
 
 	if (GetPrivacy(pframe))
 	{	
Index: rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730/core/rtw_p2p.c
===================================================================
--- rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730.orig/core/rtw_p2p.c
+++ rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730/core/rtw_p2p.c
@@ -2595,7 +2595,7 @@ u8 process_p2p_group_negotation_confirm(
 		_rtw_memset( groupid, 0x00, 38 );
 		if ( rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen) )
 		{
-			DBG_8192C( "[%s] Ssid = %s, ssidlen = %d\n", __FUNCTION__, &groupid[ETH_ALEN], strlen(&groupid[ETH_ALEN]) );
+			DBG_8192C( "[%s] Ssid = %s, ssidlen = %d\n", __FUNCTION__, &groupid[ETH_ALEN], (int)strlen(&groupid[ETH_ALEN]) );
 			_rtw_memcpy( pwdinfo->groupid_info.go_device_addr, &groupid[0], ETH_ALEN );
 			_rtw_memcpy( pwdinfo->groupid_info.ssid, &groupid[6], attr_contentlen - ETH_ALEN );			
 		}
Index: rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730/include/rtw_recv.h
===================================================================
--- rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730.orig/include/rtw_recv.h
+++ rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730/include/rtw_recv.h
@@ -623,7 +623,7 @@ __inline static union recv_frame *rxmem_
 	//from any given member of recv_frame.
 	// rxmem indicates the any member/address in recv_frame
 	
-	return (union recv_frame*)(((uint)rxmem>>RXFRAME_ALIGN) <<RXFRAME_ALIGN) ;
+	return (union recv_frame*)(((ulong)rxmem>>RXFRAME_ALIGN) <<RXFRAME_ALIGN) ;
 	
 }
 
Index: rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730/core/rtw_br_ext.c
===================================================================
--- rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730.orig/core/rtw_br_ext.c
+++ rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730/core/rtw_br_ext.c
@@ -126,11 +126,11 @@ static int skb_pull_and_merge(struct sk_
 	int tail_len;
 	unsigned long end, tail;
 
-	if ((src+len) > skb->tail || skb->len < len)
-		return -1;
-
 	tail = (unsigned long)skb->tail;
 	end = (unsigned long)src+len;
+	if ((end) > tail || skb->len < len)
+		return -1;
+
 	if (tail < end)
 		return -1;
 
@@ -1633,13 +1633,13 @@ void dhcp_flag_bcast(_adapter *priv, str
 
 			if(iph->protocol == IPPROTO_UDP) // UDP
 			{
-				struct udphdr *udph = (struct udphdr *)((unsigned int)iph + (iph->ihl << 2));
+				struct udphdr *udph = (struct udphdr *)((unsigned long)iph + (iph->ihl << 2));
 
 				if((udph->source == __constant_htons(CLIENT_PORT))
 					&& (udph->dest == __constant_htons(SERVER_PORT))) // DHCP request
 				{
 					struct dhcpMessage *dhcph =
-						(struct dhcpMessage *)((unsigned int)udph + sizeof(struct udphdr));
+						(struct dhcpMessage *)((unsigned long)udph + sizeof(struct udphdr));
 
 					if(dhcph->cookie == __constant_htonl(DHCP_MAGIC)) // match magic word
 					{
Index: rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730/core/rtw_recv.c
===================================================================
--- rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730.orig/core/rtw_recv.c
+++ rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730/core/rtw_recv.c
@@ -3305,7 +3305,7 @@ static int amsdu_to_msdu(_adapter *padap
 			{
 				sub_skb->data = pdata;
 				sub_skb->len = nSubframe_Length;
-				sub_skb->tail = sub_skb->data + nSubframe_Length;
+				skb_set_tail_pointer(sub_skb, nSubframe_Length);
 			}
 			else
 			{
Index: rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730/os_dep/linux/ioctl_linux.c
===================================================================
--- rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730.orig/os_dep/linux/ioctl_linux.c
+++ rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730/os_dep/linux/ioctl_linux.c
@@ -143,7 +143,7 @@ static void indicate_wx_custom_event(_ad
 	union iwreq_data wrqu;
 
 	if (strlen(msg) > IW_CUSTOM_MAX) {
-		DBG_871X("%s strlen(msg):%u > IW_CUSTOM_MAX:%u\n", __FUNCTION__ ,strlen(msg), IW_CUSTOM_MAX);
+		DBG_871X("%s strlen(msg):%u > IW_CUSTOM_MAX:%u\n", __FUNCTION__ ,(uint)strlen(msg), IW_CUSTOM_MAX);
 		return;
 	}
 
@@ -3865,7 +3865,7 @@ static int rtw_p2p_set_go_nego_ssid(stru
 	struct iw_point *pdata = &wrqu->data;
 	struct wifidirect_info *pwdinfo= &(padapter->wdinfo);
 
-	DBG_8192C( "[%s] ssid = %s, len = %d\n", __FUNCTION__, extra, strlen( extra ) );
+	DBG_8192C( "[%s] ssid = %s, len = %d\n", __FUNCTION__, extra, (int)strlen( extra ) );
 	_rtw_memcpy( pwdinfo->nego_ssid, extra, strlen( extra ) );
 	pwdinfo->nego_ssidlen = strlen( extra );
 	
Index: rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730/include/drv_types.h
===================================================================
--- rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730.orig/include/drv_types.h
+++ rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730/include/drv_types.h
@@ -462,10 +462,10 @@ struct _ADAPTER{
 	u8	bfirst_init;
 	u8	bHaltInProgress;
 	
-	_thread_hdl_	cmdThread;
-	_thread_hdl_	evtThread;
-	_thread_hdl_	xmitThread;
-	_thread_hdl_	recvThread;
+	void *cmdThread;
+	void *evtThread;
+	void *xmitThread;
+	void *recvThread;
 
 
 	NDIS_STATUS (*dvobj_init)(_adapter * adapter);
Index: rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730/os_dep/linux/os_intfs.c
===================================================================
--- rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730.orig/os_dep/linux/os_intfs.c
+++ rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730/os_dep/linux/os_intfs.c
@@ -35,6 +35,10 @@
 #include <rtw_ioctl.h>
 #include <rtw_version.h>
 
+#ifdef PLATFORM_LINUX
+#include <linux/kthread.h>
+#endif
+
 #ifdef CONFIG_SDIO_HCI
 #include <sdio_osintf.h>
 #endif
@@ -255,6 +259,17 @@ static char rtw_proc_name[IFNAMSIZ];
 static struct proc_dir_entry *rtw_proc = NULL;
 static int	rtw_proc_cnt = 0;
 
+#ifndef create_proc_entry
+/* dummy routines */
+void rtw_proc_remove_one(struct net_device *dev)
+{
+}
+
+void rtw_proc_init_one(struct net_device *dev)
+{
+}
+
+#else	/* create_proc_entry not defined */
 void rtw_proc_init_one(struct net_device *dev)
 {
 	struct proc_dir_entry *dir_dev = NULL;
@@ -518,6 +533,7 @@ void rtw_proc_remove_one(struct net_devi
 	}
 }
 #endif
+#endif
 
 uint loadparam( _adapter *padapter,  _nic_hdl	pnetdev)
 {
@@ -790,27 +806,27 @@ u32 rtw_start_drv_threads(_adapter *pada
 	RT_TRACE(_module_os_intfs_c_,_drv_info_,("+rtw_start_drv_threads\n"));
 
 #ifdef CONFIG_SDIO_HCI
-	padapter->xmitThread = kernel_thread(rtw_xmit_thread, padapter, CLONE_FS|CLONE_FILES);
-	if(padapter->xmitThread < 0)
+	padapter->xmitThread = kthread_run(rtw_xmit_thread, padapter, "xmitThread");
+	if(IS_ERR(padapter->xmitThread))
 		_status = _FAIL;
 #endif
 
 #ifdef CONFIG_RECV_THREAD_MODE
-	padapter->recvThread = kernel_thread(recv_thread, padapter, CLONE_FS|CLONE_FILES);
-	if(padapter->recvThread < 0)
+	padapter->recvThread = kthread_run(recv_thread, padapter, "recvThread");
+	if(IS_ERR(padapter->recvThread))
 		_status = _FAIL;	
 #endif
 
-	padapter->cmdThread = kernel_thread(rtw_cmd_thread, padapter, CLONE_FS|CLONE_FILES);
-	if(padapter->cmdThread < 0)
+	padapter->cmdThread = kthread_run(rtw_cmd_thread, padapter, "cmdThread");
+	if(IS_ERR(padapter->cmdThread))
 		_status = _FAIL;
 	else
 		_rtw_down_sema(&padapter->cmdpriv.terminate_cmdthread_sema); //wait for cmd_thread to run
 		
 
 #ifdef CONFIG_EVENT_THREAD_MODE
-	padapter->evtThread = kernel_thread(event_thread, padapter, CLONE_FS|CLONE_FILES);
-	if(padapter->evtThread < 0)
+	padapter->evtThread = kthread_run(event_thread, padapter, "evtThread");
+	if(IS_ERR(padapter->evtThread))
 		_status = _FAIL;		
 #endif
 
Index: rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730/include/osdep_service.h
===================================================================
--- rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730.orig/include/osdep_service.h
+++ rtl8188C_8192C_usb_linux_v3.4.4_4749.20120730/include/osdep_service.h
@@ -570,10 +570,12 @@ __inline static unsigned char _cancel_ti
 __inline static void thread_enter(void *context)
 {
 #ifdef PLATFORM_LINUX
+	#ifdef daemonize
 	//struct net_device *pnetdev = (struct net_device *)context;
 	//daemonize("%s", pnetdev->name);
 	daemonize("%s", "RTKTHREAD");
 	allow_signal(SIGTERM);
+	#endif
 #endif
 }
 

^ permalink raw reply

* Re: regression after, " ath9k_htc: Add support for mesh interfaces"
From: Oleksij Rempel @ 2013-06-26 19:16 UTC (permalink / raw)
  To: Thomas Pedersen
  Cc: Johannes Berg, ath9k-devel@lists.ath9k.org,
	linux-wireless@vger.kernel.org, Javier Cardona
In-Reply-To: <CAG6hwVNk-sA_RFYJN+MzSURwWZYd-X3Uu8g2sRP8AfyKWQUQbw@mail.gmail.com>

Am 26.06.2013 20:52, schrieb Thomas Pedersen:
> On Wed, Jun 26, 2013 at 12:31 AM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
>> On Tue, 2013-06-25 at 13:05 -0700, Thomas Pedersen wrote:
>>
>>> That warning is triggered by wiphy_verify_combinations():
>>>
>>>                          if (WARN_ON((wiphy->interface_modes & types) != types))
>>>                                  return -EINVAL;
>>>
>>> But before that, the mesh iftype bit is cleared in ieee80211_register_hw():
>>>
>>> #ifndef CONFIG_MAC80211_MESH
>>>          /* mesh depends on Kconfig, but drivers should set it if they want */
>>>          local->hw.wiphy->interface_modes &= ~BIT(NL80211_IFTYPE_MESH_POINT);
>>> #endif
>>>
>>> It seems the intention was to avoid an #ifdef CONFIG_MAC80211_MESH in
>>> every driver, but then mac80211 also has to clear the MESH_POINT bit
>>> for each ieee80211_iface_limit? I don't really see a cleaner way of
>>> resolving this.
>>
>> The problem is that the data structures there are const, so we can't
>> modify them. I think the other drivers just have an #ifdef on
>> MAC80211_MESH or so in there.
>
> Indeed, ath5k and rt2x00 at least already do this.
>
> Thanks,

I just discovered one more issue with mesh on ath9k* devices.
if i try to do "ifconfig mesh0 down" this task will freeze and after 
some time kernel will oops.

Steps to reproduce:
iw dev wlan2 interface add mesh0 type mp mesh_id mesh
iwconfig mesh0 channel 1
ifconfig mesh0 10.0.0.1 netmask 255.255.255.0 up
sleep 30
ifconfig mesh0 down

-- 
Regards,
Oleksij

^ permalink raw reply

* Re: regression after, " ath9k_htc: Add support for mesh interfaces"
From: Thomas Pedersen @ 2013-06-26 18:52 UTC (permalink / raw)
  To: Johannes Berg
  Cc: Oleksij Rempel, ath9k-devel@lists.ath9k.org,
	linux-wireless@vger.kernel.org, Javier Cardona
In-Reply-To: <1372231882.8157.0.camel@jlt4.sipsolutions.net>

On Wed, Jun 26, 2013 at 12:31 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Tue, 2013-06-25 at 13:05 -0700, Thomas Pedersen wrote:
>
>> That warning is triggered by wiphy_verify_combinations():
>>
>>                         if (WARN_ON((wiphy->interface_modes & types) != types))
>>                                 return -EINVAL;
>>
>> But before that, the mesh iftype bit is cleared in ieee80211_register_hw():
>>
>> #ifndef CONFIG_MAC80211_MESH
>>         /* mesh depends on Kconfig, but drivers should set it if they want */
>>         local->hw.wiphy->interface_modes &= ~BIT(NL80211_IFTYPE_MESH_POINT);
>> #endif
>>
>> It seems the intention was to avoid an #ifdef CONFIG_MAC80211_MESH in
>> every driver, but then mac80211 also has to clear the MESH_POINT bit
>> for each ieee80211_iface_limit? I don't really see a cleaner way of
>> resolving this.
>
> The problem is that the data structures there are const, so we can't
> modify them. I think the other drivers just have an #ifdef on
> MAC80211_MESH or so in there.

Indeed, ath5k and rt2x00 at least already do this.

Thanks,

--
Thomas

^ permalink raw reply

* RE: [PATCH v4 2/2] cfg80211/nl80211: Add packet coalesce support
From: Amitkumar Karwar @ 2013-06-26 18:53 UTC (permalink / raw)
  To: Johannes Berg, Bing Zhao
  Cc: linux-wireless@vger.kernel.org, Luis R. Rodriguez, Jouni Malinen,
	Vasanthakumar Thiagarajan, Senthil Balasubramanian,
	Luciano Coelho
In-Reply-To: <1372259597.13529.11.camel@jlt4.sipsolutions.net>


Hi Johannes,

Thanks for your comments.

>> +struct cfg80211_coalesce {
>> +     struct cfg80211_coalesce_rules **rules;

>I don't really see why this should be a double pointer? The
>coalesce_rules struct is small enough that you could just allocate an
>array of that, no?

Actually it came from our previous design which used to add one rule per iw command by allocating an array of rule pointers.
You are right. We will use normal pointer and allocate an array of rules in updated version.

>>  /**
>> + * struct wiphy_coalesce_support - coalesce support data
>> + * @n_rules: maximum number of coalesce rules
>> + * @n_patterns: number of supported patterns
>> + *   (see nl80211.h for the pattern definition)
>> + * @pattern_max_len: maximum length of each pattern
>> + * @pattern_min_len: minimum length of each pattern
>> + * @max_pkt_offset: maximum Rx packet offset

>Should there be any limits on the timer? Will the firmware actually work
>if I set it to (useless) values like 2^32-1 msecs?

Makes sense. There should be a limit for colaescing delay. We will add new parameter 'max_delay'.

>Also -- is n_patterns per rule, or global? It seems global, but in the
>rules you can have multiple patterns per rule?

n_patterns is per rule. We will update description of 'n_patterns'.

>> + * @NL80211_CMD_GET_COALESCE: Get currently supported coalesce rules.
>> + *
>> + * @NL80211_CMD_SET_COALESCE: Configure coalesce rules or clear existing rules.

> I'd prefer no space between the two :)
Sure.

>> +struct nl80211_coalesce_rule_support {
>> +     __u32 max_rules;
>> +     struct nl80211_pattern_support pat;

>(timing stuff would also go here, I suppose)
Yes. The new parameter will be added here.


>> +     new_rule->delay = nla_get_u32(tb[NL80211_ATTR_COALESCE_RULE_DELAY]);
>no check that it actually exists?

>> +     new_rule->condition =
>> +             nla_get_u32(tb[NL80211_ATTR_COALESCE_RULE_CONDITION]);
>ditto. easy to crash, no?

Thanks. We will add checks to see if these attributes are present.

> +     if (!rdev->wiphy.coalesce)
> +             return -EOPNOTSUPP;
> +     if (!rdev->ops->set_coalesce)
> +             return -EOPNOTSUPP;

>could combine the conditions :)
Ack.

>> +     new_coalesce = kzalloc(sizeof(*new_coalesce), GFP_KERNEL);
>> +     new_coalesce->rules = kcalloc(coalesce->n_rules,
>> +                                     sizeof(void *), GFP_KERNEL);
>*kaboom*
>> +     cfg80211_rdev_free_coalesce(rdev->coalesce);
>> +     rdev->coalesce = new_coalesce;
>> +
>> +     err = rdev->ops->set_coalesce(&rdev->wiphy, rdev->coalesce);
>> +     if (err)
>> +             goto error;
>> +
>> +     return 0;
>> +error:
>> +     cfg80211_rdev_free_coalesce(new_coalesce);

>*kaboom* if it ever fails, and you then do get_coalesce -- should
>probably assign only after setting the new value successfully?

Thanks for pointing this out. We will take care of this error path.

Regards,
Amitkumar Karwar

^ permalink raw reply

* Re: [RFC] mac80211: Use libnl-configurable values for retry counts
From: Felix Fietkau @ 2013-06-26 18:32 UTC (permalink / raw)
  To: Jean-Pierre Tosoni; +Cc: linux-wireless
In-Reply-To: <1372267723-25072-1-git-send-email-jp.tosoni@acksys.fr>

On 2013-06-26 7:28 PM, Jean-Pierre Tosoni wrote:
> From: J.P. Tosoni <jp.tosoni@acksys.fr>
> 
> In the rate control algorithms, the maximum retry count is limited by
> a) a constant value obtained from the hardware driver
> b) a constant limit (6ms) on the time allowed for all
>    retries of each frame.
> 
> Replace the retry count by existing configurable values from nl80211.
> Use wiphy->retry_short for management frames.
> Use wiphy->retry_long for other frames.
That seems a bit arbitrary.

> diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c
> index ac7ef54..502d0c9 100644
> --- a/net/mac80211/rc80211_minstrel.c
> +++ b/net/mac80211/rc80211_minstrel.c
> @@ -592,11 +592,7 @@ minstrel_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
>  	/* maximum time that the hw is allowed to stay in one MRR segment */
>  	mp->segment_size = 6000;
>  
> -	if (hw->max_rate_tries > 0)
> -		mp->max_retry = hw->max_rate_tries;
> -	else
> -		/* safe default, does not necessarily have to match hw properties */
> -		mp->max_retry = 7;
> +	mp->max_retry = hw->conf.long_frame_max_tx_count;
minstrel_alloc is called at rate control init time. You're not making
max_retry configurable here, it'll pick the default value of
hw->conf.long_frame_max_tx_count and never update it again.

- Felix

^ permalink raw reply

* [PATCH 4/5] rt2x00: rt2800lib: introduce rt2800_eeprom_word_index helper
From: Gabor Juhos @ 2013-06-26 17:55 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, users, Gabor Juhos
In-Reply-To: <1372269318-30233-1-git-send-email-juhosg@openwrt.org>

Instead of assign the offset value to the
enum directly use a new helper function to
convert a rt2800_eeprom_word enum into an
index of the rt2x00_dev->eeprom array.

The patch does not change the existing
behaviour, but makes it possible to add
support for three-chain devices which are
using a different EEPROM layout.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
 drivers/net/wireless/rt2x00/rt2800.h    |   76 +++++++++++++-------------
 drivers/net/wireless/rt2x00/rt2800lib.c |   88 +++++++++++++++++++++++++++++--
 2 files changed, 123 insertions(+), 41 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
index 0647039..bc5c695 100644
--- a/drivers/net/wireless/rt2x00/rt2800.h
+++ b/drivers/net/wireless/rt2x00/rt2800.h
@@ -2207,43 +2207,45 @@ struct mac_iveiv_entry {
  */
 
 enum rt2800_eeprom_word {
-	EEPROM_CHIP_ID		= 0x0000,
-	EEPROM_VERSION		= 0x0001,
-	EEPROM_MAC_ADDR_0	= 0x0002,
-	EEPROM_MAC_ADDR_1	= 0x0003,
-	EEPROM_MAC_ADDR_2	= 0x0004,
-	EEPROM_NIC_CONF0	= 0x001a,
-	EEPROM_NIC_CONF1	= 0x001b,
-	EEPROM_FREQ		= 0x001d,
-	EEPROM_LED_AG_CONF	= 0x001e,
-	EEPROM_LED_ACT_CONF	= 0x001f,
-	EEPROM_LED_POLARITY	= 0x0020,
-	EEPROM_NIC_CONF2	= 0x0021,
-	EEPROM_LNA		= 0x0022,
-	EEPROM_RSSI_BG		= 0x0023,
-	EEPROM_RSSI_BG2		= 0x0024,
-	EEPROM_TXMIXER_GAIN_BG	= 0x0024, /* overlaps with RSSI_BG2 */
-	EEPROM_RSSI_A		= 0x0025,
-	EEPROM_RSSI_A2		= 0x0026,
-	EEPROM_TXMIXER_GAIN_A	= 0x0026, /* overlaps with RSSI_A2 */
-	EEPROM_EIRP_MAX_TX_POWER = 0x0027,
-	EEPROM_TXPOWER_DELTA	= 0x0028,
-	EEPROM_TXPOWER_BG1	= 0x0029,
-	EEPROM_TXPOWER_BG2	= 0x0030,
-	EEPROM_TSSI_BOUND_BG1	= 0x0037,
-	EEPROM_TSSI_BOUND_BG2	= 0x0038,
-	EEPROM_TSSI_BOUND_BG3	= 0x0039,
-	EEPROM_TSSI_BOUND_BG4	= 0x003a,
-	EEPROM_TSSI_BOUND_BG5	= 0x003b,
-	EEPROM_TXPOWER_A1	= 0x003c,
-	EEPROM_TXPOWER_A2	= 0x0053,
-	EEPROM_TSSI_BOUND_A1	= 0x006a,
-	EEPROM_TSSI_BOUND_A2	= 0x006b,
-	EEPROM_TSSI_BOUND_A3	= 0x006c,
-	EEPROM_TSSI_BOUND_A4	= 0x006d,
-	EEPROM_TSSI_BOUND_A5	= 0x006e,
-	EEPROM_TXPOWER_BYRATE	= 0x006f,
-	EEPROM_BBP_START	= 0x0078,
+	EEPROM_CHIP_ID = 0,
+	EEPROM_VERSION,
+	EEPROM_MAC_ADDR_0,
+	EEPROM_MAC_ADDR_1,
+	EEPROM_MAC_ADDR_2,
+	EEPROM_NIC_CONF0,
+	EEPROM_NIC_CONF1,
+	EEPROM_FREQ,
+	EEPROM_LED_AG_CONF,
+	EEPROM_LED_ACT_CONF,
+	EEPROM_LED_POLARITY,
+	EEPROM_NIC_CONF2,
+	EEPROM_LNA,
+	EEPROM_RSSI_BG,
+	EEPROM_RSSI_BG2,
+	EEPROM_TXMIXER_GAIN_BG,
+	EEPROM_RSSI_A,
+	EEPROM_RSSI_A2,
+	EEPROM_TXMIXER_GAIN_A,
+	EEPROM_EIRP_MAX_TX_POWER,
+	EEPROM_TXPOWER_DELTA,
+	EEPROM_TXPOWER_BG1,
+	EEPROM_TXPOWER_BG2,
+	EEPROM_TSSI_BOUND_BG1,
+	EEPROM_TSSI_BOUND_BG2,
+	EEPROM_TSSI_BOUND_BG3,
+	EEPROM_TSSI_BOUND_BG4,
+	EEPROM_TSSI_BOUND_BG5,
+	EEPROM_TXPOWER_A1,
+	EEPROM_TXPOWER_A2,
+	EEPROM_TSSI_BOUND_A1,
+	EEPROM_TSSI_BOUND_A2,
+	EEPROM_TSSI_BOUND_A3,
+	EEPROM_TSSI_BOUND_A4,
+	EEPROM_TSSI_BOUND_A5,
+	EEPROM_TXPOWER_BYRATE,
+	EEPROM_BBP_START,
+	/* New values must be added before this */
+	EEPROM_WORD_COUNT
 };
 
 /*
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index b59772a..9ff62b0 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -221,22 +221,99 @@ static void rt2800_rf_write(struct rt2x00_dev *rt2x00dev,
 	mutex_unlock(&rt2x00dev->csr_mutex);
 }
 
+static const unsigned int rt2800_eeprom_map[EEPROM_WORD_COUNT] = {
+	[EEPROM_CHIP_ID]		= 0x0000,
+	[EEPROM_VERSION]		= 0x0001,
+	[EEPROM_MAC_ADDR_0]		= 0x0002,
+	[EEPROM_MAC_ADDR_1]		= 0x0003,
+	[EEPROM_MAC_ADDR_2]		= 0x0004,
+	[EEPROM_NIC_CONF0]		= 0x001a,
+	[EEPROM_NIC_CONF1]		= 0x001b,
+	[EEPROM_FREQ]			= 0x001d,
+	[EEPROM_LED_AG_CONF]		= 0x001e,
+	[EEPROM_LED_ACT_CONF]		= 0x001f,
+	[EEPROM_LED_POLARITY]		= 0x0020,
+	[EEPROM_NIC_CONF2]		= 0x0021,
+	[EEPROM_LNA]			= 0x0022,
+	[EEPROM_RSSI_BG]		= 0x0023,
+	[EEPROM_RSSI_BG2]		= 0x0024,
+	[EEPROM_TXMIXER_GAIN_BG]	= 0x0024, /* overlaps with RSSI_BG2 */
+	[EEPROM_RSSI_A]			= 0x0025,
+	[EEPROM_RSSI_A2]		= 0x0026,
+	[EEPROM_TXMIXER_GAIN_A]		= 0x0026, /* overlaps with RSSI_A2 */
+	[EEPROM_EIRP_MAX_TX_POWER]	= 0x0027,
+	[EEPROM_TXPOWER_DELTA]		= 0x0028,
+	[EEPROM_TXPOWER_BG1]		= 0x0029,
+	[EEPROM_TXPOWER_BG2]		= 0x0030,
+	[EEPROM_TSSI_BOUND_BG1]		= 0x0037,
+	[EEPROM_TSSI_BOUND_BG2]		= 0x0038,
+	[EEPROM_TSSI_BOUND_BG3]		= 0x0039,
+	[EEPROM_TSSI_BOUND_BG4]		= 0x003a,
+	[EEPROM_TSSI_BOUND_BG5]		= 0x003b,
+	[EEPROM_TXPOWER_A1]		= 0x003c,
+	[EEPROM_TXPOWER_A2]		= 0x0053,
+	[EEPROM_TSSI_BOUND_A1]		= 0x006a,
+	[EEPROM_TSSI_BOUND_A2]		= 0x006b,
+	[EEPROM_TSSI_BOUND_A3]		= 0x006c,
+	[EEPROM_TSSI_BOUND_A4]		= 0x006d,
+	[EEPROM_TSSI_BOUND_A5]		= 0x006e,
+	[EEPROM_TXPOWER_BYRATE]		= 0x006f,
+	[EEPROM_BBP_START]		= 0x0078,
+};
+
+static unsigned int rt2800_eeprom_word_index(struct rt2x00_dev *rt2x00dev,
+					     const enum rt2800_eeprom_word word)
+{
+	const unsigned int *map;
+	unsigned int index;
+
+	if (WARN_ON(word >= EEPROM_WORD_COUNT)) {
+		rt2x00_warn(rt2x00dev, "invalid EEPROM word %d\n", word);
+		return 0;
+	}
+
+	map = rt2800_eeprom_map;
+	index = map[word];
+
+	if (WARN_ON(word != EEPROM_CHIP_ID && index == 0)) {
+		/* Index 0 is valid only for EEPROM_CHIP_ID.
+		 * Otherwise it means that the offset of the
+		 * given word is not initialized in the map,
+		 * or that the field is not usable on the
+		 * actual chipset.
+		 */
+		rt2x00_warn(rt2x00dev, "invalid access of EEPROM word %d\n",
+			    word);
+	}
+
+	return index;
+}
+
 static void *rt2800_eeprom_addr(struct rt2x00_dev *rt2x00dev,
 				const enum rt2800_eeprom_word word)
 {
-	return rt2x00_eeprom_addr(rt2x00dev, word);
+	unsigned int index;
+
+	index = rt2800_eeprom_word_index(rt2x00dev, word);
+	return rt2x00_eeprom_addr(rt2x00dev, index);
 }
 
 static void rt2800_eeprom_read(struct rt2x00_dev *rt2x00dev,
 			       const enum rt2800_eeprom_word word, u16 *data)
 {
-	rt2x00_eeprom_read(rt2x00dev, word, data);
+	unsigned int index;
+
+	index = rt2800_eeprom_word_index(rt2x00dev, word);
+	rt2x00_eeprom_read(rt2x00dev, index, data);
 }
 
 static void rt2800_eeprom_write(struct rt2x00_dev *rt2x00dev,
 				const enum rt2800_eeprom_word word, u16 data)
 {
-	rt2x00_eeprom_write(rt2x00dev, word, data);
+	unsigned int index;
+
+	index = rt2800_eeprom_word_index(rt2x00dev, word);
+	rt2x00_eeprom_write(rt2x00dev, index, data);
 }
 
 static void rt2800_eeprom_read_from_array(struct rt2x00_dev *rt2x00dev,
@@ -244,7 +321,10 @@ static void rt2800_eeprom_read_from_array(struct rt2x00_dev *rt2x00dev,
 					  unsigned int offset,
 					  u16 *data)
 {
-	rt2x00_eeprom_read(rt2x00dev, array + offset, data);
+	unsigned int index;
+
+	index = rt2800_eeprom_word_index(rt2x00dev, array);
+	rt2x00_eeprom_read(rt2x00dev, index + offset, data);
 }
 
 static int rt2800_enable_wlan_rt3290(struct rt2x00_dev *rt2x00dev)
-- 
1.7.10


^ permalink raw reply related

* [PATCH 5/5] rt2x00: rt2800lib: add EEPROM map for the RT3593 chipset
From: Gabor Juhos @ 2013-06-26 17:55 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless, users, Gabor Juhos
In-Reply-To: <1372269318-30233-1-git-send-email-juhosg@openwrt.org>

Three-chain devices are using a different
EEPROM layout than the rest of the chipsets.
Add a new map which describes the new layout
and use that for the RT3593 chipset.

The index values has been computed from the
EEPROM_EXT_* defines, which can be found in
the 'include/chip/rt3593.h' file in the
Ralink DPO_RT5572_LinuxSTA_2.6.0.1_20120629
driver.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
---
 drivers/net/wireless/rt2x00/rt2800.h    |    6 ++++
 drivers/net/wireless/rt2x00/rt2800lib.c |   48 ++++++++++++++++++++++++++++++-
 2 files changed, 53 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
index bc5c695..9216834 100644
--- a/drivers/net/wireless/rt2x00/rt2800.h
+++ b/drivers/net/wireless/rt2x00/rt2800.h
@@ -2244,6 +2244,12 @@ enum rt2800_eeprom_word {
 	EEPROM_TSSI_BOUND_A5,
 	EEPROM_TXPOWER_BYRATE,
 	EEPROM_BBP_START,
+
+	/* IDs for extended EEPROM format used by three-chain devices */
+	EEPROM_EXT_LNA2,
+	EEPROM_EXT_TXPOWER_BG3,
+	EEPROM_EXT_TXPOWER_A3,
+
 	/* New values must be added before this */
 	EEPROM_WORD_COUNT
 };
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 9ff62b0..7b216f9 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -261,6 +261,48 @@ static const unsigned int rt2800_eeprom_map[EEPROM_WORD_COUNT] = {
 	[EEPROM_BBP_START]		= 0x0078,
 };
 
+static const unsigned int rt2800_eeprom_map_ext[EEPROM_WORD_COUNT] = {
+	[EEPROM_CHIP_ID]		= 0x0000,
+	[EEPROM_VERSION]		= 0x0001,
+	[EEPROM_MAC_ADDR_0]		= 0x0002,
+	[EEPROM_MAC_ADDR_1]		= 0x0003,
+	[EEPROM_MAC_ADDR_2]		= 0x0004,
+	[EEPROM_NIC_CONF0]		= 0x001a,
+	[EEPROM_NIC_CONF1]		= 0x001b,
+	[EEPROM_NIC_CONF2]		= 0x001c,
+	[EEPROM_EIRP_MAX_TX_POWER]	= 0x0020,
+	[EEPROM_FREQ]			= 0x0022,
+	[EEPROM_LED_AG_CONF]		= 0x0023,
+	[EEPROM_LED_ACT_CONF]		= 0x0024,
+	[EEPROM_LED_POLARITY]		= 0x0025,
+	[EEPROM_LNA]			= 0x0026,
+	[EEPROM_EXT_LNA2]		= 0x0027,
+	[EEPROM_RSSI_BG]		= 0x0028,
+	[EEPROM_TXPOWER_DELTA]		= 0x0028, /* Overlaps with RSSI_BG */
+	[EEPROM_RSSI_BG2]		= 0x0029,
+	[EEPROM_TXMIXER_GAIN_BG]	= 0x0029, /* Overlaps with RSSI_BG2 */
+	[EEPROM_RSSI_A]			= 0x002a,
+	[EEPROM_RSSI_A2]		= 0x002b,
+	[EEPROM_TXMIXER_GAIN_A]		= 0x002b, /* Overlaps with RSSI_A2 */
+	[EEPROM_TXPOWER_BG1]		= 0x0030,
+	[EEPROM_TXPOWER_BG2]		= 0x0037,
+	[EEPROM_EXT_TXPOWER_BG3]	= 0x003e,
+	[EEPROM_TSSI_BOUND_BG1]		= 0x0045,
+	[EEPROM_TSSI_BOUND_BG2]		= 0x0046,
+	[EEPROM_TSSI_BOUND_BG3]		= 0x0047,
+	[EEPROM_TSSI_BOUND_BG4]		= 0x0048,
+	[EEPROM_TSSI_BOUND_BG5]		= 0x0049,
+	[EEPROM_TXPOWER_A1]		= 0x004b,
+	[EEPROM_TXPOWER_A2]		= 0x0065,
+	[EEPROM_EXT_TXPOWER_A3]		= 0x007f,
+	[EEPROM_TSSI_BOUND_A1]		= 0x009a,
+	[EEPROM_TSSI_BOUND_A2]		= 0x009b,
+	[EEPROM_TSSI_BOUND_A3]		= 0x009c,
+	[EEPROM_TSSI_BOUND_A4]		= 0x009d,
+	[EEPROM_TSSI_BOUND_A5]		= 0x009e,
+	[EEPROM_TXPOWER_BYRATE]		= 0x00a0,
+};
+
 static unsigned int rt2800_eeprom_word_index(struct rt2x00_dev *rt2x00dev,
 					     const enum rt2800_eeprom_word word)
 {
@@ -272,7 +314,11 @@ static unsigned int rt2800_eeprom_word_index(struct rt2x00_dev *rt2x00dev,
 		return 0;
 	}
 
-	map = rt2800_eeprom_map;
+	if (rt2x00_rt(rt2x00dev, RT3593))
+		map = rt2800_eeprom_map_ext;
+	else
+		map = rt2800_eeprom_map;
+
 	index = map[word];
 
 	if (WARN_ON(word != EEPROM_CHIP_ID && index == 0)) {
-- 
1.7.10


^ permalink raw reply related


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