* [PATCH 4/4] cw1200: hwio: Remove an unnecessary goto
From: Joe Perches @ 2013-06-04 14:44 UTC (permalink / raw)
To: linux-kernel; +Cc: Solomon Peachy, John W. Linville, linux-wireless, netdev
In-Reply-To: <60123fd3175b7cceadf6c335b12e58b797e18f65.1370356776.git.joe@perches.com>
goto after return is wrong.
The other code in this block needs to set an
error value then goto an error release block.
This one doesn't need to release anything and
was likely a copy/paste remainder.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/wireless/cw1200/hwio.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/wireless/cw1200/hwio.c b/drivers/net/wireless/cw1200/hwio.c
index 142f45ef..dad3fb3 100644
--- a/drivers/net/wireless/cw1200/hwio.c
+++ b/drivers/net/wireless/cw1200/hwio.c
@@ -178,7 +178,6 @@ int cw1200_indirect_read(struct cw1200_common *priv, u32 addr, void *buf,
if ((buf_len / 2) >= 0x1000) {
pr_err("Can't read more than 0xfff words.\n");
return -EINVAL;
- goto out;
}
priv->hwbus_ops->lock(priv->hwbus_priv);
--
1.8.1.2.459.gbcd45b4.dirty
^ permalink raw reply related
* [PATCH v9] cfg80211: P2P find phase offload
From: Vladimir Kondratiev @ 2013-06-04 15:03 UTC (permalink / raw)
To: Johannes Berg
Cc: Vladimir Kondratiev, linux-wireless, Luis R . Rodriguez,
John W . Linville, Jouni Malinen
In-Reply-To: <1370358191-7103-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 | 72 +++++++++++++++++
include/uapi/linux/nl80211.h | 15 ++++
net/wireless/nl80211.c | 181 +++++++++++++++++++++++++++++++++++++++++++
net/wireless/rdev-ops.h | 19 +++++
net/wireless/trace.h | 42 ++++++++++
5 files changed, 329 insertions(+)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 6dd1959..935a6c4 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1799,6 +1799,38 @@ 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: channels to listen on; not NULL
+ * @n_channels: number of channels to operate on
+ * @channels: channels to operate on
+ * may be NULL, in this case driver suppose to scan for all social
+ * channels; or channel set should be non-empty (n_channels > 0)
+ */
+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
@@ -2037,6 +2069,20 @@ 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 all received
+ * probe-request and probe-response frames via cfg80211_rx_mgmt
+ * @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);
@@ -2272,6 +2318,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);
};
/*
@@ -4185,6 +4237,26 @@ 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
+ *
+ * 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 5920715..ae7f798 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 */
@@ -1436,6 +1439,11 @@ enum nl80211_commands {
* allowed to be used with the first @NL80211_CMD_SET_STATION command to
* update a TDLS peer STA entry.
*
+ * @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_LISTEN_FREQ: Listen channel frequency, represented as u32
+ *
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
*/
@@ -1736,6 +1744,10 @@ enum nl80211_attrs {
NL80211_ATTR_PEER_AID,
+ NL80211_ATTR_MIN_DISCOVERABLE_INTERVAL,
+ NL80211_ATTR_MAX_DISCOVERABLE_INTERVAL,
+ NL80211_ATTR_LISTEN_FREQ,
+
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
@@ -3579,6 +3591,8 @@ enum nl80211_ap_sme_features {
* Peering Management entity which may be implemented by registering for
* beacons or NL80211_CMD_NEW_PEER_CANDIDATE events. The mesh beacon is
* still generated by the driver.
+ * @NL80211_FEATURE_P2P_PROBE_RESP_OFFLOAD: When in P2P find phase,
+ * the device responds to probe-requests in hardware.
*/
enum nl80211_feature_flags {
NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
@@ -3599,6 +3613,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 31d265f..bcf0d62 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -349,6 +349,9 @@ 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 },
+ [NL80211_ATTR_LISTEN_FREQ] = { .type = NLA_U32 },
};
/* policy for the key attributes */
@@ -1390,6 +1393,8 @@ static int nl80211_send_wiphy(struct cfg80211_registered_device *dev,
if (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
@@ -8265,6 +8270,129 @@ static int nl80211_crit_protocol_stop(struct sk_buff *skb,
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,
+ };
+ struct nlattr *attr_freq = info->attrs[NL80211_ATTR_SCAN_FREQUENCIES];
+ struct nlattr *attr_l_freq = info->attrs[NL80211_ATTR_LISTEN_FREQ];
+ struct nlattr *attr;
+ int err, tmp, n_channels, i = 0;
+ struct ieee80211_channel **channels = NULL;
+ 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;
+
+ 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;
+
+ channels = kzalloc(n_channels * sizeof(*channels), GFP_KERNEL);
+ if (!channels)
+ return -ENOMEM;
+
+ /* user specified, bail out if channel not found */
+ nla_for_each_nested(attr, attr_freq, tmp) {
+ chan = ieee80211_get_channel(wiphy, nla_get_u32(attr));
+
+ if (!chan) {
+ err = -EINVAL;
+ goto out_free;
+ }
+
+ /* ignore disabled channels */
+ if (chan->flags & IEEE80211_CHAN_DISABLED)
+ continue;
+
+ params.channels[i] = chan;
+ i++;
+ }
+ if (!i) {
+ err = -EINVAL;
+ goto out_free;
+ }
+
+ params.n_channels = i;
+ params.channels = channels;
+ }
+
+
+ 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);
+
+ err = rdev_start_p2p_find(rdev, wdev, ¶ms);
+
+out_free:
+ kfree(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;
+
+ 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
@@ -8937,6 +9065,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,
@@ -10627,6 +10771,43 @@ 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)
+{
+ cfg80211_p2p_find_notify(wdev, NL80211_CMD_STOP_P2P_FIND, gfp);
+}
+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 23fafea..9eb3dd7 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -1841,6 +1841,34 @@ 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(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->n_channels = params->n_channels;
+ ),
+ TP_printk(WIPHY_PR_FMT ", " WDEV_PR_FMT ", disc. int. [%d..%d], n_channels %d",
+ WIPHY_PR_ARG, WDEV_PR_ARG, __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 *
*************************************************************/
@@ -2498,6 +2526,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 v9] P2P find phase offload
From: Vladimir Kondratiev @ 2013-06-04 15:03 UTC (permalink / raw)
To: Johannes Berg
Cc: Vladimir Kondratiev, linux-wireless, Luis R . Rodriguez,
John W . Linville, Jouni Malinen
- add listen_channel
- comment on channel set assumption (either missing or non-empty set)
- document expected behavior for p2p_find conflict with scan/ROC
- document probe/probe-resp reporting assumption
- remove check for genlmsg_end return value
Vladimir Kondratiev (1):
cfg80211: P2P find phase offload
include/net/cfg80211.h | 72 +++++++++++++++++
include/uapi/linux/nl80211.h | 15 ++++
net/wireless/nl80211.c | 181 +++++++++++++++++++++++++++++++++++++++++++
net/wireless/rdev-ops.h | 19 +++++
net/wireless/trace.h | 42 ++++++++++
5 files changed, 329 insertions(+)
--
1.8.1.2
^ permalink raw reply
* Re: [PATCH 4/4] cw1200: hwio: Remove an unnecessary goto
From: Solomon Peachy @ 2013-06-04 15:09 UTC (permalink / raw)
To: Joe Perches; +Cc: linux-kernel, John W. Linville, linux-wireless, netdev
In-Reply-To: <fd299c9ef87fe50c12af871d6bfcc92d7f6ef3dc.1370356776.git.joe@perches.com>
[-- Attachment #1: Type: text/plain, Size: 1394 bytes --]
On Tue, Jun 04, 2013 at 07:44:50AM -0700, Joe Perches wrote:
> goto after return is wrong.
>
> The other code in this block needs to set an
> error value then goto an error release block.
>
> This one doesn't need to release anything and
> was likely a copy/paste remainder.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Acked-By: Solomon Peachy <pizza@shaftnet.org>
> ---
> drivers/net/wireless/cw1200/hwio.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/net/wireless/cw1200/hwio.c b/drivers/net/wireless/cw1200/hwio.c
> index 142f45ef..dad3fb3 100644
> --- a/drivers/net/wireless/cw1200/hwio.c
> +++ b/drivers/net/wireless/cw1200/hwio.c
> @@ -178,7 +178,6 @@ int cw1200_indirect_read(struct cw1200_common *priv, u32 addr, void *buf,
> if ((buf_len / 2) >= 0x1000) {
> pr_err("Can't read more than 0xfff words.\n");
> return -EINVAL;
> - goto out;
> }
>
> priv->hwbus_ops->lock(priv->hwbus_priv);
> --
> 1.8.1.2.459.gbcd45b4.dirty
>
> --
> 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
--
Solomon Peachy pizza at shaftnet dot org
Delray Beach, FL ^^ (email/xmpp) ^^
Quidquid latine dictum sit, altum viditur.
[-- Attachment #2: Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply
* Ath6kl feature request - list hw capabilities
From: drwho @ 2013-06-04 16:35 UTC (permalink / raw)
To: Kalle Valo; +Cc: linux-wireless, ath6kl-devel
In-Reply-To: <877gienh7k.fsf@kamboji.qca.qualcomm.com>
Using "iw list" with ath6k doesn't list any Capabilities like other
drivers do. Example using "iw list" with ath9k.....
Band 1:
Capabilities: 0x11ee
HT20/HT40
SM Power Save disabled
RX HT20 SGI
RX HT40 SGI
TX STBC
RX STBC 1-stream
Max AMSDU length: 3839 bytes
DSSS/CCK HT40
Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
Minimum RX AMPDU time spacing: 8 usec (0x06)
HT TX/RX MCS rate indexes supported: 0-15
Frequencies:
Jon
^ permalink raw reply
* Re: [PATCH v8] cfg80211: P2P find phase offload
From: Vladimir Kondratiev @ 2013-06-04 16:47 UTC (permalink / raw)
To: Malinen, Jouni
Cc: Johannes Berg, Peer, Ilan, linux-wireless@vger.kernel.org,
Rodriguez, Luis, John W . Linville
In-Reply-To: <8887AA04B7EC49479420AE48C5F94A930EF6C0AA@NASANEXD02D.na.qualcomm.com>
On Tuesday, June 04, 2013 05:35:30 PM Malinen, Jouni wrote:
>
> On 6/4/13 5:29 PM, "Johannes Berg" <johannes@sipsolutions.net> wrote:
>
> >On Tue, 2013-06-04 at 17:03 +0300, Vladimir Kondratiev wrote:
> >
> >> And, probes must be reported to the host in all cases, for wpa_s to
> >>have peer list.
> >> Need to add comment describing this.
> >
> >I don't think that's necessarily true. wpa_s will pre-build a list, but
> >note that it doesn't make those peers as discovered and you can't really
> >do anything with them. As such, I would argue that reporting probe
> >requests ("probes") would be harmful and counter to one potential goal
> >of this patch (powersaving.)
>
> In general, I'd agree. However, I would like to get information of any
> peer device being in active PBC mode. This would require either getting
> those Probe Request frames or alternatively that being tracked in
> kernel/driver/firmware with some access for wpa_supplicant to fetch
> information of all STAs (list of MAC Address + UUID) that have indicated
> active PBC mode within last 120 seconds.
>
> - Jouni
I am a bit confused. I supposed that if devices A and B (not in a group yet)
try to discover each other, it works like the following
A ---- probe-req ---> B (now B knows A)
A <--- probe-resp ---- B (now A knows B)
But if device is discovered by probe-resp only, it mean this should be
A ---- probe-req ---> B
A <--- probe-resp ---- B (now A knows B)
A <--- probe-req ---- B
A ---- probe-resp ---> B (now B knows A)
What is the case?
Thanks, Vladimir
^ permalink raw reply
* Re: [PATCH v8] cfg80211: P2P find phase offload
From: Jouni Malinen @ 2013-06-04 18:30 UTC (permalink / raw)
To: Vladimir Kondratiev
Cc: Johannes Berg, Peer, Ilan, linux-wireless@vger.kernel.org,
Rodriguez, Luis, John W . Linville
In-Reply-To: <2442077.aHiBPHBLmq@lx-vladimir>
On Tue, Jun 04, 2013 at 07:47:20PM +0300, Vladimir Kondratiev wrote:
> I am a bit confused. I supposed that if devices A and B (not in a group yet)
> try to discover each other, it works like the following
>
> A ---- probe-req ---> B (now B knows A)
> A <--- probe-resp ---- B (now A knows B)
This depends on what exactly you mean with "discover". Sure, it is known
that there is a P2P peer in the environment if a Probe Request frame
with P2P IE is received from it. However, that does not necessarily mean
we know enough of that peer to initiate new P2P operations.
> But if device is discovered by probe-resp only, it mean this should be
>
> A ---- probe-req ---> B
> A <--- probe-resp ---- B (now A knows B)
> A <--- probe-req ---- B
> A ---- probe-resp ---> B (now B knows A)
Probe Response frames include more information about the peer and that
allows wpa_supplicant to complete the peer entry. This is the point when
the peer is fully known and indicated to upper layers. The Probe Request
frame RX case is just used internally within wpa_supplicant. (For
completeness, number of other frames, i.e., P2P Action frames, can also
complete the P2P peer entry, so this does not need to be Probe
Response).
--
Jouni Malinen PGP id EFC895FA
^ permalink raw reply
* [PATCH] ath9k_htc: fix skb_under_panic error
From: Oleksij Rempel @ 2013-06-04 18:37 UTC (permalink / raw)
To: linux-wireless, ath9k-devel; +Cc: Oleksij Rempel
In-Reply-To: <51ADBC01.6090202@blackshift.org>
This error seems to be really rare, and we do not know real couse of it.
But, in any case, we should check size of head before reducing it.
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Reported-by: Marc Kleine-Budde <mkl@blackshift.org>
---
drivers/net/wireless/ath/ath9k/htc_hst.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c
index aac4a40..2901351 100644
--- a/drivers/net/wireless/ath/ath9k/htc_hst.c
+++ b/drivers/net/wireless/ath/ath9k/htc_hst.c
@@ -26,6 +26,12 @@ static int htc_issue_send(struct htc_target *target, struct sk_buff* skb,
struct htc_endpoint *endpoint = &target->endpoint[epid];
int status;
+ if (skb_headroom(skb) < len &&
+ pskb_expand_head(skb, len, 0, GFP_ATOMIC)) {
+ dev_err(target->dev, "Unable to expand headrom to %d\n", len);
+ return -ENOMEM;
+ }
+
hdr = (struct htc_frame_hdr *)
skb_push(skb, sizeof(struct htc_frame_hdr));
hdr->endpoint_id = epid;
--
1.8.1.2
^ permalink raw reply related
* Re: carl9170:5/10 MHz Channel Support on carl9170
From: Christian Lamparter @ 2013-06-04 19:43 UTC (permalink / raw)
To: C.B. Wang; +Cc: linux-wireless
In-Reply-To: <CAB-Tk70FmmfZOaJnWOubcOrP3MyXebTtrY936_4NROmf_76EZw@mail.gmail.com>
On Tuesday, June 04, 2013 03:20:26 PM C.B. Wang wrote:
> I want to know if the ar9170 chip support 5/10 mhz channels.
Maybe. if you care about it, you'll have to look for clues in
the original vendor driver (otus - was part of the kernel's staging/
directory for < 2.6.39?) and the original vendor firmware
(ar9170fw - you can find a git-tree @ git.sipsolutions.com).
Anyway, if you need a definitive "yes" or "no", you should
ask Qualcomm Atheros directly. As I can only tell something
about the MAC [which does have a 802.11j Mode. It can be
enabled by setting bit 3 in AR9170_MAC_REG_POWER_STATE_CTRL.]
However, I don't have any information about the PHY/FEM/RF
and BB.
> The datasheet says it supports 802.11j, but the carl9170
> driver does not provide support.
Again, talk to Qualcomm Atheros to find out what needs to be
done in order to support it.
> Also the radio chip ar9104 has tuning range from 2.3-2.5ghz and
> 4.9-6.1ghz,but the driver does not provide any support for these
> super channels.
Some AR9170 devices do indeed support the 4.9 GHz channels
(out of the box). e.g.:
Frequencies:
* 4920 MHz [-16] (18.0 dBm)
* 4940 MHz [-12] (18.0 dBm)
* 4960 MHz [-8] (18.0 dBm)
* 4980 MHz [-4] (18.0 dBm)
* 5040 MHz [8] (18.0 dBm)
* 5060 MHz [12] (18.0 dBm)
* 5080 MHz [16] (18.0 dBm)
However, the device needs to be calibrated for the frequencies
to use them legally (the Japanese Market). Look in your kernel
logs when the driver is loaded; There should be something like
this:
> ath: EEPROM regdomain: 0x8xyz
> ath: EEPROM indicates we should expect a country code
> ath: doing EEPROM country->regdmn map search
> ath: Country alpha2 being used: JP <--- JaPan
If your country code is not "JP", then you'll have to talk to
the manufacturer.
Regards,
Chr
^ permalink raw reply
* Re: pull request: wireless 2013-06-03
From: David Miller @ 2013-06-04 20:18 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20130603184817.GD2727@tuxdriver.com>
From: "John W. Linville" <linville@tuxdriver.com>
Date: Mon, 3 Jun 2013 14:48:17 -0400
> Please let me know if there are problems!
Sorry, the broadcom brcmfmac changes need to go.
Some of those commits are cleanups, and some of them have the worst
commit log messages ever, the last one for example:
0017-brcmsmac-fix-regression-observed-in-3.10-rc1.patch
has no explanation whatsoever of what the actual problem or regression
is, what aspect of the logic in that function is causing the problem,
and no explanation why making this function always return 'false' is a
reasonable fix.
That entire series is of very low quality, and even if it was in good
shape, at least half the changes are not appropriate at all this late
in the -rc series.
^ permalink raw reply
* [PATCH] cfg80211: fix potential deadlock regression
From: Johannes Berg @ 2013-06-04 20:22 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg
From: Johannes Berg <johannes.berg@intel.com>
My big locking cleanups caused a problem by registering the
rfkill instance with the RTNL held, while the callback also
acquires the RTNL. This potentially causes a deadlock since
the two locks used (rfkill mutex and RTNL) can be acquired
in two different orders. Fix this by (un)registering rfkill
without holding the RTNL. This needs to be done after the
device struct is registered, but that can also be done w/o
holding the RTNL.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/wireless/core.c | 23 ++++++++---------------
1 file changed, 8 insertions(+), 15 deletions(-)
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 221e76b..99d86dd 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -555,14 +555,18 @@ int wiphy_register(struct wiphy *wiphy)
/* check and set up bitrates */
ieee80211_set_bitrate_flags(wiphy);
- rtnl_lock();
res = device_add(&rdev->wiphy.dev);
+ if (res)
+ return res;
+
+ res = rfkill_register(rdev->rfkill);
if (res) {
- rtnl_unlock();
+ device_del(&rdev->wiphy.dev);
return res;
}
+ rtnl_lock();
/* set up regulatory info */
wiphy_regulatory_register(wiphy);
@@ -589,17 +593,6 @@ int wiphy_register(struct wiphy *wiphy)
cfg80211_debugfs_rdev_add(rdev);
- res = rfkill_register(rdev->rfkill);
- if (res) {
- device_del(&rdev->wiphy.dev);
-
- debugfs_remove_recursive(rdev->wiphy.debugfsdir);
- list_del_rcu(&rdev->list);
- wiphy_regulatory_deregister(wiphy);
- rtnl_unlock();
- return res;
- }
-
rdev->wiphy.registered = true;
rtnl_unlock();
return 0;
@@ -636,11 +629,11 @@ void wiphy_unregister(struct wiphy *wiphy)
rtnl_unlock();
__count == 0; }));
+ rfkill_unregister(rdev->rfkill);
+
rtnl_lock();
rdev->wiphy.registered = false;
- rfkill_unregister(rdev->rfkill);
-
BUG_ON(!list_empty(&rdev->wdev_list));
/*
--
1.8.0
^ permalink raw reply related
* [PATCH] cfg80211: make wiphy index start at 0 again
From: Johannes Berg @ 2013-06-04 20:28 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg
From: Johannes Berg <johannes.berg@intel.com>
The change to use atomic_inc_return() for assigning the wiphy
index made the first wiphy index 1 instead of 0. This is fine,
but we all habitually type "phy0" when we're testing, so make
it go back to 0 instead of 1 by subtracting 1 from the index.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/wireless/core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 99d86dd..4224e75 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -301,6 +301,9 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv)
return NULL;
}
+ /* atomic_inc_return makes it start at 1, make it start at 0 */
+ rdev->wiphy_idx--;
+
/* give it a proper name */
dev_set_name(&rdev->wiphy.dev, PHY_NAME "%d", rdev->wiphy_idx);
--
1.8.0
^ permalink raw reply related
* Re: pull request: wireless 2013-06-03
From: John W. Linville @ 2013-06-04 20:56 UTC (permalink / raw)
To: David Miller; +Cc: linux-wireless, netdev, linux-kernel, arend
In-Reply-To: <20130604.131813.134898245916084893.davem@davemloft.net>
On Tue, Jun 04, 2013 at 01:18:13PM -0700, David Miller wrote:
> From: "John W. Linville" <linville@tuxdriver.com>
> Date: Mon, 3 Jun 2013 14:48:17 -0400
>
> > Please let me know if there are problems!
>
> Sorry, the broadcom brcmfmac changes need to go.
>
> Some of those commits are cleanups, and some of them have the worst
> commit log messages ever, the last one for example:
>
> 0017-brcmsmac-fix-regression-observed-in-3.10-rc1.patch
>
> has no explanation whatsoever of what the actual problem or regression
> is, what aspect of the logic in that function is causing the problem,
> and no explanation why making this function always return 'false' is a
> reasonable fix.
>
> That entire series is of very low quality, and even if it was in good
> shape, at least half the changes are not appropriate at all this late
> in the -rc series.
OK, sorry Dave -- I knew better...
John
--
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
* wireless tree rebased (from 5/28), Broadcom bits dropped
From: John W. Linville @ 2013-06-04 21:26 UTC (permalink / raw)
To: linux-wireless
Cc: Johannes Berg, Samuel Ortiz, Gustavo Padovan, Luciano Coelho
All,
Due to my poor judgment in accepting the brcmfmac/brcmsmac series,
I've made a mess of the wireless tree. To fix it, I have rebased from
before that series was applied. I'm sure there were other potential
courses of action, but this is the one I chose...
If you maintain a tree that pulls from wireless.git (and has done
so within the past week), then you will need to rebase as well.
This is particularly true if you wish for me to pull from your tree
in the future.
I sincerely apologize for the inconvenience. I hope that it won't
be happening again anytime soon (if at all).
John
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply
* Re: wireless tree rebased (from 5/28), Broadcom bits dropped
From: John W. Linville @ 2013-06-04 21:53 UTC (permalink / raw)
To: linux-wireless
Cc: Johannes Berg, Samuel Ortiz, Gustavo Padovan, Luciano Coelho
In-Reply-To: <20130604212602.GB11199@tuxdriver.com>
I messed this up too -- bad day...
If you pulled in between the earlier message and this one, please
do so again. If you saw this message before taking any action to
clean-up my mess, then you are OK.
John
On Tue, Jun 04, 2013 at 05:26:03PM -0400, John W. Linville wrote:
> All,
>
> Due to my poor judgment in accepting the brcmfmac/brcmsmac series,
> I've made a mess of the wireless tree. To fix it, I have rebased from
> before that series was applied. I'm sure there were other potential
> courses of action, but this is the one I chose...
>
> If you maintain a tree that pulls from wireless.git (and has done
> so within the past week), then you will need to rebase as well.
> This is particularly true if you wish for me to pull from your tree
> in the future.
>
> I sincerely apologize for the inconvenience. I hope that it won't
> be happening again anytime soon (if at all).
>
> John
> --
> John W. Linville Someday the world will need a hero, and you
> linville@tuxdriver.com might be all we have. Be ready.
> --
> 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
>
--
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] mwifiex: enable/disable tx_amsdu support via module parameter
From: Bing Zhao @ 2013-06-04 23:20 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Amitkumar Karwar, Avinash Patil,
Yogesh Ashok Powar, Nishant Sarmukadam, Frank Huang, Bing Zhao
From: Avinash Patil <patila@marvell.com>
This patch disables tx_amsdu support in mwifiex by default.
tx_amdsu support can be enabled via module parameter at load time.
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
drivers/net/wireless/mwifiex/wmm.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c
index 4be3d33..944e884 100644
--- a/drivers/net/wireless/mwifiex/wmm.c
+++ b/drivers/net/wireless/mwifiex/wmm.c
@@ -37,6 +37,9 @@
/* Offset for TOS field in the IP header */
#define IPTOS_OFFSET 5
+static bool enable_tx_amsdu;
+module_param(enable_tx_amsdu, bool, 0644);
+
/* WMM information IE */
static const u8 wmm_info_ie[] = { WLAN_EID_VENDOR_SPECIFIC, 0x07,
0x00, 0x50, 0xf2, 0x02,
@@ -1233,7 +1236,7 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter)
mwifiex_send_delba(priv, tid_del, ra, 1);
}
}
- if (mwifiex_is_amsdu_allowed(priv, tid) &&
+ if (enable_tx_amsdu && mwifiex_is_amsdu_allowed(priv, tid) &&
mwifiex_is_11n_aggragation_possible(priv, ptr,
adapter->tx_buf_size))
mwifiex_11n_aggregate_pkt(priv, ptr, INTF_HEADER_LEN,
--
1.8.2.3
^ permalink raw reply related
* [PATCH] mwifiex: fix regression issue for usb interface
From: Bing Zhao @ 2013-06-04 23:19 UTC (permalink / raw)
To: linux-wireless
Cc: John W. Linville, Daniel Drake, Amitkumar Karwar, Avinash Patil,
Yogesh Ashok Powar, Nishant Sarmukadam, Frank Huang, Bing Zhao
From: Amitkumar Karwar <akarwar@marvell.com>
PATCH "mwifiex: scan delay timer cleanup in unload path" adds code
to cancel scan delay timer in unload path. It causes a regression
for USB interface.
USB8797 card gets enumerated twice. First enumeration is for
firmware download and second enumeration expects firmware
initialization.
It was observed that we are trying del_timer_sync() without setting
up the timer when remove handler is called after first enumeration.
This patch moves setup_timer() call to appropriate place so that
timer is setup for both the enumerations.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
drivers/net/wireless/mwifiex/init.c | 81 ------------------------------------
drivers/net/wireless/mwifiex/main.c | 82 +++++++++++++++++++++++++++++++++++++
2 files changed, 82 insertions(+), 81 deletions(-)
diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index c7f11c0..2fe31dc 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -52,84 +52,6 @@ static int mwifiex_add_bss_prio_tbl(struct mwifiex_private *priv)
return 0;
}
-static void scan_delay_timer_fn(unsigned long data)
-{
- struct mwifiex_private *priv = (struct mwifiex_private *)data;
- struct mwifiex_adapter *adapter = priv->adapter;
- struct cmd_ctrl_node *cmd_node, *tmp_node;
- unsigned long flags;
-
- if (adapter->surprise_removed)
- return;
-
- if (adapter->scan_delay_cnt == MWIFIEX_MAX_SCAN_DELAY_CNT) {
- /*
- * Abort scan operation by cancelling all pending scan
- * commands
- */
- spin_lock_irqsave(&adapter->scan_pending_q_lock, flags);
- list_for_each_entry_safe(cmd_node, tmp_node,
- &adapter->scan_pending_q, list) {
- list_del(&cmd_node->list);
- mwifiex_insert_cmd_to_free_q(adapter, cmd_node);
- }
- spin_unlock_irqrestore(&adapter->scan_pending_q_lock, flags);
-
- spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
- adapter->scan_processing = false;
- adapter->scan_delay_cnt = 0;
- adapter->empty_tx_q_cnt = 0;
- spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
-
- if (priv->scan_request) {
- dev_dbg(adapter->dev, "info: aborting scan\n");
- cfg80211_scan_done(priv->scan_request, 1);
- priv->scan_request = NULL;
- } else {
- priv->scan_aborting = false;
- dev_dbg(adapter->dev, "info: scan already aborted\n");
- }
- goto done;
- }
-
- if (!atomic_read(&priv->adapter->is_tx_received)) {
- adapter->empty_tx_q_cnt++;
- if (adapter->empty_tx_q_cnt == MWIFIEX_MAX_EMPTY_TX_Q_CNT) {
- /*
- * No Tx traffic for 200msec. Get scan command from
- * scan pending queue and put to cmd pending queue to
- * resume scan operation
- */
- adapter->scan_delay_cnt = 0;
- adapter->empty_tx_q_cnt = 0;
- spin_lock_irqsave(&adapter->scan_pending_q_lock, flags);
- cmd_node = list_first_entry(&adapter->scan_pending_q,
- struct cmd_ctrl_node, list);
- list_del(&cmd_node->list);
- spin_unlock_irqrestore(&adapter->scan_pending_q_lock,
- flags);
-
- mwifiex_insert_cmd_to_pending_q(adapter, cmd_node,
- true);
- queue_work(adapter->workqueue, &adapter->main_work);
- goto done;
- }
- } else {
- adapter->empty_tx_q_cnt = 0;
- }
-
- /* Delay scan operation further by 20msec */
- mod_timer(&priv->scan_delay_timer, jiffies +
- msecs_to_jiffies(MWIFIEX_SCAN_DELAY_MSEC));
- adapter->scan_delay_cnt++;
-
-done:
- if (atomic_read(&priv->adapter->is_tx_received))
- atomic_set(&priv->adapter->is_tx_received, false);
-
- return;
-}
-
/*
* This function initializes the private structure and sets default
* values to the members.
@@ -211,9 +133,6 @@ int mwifiex_init_priv(struct mwifiex_private *priv)
priv->scan_block = false;
- setup_timer(&priv->scan_delay_timer, scan_delay_timer_fn,
- (unsigned long)priv);
-
return mwifiex_add_bss_prio_tbl(priv);
}
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 5bc7ef8..4858719 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -28,6 +28,84 @@ const char driver_version[] = "mwifiex " VERSION " (%s) ";
static char *cal_data_cfg;
module_param(cal_data_cfg, charp, 0);
+static void scan_delay_timer_fn(unsigned long data)
+{
+ struct mwifiex_private *priv = (struct mwifiex_private *)data;
+ struct mwifiex_adapter *adapter = priv->adapter;
+ struct cmd_ctrl_node *cmd_node, *tmp_node;
+ unsigned long flags;
+
+ if (adapter->surprise_removed)
+ return;
+
+ if (adapter->scan_delay_cnt == MWIFIEX_MAX_SCAN_DELAY_CNT) {
+ /*
+ * Abort scan operation by cancelling all pending scan
+ * commands
+ */
+ spin_lock_irqsave(&adapter->scan_pending_q_lock, flags);
+ list_for_each_entry_safe(cmd_node, tmp_node,
+ &adapter->scan_pending_q, list) {
+ list_del(&cmd_node->list);
+ mwifiex_insert_cmd_to_free_q(adapter, cmd_node);
+ }
+ spin_unlock_irqrestore(&adapter->scan_pending_q_lock, flags);
+
+ spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags);
+ adapter->scan_processing = false;
+ adapter->scan_delay_cnt = 0;
+ adapter->empty_tx_q_cnt = 0;
+ spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags);
+
+ if (priv->scan_request) {
+ dev_dbg(adapter->dev, "info: aborting scan\n");
+ cfg80211_scan_done(priv->scan_request, 1);
+ priv->scan_request = NULL;
+ } else {
+ priv->scan_aborting = false;
+ dev_dbg(adapter->dev, "info: scan already aborted\n");
+ }
+ goto done;
+ }
+
+ if (!atomic_read(&priv->adapter->is_tx_received)) {
+ adapter->empty_tx_q_cnt++;
+ if (adapter->empty_tx_q_cnt == MWIFIEX_MAX_EMPTY_TX_Q_CNT) {
+ /*
+ * No Tx traffic for 200msec. Get scan command from
+ * scan pending queue and put to cmd pending queue to
+ * resume scan operation
+ */
+ adapter->scan_delay_cnt = 0;
+ adapter->empty_tx_q_cnt = 0;
+ spin_lock_irqsave(&adapter->scan_pending_q_lock, flags);
+ cmd_node = list_first_entry(&adapter->scan_pending_q,
+ struct cmd_ctrl_node, list);
+ list_del(&cmd_node->list);
+ spin_unlock_irqrestore(&adapter->scan_pending_q_lock,
+ flags);
+
+ mwifiex_insert_cmd_to_pending_q(adapter, cmd_node,
+ true);
+ queue_work(adapter->workqueue, &adapter->main_work);
+ goto done;
+ }
+ } else {
+ adapter->empty_tx_q_cnt = 0;
+ }
+
+ /* Delay scan operation further by 20msec */
+ mod_timer(&priv->scan_delay_timer, jiffies +
+ msecs_to_jiffies(MWIFIEX_SCAN_DELAY_MSEC));
+ adapter->scan_delay_cnt++;
+
+done:
+ if (atomic_read(&priv->adapter->is_tx_received))
+ atomic_set(&priv->adapter->is_tx_received, false);
+
+ return;
+}
+
/*
* This function registers the device and performs all the necessary
* initializations.
@@ -75,6 +153,10 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops,
adapter->priv[i]->adapter = adapter;
adapter->priv_num++;
+
+ setup_timer(&adapter->priv[i]->scan_delay_timer,
+ scan_delay_timer_fn,
+ (unsigned long)adapter->priv[i]);
}
mwifiex_init_lock_list(adapter);
--
1.8.2.3
^ permalink raw reply related
* 4.9GHz and 5.8GHz regulatory entries?
From: Adrian Chadd @ 2013-06-05 0:49 UTC (permalink / raw)
To: linux-wireless, ath9k-devel
Hi all,
I'm hacking at the support needed for 4.9 and 5.8GHz NICs in FreeBSD.
Well, there's support for them (and they work!) but I'm doing up some
regulatory entries for them.
So, has anyone looked at adding 4.9 and 5.8GHz regulatory domain
entries to db.txt in Linux, for regulatory domains that allow them to
be used unlicenced?
Thanks,
Adrian
^ permalink raw reply
* [PATCH] iwlegacy: fix error return code in il3945_pci_probe()
From: Wei Yongjun @ 2013-06-05 2:16 UTC (permalink / raw)
To: sgruszka, linville; +Cc: yongjun_wei, linux-wireless
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Fix to return a negative error code in the il3945_hw_set_hw_params() error
handling case instead of 0, as done elsewhere in this function.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
drivers/net/wireless/iwlegacy/3945-mac.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index dce5e8f..9581d07 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -3727,7 +3727,8 @@ il3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
* 5. Setup HW Constants
* ********************/
/* Device-specific setup */
- if (il3945_hw_set_hw_params(il)) {
+ err = il3945_hw_set_hw_params(il);
+ if (err) {
IL_ERR("failed to set hw settings\n");
goto out_eeprom_free;
}
^ permalink raw reply related
* [PATCH -next] cw1200: Sanity-check arguments in copy_from_user()
From: Solomon Peachy @ 2013-06-05 3:37 UTC (permalink / raw)
To: linux-wireless; +Cc: Solomon Peachy
The optional debugfs interface to the vendor's engineering tools wasn't
bounds checking at all, which made it trivial to perform a buffer
overflow if this interface was compiled in and then explicitly enabled
at runtime.
This patch checks both the length supplied as part of the data to ensure
it is sane, and also the amount of data compared to the remaining buffer
space. If either is too large, fail immediately.
(This bug was spotted by Dan Carpenter <dan.carpenter@oracle.com>)
Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
---
drivers/net/wireless/cw1200/debug.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/cw1200/debug.c b/drivers/net/wireless/cw1200/debug.c
index b815181..1aeef5e 100644
--- a/drivers/net/wireless/cw1200/debug.c
+++ b/drivers/net/wireless/cw1200/debug.c
@@ -403,13 +403,13 @@ struct etf_req_msg;
static int etf_request(struct cw1200_common *priv,
struct etf_req_msg *msg, u32 len);
-#define MAX_RX_SZE 2600
+#define MAX_RX_SIZE 2600
struct etf_in_state {
struct cw1200_common *priv;
- u32 total_len;
- u8 buf[MAX_RX_SZE];
- u32 written;
+ u16 total_len;
+ u16 written;
+ u8 buf[MAX_RX_SIZE];
};
static int cw1200_etf_in_open(struct inode *inode, struct file *file)
@@ -454,6 +454,11 @@ static ssize_t cw1200_etf_in_write(struct file *file,
return -EFAULT;
}
+ if (etf->total_len > MAX_RX_SIZE) {
+ pr_err("requested length > MAX_RX_SIZE\n");
+ return -EINVAL;
+ }
+
written += sizeof(etf->total_len);
count -= sizeof(etf->total_len);
}
@@ -461,6 +466,11 @@ static ssize_t cw1200_etf_in_write(struct file *file,
if (!count)
goto done;
+ if (count > (etf->total_len - written)) {
+ pr_err("Tried to write > MAX_RX_SIZE\n");
+ return -EINVAL;
+ }
+
if (copy_from_user(etf->buf + etf->written, user_buf + written,
count)) {
pr_err("copy_from_user (payload %zu) failed\n", count);
--
1.8.2.1
^ permalink raw reply related
* Re: [PATCH] cw1200: fix some obvious mistakes
From: Solomon Peachy @ 2013-06-05 4:08 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-kernel, John W. Linville, Wei Yongjun, Dmitry Tarnyagin,
Ajitpal Singh, linux-wireless
In-Reply-To: <2014948.bdhzSga56L@wuerfel>
[-- Attachment #1: Type: text/plain, Size: 2147 bytes --]
On Mon, Jun 03, 2013 at 10:40:42AM +0200, Arnd Bergmann wrote:
> It's much better than what you have today, but not ideal because it
> means the driver cannot be a loadable module any more.
At least not when being built with platform data, anyway.
I suppose the next step here is to define some devicetree mappings for
this device.
> At least it's not in a released kernel yet.
Given the boneheaded buffer overflow bug that was just pointed out (and
fixed), I'm glad it's getting a lot more scrutiny.
> Regarding a long-term solution, I think what we should do here is to
> move the reset logic into the SDIO framework itself: We have similar
> requirements even for eMMC and SD cards, where you need to provide
> the correct voltage to a device on the MMC port in order for it to
> work. Today this is supported to a varying degree on the MMC controller
> level, where we hook into various frameworks (clk, reset-controller,
> regulator, gpio, pinctrl, power domain) based on platformm data or
> device tree information on the controller node.
If I understand you correctly, the "traditional" platform data -- power
supply, clock source, and gpio (ie POWERUP, RESET) lines would be
brought up using this mechanism, in order to get the device to attach to
the SDIO bus. One wrinkle here is that the cw1200 has some minimum
timing requirements between when each of those signals are brought up; I
don't know if there's a way to encode that into the devicetree.
But that's only half the equation.
Once the device has identified it to the SDIO bus and the driver's
probe() function is called, the other half of the platform data is
needed to successfully probe the hardware. Namely, the 'ref_clk' field.
This would need to be made available to the probe() call (eg via
func->dev.platform_data) but from what I can tell there's currently no
mechanism to make that connection.
Anyway, it's time for bed.
- Solomon
--
Solomon Peachy pizza at shaftnet dot org
Delray Beach, FL ^^ (email/xmpp) ^^
Quidquid latine dictum sit, altum viditur.
[-- Attachment #2: Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply
* Re: [wireless-regdb] [PATCH] regulatory: enable channels 52-64 and 100-144 for world roaming
From: Johannes Berg @ 2013-06-05 6:34 UTC (permalink / raw)
To: linux-wireless; +Cc: bzhao, wireless-regdb, mcgrof
In-Reply-To: <1368738412-7740-1-git-send-email-johannes@sipsolutions.net>
On Thu, 2013-05-16 at 23:06 +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> If allowed in a country, these channels typically require DFS
> so mark them as such. Channel 144 is a bit special, it's coming
> into use now to allow more VHT 80 channels, but world roaming
> with passive scanning is acceptable anyway. It seems fairly
> unlikely that it'll be used as the control channel for a VHT
> AP, but it needs to be present to allow a full VHT connection
> to an AP that uses it as one of the secondary channels.
>
> Also enable VHT 160 on these channels, and also for channels
> 36-48 to be able to use VHT 160 there.
You guys all get a few more days for comments, then I'm merging this
next Monday. I really think it's the right thing to do, there's no
reason to prohibit passive scanning on radar channels that I know of.
johannes
^ permalink raw reply
* [PATCH] mac80211: fix powersave bug and clean up ieee80211_rx_bss_info
From: Johannes Berg @ 2013-06-05 6:54 UTC (permalink / raw)
To: linux-wireless; +Cc: Alexander Bondar
From: Alexander Bondar <alexander.bondar@intel.com>
ieee80211_rx_bss_info() deals with dtim_period setting and PS update
when associated. Move all these to another locations cleaning this
function. Also, the current implementation is buggy because when it
calls ieee80211_recalc_ps() bss_conf->dtim_period is notset properly
yet and thus nothing will happen.
Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/mac80211/mlme.c | 30 +++++++++---------------------
1 file changed, 9 insertions(+), 21 deletions(-)
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index df8170a..aa5cd2e 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2737,24 +2737,9 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
int freq;
struct ieee80211_bss *bss;
struct ieee80211_channel *channel;
- bool need_ps = false;
sdata_assert_lock(sdata);
- if ((sdata->u.mgd.associated &&
- ether_addr_equal(mgmt->bssid, sdata->u.mgd.associated->bssid)) ||
- (sdata->u.mgd.assoc_data &&
- ether_addr_equal(mgmt->bssid,
- sdata->u.mgd.assoc_data->bss->bssid))) {
- /* not previously set so we may need to recalc */
- need_ps = sdata->u.mgd.associated && !sdata->u.mgd.dtim_period;
-
- if (elems->tim && !elems->parse_error) {
- const struct ieee80211_tim_ie *tim_ie = elems->tim;
- sdata->u.mgd.dtim_period = tim_ie->dtim_period;
- }
- }
-
if (elems->ds_params)
freq = ieee80211_channel_to_frequency(elems->ds_params[0],
rx_status->band);
@@ -2775,12 +2760,6 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
!ether_addr_equal(mgmt->bssid, sdata->u.mgd.associated->bssid))
return;
- if (need_ps) {
- mutex_lock(&local->iflist_mtx);
- ieee80211_recalc_ps(local, -1);
- mutex_unlock(&local->iflist_mtx);
- }
-
ieee80211_sta_process_chanswitch(sdata, rx_status->mactime,
elems, true);
@@ -2894,6 +2873,10 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
len - baselen, false, &elems);
ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems);
+ if (elems.tim && !elems.parse_error) {
+ const struct ieee80211_tim_ie *tim_ie = elems.tim;
+ ifmgd->dtim_period = tim_ie->dtim_period;
+ }
ifmgd->assoc_data->have_beacon = true;
ifmgd->assoc_data->need_beacon = false;
if (local->hw.flags & IEEE80211_HW_TIMING_BEACON_ONLY) {
@@ -3096,6 +3079,11 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
}
changed |= BSS_CHANGED_DTIM_PERIOD;
+
+ mutex_lock(&local->iflist_mtx);
+ ieee80211_recalc_ps(local, -1);
+ mutex_unlock(&local->iflist_mtx);
+
ieee80211_recalc_ps_vif(sdata);
}
--
1.8.0
^ permalink raw reply related
* Re: wireless tree rebased (from 5/28), Broadcom bits dropped
From: Johannes Berg @ 2013-06-05 6:59 UTC (permalink / raw)
To: John W. Linville
Cc: linux-wireless, Samuel Ortiz, Gustavo Padovan, Luciano Coelho
In-Reply-To: <20130604215320.GC11199@tuxdriver.com>
On Tue, 2013-06-04 at 17:53 -0400, John W. Linville wrote:
> I messed this up too -- bad day...
>
> If you pulled in between the earlier message and this one, please
> do so again. If you saw this message before taking any action to
> clean-up my mess, then you are OK.
This was confusing, I think you rebased around some merges instead of
redoing the merges? My patches are in, but suddenly got new commit IDs,
e.g. fa331699d05ce1d0d4896eb4a137cfae50d7afde (new) vs.
c2c15e215e860c99b86ddfc4be4bb25cf180fed0 for "mac80211: work around
broken APs not including HT info".
This will cause git to pull them in again when I send a new pull
request, so it would have been nicer to redo the merges, but anyway ...
just a heads-up for everyone that here it's a bit confusing now.
johannes
^ permalink raw reply
* pull-request: iwlwifi-fixes 2013-06-05
From: Johannes Berg @ 2013-06-05 7:02 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless
[-- Attachment #1: Type: text/plain, Size: 1367 bytes --]
Hi,
Here's another one ... I guess the fixes stream never ends, but on the
plus side they're getting smaller.
I picked up Nikolay's patch for the chain noise calibration bug that
seems to have been there forever, a fix from Emmanuel for setting TX
flags on BAR frames and a fix of my own to avoid printing
request_module() errors if the kernel isn't even modular.
Please pull.
Thanks,
johannes
The following changes since commit a87783699b23395c46bbeeb5d28f6db24897bf26:
iwlwifi: dvm: fix zero LQ CMD sending avoidance (2013-05-27 11:33:57 +0200)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes.git for-john
for you to fetch changes up to 2edc6ec6330c7906f4dbd7f5da71be8989efc5a3:
iwlwifi: mvm: correctly set the flags for BAR (2013-06-04 13:14:30 +0200)
----------------------------------------------------------------
Emmanuel Grumbach (1):
iwlwifi: mvm: correctly set the flags for BAR
Johannes Berg (1):
iwlwifi: don't print module loading error if not modular
Nikolay Martynov (1):
iwlwifi: dvm: fix chain noise calibration
drivers/net/wireless/iwlwifi/dvm/rxon.c | 2 +-
drivers/net/wireless/iwlwifi/iwl-drv.c | 2 ++
drivers/net/wireless/iwlwifi/mvm/tx.c | 3 ++-
3 files changed, 5 insertions(+), 2 deletions(-)
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox