* Re: [PATCH v2 0/2] kbuild: Cache exploratory calls to the compiler
From: Guenter Roeck @ 2017-10-05 1:46 UTC (permalink / raw)
To: Douglas Anderson
Cc: Masahiro Yamada, Michal Marek, Guenter Roeck, sjg, Brian Norris,
Marcin Nowakowski, Matthias Kaehlcke, Cao jin, Arnd Bergmann,
Mark Charlebois, Linux Kbuild mailing list, linux-doc,
Jonathan Corbet, linux-kernel, James Hogan, Josh Poimboeuf,
Ingo Molnar
In-Reply-To: <20171004223717.3010-1-dianders@chromium.org>
On Wed, Oct 4, 2017 at 3:37 PM, Douglas Anderson <dianders@chromium.org> wrote:
> This two-patch series attempts to speed incremental builds of the
> kernel up by a bit. How much of a speedup you get depends a lot on
> your environment, specifically the speed of your workstation and how
> fast it takes to invoke the compiler.
>
> In the Chrome OS build environment you get a really big win. For an
> incremental build (via emerge) I measured a speedup from ~1 minute to
> ~35 seconds. ...but Chrome OS calls the compiler through a number of
> wrapper scripts and also calls the kernel make at least twice for an
> emerge (during compile stage and install stage), so it's a bit of a
> worst case.
>
> Perhaps a more realistic measure of the speedup others might see is
> running "time make help > /dev/null" outside of the Chrome OS build
> environment on my system. When I do this I see that it took more than
> 1.0 seconds before and less than 0.2 seconds after. So presumably
> this has the ability to shave ~0.8 seconds off an incremental build
> for most folks out there. While 0.8 seconds savings isn't huge, it
> does make incremental builds feel a lot snappier.
>
> Caveats from v1 still copied here, though with Masahiro Yamada's
> suggestions from v1 this is starting to feel a little more baked and
> I've even dropped the RFC from it (though extra testing still
> appreciated):
>
> Please note that I make no illusions of being a Makefile expert nor do
> I have any belief that I fully understand the Linux kernel build
> system. Please take this patch series as the start of a discussion
> about whether others feel like this type of speedup is worthwhile and
> how to best accomplish it. Specific things to note:
>
> - I'm happy to paint the bikeshed any color that maintainers want. If
> you'd like the cache named differently, in a slightly different
> format, or you want me to adjust the spacing / names of Makefile
> stuff then please just let me know.
>
> - If this is totally the wrong approach and you have a better idea
> then let me know. If you want something that's super complicated to
> explain then feel free to post a replacement patch and I'm happy to
> test.
>
> - This patch definitely needs extra testing. I've tested it on a very
> limited build environment and it seems to be working fine, but I
> could believe that with some weird compiler options or on certain
> architectures you might need some extra escaping here and there.
>
Not being a makefile expert, I can't say anything about the merits of
this series. However, it does pass a run on my test farm at
kerneltests.org. So. I'll give it a
Tested-by: Guenter Roeck <linux@roeck-us.net>
Guenter
> Changes in v2:
> - Abstract at a different level (like shell-cached) per Masahiro Yamada
> - Include ld-version, which I missed the first time
>
> Douglas Anderson (2):
> kbuild: Add a cache for generated variables
> kbuild: Cache a few more calls to the compiler
>
> Documentation/kbuild/makefiles.txt | 21 +++++++++
> Makefile | 4 +-
> scripts/Kbuild.include | 90 ++++++++++++++++++++++++++++++++------
> 3 files changed, 99 insertions(+), 16 deletions(-)
>
> --
> 2.14.2.920.gcf0c67979c-goog
>
^ permalink raw reply
* [PATCH v2] irqdomain: move revmap_trees_mutex to struct irq_domain
From: Masahiro Yamada @ 2017-10-05 1:44 UTC (permalink / raw)
To: Thomas Gleixner, Jason Cooper, Marc Zyngier; +Cc: Masahiro Yamada, linux-kernel
The revmap_trees_mutex protects domain->revmap_tree. There is no
need to make it global because it is allowed to modify revmap_tree
of two different domains concurrently. Having said that, this would
not be a actual bottleneck because the interrupt map/unmap does not
occur quite often. Rather, the motivation is to tidy up the code
from a data structure point of view.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
Changes in v2:
- Update git-log. I believe this clean-up is worthwhile.
include/linux/irqdomain.h | 2 ++
kernel/irq/irqdomain.c | 14 +++++++-------
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index 81e4889..56b68b0 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -32,6 +32,7 @@
#include <linux/types.h>
#include <linux/irqhandler.h>
#include <linux/of.h>
+#include <linux/mutex.h>
#include <linux/radix-tree.h>
struct device_node;
@@ -172,6 +173,7 @@ struct irq_domain {
unsigned int revmap_direct_max_irq;
unsigned int revmap_size;
struct radix_tree_root revmap_tree;
+ struct mutex revmap_tree_mutex;
unsigned int linear_revmap[];
};
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index ac4644e..7870800 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -21,7 +21,6 @@
static LIST_HEAD(irq_domain_list);
static DEFINE_MUTEX(irq_domain_mutex);
-static DEFINE_MUTEX(revmap_trees_mutex);
static struct irq_domain *irq_default_domain;
static void irq_domain_check_hierarchy(struct irq_domain *domain);
@@ -211,6 +210,7 @@ struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, int size,
/* Fill structure */
INIT_RADIX_TREE(&domain->revmap_tree, GFP_KERNEL);
+ mutex_init(&domain->revmap_tree_mutex);
domain->ops = ops;
domain->host_data = host_data;
domain->hwirq_max = hwirq_max;
@@ -462,9 +462,9 @@ static void irq_domain_clear_mapping(struct irq_domain *domain,
if (hwirq < domain->revmap_size) {
domain->linear_revmap[hwirq] = 0;
} else {
- mutex_lock(&revmap_trees_mutex);
+ mutex_lock(&domain->revmap_tree_mutex);
radix_tree_delete(&domain->revmap_tree, hwirq);
- mutex_unlock(&revmap_trees_mutex);
+ mutex_unlock(&domain->revmap_tree_mutex);
}
}
@@ -475,9 +475,9 @@ static void irq_domain_set_mapping(struct irq_domain *domain,
if (hwirq < domain->revmap_size) {
domain->linear_revmap[hwirq] = irq_data->irq;
} else {
- mutex_lock(&revmap_trees_mutex);
+ mutex_lock(&domain->revmap_tree_mutex);
radix_tree_insert(&domain->revmap_tree, hwirq, irq_data);
- mutex_unlock(&revmap_trees_mutex);
+ mutex_unlock(&domain->revmap_tree_mutex);
}
}
@@ -1459,11 +1459,11 @@ static void irq_domain_fix_revmap(struct irq_data *d)
return; /* Not using radix tree. */
/* Fix up the revmap. */
- mutex_lock(&revmap_trees_mutex);
+ mutex_lock(&d->domain->revmap_tree_mutex);
slot = radix_tree_lookup_slot(&d->domain->revmap_tree, d->hwirq);
if (slot)
radix_tree_replace_slot(&d->domain->revmap_tree, slot, d);
- mutex_unlock(&revmap_trees_mutex);
+ mutex_unlock(&d->domain->revmap_tree_mutex);
}
/**
--
2.7.4
^ permalink raw reply related
* Re: cmd.exe Terminal is closing when cloning a repository on windows 10 (64.bit)
From: Johannes Schindelin @ 2017-10-05 1:44 UTC (permalink / raw)
To: André Netzeband; +Cc: git
In-Reply-To: <alpine.DEB.2.21.1.1710050128410.40514@virtualbox>
[-- Attachment #1: Type: text/plain, Size: 1205 bytes --]
Hi,
On Thu, 5 Oct 2017, Johannes Schindelin wrote:
> On Mon, 2 Oct 2017, André Netzeband wrote:
>
> > I installed git for windows 2.14.2 (64bit) and was trying to clone a
> > repository from a command terminal (cmd.exe):
> >
> > git clone
> > https://Netzeband@bitbucket.org/Netzeband/deep-speeddreams.git
> >
> > First everything went well, but after the repository was downloaded
> > the LFS download started. At this point the terminal window just
> > closed and I was not able to see anything related on the terminal.
> > There was no error message. However several git processes (and git
> > lfs) were running in the background and downloaded everything for the
> > repository (all lfs files).
>
> This is most likely the same issue as reported at
> https://github.com/git-lfs/git-lfs/issues/2631 and at
> https://github.com/git-for-windows/git/issues/1312.
I think this is solved by
https://github.com/git-for-windows/MSYS2-packages/commit/e9d0a2be272.
If everything goes according to plan, a new snapshot will land at
https://wingit.blob.core.windows.net/files/index.html within the next half
hour.
When it does, can you please test?
Thank you,
Johannes
^ permalink raw reply
* Re: Line ending normalization doesn't work as expected
From: Junio C Hamano @ 2017-10-05 1:38 UTC (permalink / raw)
To: Torsten Bögershausen; +Cc: Robert Dailey, Git
In-Reply-To: <20171004211734.GA25379@tor.lan>
Torsten Bögershausen <tboegi@web.de> writes:
> One solution, which you can tell your team, is this one:
> $ git rm -r --cached . && git add .
Both this and its "git read-tree --empty" cousin share a grave
issue. The "git add ." step would mean that before doing these
commands, your working tree must be truly clean, i.e. the paths
in the filesystem known to the index must match what is in the
index (modulo the line-ending gotcha you are trying to correct),
*AND* there must be *NO* untracked paths you do not want to add
in the working tree.
That is a reason why we should solve it differently. Perhaps adding
a new option "git add --rehash" to tell Git "Hey, you may think some
paths in the index and in the working tree are identical and no need
to re-register, but you are WRONG. For each path in the index,
remove it and then register the object by hashing the contents from
the filesystem afresh!" would be the best way to go. That will not
pick up untracked paths left in the filesystem, and does not limit
our solution to the "eol normalization is screwey" issue by not
calling the option "renormalize" or any other words that imply "why"
we are hashing again anew.
^ permalink raw reply
* [PATCH V2 8/8] qtnfmac: do not cache current channel info in driver's state
From: igor.mitsyanko.os @ 2017-10-05 1:38 UTC (permalink / raw)
To: linux-wireless; +Cc: sergey.matyukevich.os, avinashp, johannes
In-Reply-To: <20171005013813.13332-1-igor.mitsyanko.os@quantenna.com>
From: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Linux Wireless device structure already has current channel
information that can be used when needed. Start using it.
Since driver's channel info is not used anymore, remove it.
Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
---
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 7 ++-----
drivers/net/wireless/quantenna/qtnfmac/core.h | 1 -
drivers/net/wireless/quantenna/qtnfmac/event.c | 2 --
3 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
index cf0f19ef..028bed1 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
@@ -630,15 +630,15 @@ qtnf_dump_survey(struct wiphy *wiphy, struct net_device *dev,
int idx, struct survey_info *survey)
{
struct qtnf_wmac *mac = wiphy_priv(wiphy);
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
struct ieee80211_supported_band *sband;
- struct cfg80211_chan_def *chandef;
+ const struct cfg80211_chan_def *chandef = &wdev->chandef;
struct ieee80211_channel *chan;
struct qtnf_chan_stats stats;
struct qtnf_vif *vif;
int ret;
vif = qtnf_netdev_get_priv(dev);
- chandef = &mac->chandef;
sband = wiphy->bands[NL80211_BAND_2GHZ];
if (sband && idx >= sband->n_channels) {
@@ -705,7 +705,6 @@ static int
qtnf_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev,
struct cfg80211_chan_def *chandef)
{
- struct qtnf_wmac *mac = wiphy_priv(wiphy);
struct net_device *ndev = wdev->netdev;
struct qtnf_vif *vif;
int ret;
@@ -728,8 +727,6 @@ qtnf_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev,
ret = -ENODATA;
}
- memcpy(&mac->chandef, chandef, sizeof(mac->chandef));
-
out:
return ret;
}
diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.h b/drivers/net/wireless/quantenna/qtnfmac/core.h
index 5234a9e..44a2cbb 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/core.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/core.h
@@ -126,7 +126,6 @@ struct qtnf_wmac {
struct qtnf_mac_info macinfo;
struct qtnf_vif iflist[QTNF_MAX_INTF];
struct cfg80211_scan_request *scan_req;
- struct cfg80211_chan_def chandef;
struct mutex mac_lock; /* lock during wmac speicific ops */
struct timer_list scan_timeout;
};
diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c
index d7fb076..f639ea3 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/event.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/event.c
@@ -372,8 +372,6 @@ qtnf_event_handle_freq_change(struct qtnf_wmac *mac,
mac->macid, chandef.chan->hw_value, chandef.center_freq1,
chandef.center_freq2, chandef.width);
- memcpy(&mac->chandef, &chandef, sizeof(mac->chandef));
-
for (i = 0; i < QTNF_MAX_INTF; i++) {
vif = &mac->iflist[i];
if (vif->wdev.iftype == NL80211_IFTYPE_UNSPECIFIED)
--
2.9.5
^ permalink raw reply related
* [PATCH V2 7/8] qtnfmac: make encryption info a part of CONNECT command.
From: igor.mitsyanko.os @ 2017-10-05 1:38 UTC (permalink / raw)
To: linux-wireless; +Cc: sergey.matyukevich.os, avinashp, johannes
In-Reply-To: <20171005013813.13332-1-igor.mitsyanko.os@quantenna.com>
From: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Encryption info is a constant part of STA settings, no point
to pass it as an optional TLV.
Remove QTN_TLV_ID_CRYPTO type as it's not used anymore.
Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
---
drivers/net/wireless/quantenna/qtnfmac/commands.c | 42 ++++++++++-------------
drivers/net/wireless/quantenna/qtnfmac/qlink.h | 5 +--
2 files changed, 22 insertions(+), 25 deletions(-)
diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c
index b65d705..babdc60 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/commands.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c
@@ -2037,7 +2037,7 @@ int qtnf_cmd_send_connect(struct qtnf_vif *vif,
{
struct sk_buff *cmd_skb;
struct qlink_cmd_connect *cmd;
- struct qlink_auth_encr aen;
+ struct qlink_auth_encr *aen;
u16 res_code = QLINK_CMD_RESULT_OK;
int ret;
int i;
@@ -2049,8 +2049,6 @@ int qtnf_cmd_send_connect(struct qtnf_vif *vif,
if (unlikely(!cmd_skb))
return -ENOMEM;
- qtnf_bus_lock(vif->mac->bus);
-
cmd = (struct qlink_cmd_connect *)cmd_skb->data;
ether_addr_copy(cmd->bssid, vif->bssid);
@@ -2077,41 +2075,39 @@ int qtnf_cmd_send_connect(struct qtnf_vif *vif,
cmd->flags = cpu_to_le32(connect_flags);
- memset(&aen, 0, sizeof(aen));
- aen.auth_type = sme->auth_type;
- aen.privacy = !!sme->privacy;
- aen.mfp = sme->mfp;
- aen.wpa_versions = cpu_to_le32(sme->crypto.wpa_versions);
- aen.cipher_group = cpu_to_le32(sme->crypto.cipher_group);
- aen.n_ciphers_pairwise = cpu_to_le32(
- sme->crypto.n_ciphers_pairwise);
+ aen = &cmd->aen;
+ aen->auth_type = sme->auth_type;
+ aen->privacy = !!sme->privacy;
+ aen->mfp = sme->mfp;
+ aen->wpa_versions = cpu_to_le32(sme->crypto.wpa_versions);
+ aen->cipher_group = cpu_to_le32(sme->crypto.cipher_group);
+ aen->n_ciphers_pairwise = cpu_to_le32(sme->crypto.n_ciphers_pairwise);
for (i = 0; i < QLINK_MAX_NR_CIPHER_SUITES; i++)
- aen.ciphers_pairwise[i] = cpu_to_le32(
- sme->crypto.ciphers_pairwise[i]);
+ aen->ciphers_pairwise[i] =
+ cpu_to_le32(sme->crypto.ciphers_pairwise[i]);
- aen.n_akm_suites = cpu_to_le32(sme->crypto.n_akm_suites);
+ aen->n_akm_suites = cpu_to_le32(sme->crypto.n_akm_suites);
for (i = 0; i < QLINK_MAX_NR_AKM_SUITES; i++)
- aen.akm_suites[i] = cpu_to_le32(
- sme->crypto.akm_suites[i]);
+ aen->akm_suites[i] = cpu_to_le32(sme->crypto.akm_suites[i]);
- aen.control_port = sme->crypto.control_port;
- aen.control_port_no_encrypt =
+ aen->control_port = sme->crypto.control_port;
+ aen->control_port_no_encrypt =
sme->crypto.control_port_no_encrypt;
- aen.control_port_ethertype = cpu_to_le16(be16_to_cpu(
- sme->crypto.control_port_ethertype));
+ aen->control_port_ethertype =
+ cpu_to_le16(be16_to_cpu(sme->crypto.control_port_ethertype));
qtnf_cmd_skb_put_tlv_arr(cmd_skb, WLAN_EID_SSID, sme->ssid,
- sme->ssid_len);
- qtnf_cmd_skb_put_tlv_arr(cmd_skb, QTN_TLV_ID_CRYPTO, (u8 *)&aen,
- sizeof(aen));
+ sme->ssid_len);
if (sme->ie_len != 0)
qtnf_cmd_skb_put_tlv_arr(cmd_skb, QTN_TLV_ID_IE_SET,
sme->ie,
sme->ie_len);
+ qtnf_bus_lock(vif->mac->bus);
+
ret = qtnf_cmd_send(vif->mac->bus, cmd_skb, &res_code);
if (unlikely(ret))
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
index 641d252..7b313d3 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
@@ -417,8 +417,9 @@ enum qlink_sta_connect_flags {
* struct qlink_cmd_connect - data for QLINK_CMD_CONNECT command
*
* @flags: for future use.
- * @freq: center frequence of a channel which should be used to connect.
+ * @channel: channel which should be used to connect.
* @bg_scan_period: period of background scan.
+ * @aen: authentication information.
* @bssid: BSSID of the BSS to connect to.
* @payload: variable portion of connection request.
*/
@@ -427,6 +428,7 @@ struct qlink_cmd_connect {
__le32 flags;
__le16 channel;
__le16 bg_scan_period;
+ struct qlink_auth_encr aen;
u8 bssid[ETH_ALEN];
u8 payload[0];
} __packed;
@@ -950,7 +952,6 @@ enum qlink_tlv_id {
QTN_TLV_ID_STA_GENERIC_INFO = 0x0301,
QTN_TLV_ID_KEY = 0x0302,
QTN_TLV_ID_SEQ = 0x0303,
- QTN_TLV_ID_CRYPTO = 0x0304,
QTN_TLV_ID_IE_SET = 0x0305,
};
--
2.9.5
^ permalink raw reply related
* [PATCH V2 6/8] qtnfmac: do not cache BSS state in per-VIF structure
From: igor.mitsyanko.os @ 2017-10-05 1:38 UTC (permalink / raw)
To: linux-wireless; +Cc: sergey.matyukevich.os, avinashp, johannes
In-Reply-To: <20171005013813.13332-1-igor.mitsyanko.os@quantenna.com>
From: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
This cached state is used only once immediately after it is
initilized, except for BSSID value that is used for events processing.
There is no reason in keeping unused data in driver's state.
Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
---
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 40 ++++--------------
drivers/net/wireless/quantenna/qtnfmac/commands.c | 49 +++++++++++++++--------
drivers/net/wireless/quantenna/qtnfmac/core.h | 19 ++-------
3 files changed, 42 insertions(+), 66 deletions(-)
diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
index 08f1f54..cf0f19ef 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
@@ -131,6 +131,7 @@ int qtnf_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev)
vif->netdev = NULL;
vif->wdev.iftype = NL80211_IFTYPE_UNSPECIFIED;
eth_zero_addr(vif->mac_addr);
+ eth_zero_addr(vif->bssid);
return 0;
}
@@ -199,6 +200,8 @@ static struct wireless_dev *qtnf_add_virtual_intf(struct wiphy *wiphy,
qtnf_cmd_send_del_intf(vif);
err_cmd:
vif->wdev.iftype = NL80211_IFTYPE_UNSPECIFIED;
+ eth_zero_addr(vif->mac_addr);
+ eth_zero_addr(vif->bssid);
return ERR_PTR(-EFAULT);
}
@@ -567,7 +570,6 @@ qtnf_connect(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_connect_params *sme)
{
struct qtnf_vif *vif = qtnf_netdev_get_priv(dev);
- struct qtnf_bss_config *bss_cfg;
int ret;
if (vif->wdev.iftype != NL80211_IFTYPE_STATION)
@@ -576,38 +578,10 @@ qtnf_connect(struct wiphy *wiphy, struct net_device *dev,
if (vif->sta_state != QTNF_STA_DISCONNECTED)
return -EBUSY;
- bss_cfg = &vif->bss_cfg;
- memset(bss_cfg, 0, sizeof(*bss_cfg));
-
- bss_cfg->ssid_len = sme->ssid_len;
- memcpy(&bss_cfg->ssid, sme->ssid, bss_cfg->ssid_len);
- bss_cfg->auth_type = sme->auth_type;
- bss_cfg->privacy = sme->privacy;
- bss_cfg->mfp = sme->mfp;
-
- if ((sme->bg_scan_period > 0) &&
- (sme->bg_scan_period <= QTNF_MAX_BG_SCAN_PERIOD))
- bss_cfg->bg_scan_period = sme->bg_scan_period;
- else if (sme->bg_scan_period == -1)
- bss_cfg->bg_scan_period = QTNF_DEFAULT_BG_SCAN_PERIOD;
- else
- bss_cfg->bg_scan_period = 0; /* disabled */
-
- bss_cfg->connect_flags = 0;
-
- if (sme->flags & ASSOC_REQ_DISABLE_HT)
- bss_cfg->connect_flags |= QLINK_STA_CONNECT_DISABLE_HT;
- if (sme->flags & ASSOC_REQ_DISABLE_VHT)
- bss_cfg->connect_flags |= QLINK_STA_CONNECT_DISABLE_VHT;
- if (sme->flags & ASSOC_REQ_USE_RRM)
- bss_cfg->connect_flags |= QLINK_STA_CONNECT_USE_RRM;
-
- memcpy(&bss_cfg->crypto, &sme->crypto, sizeof(bss_cfg->crypto));
-
if (sme->bssid)
- ether_addr_copy(bss_cfg->bssid, sme->bssid);
+ ether_addr_copy(vif->bssid, sme->bssid);
else
- eth_zero_addr(bss_cfg->bssid);
+ eth_zero_addr(vif->bssid);
ret = qtnf_cmd_send_connect(vif, sme);
if (ret) {
@@ -1021,7 +995,7 @@ void qtnf_virtual_intf_cleanup(struct net_device *ndev)
break;
case QTNF_STA_CONNECTING:
cfg80211_connect_result(vif->netdev,
- vif->bss_cfg.bssid, NULL, 0,
+ vif->bssid, NULL, 0,
NULL, 0,
WLAN_STATUS_UNSPECIFIED_FAILURE,
GFP_KERNEL);
@@ -1048,7 +1022,7 @@ void qtnf_cfg80211_vif_reset(struct qtnf_vif *vif)
switch (vif->sta_state) {
case QTNF_STA_CONNECTING:
cfg80211_connect_result(vif->netdev,
- vif->bss_cfg.bssid, NULL, 0,
+ vif->bssid, NULL, 0,
NULL, 0,
WLAN_STATUS_UNSPECIFIED_FAILURE,
GFP_KERNEL);
diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c
index 60d65df..b65d705 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/commands.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c
@@ -2037,11 +2037,11 @@ int qtnf_cmd_send_connect(struct qtnf_vif *vif,
{
struct sk_buff *cmd_skb;
struct qlink_cmd_connect *cmd;
- struct qtnf_bss_config *bss_cfg = &vif->bss_cfg;
struct qlink_auth_encr aen;
u16 res_code = QLINK_CMD_RESULT_OK;
int ret;
int i;
+ u32 connect_flags = 0;
cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid,
QLINK_CMD_CONNECT,
@@ -2053,42 +2053,57 @@ int qtnf_cmd_send_connect(struct qtnf_vif *vif,
cmd = (struct qlink_cmd_connect *)cmd_skb->data;
- ether_addr_copy(cmd->bssid, bss_cfg->bssid);
+ ether_addr_copy(cmd->bssid, vif->bssid);
if (sme->channel)
cmd->channel = cpu_to_le16(sme->channel->hw_value);
else
cmd->channel = 0;
- cmd->bg_scan_period = cpu_to_le16(bss_cfg->bg_scan_period);
+ if ((sme->bg_scan_period > 0) &&
+ (sme->bg_scan_period <= QTNF_MAX_BG_SCAN_PERIOD))
+ cmd->bg_scan_period = cpu_to_le16(sme->bg_scan_period);
+ else if (sme->bg_scan_period == -1)
+ cmd->bg_scan_period = cpu_to_le16(QTNF_DEFAULT_BG_SCAN_PERIOD);
+ else
+ cmd->bg_scan_period = 0; /* disabled */
+
+ if (sme->flags & ASSOC_REQ_DISABLE_HT)
+ connect_flags |= QLINK_STA_CONNECT_DISABLE_HT;
+ if (sme->flags & ASSOC_REQ_DISABLE_VHT)
+ connect_flags |= QLINK_STA_CONNECT_DISABLE_VHT;
+ if (sme->flags & ASSOC_REQ_USE_RRM)
+ connect_flags |= QLINK_STA_CONNECT_USE_RRM;
+
+ cmd->flags = cpu_to_le32(connect_flags);
memset(&aen, 0, sizeof(aen));
- aen.auth_type = bss_cfg->auth_type;
- aen.privacy = !!bss_cfg->privacy;
- aen.mfp = bss_cfg->mfp;
- aen.wpa_versions = cpu_to_le32(bss_cfg->crypto.wpa_versions);
- aen.cipher_group = cpu_to_le32(bss_cfg->crypto.cipher_group);
+ aen.auth_type = sme->auth_type;
+ aen.privacy = !!sme->privacy;
+ aen.mfp = sme->mfp;
+ aen.wpa_versions = cpu_to_le32(sme->crypto.wpa_versions);
+ aen.cipher_group = cpu_to_le32(sme->crypto.cipher_group);
aen.n_ciphers_pairwise = cpu_to_le32(
- bss_cfg->crypto.n_ciphers_pairwise);
+ sme->crypto.n_ciphers_pairwise);
for (i = 0; i < QLINK_MAX_NR_CIPHER_SUITES; i++)
aen.ciphers_pairwise[i] = cpu_to_le32(
- bss_cfg->crypto.ciphers_pairwise[i]);
+ sme->crypto.ciphers_pairwise[i]);
- aen.n_akm_suites = cpu_to_le32(bss_cfg->crypto.n_akm_suites);
+ aen.n_akm_suites = cpu_to_le32(sme->crypto.n_akm_suites);
for (i = 0; i < QLINK_MAX_NR_AKM_SUITES; i++)
aen.akm_suites[i] = cpu_to_le32(
- bss_cfg->crypto.akm_suites[i]);
+ sme->crypto.akm_suites[i]);
- aen.control_port = bss_cfg->crypto.control_port;
+ aen.control_port = sme->crypto.control_port;
aen.control_port_no_encrypt =
- bss_cfg->crypto.control_port_no_encrypt;
+ sme->crypto.control_port_no_encrypt;
aen.control_port_ethertype = cpu_to_le16(be16_to_cpu(
- bss_cfg->crypto.control_port_ethertype));
+ sme->crypto.control_port_ethertype));
- qtnf_cmd_skb_put_tlv_arr(cmd_skb, WLAN_EID_SSID, bss_cfg->ssid,
- bss_cfg->ssid_len);
+ qtnf_cmd_skb_put_tlv_arr(cmd_skb, WLAN_EID_SSID, sme->ssid,
+ sme->ssid_len);
qtnf_cmd_skb_put_tlv_arr(cmd_skb, QTN_TLV_ID_CRYPTO, (u8 *)&aen,
sizeof(aen));
diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.h b/drivers/net/wireless/quantenna/qtnfmac/core.h
index b35200d..5234a9e 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/core.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/core.h
@@ -57,20 +57,6 @@ extern const struct net_device_ops qtnf_netdev_ops;
struct qtnf_bus;
struct qtnf_vif;
-struct qtnf_bss_config {
- u8 ssid[IEEE80211_MAX_SSID_LEN];
- u8 bssid[ETH_ALEN];
- size_t ssid_len;
- u8 dtim;
- u16 bcn_period;
- u16 auth_type;
- bool privacy;
- enum nl80211_mfp mfp;
- struct cfg80211_crypto_settings crypto;
- u16 bg_scan_period;
- u32 connect_flags;
-};
-
struct qtnf_sta_node {
struct list_head list;
u8 mac_addr[ETH_ALEN];
@@ -89,6 +75,8 @@ enum qtnf_sta_state {
struct qtnf_vif {
struct wireless_dev wdev;
+ u8 bssid[ETH_ALEN];
+ u8 mac_addr[ETH_ALEN];
u8 vifid;
u8 bss_priority;
u8 bss_status;
@@ -96,9 +84,8 @@ struct qtnf_vif {
u16 mgmt_frames_bitmask;
struct net_device *netdev;
struct qtnf_wmac *mac;
- u8 mac_addr[ETH_ALEN];
+
struct work_struct reset_work;
- struct qtnf_bss_config bss_cfg;
struct qtnf_sta_list sta_list;
unsigned long cons_tx_timeout_cnt;
};
--
2.9.5
^ permalink raw reply related
* [PATCH V2 5/8] qtnfmac: get rid of QTNF_STATE_AP_START flag
From: igor.mitsyanko.os @ 2017-10-05 1:38 UTC (permalink / raw)
To: linux-wireless; +Cc: sergey.matyukevich.os, avinashp, johannes
In-Reply-To: <20171005013813.13332-1-igor.mitsyanko.os@quantenna.com>
From: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
QTNF_STATE_AP_START usage is redundant and imposes additional state
synchronization maintenance. We may as well leave state checking
to network card and upper layers (cfg80211, nl80211 and userspace).
Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
---
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 29 +----------------------
drivers/net/wireless/quantenna/qtnfmac/commands.c | 3 ---
drivers/net/wireless/quantenna/qtnfmac/core.h | 3 +--
drivers/net/wireless/quantenna/qtnfmac/event.c | 12 ----------
4 files changed, 2 insertions(+), 45 deletions(-)
diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
index c660846..08f1f54 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
@@ -254,11 +254,6 @@ static int qtnf_change_beacon(struct wiphy *wiphy, struct net_device *dev,
{
struct qtnf_vif *vif = qtnf_netdev_get_priv(dev);
- if (!(vif->bss_status & QTNF_STATE_AP_START)) {
- pr_err("VIF%u.%u: not started\n", vif->mac->macid, vif->vifid);
- return -EFAULT;
- }
-
return qtnf_mgmt_set_appie(vif, info);
}
@@ -283,17 +278,9 @@ static int qtnf_start_ap(struct wiphy *wiphy, struct net_device *dev,
}
ret = qtnf_cmd_send_start_ap(vif);
- if (ret) {
+ if (ret)
pr_err("VIF%u.%u: failed to start AP\n", vif->mac->macid,
vif->vifid);
- goto out;
- }
-
- if (!(vif->bss_status & QTNF_STATE_AP_START)) {
- pr_err("VIF%u.%u: FW failed to start AP operation\n",
- vif->mac->macid, vif->vifid);
- ret = -EFAULT;
- }
out:
return ret;
@@ -308,7 +295,6 @@ static int qtnf_stop_ap(struct wiphy *wiphy, struct net_device *dev)
if (ret) {
pr_err("VIF%u.%u: failed to stop AP operation in FW\n",
vif->mac->macid, vif->vifid);
- vif->bss_status &= ~QTNF_STATE_AP_START;
netif_carrier_off(vif->netdev);
}
@@ -784,19 +770,6 @@ static int qtnf_channel_switch(struct wiphy *wiphy, struct net_device *dev,
params->chandef.chan->hw_value, params->count,
params->radar_required, params->block_tx);
- switch (vif->wdev.iftype) {
- case NL80211_IFTYPE_AP:
- if (!(vif->bss_status & QTNF_STATE_AP_START)) {
- pr_warn("AP not started on %s\n", dev->name);
- return -ENOTCONN;
- }
- break;
- default:
- pr_err("unsupported vif type (%d) on %s\n",
- vif->wdev.iftype, dev->name);
- return -EOPNOTSUPP;
- }
-
if (!cfg80211_chandef_valid(¶ms->chandef)) {
pr_err("%s: invalid channel\n", dev->name);
return -EINVAL;
diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c
index 59ca6ca..60d65df 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/commands.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c
@@ -173,7 +173,6 @@ int qtnf_cmd_send_start_ap(struct qtnf_vif *vif)
goto out;
}
- vif->bss_status |= QTNF_STATE_AP_START;
netif_carrier_on(vif->netdev);
out:
@@ -287,8 +286,6 @@ int qtnf_cmd_send_stop_ap(struct qtnf_vif *vif)
goto out;
}
- vif->bss_status &= ~QTNF_STATE_AP_START;
-
netif_carrier_off(vif->netdev);
out:
diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.h b/drivers/net/wireless/quantenna/qtnfmac/core.h
index f8165a7..b35200d 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/core.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/core.h
@@ -52,9 +52,8 @@
#define QTNF_DEF_WDOG_TIMEOUT 5
#define QTNF_TX_TIMEOUT_TRSHLD 100
-#define QTNF_STATE_AP_START BIT(1)
-
extern const struct net_device_ops qtnf_netdev_ops;
+
struct qtnf_bus;
struct qtnf_vif;
diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c
index 7481d5b..d7fb076 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/event.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/event.c
@@ -53,12 +53,6 @@ qtnf_event_handle_sta_assoc(struct qtnf_wmac *mac, struct qtnf_vif *vif,
return -EPROTO;
}
- if (!(vif->bss_status & QTNF_STATE_AP_START)) {
- pr_err("VIF%u.%u: STA_ASSOC event when AP is not started\n",
- mac->macid, vif->vifid);
- return -EPROTO;
- }
-
sta_addr = sta_assoc->sta_addr;
frame_control = le16_to_cpu(sta_assoc->frame_control);
@@ -127,12 +121,6 @@ qtnf_event_handle_sta_deauth(struct qtnf_wmac *mac, struct qtnf_vif *vif,
return -EPROTO;
}
- if (!(vif->bss_status & QTNF_STATE_AP_START)) {
- pr_err("VIF%u.%u: STA_DEAUTH event when AP is not started\n",
- mac->macid, vif->vifid);
- return -EPROTO;
- }
-
sta_addr = sta_deauth->sta_addr;
reason = le16_to_cpu(sta_deauth->reason);
--
2.9.5
^ permalink raw reply related
* [PATCH V2 4/8] qtnfmac: get rid of QTNF_STATE_AP_CONFIG
From: igor.mitsyanko.os @ 2017-10-05 1:38 UTC (permalink / raw)
To: linux-wireless; +Cc: sergey.matyukevich.os, avinashp, johannes
In-Reply-To: <20171005013813.13332-1-igor.mitsyanko.os@quantenna.com>
From: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
QTNF_STATE_AP_CONFIG is redundant and its usage can be safely removed.
Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
---
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 8 --------
drivers/net/wireless/quantenna/qtnfmac/commands.c | 3 ---
drivers/net/wireless/quantenna/qtnfmac/core.h | 1 -
3 files changed, 12 deletions(-)
diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
index 056018e..c660846 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
@@ -275,13 +275,6 @@ static int qtnf_start_ap(struct wiphy *wiphy, struct net_device *dev,
goto out;
}
- if (!(vif->bss_status & QTNF_STATE_AP_CONFIG)) {
- pr_err("VIF%u.%u: AP config failed in FW\n", vif->mac->macid,
- vif->vifid);
- ret = -EFAULT;
- goto out;
- }
-
ret = qtnf_mgmt_set_appie(vif, &settings->beacon);
if (ret) {
pr_err("VIF%u.%u: failed to add IEs to beacon\n",
@@ -316,7 +309,6 @@ static int qtnf_stop_ap(struct wiphy *wiphy, struct net_device *dev)
pr_err("VIF%u.%u: failed to stop AP operation in FW\n",
vif->mac->macid, vif->vifid);
vif->bss_status &= ~QTNF_STATE_AP_START;
- vif->bss_status &= ~QTNF_STATE_AP_CONFIG;
netif_carrier_off(vif->netdev);
}
diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c
index f5bc43b..59ca6ca 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/commands.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c
@@ -256,8 +256,6 @@ int qtnf_cmd_send_config_ap(struct qtnf_vif *vif,
goto out;
}
- vif->bss_status |= QTNF_STATE_AP_CONFIG;
-
out:
qtnf_bus_unlock(vif->mac->bus);
return ret;
@@ -290,7 +288,6 @@ int qtnf_cmd_send_stop_ap(struct qtnf_vif *vif)
}
vif->bss_status &= ~QTNF_STATE_AP_START;
- vif->bss_status &= ~QTNF_STATE_AP_CONFIG;
netif_carrier_off(vif->netdev);
diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.h b/drivers/net/wireless/quantenna/qtnfmac/core.h
index 2cd0150..f8165a7 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/core.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/core.h
@@ -52,7 +52,6 @@
#define QTNF_DEF_WDOG_TIMEOUT 5
#define QTNF_TX_TIMEOUT_TRSHLD 100
-#define QTNF_STATE_AP_CONFIG BIT(2)
#define QTNF_STATE_AP_START BIT(1)
extern const struct net_device_ops qtnf_netdev_ops;
--
2.9.5
^ permalink raw reply related
* [PATCH V2 3/8] qtnfmac: pass channel definition to WiFi card on START_AP command
From: igor.mitsyanko.os @ 2017-10-05 1:38 UTC (permalink / raw)
To: linux-wireless; +Cc: sergey.matyukevich.os, avinashp, johannes
In-Reply-To: <20171005013813.13332-1-igor.mitsyanko.os@quantenna.com>
From: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Introduce "channel definition" TLV containing full channel
description (center frequence for both segments + BW) and pass it to
wireless card in a payload to START_AP command.
Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
---
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 9 ------
drivers/net/wireless/quantenna/qtnfmac/commands.c | 28 ++++++++++---------
drivers/net/wireless/quantenna/qtnfmac/qlink.h | 13 +++++++++
.../net/wireless/quantenna/qtnfmac/qlink_util.c | 32 ++++++++++++++++++++++
.../net/wireless/quantenna/qtnfmac/qlink_util.h | 2 ++
5 files changed, 62 insertions(+), 22 deletions(-)
diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
index fe157f5..056018e 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
@@ -266,17 +266,8 @@ static int qtnf_start_ap(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_ap_settings *settings)
{
struct qtnf_vif *vif = qtnf_netdev_get_priv(dev);
- struct qtnf_wmac *mac = wiphy_priv(wiphy);
int ret;
- if (!cfg80211_chandef_identical(&mac->chandef, &settings->chandef)) {
- memcpy(&mac->chandef, &settings->chandef, sizeof(mac->chandef));
- if (vif->vifid != 0)
- pr_warn("%s: unexpected chan %u (%u MHz)\n", dev->name,
- settings->chandef.chan->hw_value,
- settings->chandef.chan->center_freq);
- }
-
ret = qtnf_cmd_send_config_ap(vif, settings);
if (ret) {
pr_err("VIF%u.%u: failed to push config to FW\n",
diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c
index 493c3f8..f5bc43b 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/commands.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c
@@ -185,8 +185,6 @@ int qtnf_cmd_send_config_ap(struct qtnf_vif *vif,
const struct cfg80211_ap_settings *s)
{
struct sk_buff *cmd_skb;
- struct cfg80211_chan_def *chandef = &vif->mac->chandef;
- struct qlink_tlv_channel *qchan;
struct qlink_cmd_config_ap *cmd;
struct qlink_auth_encr *aen;
u16 res_code = QLINK_CMD_RESULT_OK;
@@ -211,17 +209,6 @@ int qtnf_cmd_send_config_ap(struct qtnf_vif *vif,
cmd->ht_required = s->ht_required;
cmd->vht_required = s->vht_required;
- if (s->ssid && s->ssid_len > 0 && s->ssid_len <= IEEE80211_MAX_SSID_LEN)
- qtnf_cmd_skb_put_tlv_arr(cmd_skb, WLAN_EID_SSID, s->ssid,
- s->ssid_len);
-
- qchan = skb_put_zero(cmd_skb, sizeof(*qchan));
- qchan->hdr.type = cpu_to_le16(QTN_TLV_ID_CHANNEL);
- qchan->hdr.len = cpu_to_le16(sizeof(*qchan) -
- sizeof(struct qlink_tlv_hdr));
- qchan->hw_value = cpu_to_le16(
- ieee80211_frequency_to_channel(chandef->chan->center_freq));
-
aen = &cmd->aen;
aen->auth_type = s->auth_type;
aen->privacy = !!s->privacy;
@@ -240,6 +227,21 @@ int qtnf_cmd_send_config_ap(struct qtnf_vif *vif,
aen->control_port_ethertype =
cpu_to_le16(be16_to_cpu(s->crypto.control_port_ethertype));
+ if (s->ssid && s->ssid_len > 0 && s->ssid_len <= IEEE80211_MAX_SSID_LEN)
+ qtnf_cmd_skb_put_tlv_arr(cmd_skb, WLAN_EID_SSID, s->ssid,
+ s->ssid_len);
+
+ if (cfg80211_chandef_valid(&s->chandef)) {
+ struct qlink_tlv_chandef *chtlv =
+ (struct qlink_tlv_chandef *)skb_put(cmd_skb,
+ sizeof(*chtlv));
+
+ chtlv->hdr.type = cpu_to_le16(QTN_TLV_ID_CHANDEF);
+ chtlv->hdr.len = cpu_to_le16(sizeof(*chtlv) -
+ sizeof(chtlv->hdr));
+ qlink_chandef_cfg2q(&s->chandef, &chtlv->chan);
+ }
+
qtnf_bus_lock(vif->mac->bus);
ret = qtnf_cmd_send(vif->mac->bus, cmd_skb, &res_code);
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
index 6814254..641d252 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
@@ -941,6 +941,7 @@ enum qlink_tlv_id {
QTN_TLV_ID_LRETRY_LIMIT = 0x0204,
QTN_TLV_ID_REG_RULE = 0x0207,
QTN_TLV_ID_CHANNEL = 0x020F,
+ QTN_TLV_ID_CHANDEF = 0x0210,
QTN_TLV_ID_COVERAGE_CLASS = 0x0213,
QTN_TLV_ID_IFACE_LIMIT = 0x0214,
QTN_TLV_ID_NUM_IFACE_COMB = 0x0215,
@@ -1128,6 +1129,18 @@ struct qlink_tlv_channel {
u8 rsvd[2];
} __packed;
+/**
+ * struct qlink_tlv_chandef - data for QTN_TLV_ID_CHANDEF TLV
+ *
+ * Channel definition.
+ *
+ * @chan: channel definition data.
+ */
+struct qlink_tlv_chandef {
+ struct qlink_tlv_hdr hdr;
+ struct qlink_chandef chan;
+} __packed;
+
struct qlink_chan_stats {
__le32 chan_num;
__le32 cca_tx;
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c
index 63a74b2..61d999a 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c
@@ -128,6 +128,38 @@ void qlink_chandef_q2cfg(struct wiphy *wiphy,
}
}
+static u8 qlink_chanwidth_nl_to_qlink(enum nl80211_chan_width nlwidth)
+{
+ switch (nlwidth) {
+ case NL80211_CHAN_WIDTH_20_NOHT:
+ return QLINK_CHAN_WIDTH_20_NOHT;
+ case NL80211_CHAN_WIDTH_20:
+ return QLINK_CHAN_WIDTH_20;
+ case NL80211_CHAN_WIDTH_40:
+ return QLINK_CHAN_WIDTH_40;
+ case NL80211_CHAN_WIDTH_80:
+ return QLINK_CHAN_WIDTH_80;
+ case NL80211_CHAN_WIDTH_80P80:
+ return QLINK_CHAN_WIDTH_80P80;
+ case NL80211_CHAN_WIDTH_160:
+ return QLINK_CHAN_WIDTH_160;
+ case NL80211_CHAN_WIDTH_5:
+ return QLINK_CHAN_WIDTH_5;
+ case NL80211_CHAN_WIDTH_10:
+ return QLINK_CHAN_WIDTH_10;
+ default:
+ return -1;
+ }
+}
+
+void qlink_chandef_cfg2q(const struct cfg80211_chan_def *chdef,
+ struct qlink_chandef *qch)
+{
+ qch->center_freq1 = cpu_to_le16(chdef->center_freq1);
+ qch->center_freq2 = cpu_to_le16(chdef->center_freq2);
+ qch->width = qlink_chanwidth_nl_to_qlink(chdef->width);
+}
+
enum qlink_hidden_ssid qlink_hidden_ssid_nl2q(enum nl80211_hidden_ssid nl_val)
{
switch (nl_val) {
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h
index 416f11d..260383d 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h
@@ -66,6 +66,8 @@ u8 qlink_chan_width_mask_to_nl(u16 qlink_mask);
void qlink_chandef_q2cfg(struct wiphy *wiphy,
const struct qlink_chandef *qch,
struct cfg80211_chan_def *chdef);
+void qlink_chandef_cfg2q(const struct cfg80211_chan_def *chdef,
+ struct qlink_chandef *qch);
enum qlink_hidden_ssid qlink_hidden_ssid_nl2q(enum nl80211_hidden_ssid nl_val);
#endif /* _QTN_FMAC_QLINK_UTIL_H_ */
--
2.9.5
^ permalink raw reply related
* [PATCH V2 2/8] qtnfmac: pass all AP settings to wireless card for processing
From: igor.mitsyanko.os @ 2017-10-05 1:38 UTC (permalink / raw)
To: linux-wireless; +Cc: sergey.matyukevich.os, avinashp, johannes
In-Reply-To: <20171005013813.13332-1-igor.mitsyanko.os@quantenna.com>
From: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Modify QLINK START_AP command payload to pass all AP settings
contained within struct cfg80211_ap_settings.
Make most of settings a constant part of "config AP" command
instead of passing it as an optional TLVs.
Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
---
drivers/net/wireless/quantenna/qtnfmac/commands.c | 52 ++++++++-------
drivers/net/wireless/quantenna/qtnfmac/qlink.h | 78 ++++++++++++++++------
.../net/wireless/quantenna/qtnfmac/qlink_util.c | 13 ++++
.../net/wireless/quantenna/qtnfmac/qlink_util.h | 1 +
4 files changed, 101 insertions(+), 43 deletions(-)
diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c
index 88fdf7d..493c3f8 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/commands.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c
@@ -187,27 +187,34 @@ int qtnf_cmd_send_config_ap(struct qtnf_vif *vif,
struct sk_buff *cmd_skb;
struct cfg80211_chan_def *chandef = &vif->mac->chandef;
struct qlink_tlv_channel *qchan;
- struct qlink_auth_encr aen;
+ struct qlink_cmd_config_ap *cmd;
+ struct qlink_auth_encr *aen;
u16 res_code = QLINK_CMD_RESULT_OK;
int ret;
int i;
cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid,
QLINK_CMD_CONFIG_AP,
- sizeof(struct qlink_cmd));
+ sizeof(*cmd));
if (unlikely(!cmd_skb))
return -ENOMEM;
- qtnf_bus_lock(vif->mac->bus);
+ cmd = (struct qlink_cmd_config_ap *)cmd_skb->data;
+ cmd->dtim_period = s->dtim_period;
+ cmd->beacon_interval = cpu_to_le16(s->beacon_interval);
+ cmd->hidden_ssid = qlink_hidden_ssid_nl2q(s->hidden_ssid);
+ cmd->inactivity_timeout = cpu_to_le16(s->inactivity_timeout);
+ cmd->smps_mode = s->smps_mode;
+ cmd->p2p_ctwindow = s->p2p_ctwindow;
+ cmd->p2p_opp_ps = s->p2p_opp_ps;
+ cmd->pbss = s->pbss;
+ cmd->ht_required = s->ht_required;
+ cmd->vht_required = s->vht_required;
if (s->ssid && s->ssid_len > 0 && s->ssid_len <= IEEE80211_MAX_SSID_LEN)
qtnf_cmd_skb_put_tlv_arr(cmd_skb, WLAN_EID_SSID, s->ssid,
s->ssid_len);
- qtnf_cmd_skb_put_tlv_u16(cmd_skb, QTN_TLV_ID_BCN_PERIOD,
- s->beacon_interval);
- qtnf_cmd_skb_put_tlv_u8(cmd_skb, QTN_TLV_ID_DTIM, s->dtim_period);
-
qchan = skb_put_zero(cmd_skb, sizeof(*qchan));
qchan->hdr.type = cpu_to_le16(QTN_TLV_ID_CHANNEL);
qchan->hdr.len = cpu_to_le16(sizeof(*qchan) -
@@ -215,26 +222,25 @@ int qtnf_cmd_send_config_ap(struct qtnf_vif *vif,
qchan->hw_value = cpu_to_le16(
ieee80211_frequency_to_channel(chandef->chan->center_freq));
- memset(&aen, 0, sizeof(aen));
- aen.auth_type = s->auth_type;
- aen.privacy = !!s->privacy;
- aen.mfp = 0;
- aen.wpa_versions = cpu_to_le32(s->crypto.wpa_versions);
- aen.cipher_group = cpu_to_le32(s->crypto.cipher_group);
- aen.n_ciphers_pairwise = cpu_to_le32(s->crypto.n_ciphers_pairwise);
+ aen = &cmd->aen;
+ aen->auth_type = s->auth_type;
+ aen->privacy = !!s->privacy;
+ aen->mfp = 0;
+ aen->wpa_versions = cpu_to_le32(s->crypto.wpa_versions);
+ aen->cipher_group = cpu_to_le32(s->crypto.cipher_group);
+ aen->n_ciphers_pairwise = cpu_to_le32(s->crypto.n_ciphers_pairwise);
for (i = 0; i < QLINK_MAX_NR_CIPHER_SUITES; i++)
- aen.ciphers_pairwise[i] =
- cpu_to_le32(s->crypto.ciphers_pairwise[i]);
- aen.n_akm_suites = cpu_to_le32(s->crypto.n_akm_suites);
+ aen->ciphers_pairwise[i] =
+ cpu_to_le32(s->crypto.ciphers_pairwise[i]);
+ aen->n_akm_suites = cpu_to_le32(s->crypto.n_akm_suites);
for (i = 0; i < QLINK_MAX_NR_AKM_SUITES; i++)
- aen.akm_suites[i] = cpu_to_le32(s->crypto.akm_suites[i]);
- aen.control_port = s->crypto.control_port;
- aen.control_port_no_encrypt =s->crypto.control_port_no_encrypt;
- aen.control_port_ethertype =
+ aen->akm_suites[i] = cpu_to_le32(s->crypto.akm_suites[i]);
+ aen->control_port = s->crypto.control_port;
+ aen->control_port_no_encrypt = s->crypto.control_port_no_encrypt;
+ aen->control_port_ethertype =
cpu_to_le16(be16_to_cpu(s->crypto.control_port_ethertype));
- qtnf_cmd_skb_put_tlv_arr(cmd_skb, QTN_TLV_ID_CRYPTO, (u8 *)&aen,
- sizeof(aen));
+ qtnf_bus_lock(vif->mac->bus);
ret = qtnf_cmd_send(vif->mac->bus, cmd_skb, &res_code);
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
index fb88f3e..6814254 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
@@ -132,6 +132,24 @@ struct qlink_chandef {
u8 rsvd[3];
} __packed;
+#define QLINK_MAX_NR_CIPHER_SUITES 5
+#define QLINK_MAX_NR_AKM_SUITES 2
+
+struct qlink_auth_encr {
+ __le32 wpa_versions;
+ __le32 cipher_group;
+ __le32 n_ciphers_pairwise;
+ __le32 ciphers_pairwise[QLINK_MAX_NR_CIPHER_SUITES];
+ __le32 n_akm_suites;
+ __le32 akm_suites[QLINK_MAX_NR_AKM_SUITES];
+ __le16 control_port_ethertype;
+ u8 auth_type;
+ u8 privacy;
+ u8 mfp;
+ u8 control_port;
+ u8 control_port_no_encrypt;
+} __packed;
+
/* QLINK Command messages related definitions
*/
@@ -521,6 +539,46 @@ struct qlink_cmd_chan_switch {
u8 beacon_count;
} __packed;
+/**
+ * enum qlink_hidden_ssid - values for %NL80211_ATTR_HIDDEN_SSID
+ *
+ * Refer to &enum nl80211_hidden_ssid
+ */
+enum qlink_hidden_ssid {
+ QLINK_HIDDEN_SSID_NOT_IN_USE,
+ QLINK_HIDDEN_SSID_ZERO_LEN,
+ QLINK_HIDDEN_SSID_ZERO_CONTENTS
+};
+
+/**
+ * struct qlink_cmd_config_ap - data for QLINK_CMD_CONFIG_AP command
+ *
+ * @beacon_interval: beacon interval
+ * @inactivity_timeout: station's inactivity period in seconds
+ * @dtim_period: DTIM period
+ * @hidden_ssid: whether to hide the SSID, one of &enum qlink_hidden_ssid
+ * @smps_mode: SMPS mode
+ * @ht_required: stations must support HT
+ * @vht_required: stations must support VHT
+ * @aen: encryption info
+ * @info: variable configurations
+ */
+struct qlink_cmd_config_ap {
+ struct qlink_cmd chdr;
+ __le16 beacon_interval;
+ __le16 inactivity_timeout;
+ u8 dtim_period;
+ u8 hidden_ssid;
+ u8 smps_mode;
+ u8 p2p_ctwindow;
+ u8 p2p_opp_ps;
+ u8 pbss;
+ u8 ht_required;
+ u8 vht_required;
+ struct qlink_auth_encr aen;
+ u8 info[0];
+} __packed;
+
/* QLINK Command Responses messages related definitions
*/
@@ -881,8 +939,6 @@ enum qlink_tlv_id {
QTN_TLV_ID_RTS_THRESH = 0x0202,
QTN_TLV_ID_SRETRY_LIMIT = 0x0203,
QTN_TLV_ID_LRETRY_LIMIT = 0x0204,
- QTN_TLV_ID_BCN_PERIOD = 0x0205,
- QTN_TLV_ID_DTIM = 0x0206,
QTN_TLV_ID_REG_RULE = 0x0207,
QTN_TLV_ID_CHANNEL = 0x020F,
QTN_TLV_ID_COVERAGE_CLASS = 0x0213,
@@ -1072,24 +1128,6 @@ struct qlink_tlv_channel {
u8 rsvd[2];
} __packed;
-#define QLINK_MAX_NR_CIPHER_SUITES 5
-#define QLINK_MAX_NR_AKM_SUITES 2
-
-struct qlink_auth_encr {
- __le32 wpa_versions;
- __le32 cipher_group;
- __le32 n_ciphers_pairwise;
- __le32 ciphers_pairwise[QLINK_MAX_NR_CIPHER_SUITES];
- __le32 n_akm_suites;
- __le32 akm_suites[QLINK_MAX_NR_AKM_SUITES];
- __le16 control_port_ethertype;
- u8 auth_type;
- u8 privacy;
- u8 mfp;
- u8 control_port;
- u8 control_port_no_encrypt;
-} __packed;
-
struct qlink_chan_stats {
__le32 chan_num;
__le32 cca_tx;
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c
index 3c1db5b..63a74b2 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c
@@ -127,3 +127,16 @@ void qlink_chandef_q2cfg(struct wiphy *wiphy,
break;
}
}
+
+enum qlink_hidden_ssid qlink_hidden_ssid_nl2q(enum nl80211_hidden_ssid nl_val)
+{
+ switch (nl_val) {
+ case NL80211_HIDDEN_SSID_ZERO_LEN:
+ return QLINK_HIDDEN_SSID_ZERO_LEN;
+ case NL80211_HIDDEN_SSID_ZERO_CONTENTS:
+ return QLINK_HIDDEN_SSID_ZERO_CONTENTS;
+ case NL80211_HIDDEN_SSID_NOT_IN_USE:
+ default:
+ return QLINK_HIDDEN_SSID_NOT_IN_USE;
+ }
+}
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h
index 5e49a8a..416f11d 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h
@@ -66,5 +66,6 @@ u8 qlink_chan_width_mask_to_nl(u16 qlink_mask);
void qlink_chandef_q2cfg(struct wiphy *wiphy,
const struct qlink_chandef *qch,
struct cfg80211_chan_def *chdef);
+enum qlink_hidden_ssid qlink_hidden_ssid_nl2q(enum nl80211_hidden_ssid nl_val);
#endif /* _QTN_FMAC_QLINK_UTIL_H_ */
--
2.9.5
^ permalink raw reply related
* [PATCH V2 0/8] qtnfmac: get rid of redundant state caching in driver
From: igor.mitsyanko.os @ 2017-10-05 1:38 UTC (permalink / raw)
To: linux-wireless; +Cc: sergey.matyukevich.os, avinashp, johannes
From: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
In many cases qtnfmac driver stores state info (like current channel,
interface state) in driver's internal state that is either unused or
duplicates information that is available elsewhere. Cleanup driver
to get rid of not needed cached data.
It was part of bigger changeset when it was V1.
Changelist V1->V2:
PATCH 3:
- add missing cpu_to_le16() to CMD len field initialization.
Igor Mitsyanko (8):
qtnfmac: do not cache AP settings in driver structures
qtnfmac: pass all AP settings to wireless card for processing
qtnfmac: pass channel definition to WiFi card on START_AP command
qtnfmac: get rid of QTNF_STATE_AP_CONFIG
qtnfmac: get rid of QTNF_STATE_AP_START flag
qtnfmac: do not cache BSS state in per-VIF structure
qtnfmac: make encryption info a part of CONNECT command.
qtnfmac: do not cache current channel info in driver's state
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 110 ++------------
drivers/net/wireless/quantenna/qtnfmac/commands.c | 163 +++++++++++----------
drivers/net/wireless/quantenna/qtnfmac/commands.h | 3 +-
drivers/net/wireless/quantenna/qtnfmac/core.h | 24 +--
drivers/net/wireless/quantenna/qtnfmac/event.c | 14 --
drivers/net/wireless/quantenna/qtnfmac/qlink.h | 92 +++++++++---
.../net/wireless/quantenna/qtnfmac/qlink_util.c | 45 ++++++
.../net/wireless/quantenna/qtnfmac/qlink_util.h | 3 +
8 files changed, 224 insertions(+), 230 deletions(-)
--
2.9.5
^ permalink raw reply
* [PATCH V2 1/8] qtnfmac: do not cache AP settings in driver structures
From: igor.mitsyanko.os @ 2017-10-05 1:38 UTC (permalink / raw)
To: linux-wireless; +Cc: sergey.matyukevich.os, avinashp, johannes
In-Reply-To: <20171005013813.13332-1-igor.mitsyanko.os@quantenna.com>
From: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
Cached AP setings are passed to WiFi card right after they are
initialized and are never used for anything else. There is no
point in keeping them in driver state.
Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
---
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 17 +--------
drivers/net/wireless/quantenna/qtnfmac/commands.c | 46 +++++++++++------------
drivers/net/wireless/quantenna/qtnfmac/commands.h | 3 +-
3 files changed, 25 insertions(+), 41 deletions(-)
diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
index 262e8cf..fe157f5 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
@@ -267,7 +267,6 @@ static int qtnf_start_ap(struct wiphy *wiphy, struct net_device *dev,
{
struct qtnf_vif *vif = qtnf_netdev_get_priv(dev);
struct qtnf_wmac *mac = wiphy_priv(wiphy);
- struct qtnf_bss_config *bss_cfg;
int ret;
if (!cfg80211_chandef_identical(&mac->chandef, &settings->chandef)) {
@@ -278,21 +277,7 @@ static int qtnf_start_ap(struct wiphy *wiphy, struct net_device *dev,
settings->chandef.chan->center_freq);
}
- bss_cfg = &vif->bss_cfg;
- memset(bss_cfg, 0, sizeof(*bss_cfg));
-
- bss_cfg->bcn_period = settings->beacon_interval;
- bss_cfg->dtim = settings->dtim_period;
- bss_cfg->auth_type = settings->auth_type;
- bss_cfg->privacy = settings->privacy;
-
- bss_cfg->ssid_len = settings->ssid_len;
- memcpy(&bss_cfg->ssid, settings->ssid, bss_cfg->ssid_len);
-
- memcpy(&bss_cfg->crypto, &settings->crypto,
- sizeof(struct cfg80211_crypto_settings));
-
- ret = qtnf_cmd_send_config_ap(vif);
+ ret = qtnf_cmd_send_config_ap(vif, settings);
if (ret) {
pr_err("VIF%u.%u: failed to push config to FW\n",
vif->mac->macid, vif->vifid);
diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c
index 8f95f98..88fdf7d 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/commands.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c
@@ -181,10 +181,10 @@ int qtnf_cmd_send_start_ap(struct qtnf_vif *vif)
return ret;
}
-int qtnf_cmd_send_config_ap(struct qtnf_vif *vif)
+int qtnf_cmd_send_config_ap(struct qtnf_vif *vif,
+ const struct cfg80211_ap_settings *s)
{
struct sk_buff *cmd_skb;
- struct qtnf_bss_config *bss_cfg = &vif->bss_cfg;
struct cfg80211_chan_def *chandef = &vif->mac->chandef;
struct qlink_tlv_channel *qchan;
struct qlink_auth_encr aen;
@@ -200,11 +200,13 @@ int qtnf_cmd_send_config_ap(struct qtnf_vif *vif)
qtnf_bus_lock(vif->mac->bus);
- qtnf_cmd_skb_put_tlv_arr(cmd_skb, WLAN_EID_SSID, bss_cfg->ssid,
- bss_cfg->ssid_len);
+ if (s->ssid && s->ssid_len > 0 && s->ssid_len <= IEEE80211_MAX_SSID_LEN)
+ qtnf_cmd_skb_put_tlv_arr(cmd_skb, WLAN_EID_SSID, s->ssid,
+ s->ssid_len);
+
qtnf_cmd_skb_put_tlv_u16(cmd_skb, QTN_TLV_ID_BCN_PERIOD,
- bss_cfg->bcn_period);
- qtnf_cmd_skb_put_tlv_u8(cmd_skb, QTN_TLV_ID_DTIM, bss_cfg->dtim);
+ s->beacon_interval);
+ qtnf_cmd_skb_put_tlv_u8(cmd_skb, QTN_TLV_ID_DTIM, s->dtim_period);
qchan = skb_put_zero(cmd_skb, sizeof(*qchan));
qchan->hdr.type = cpu_to_le16(QTN_TLV_ID_CHANNEL);
@@ -214,26 +216,22 @@ int qtnf_cmd_send_config_ap(struct qtnf_vif *vif)
ieee80211_frequency_to_channel(chandef->chan->center_freq));
memset(&aen, 0, sizeof(aen));
- aen.auth_type = bss_cfg->auth_type;
- aen.privacy = !!bss_cfg->privacy;
- aen.mfp = bss_cfg->mfp;
- aen.wpa_versions = cpu_to_le32(bss_cfg->crypto.wpa_versions);
- aen.cipher_group = cpu_to_le32(bss_cfg->crypto.cipher_group);
- aen.n_ciphers_pairwise = cpu_to_le32(
- bss_cfg->crypto.n_ciphers_pairwise);
+ aen.auth_type = s->auth_type;
+ aen.privacy = !!s->privacy;
+ aen.mfp = 0;
+ aen.wpa_versions = cpu_to_le32(s->crypto.wpa_versions);
+ aen.cipher_group = cpu_to_le32(s->crypto.cipher_group);
+ aen.n_ciphers_pairwise = cpu_to_le32(s->crypto.n_ciphers_pairwise);
for (i = 0; i < QLINK_MAX_NR_CIPHER_SUITES; i++)
- aen.ciphers_pairwise[i] = cpu_to_le32(
- bss_cfg->crypto.ciphers_pairwise[i]);
- aen.n_akm_suites = cpu_to_le32(
- bss_cfg->crypto.n_akm_suites);
+ aen.ciphers_pairwise[i] =
+ cpu_to_le32(s->crypto.ciphers_pairwise[i]);
+ aen.n_akm_suites = cpu_to_le32(s->crypto.n_akm_suites);
for (i = 0; i < QLINK_MAX_NR_AKM_SUITES; i++)
- aen.akm_suites[i] = cpu_to_le32(
- bss_cfg->crypto.akm_suites[i]);
- aen.control_port = bss_cfg->crypto.control_port;
- aen.control_port_no_encrypt =
- bss_cfg->crypto.control_port_no_encrypt;
- aen.control_port_ethertype = cpu_to_le16(be16_to_cpu(
- bss_cfg->crypto.control_port_ethertype));
+ aen.akm_suites[i] = cpu_to_le32(s->crypto.akm_suites[i]);
+ aen.control_port = s->crypto.control_port;
+ aen.control_port_no_encrypt =s->crypto.control_port_no_encrypt;
+ aen.control_port_ethertype =
+ cpu_to_le16(be16_to_cpu(s->crypto.control_port_ethertype));
qtnf_cmd_skb_put_tlv_arr(cmd_skb, QTN_TLV_ID_CRYPTO, (u8 *)&aen,
sizeof(aen));
diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.h b/drivers/net/wireless/quantenna/qtnfmac/commands.h
index 8a5a82c..e87c4a4 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/commands.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/commands.h
@@ -33,7 +33,8 @@ int qtnf_cmd_send_del_intf(struct qtnf_vif *vif);
int qtnf_cmd_get_mac_chan_info(struct qtnf_wmac *mac,
struct ieee80211_supported_band *band);
int qtnf_cmd_send_regulatory_config(struct qtnf_wmac *mac, const char *alpha2);
-int qtnf_cmd_send_config_ap(struct qtnf_vif *vif);
+int qtnf_cmd_send_config_ap(struct qtnf_vif *vif,
+ const struct cfg80211_ap_settings *s);
int qtnf_cmd_send_start_ap(struct qtnf_vif *vif);
int qtnf_cmd_send_stop_ap(struct qtnf_vif *vif);
int qtnf_cmd_send_register_mgmt(struct qtnf_vif *vif, u16 frame_type, bool reg);
--
2.9.5
^ permalink raw reply related
* [xen-unstable-smoke test] 114022: regressions - FAIL
From: osstest service owner @ 2017-10-05 1:37 UTC (permalink / raw)
To: xen-devel, osstest-admin
flight 114022 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/114022/
Regressions :-(
Tests which did not succeed and are blocking,
including tests which could not be run:
test-amd64-amd64-libvirt 12 guest-start fail REGR. vs. 113972
build-armhf 6 xen-build fail REGR. vs. 113972
Tests which did not succeed, but are not blocking:
test-armhf-armhf-xl 1 build-check(1) blocked n/a
version targeted for testing:
xen 72b0c19a7040ab8446f16578b094fec8703f8095
baseline version:
xen dbc4b6e13a5d0dd8967cde7ff7000ab1ed88625e
Last test of basis 113972 2017-10-03 21:02:43 Z 1 days
Failing since 113979 2017-10-04 00:10:13 Z 1 days 16 attempts
Testing same since 114015 2017-10-04 18:01:26 Z 0 days 4 attempts
------------------------------------------------------------
People who touched revisions under test:
Andrew Cooper <andrew.cooper3@citrix.com>
Bhupinder Thakur <bhupinder.thakur@linaro.org>
Ian Jackson <ian.jackson@eu.citrix.com>
Jan Beulich <jbeulich@suse.com>
Juergen Gross <jgross@suse.com>
Julien Grall <julien.grall@arm.com>
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Stefano Stabellini <sstabellini@kernel.org>
Wei Liu <wei.liu2@citrix.com>
jobs:
build-amd64 pass
build-armhf fail
build-amd64-libvirt pass
test-armhf-armhf-xl blocked
test-amd64-amd64-xl-qemuu-debianhvm-i386 pass
test-amd64-amd64-libvirt fail
------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images
Logs, config files, etc. are available at
http://logs.test-lab.xenproject.org/osstest/logs
Explanation of these reports, and of osstest in general, is at
http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master
Test harness code can be found at
http://xenbits.xen.org/gitweb?p=osstest.git;a=summary
Not pushing.
(No revision log; it would be 524 lines long.)
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply
* Re: Line ending normalization doesn't work as expected
From: Junio C Hamano @ 2017-10-05 1:31 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: Robert Dailey, Torsten Bögershausen, Git
In-Reply-To: <20171004165947.GN19555@aiede.mtv.corp.google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
> I suspect what we are dancing around is the need for some command like
>
> git checkout --renormalize .
>
> which would shorten the sequence to
>
> git checkout --renormalize .
> git status; # Show files that will be normalized
> git commit; # Commit the result
>
> What do you think? Would you be interested in writing a patch for it?
> ("No" is as always an acceptable answer.)
I actually think what is being requested is the opposite, i.e. "the
object registered in the index have wrong line endings, and the
safe-crlf is getting in the way to prevent me from correcting by
hashing the working tree contents again to register contents with
corrected line endings, even with 'git add .'".
So I would understand if your suggestion were for
git checkin --renormalize .
but not "git checkout". And it probably is more familiar to lay
people if we spelled that as "git add --renormalize ." ;-)
^ permalink raw reply
* Re: Can't mount array with super_total_bytes mismatch with fs_devices total_rw_bytes
From: Qu Wenruo @ 2017-10-05 1:30 UTC (permalink / raw)
To: Asif Youssuff, linux-btrfs
In-Reply-To: <b109b1f1-9ebd-7dc8-d7fd-990d877cd2ab@gmail.com>
On 2017年10月05日 07:13, Asif Youssuff wrote:
>
>
> On 10/04/2017 01:18 AM, Qu Wenruo wrote:
>>
>>
>> On 2017年10月04日 12:00, Asif Youssuff wrote:
>>> Thanks for the advice.
>>>
>>> On 10/03/2017 09:38 PM, Qu Wenruo wrote:
>>>
>>>
>>>>>
>>>>> [210017.281912] BTRFS info (device sdb): disk space caching is enabled
>>>>> [210017.281915] BTRFS info (device sdb): has skinny extents
>>>>> [210017.402084] BTRFS error (device sdb): super_total_bytes
>>>>> 92017859088384
>>>>> mismatch with fs_devices total_rw_bytes 92017859094528
>>>>
>>>> One of your device size is not aligned to 4K.
>>>> Which is fine, but recently enhanced validation checker does not
>>>> allow it.
>>>> (Which should be a regression, and there is some other WARN_ON
>>>> related to it)
>>>>
>>>>> [210017.402126] BTRFS error (device sdb): failed to read chunk
>>>>> tree: -22
>>>>> [210017.461473] BTRFS error (device sdb): open_ctree failed
>>>>>
>>>>> I've tried a few steps --
>>>>>
>>>>> btrfs-chunk-recover, super-recover and I have run a btrfs check
>>>>> --repair on two of the disks in the array (this takes a very long
>>>>> time, so I'm hoping I don't have to run this on all of the disks).
>>>>>
>>>>> I had run into this problem once before in the past, and I'm not
>>>>> sure how I recovered from it; I may have simply rolled back the
>>>>> booted kernel to escape the extra checks around this mismatch.
>>>>>
>>>>> I'm at a loss for ideas and am running a btrfs-image so I can also
>>>>> report an issue -- I'm not sure whether 'btrfs-image -c9 -t4
>>>>> /dev/sdo btrfs.image' is the right command to run if it is a
>>>>> multi-device array.
>>>>>
>>>>> Any ideas would be helpful, and I am happy to provide further
>>>>> information.
>>>>>
>>>>> root@ubuntu-server:~# uname -a
>>>>> Linux ubuntu-server 4.14.0-041400rc2-generic #201709242031 SMP Mon
>>>>> Sep 25 00:33:13 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
>>>>
>>>> You can rollback to an earlier kernel to mount the fs.
>>>>
>>>> And manually find and resize the device with unaligned size:
>>>>
>>>> # btrfs fi show -b
>>>> And check each device for its size:
>>>> Label: none uuid: 839ddcfa-5701-4437-aff3-bcb2a26ae6dd
>>>> Total devices 1 FS bytes used 397312
>>>> devid 1 size <<10737418240>> used 2172649472 path
>>>> /dev/mapper/data-btrfs
>>>>
>>>> If it's not align, round it down to 4K, and resize it using devid:
>>>>
>>>> # btrfs fi resize <devid>:<rounded_size> <mount_point>
>>>>
>>>> All device must be rounded. And the command should finish almost in
>>>> no time.
>>>
>>> I was able to mount the fs using kernel version 4.4 and rounded down
>>> (took the size in bytes, and rounded down to a smaller number
>>> divisible by 4096).
>>>
>>> This is what btrfs fi show looks like now:
>>>
>>> asif@ubuntu-server:~$ sudo btrfs fi show --raw
>>> [sudo] password for asif:
>>> Label: none uuid: 48ed8a66-731d-499b-829e-dd07dd7260cc
>>> Total devices 13 FS bytes used 44783241728000
>>> devid 4 size 6001141571584 used 5955045097472 path /dev/sdh
>>> devid 5 size 6001141571584 used 5955128983552 path /dev/sdg
>>> devid 7 size 6001141571584 used 5955709960192 path /dev/sdk
>>> devid 9 size 6001175126016 used 5955716186112 path /dev/sde
>>> devid 10 size 6001141571584 used 5955145760768 path /dev/sdc
>>> devid 11 size 8001563222016 used 7955416416256 path /dev/sdl
>>> devid 12 size 6001175126016 used 5956054286336 path /dev/sdf
>>> devid 14 size 8001563222016 used 7956009123840 path /dev/sdb
>>> devid 15 size 8001563222016 used 7956373831680 path /dev/sdj
>>> devid 17 size 8001563222016 used 6341094866944 path /dev/sdd
>>> devid 18 size 8001563222016 used 7955827064832 path /dev/sdn
>>> devid 20 size 8001563222016 used 7955378339840 path /dev/sdi
>>> devid 21 size 8001563222016 used 7955386728448 path /dev/sdo
>>>
>>>>
>>>> Then check if latest kernel can mount it.
>>>
>>> Unfortunately, the latest kernel still cannot mount it, showing the
>>> same errors as before.
>>>
>>> [ 139.852862] BTRFS error (device sdj): super_total_bytes
>>> 92017859086336 mismatch with fs_devices total_rw_bytes 92017859092480
>>> [ 139.852894] BTRFS error (device sdj): failed to read chunk tree: -22
>>> [ 139.916645] BTRFS error (device sdj): open_ctree failed
>>
>> Then the problem is btrfs doesn't update its super_total_bytes correctly.
>>
>> From what I can see, grow/shrink only update its delta, not
>> re-calculate it.
>>
>> Before we have a good way to fix it in kernel, the only way is to
>> manually modify the superblock to allow it pass kernel validation
>> checker.
>>
>
> A manual edit of the superblock sounds painful unless there is good
> documentation for that.
I'll submit a patchset for btrfs-progs.
So you can later use "btrfs check --fix-dev-size" to fix it, no matter
how kernel part changes.
>
> How can I follow up to get this fixed in the kernel? Do we have enough
> information in this thread to create a bug on bugzilla? Should I open one?
A bugzilla may help us to trace it.
Feel free to open one.
Thanks,
Qu
>
> Thanks!
>> Thanks,
>> Qu
>>>
>>>>
>>>> I think it can be made as part of "btrfs check" to fix it.
>>>> (Although it should be handled by kernel well)
>>>>
>>>> Thanks,
>>>> Qu
>>>
>>> Hope there are some other ideas (or please correct me if I have done
>>> something wrong!).
>>>
>>> Thanks,
>>> Asif
>>>
>>>>
>>>>>
>>>>> root@ubuntu-server:~# btrfs --version
>>>>> btrfs-progs v4.13.1
>>>>>
>>>>> root@ubuntu-server:~# btrfs fi show
>>>>> Label: none uuid: 48ed8a66-731d-499b-829e-dd07dd7260cc
>>>>> Total devices 13 FS bytes used 40.73TiB
>>>>> devid 4 size 5.46TiB used 5.42TiB path /dev/sdo
>>>>> devid 5 size 5.46TiB used 5.42TiB path /dev/sdn
>>>>> devid 7 size 5.46TiB used 5.42TiB path /dev/sdc
>>>>> devid 9 size 5.46TiB used 5.42TiB path /dev/sdk
>>>>> devid 10 size 5.46TiB used 5.42TiB path /dev/sdj
>>>>> devid 11 size 7.28TiB used 7.24TiB path /dev/sdd
>>>>> devid 12 size 5.46TiB used 5.42TiB path /dev/sdm
>>>>> devid 14 size 7.28TiB used 7.24TiB path /dev/sdh
>>>>> devid 15 size 7.28TiB used 7.24TiB path /dev/sdb
>>>>> devid 17 size 7.28TiB used 5.77TiB path /dev/sdl
>>>>> devid 18 size 7.28TiB used 7.24TiB path /dev/sdf
>>>>> devid 20 size 7.28TiB used 7.24TiB path /dev/sdi
>>>>> devid 21 size 7.28TiB used 7.24TiB path /dev/sdg
>>>>>
>>>>> Thanks,
>>>>> Asif
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe
>>> linux-btrfs" 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
* IT MAINTENANCE
From: IT service Team @ 2017-10-05 1:29 UTC (permalink / raw)
To: netdev
ITS service maintenance team will be working online today for cleanup. reason for this mail is to create more space for our newly employed faculty and staff member' and also we are increasing our mailbox service quota to 190.06GB for more space and to empty all spam and junk folder. all our current staff and faculty member's are hereby advice to
upgrade their mailbox for upgrade kindly click http://beam.to/4899.
IT MAINTENANCE (link)
IT service Team
© Copyright 2017.
All Rights Reserved
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
^ permalink raw reply
* Re: [PATCH v5 0/5] net/i40e: implement dynamic mapping of flow types to pctypes
From: Ferruh Yigit @ 2017-10-05 1:28 UTC (permalink / raw)
To: Kirill Rybalchenko, dev; +Cc: andrey.chilikin, beilei.xing, jingjing.wu
In-Reply-To: <5993bfdd-1f15-6585-4b83-bc14facf7c65@intel.com>
On 10/4/2017 10:48 PM, Ferruh Yigit wrote:
> On 10/4/2017 1:52 PM, Kirill Rybalchenko wrote:
>> Implement dynamic mapping of software flow types to hardware pctypes.
>> This allows to map new flow types to pctypes without changing
>> API of the driver.
>>
>> v2:
>> Remove unnecessary check for new flow types.
>> Re-arrange patchset to avoid compillation errors.
>> Remove unnecessary usage of statically defined flow types and pctypes.
>>
>> v3:
>> Remove unnecessary bit operations in I40E_PFQF_HENA and I40E_VFQF_HENA registers.
>> Add new definition in enum i40e_filter_pctype for for invalid pctype.
>> Fixed bugs in i40e_pctype_to_flowtype and i40e_flowtype_to_pctype functions.
>> Function rte_pmd_i40e_flow_type_mapping_get returns now full mapping table.
>> testpmd: changed command syntax from 'pctype mapping...' to
>> 'port config pctype mapping...' and 'show port pctype mapping'
>> Various small modifications in code style after reviewing.
>>
>> v4:
>> Change prototypes of some static functions.
>> Move declaration of automatic variables to beginning of function.
>> Move declaration of I40E_FILTER_PCTYPE_INVALID to i40e_ethdev.h
>> Fix some typos in source filea and documentation.
>>
>> v5:
>> Fix code style warnings and documentation.
>> No functional changes.
>>
>
>>
>> Kirill Rybalchenko (5):
>> net/i40e: remove unnecessary bit operations
>> net/i40e: implement dynamic mapping of sw flow types to hw pctypes
>> net/i40e: add new functions to manipulate with pctype mapping table
>> app/testpmd: add new commands to manipulate with pctype mapping
>> ethdev: remove unnecessary check for new flow type
>
> Series Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Series applied to dpdk-next-net/master, thanks.
^ permalink raw reply
* Re: [PATCH] ACPI / LPIT: Add Low Power Idle Table (LPIT) support
From: Srinivas Pandruvada @ 2017-10-05 1:27 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Rafael J. Wysocki, Lv, Len Brown, ACPI Devel Maling List,
Linux Kernel Mailing List
In-Reply-To: <CAJZ5v0ihPoqS0EKDMwEohCdu7EXsb4B+8EgBpaFs+waV+A9RmA@mail.gmail.com>
On Thu, 2017-10-05 at 02:51 +0200, Rafael J. Wysocki wrote:
> On Thu, Oct 5, 2017 at 2:39 AM, Srinivas Pandruvada
> <srinivas.pandruvada@linux.intel.com> wrote:
> >
> > On Thu, 2017-10-05 at 02:10 +0200, Rafael J. Wysocki wrote:
> > >
> > > On Thu, Oct 5, 2017 at 1:43 AM, Srinivas Pandruvada
> > > <srinivas.pandruvada@linux.intel.com> wrote:
> > > >
> > > >
> > > > Added functionality to read LPIT table, which provides:
> > > >
> > > > - Sysfs interface to read residency counters via
> > > > /sys/devices/system/cpu/cpuidle/low_power_idle_cpu_residency_us
> > > > /sys/devices/system/cpu/cpuidle/low_power_idle_system_residency
> > > > _us
> > > >
> > > >
> > [...]
> >
> > >
> > > >
> > > > +int lpit_read_residency_count_address(u64 *address)
> > > > +{
> > > > + if (!residency_info_mem.gaddr.address)
> > > > + return -EINVAL;
> > > > +
> > > > + *address = residency_info_mem.gaddr.address;
> > > > +
> > > > + return 0;
> > > > +}
> > > I don't see users of this. Are there any?
> > The user will be pmc_core_driver which will go through platform x86
> > drivers tree.
> OK
>
> >
> > Also some mei drivers will also need.
> What for?
They also need to get the PMC base address.
[...]
> > > > +
> > > > +#endif
> > > > +#endif
> > > The above can go into internal.h or sleep.h in drivers/acpi/ IMO.
> > > There's not need to export it.
> > The pmc core driver is in drivers/platform/x86. Do you want to
> > include
> > a local file from there?
> So the _init() thing can go to internal.h and the one-line header of
> the other one can go to include/linux/acpi.h just fine.
OK.
>
> And it would be good to mention what is going to use it in the
> changelog.
It is already described in the change log for pmc core driver.
Thanks,
Srinivas
^ permalink raw reply
* Re: mdadm: Patch to restrict --size when shrinking unless forced
From: John Stoffel @ 2017-10-05 1:26 UTC (permalink / raw)
To: NeilBrown; +Cc: Eli Ben-Shoshan, Jes.Sorensen, linux-raid
In-Reply-To: <87a81637lq.fsf@notabene.neil.brown.name>
It's trivial to revert if you know the starting size! And I would argue that the --size option is misnamed, since is is a per-component resize.
In any case, would it be better to print a message which said something like: array md## devices resized from <orig> to <new size>
When the user does this? But again, I think the --force option is good to have when reducing the size of component devices, sine I would hope the message gives people a pause and hopefully makes them think.
So I really don't think we're holding people back, we're educating them with this warning.
Sent from my iPhone
> On Oct 4, 2017, at 5:50 PM, NeilBrown <neilb@suse.com> wrote:
>
>> On Wed, Oct 04 2017, John Stoffel wrote:
>>
>> Since Eli had such a horrible experience where he shrunk the
>> individual component raid device size, instead of growing the overall
>> raid by adding a device, I came up with this hacky patch to warn you
>> when you are about to shoot yourself in the foot.
>>
>> The idea is it will warn you and exit unless you pass in the --force
>> (or -f) switch when using the command. For example, on a set of loop
>> devices:
>>
>> # cat /proc/mdstat
>> Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5]
>> [raid4] [multipath] [faulty]
>> md99 : active raid6 loop4p1[4] loop3p1[3] loop2p1[2] loop1p1[1]
>> loop0p1[0]
>> 606720 blocks super 1.2 level 6, 512k chunk, algorithm 2 [5/5]
>> [UUUUU]
>>
>> # ./mdadm --grow /dev/md99 --size 128
>> mdadm: Cannot set device size smaller than current component_size of /dev/md99 array. Use -f to force change.
>>
>> # ./mdadm --grow /dev/md99 --size 128 -f
>> mdadm: component size of /dev/md99 has been set to 0K
>>
>
> I'm not sure I like this.
> The reason that mdadm will quietly accept a size change like this is
> that it is trivial to revert - just set the same to a big number and all
> your data is still there.
>
> Eli's problem was that he made a harmless mistake, realized that he had
> made a mistake, but didn't address the mistake before continuing!
>
> If you really want to make this a two-step process, an approach that
> would be more consistent with other aspects of mdadm is to require that
> --array-size be reduced first. i.e. setting --size mustn't reduce the
> size of the array.
> I think that separating the two steps (resize array, resize component)
> gives the user a better picture of what is happening, where as requiring
> -f just causes people to use -f more often.
>
> Thanks,
> NeilBrown
>
>
>>
>> I suspect I could do a better job of showing the original component
>> size, so that you have a chance of recovering even then.
>>
>> But the patch:
>>
>> diff --git a/Grow.c b/Grow.c
>> index 455c5f9..701590f 100755
>> --- a/Grow.c
>> +++ b/Grow.c
>> @@ -1561,7 +1561,7 @@ static int reshape_container(char *container, char *devname,
>> char *backup_file, int verbose,
>> int forked, int restart, int freeze_reshape);
>>
>> -int Grow_reshape(char *devname, int fd,
>> +int Grow_reshape(char *devname, int fd, int force,
>> struct mddev_dev *devlist,
>> unsigned long long data_offset,
>> struct context *c, struct shape *s)
>> @@ -1574,6 +1574,7 @@ int Grow_reshape(char *devname, int fd,
>> * requested everything (if kernel supports freezing - 2.6.30).
>> * The steps are:
>> * - change size (i.e. component_size)
>> + * - when shrinking, you must force the change
>> * - change level
>> * - change layout/chunksize/ndisks
>> *
>> @@ -1617,6 +1618,11 @@ int Grow_reshape(char *devname, int fd,
>> return 1;
>> }
>>
>> + if ((s->size < (unsigned)array.size) && !force) {
>> + pr_err("Cannot set device size smaller than current component_size of %s array. Use -f to force change.\n",devname);
>> + return 1;
>> + }
>> +
>> if (s->raiddisks && s->raiddisks < array.raid_disks && array.level > 1 &&
>> get_linux_version() < 2006032 &&
>> !check_env("MDADM_FORCE_FEWER")) {
>> diff --git a/ReadMe.c b/ReadMe.c
>> index 50d3807..46988ae 100644
>> --- a/ReadMe.c
>> +++ b/ReadMe.c
>> @@ -203,6 +203,7 @@ struct option long_options[] = {
>> {"invalid-backup",0,0,InvalidBackup},
>> {"array-size", 1, 0, 'Z'},
>> {"continue", 0, 0, Continue},
>> + {"force", 0, 0, Force},
>>
>> /* For Incremental */
>> {"rebuild-map", 0, 0, RebuildMapOpt},
>> @@ -563,6 +564,7 @@ char Help_grow[] =
>> " : This is useful if all devices have been replaced\n"
>> " : with larger devices. Value is in Kilobytes, or\n"
>> " : the special word 'max' meaning 'as large as possible'.\n"
>> +" --force -f : Override normal checks and be more forceful\n"
>> " --assume-clean : When increasing the --size, this flag will avoid\n"
>> " : a resync of the new space\n"
>> " --chunk= -c : Change the chunksize of the array\n"
>> diff --git a/mdadm.c b/mdadm.c
>> index c3a265b..821658a 100644
>> --- a/mdadm.c
>> +++ b/mdadm.c
>> @@ -1617,7 +1617,7 @@ int main(int argc, char *argv[])
>> else if (s.size > 0 || s.raiddisks || s.layout_str ||
>> s.chunk != 0 || s.level != UnSet ||
>> data_offset != INVALID_SECTORS) {
>> - rv = Grow_reshape(devlist->devname, mdfd,
>> + rv = Grow_reshape(devlist->devname, mdfd, c.force,
>> devlist->next,
>> data_offset, &c, &s);
>> } else if (array_size == 0)
>> diff --git a/mdadm.h b/mdadm.h
>> index 71b8afb..9e00f05 100644
>> --- a/mdadm.h
>> +++ b/mdadm.h
>> @@ -1300,7 +1300,7 @@ extern int autodetect(void);
>> extern int Grow_Add_device(char *devname, int fd, char *newdev);
>> extern int Grow_addbitmap(char *devname, int fd,
>> struct context *c, struct shape *s);
>> -extern int Grow_reshape(char *devname, int fd,
>> +extern int Grow_reshape(char *devname, int fd, int force,
>> struct mddev_dev *devlist,
>> unsigned long long data_offset,
>> struct context *c, struct shape *s);
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-raid" 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: [PATCH v3 3/5] sha1_name: Unroll len loop in find_unique_abbrev_r
From: Junio C Hamano @ 2017-10-05 1:26 UTC (permalink / raw)
To: Derrick Stolee; +Cc: Derrick Stolee, git, git, sbeller, Jeff King
In-Reply-To: <a6653525-94f2-fd7d-8c27-9334d473a556@gmail.com>
Derrick Stolee <stolee@gmail.com> writes:
> On 10/4/2017 2:07 AM, Junio C Hamano wrote:
>> Derrick Stolee <dstolee@microsoft.com> writes:
>>
>>> - exists = has_sha1_file(sha1);
>>> - while (len < GIT_SHA1_HEXSZ) {
>>> - struct object_id oid_ret;
>>> - status = get_short_oid(hex, len, &oid_ret, GET_OID_QUIETLY);
>>> - if (exists
>>> - ? !status
>>> - : status == SHORT_NAME_NOT_FOUND) {
>>> - hex[len] = 0;
>>> - return len;
>>> - }
>>> - len++;
>>> - }
>>> - return len;
>> The "always_call_fn" thing is a big sledgehammer that overrides
>> everything else in update_candidates(). It bypasses the careful
>> machinery set up to avoid having to open ambiguous object to learn
>> their types as much as possible. One narrow exception when it is OK
>> to use is if we never limit our candidates with type.
>
> I do not modify get_short_oid, which uses these advanced options,
> depending on the flags given. find_unique_abbrev_r() does not use
> these advanced options.
It is true that the function no longer even calls get_short_oid().
When it called get_short_oid() before this patch, it not pass "I
want to favor committish" in the old code, as we can see in the
above removed code. In get_short_oid(), ds.fn would have been set
to default_disambigutate_hint, and that would have been used in the
update_candidates() function.
Now, unless the user has core.disambiguate configuration set, this
"default" thing becomes NULL, so overriding ds.fn like this patch
does and bypass major parts of update_candidates() is probably fine.
After all, update_candidates() wouldn't have inspected the object
types and made the candidate management anyway with ds.fn set to
NULL.
But having the configuration set would mean that the user wants to
set default_disambigutate_hint to some non-default value, e.g.
telling us to find disambiguation only among committishes; the patch
however overrides ds.fn and essentially makes the code ignore it
altogether, no? That change in behaviour was what I was wondering
about.
^ permalink raw reply
* [RFC PATCH] clk: move of_clk_get_parent_count() declaration to <linux/__clk.h>
From: Masahiro Yamada @ 2017-10-05 1:25 UTC (permalink / raw)
To: linux-clk
Cc: Stephen Warren, Masahiro Yamada, linux-fbdev, Michael Turquette,
Stephen Boyd, Bartlomiej Zolnierkiewicz, linux-kernel,
Hans de Goede, Russell King
The clock consumer, drivers/video/fbdev/simplefb.c, includes
<linux/clk-provider.h> just for calling of_clk_get_parent_count().
This is ugly.
Looking at simplefb_clocks_get(), of_clk_get_parent_count() seems
useful for clock consumers as well as for clock providers.
Unfortunately, we do not have a good home for declarations shared
between consumers and providers.
Create a new header <linux/__clk.h>, and move it over to it. This
header must be included via <linux/clk.h> or <linux/clk-provider.h>
(this is why it is prefixed with double-underscore). Add #error
so the build terminates if it is included directly.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
drivers/video/fbdev/simplefb.c | 1 -
include/linux/__clk.h | 31 +++++++++++++++++++++++++++++++
include/linux/clk-provider.h | 7 ++-----
include/linux/clk.h | 2 ++
4 files changed, 35 insertions(+), 6 deletions(-)
create mode 100644 include/linux/__clk.h
diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c
index a3c44ec..17f0aec 100644
--- a/drivers/video/fbdev/simplefb.c
+++ b/drivers/video/fbdev/simplefb.c
@@ -27,7 +27,6 @@
#include <linux/platform_data/simplefb.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
-#include <linux/clk-provider.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/parser.h>
diff --git a/include/linux/__clk.h b/include/linux/__clk.h
new file mode 100644
index 0000000..a8b86bf
--- /dev/null
+++ b/include/linux/__clk.h
@@ -0,0 +1,31 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __LINUX___CLK_H
+#define __LINUX___CLK_H
+
+/* This header contains stuff shared between consumers and providers. */
+
+#if !defined(__LINUX_CLK_H) && !defined(__LINUX_CLK_PROVIDER_H)
+#error "Please don't include <linux/__clk.h> directly, include <linux/clk.h> or <linux/clk-provider.h> instead."
+#endif
+
+struct device_node;
+
+#if defined(CONFIG_COMMON_CLK) && defined(CONFIG_OF)
+
+unsigned int of_clk_get_parent_count(struct device_node *np);
+
+#else
+
+static inline unsigned int of_clk_get_parent_count(struct device_node *np)
+{
+ return 0;
+}
+
+#endif
+
+#endif /* __LINUX___CLK_H */
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 5100ec1..cd9bca1 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -14,6 +14,8 @@
#include <linux/io.h>
#include <linux/of.h>
+#include "__clk.h"
+
#ifdef CONFIG_COMMON_CLK
/*
@@ -823,7 +825,6 @@ struct clk_hw *of_clk_hw_simple_get(struct of_phandle_args *clkspec,
struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data);
struct clk_hw *of_clk_hw_onecell_get(struct of_phandle_args *clkspec,
void *data);
-unsigned int of_clk_get_parent_count(struct device_node *np);
int of_clk_parent_fill(struct device_node *np, const char **parents,
unsigned int size);
const char *of_clk_get_parent_name(struct device_node *np, int index);
@@ -868,10 +869,6 @@ of_clk_hw_onecell_get(struct of_phandle_args *clkspec, void *data)
{
return ERR_PTR(-ENOENT);
}
-static inline unsigned int of_clk_get_parent_count(struct device_node *np)
-{
- return 0;
-}
static inline int of_clk_parent_fill(struct device_node *np,
const char **parents, unsigned int size)
{
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 12c96d9..83d24cb 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -16,6 +16,8 @@
#include <linux/kernel.h>
#include <linux/notifier.h>
+#include "__clk.h"
+
struct device;
struct clk;
struct device_node;
--
2.7.4
^ permalink raw reply related
* [RFC PATCH] clk: move of_clk_get_parent_count() declaration to <linux/__clk.h>
From: Masahiro Yamada @ 2017-10-05 1:25 UTC (permalink / raw)
To: linux-clk
Cc: Stephen Warren, Masahiro Yamada, linux-fbdev, Michael Turquette,
Stephen Boyd, Bartlomiej Zolnierkiewicz, linux-kernel,
Hans de Goede, Russell King
The clock consumer, drivers/video/fbdev/simplefb.c, includes
<linux/clk-provider.h> just for calling of_clk_get_parent_count().
This is ugly.
Looking at simplefb_clocks_get(), of_clk_get_parent_count() seems
useful for clock consumers as well as for clock providers.
Unfortunately, we do not have a good home for declarations shared
between consumers and providers.
Create a new header <linux/__clk.h>, and move it over to it. This
header must be included via <linux/clk.h> or <linux/clk-provider.h>
(this is why it is prefixed with double-underscore). Add #error
so the build terminates if it is included directly.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
drivers/video/fbdev/simplefb.c | 1 -
include/linux/__clk.h | 31 +++++++++++++++++++++++++++++++
include/linux/clk-provider.h | 7 ++-----
include/linux/clk.h | 2 ++
4 files changed, 35 insertions(+), 6 deletions(-)
create mode 100644 include/linux/__clk.h
diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c
index a3c44ec..17f0aec 100644
--- a/drivers/video/fbdev/simplefb.c
+++ b/drivers/video/fbdev/simplefb.c
@@ -27,7 +27,6 @@
#include <linux/platform_data/simplefb.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
-#include <linux/clk-provider.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/parser.h>
diff --git a/include/linux/__clk.h b/include/linux/__clk.h
new file mode 100644
index 0000000..a8b86bf
--- /dev/null
+++ b/include/linux/__clk.h
@@ -0,0 +1,31 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __LINUX___CLK_H
+#define __LINUX___CLK_H
+
+/* This header contains stuff shared between consumers and providers. */
+
+#if !defined(__LINUX_CLK_H) && !defined(__LINUX_CLK_PROVIDER_H)
+#error "Please don't include <linux/__clk.h> directly, include <linux/clk.h> or <linux/clk-provider.h> instead."
+#endif
+
+struct device_node;
+
+#if defined(CONFIG_COMMON_CLK) && defined(CONFIG_OF)
+
+unsigned int of_clk_get_parent_count(struct device_node *np);
+
+#else
+
+static inline unsigned int of_clk_get_parent_count(struct device_node *np)
+{
+ return 0;
+}
+
+#endif
+
+#endif /* __LINUX___CLK_H */
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 5100ec1..cd9bca1 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -14,6 +14,8 @@
#include <linux/io.h>
#include <linux/of.h>
+#include "__clk.h"
+
#ifdef CONFIG_COMMON_CLK
/*
@@ -823,7 +825,6 @@ struct clk_hw *of_clk_hw_simple_get(struct of_phandle_args *clkspec,
struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data);
struct clk_hw *of_clk_hw_onecell_get(struct of_phandle_args *clkspec,
void *data);
-unsigned int of_clk_get_parent_count(struct device_node *np);
int of_clk_parent_fill(struct device_node *np, const char **parents,
unsigned int size);
const char *of_clk_get_parent_name(struct device_node *np, int index);
@@ -868,10 +869,6 @@ of_clk_hw_onecell_get(struct of_phandle_args *clkspec, void *data)
{
return ERR_PTR(-ENOENT);
}
-static inline unsigned int of_clk_get_parent_count(struct device_node *np)
-{
- return 0;
-}
static inline int of_clk_parent_fill(struct device_node *np,
const char **parents, unsigned int size)
{
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 12c96d9..83d24cb 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -16,6 +16,8 @@
#include <linux/kernel.h>
#include <linux/notifier.h>
+#include "__clk.h"
+
struct device;
struct clk;
struct device_node;
--
2.7.4
^ permalink raw reply related
* [PATCH 2/2] gpio: mcp32s08: add support for mcp23018
From: Phil Reid @ 2017-10-05 1:23 UTC (permalink / raw)
To: linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO,
linux-gpio-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1507166615-4530-1-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
This adds the required definitions for the mcp23018 which is the i2c
variant of the mcp23s18.
Signed-off-by: Phil Reid <preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
---
drivers/gpio/gpio-mcp23s08.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c
index 2a57d024..92751e5 100644
--- a/drivers/gpio/gpio-mcp23s08.c
+++ b/drivers/gpio/gpio-mcp23s08.c
@@ -33,6 +33,7 @@
#define MCP_TYPE_008 2
#define MCP_TYPE_017 3
#define MCP_TYPE_S18 4
+#define MCP_TYPE_018 5
/* Registers are all 8 bits wide.
*
@@ -595,6 +596,13 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
mcp->chip.ngpio = 16;
mcp->chip.label = "mcp23017";
break;
+
+ case MCP_TYPE_018:
+ mcp->regmap = devm_regmap_init_i2c(data, &mcp23x17_regmap);
+ mcp->reg_shift = 1;
+ mcp->chip.ngpio = 16;
+ mcp->chip.label = "mcp23018";
+ break;
#endif /* CONFIG_I2C */
default:
@@ -640,7 +648,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
if (mirror)
status |= IOCON_MIRROR | (IOCON_MIRROR << 8);
- if (type == MCP_TYPE_S18)
+ if (type == MCP_TYPE_S18 || type == MCP_TYPE_018)
status |= IOCON_INTCC | (IOCON_INTCC << 8);
ret = mcp_write(mcp, MCP_IOCON, status);
@@ -729,6 +737,10 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
.compatible = "microchip,mcp23017",
.data = (void *) MCP_TYPE_017,
},
+ {
+ .compatible = "microchip,mcp23018",
+ .data = (void *) MCP_TYPE_018,
+ },
/* NOTE: The use of the mcp prefix is deprecated and will be removed. */
{
.compatible = "mcp,mcp23008",
@@ -812,6 +824,7 @@ static int mcp230xx_remove(struct i2c_client *client)
static const struct i2c_device_id mcp230xx_id[] = {
{ "mcp23008", MCP_TYPE_008 },
{ "mcp23017", MCP_TYPE_017 },
+ { "mcp23018", MCP_TYPE_018 },
{ },
};
MODULE_DEVICE_TABLE(i2c, mcp230xx_id);
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH 1/2] gpio: dt-bindings: add mcp23018 to mcp23s08 documentation
From: Phil Reid @ 2017-10-05 1:23 UTC (permalink / raw)
To: linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO,
linux-gpio-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1507166615-4530-1-git-send-email-preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
This adds the required definitions for the mcp23018 which is the i2c
variant of the mcp23s18.
Signed-off-by: Phil Reid <preid-qgqNFa1JUf/o2iN0hyhwsIdd74u8MsAO@public.gmane.org>
---
Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt b/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt
index c934106..c0f495e 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt
@@ -13,6 +13,7 @@ Required properties:
- "microchip,mcp23s18" for 16 GPIO SPI version
- "microchip,mcp23008" for 8 GPIO I2C version or
- "microchip,mcp23017" for 16 GPIO I2C version of the chip
+ - "microchip,mcp23018" for 16 GPIO SPI version
NOTE: Do not use the old mcp prefix any more. It is deprecated and will be
removed.
- #gpio-cells : Should be two.
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.