summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* net/tls: Annotate access to sk_prot with READ_ONCE/WRITE_ONCEJakub Sitnicki2020-03-212-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sockmap performs lockless writes to sk->sk_prot on the following paths: tcp_bpf_{recvmsg|sendmsg} / sock_map_unref sk_psock_put sk_psock_drop sk_psock_restore_proto WRITE_ONCE(sk->sk_prot, proto) To prevent load/store tearing [1], and to make tooling aware of intentional shared access [2], we need to annotate other sites that access sk_prot with READ_ONCE/WRITE_ONCE macros. Change done with Coccinelle with following semantic patch: @@ expression E; identifier I; struct sock *sk; identifier sk_prot =~ "^sk_prot$"; @@ ( E = -sk->sk_prot +READ_ONCE(sk->sk_prot) | -sk->sk_prot = E +WRITE_ONCE(sk->sk_prot, E) | -sk->sk_prot +READ_ONCE(sk->sk_prot) ->I ) Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/tls: Read sk_prot once when building tls proto opsJakub Sitnicki2020-03-211-8/+9
| | | | | | | | | | | | | | | Apart from being a "tremendous" win when it comes to generated machine code (see bloat-o-meter output for x86-64 below) this mainly prepares ground for annotating access to sk_prot with READ_ONCE, so that we don't pepper the code with access annotations and needlessly repeat loads. add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-46 (-46) Function old new delta tls_init 851 805 -46 Total: Before=21063, After=21017, chg -0.22% Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/tls: Constify base proto ops used for building tls protoJakub Sitnicki2020-03-211-2/+2
| | | | | | | | The helper that builds kTLS proto ops doesn't need to and should not modify the base proto ops. Annotate the parameter as read-only. Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'ionic-error-recovery-fixes'David S. Miller2020-03-213-22/+50
|\ | | | | | | | | | | | | | | | | | | | | | | | | Shannon Nelson says: ==================== ionic error recovery fixes These are a few little patches to make error recovery a little more safe and successful. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * ionic: check for NULL structs on teardownShannon Nelson2020-03-212-13/+20
| | | | | | | | | | | | | | | | | | Make sure the queue structs exist before trying to tear them down to make for safer error recovery. Fixes: 0f3154e6bcb3 ("ionic: Add Tx and Rx handling") Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
| * ionic: clean irq affinity on queue deinitShannon Nelson2020-03-211-0/+2
| | | | | | | | | | | | | | | | Add a little more cleanup when tearing down the queues. Fixes: 1d062b7b6f64 ("ionic: Add basic adminq support") Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
| * ionic: ignore eexist on rx filter addShannon Nelson2020-03-211-2/+2
| | | | | | | | | | | | | | | | | | | | Don't worry if the rx filter add firmware request fails on EEXIST, at least we know the filter is there. Same for the delete request, at least we know it isn't there. Fixes: 2a654540be10 ("ionic: Add Rx filter and rx_mode ndo support") Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
| * ionic: only save good lif dentryShannon Nelson2020-03-211-1/+7
| | | | | | | | | | | | | | | | | | Don't save the lif->dentry until we know we have a good value. Fixes: 1a58e196467f ("ionic: Add basic lif support") Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
| * ionic: leave dev cmd request contents alone on FW timeoutShannon Nelson2020-03-211-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | It is possible (but unlikely) that FW was busy and missed a heartbeat check but is still alive and will process the pending request, so don't clean the dev_cmd in this case. This occasionally occurs when working with a card that is supporting many devices and is trying to shut them all down at once, but still wants to see that last LIF disable request. Fixes: 97ca486592c0 ("ionic: add heartbeat check") Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
| * ionic: add timeout error checking for queue disableShannon Nelson2020-03-211-5/+15
|/ | | | | | | | | | Short circuit the cleanup if we get a timeout error from ionic_qcq_disable() so as to not have to wait too long on shutdown when we already know the FW is not responding. Fixes: 0f3154e6bcb3 ("ionic: Add Tx and Rx handling") Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
* soc: qcom: ipa: kill IPA_RX_BUFFER_ORDERAlex Elder2020-03-211-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Don't assume the receive buffer size is a power-of-2 number of pages. Instead, define the receive buffer size independently, and then compute the page order from that size when needed. This fixes a build problem that arises when the ARM64_PAGE_SHIFT config option is set to have a page size greater than 4KB. The problem was identified by Linux Kernel Functional Testing. The IPA code basically assumed the page size to be 4KB. A larger page size caused the receive buffer size to become correspondingly larger (32KB or 128KB for ARM64_16K_PAGES and ARM64_64K_PAGES, respectively). The receive buffer size is used to compute an "aggregation byte limit" value that gets programmed into the hardware, and the large page sizes caused that limit value to be too big to fit in a 5 bit field. This triggered a BUILD_BUG_ON() call in ipa_endpoint_validate_build(). This fix causes a lot of receive buffer memory to be wasted if system is configured for page size greater than 4KB. But such a misguided configuration will now build successfully. Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org> Signed-off-by: Alex Elder <elder@linaro.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge tag 'mac80211-next-for-net-next-2020-03-20' of ↵David S. Miller2020-03-2019-44/+596
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Johannes Berg says: ==================== Another set of changes: * HE ranging (fine timing measurement) API support * hwsim gets virtio support, for use with wmediumd, to be able to simulate with multiple machines * eapol-over-nl80211 improvements to exclude preauth * IBSS reset support, to recover connections from userspace * and various others. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * mac80211: driver can remain on channel if not using chan_ctxYan-Hsuan Chuang2020-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the drivers are not using channel context, but let the stack to control/switch channels instead. For such cases, driver can still remain on channel because the mac80211 stack actually supports it. The stack will check if the driver is using chan_ctx and has ops->remain_on_channel been hooked. Otherwise it will start its ROC work to remain on channel. So, even if the driver is not using chan_ctx, the driver is still capable of doing remain on channel. Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Link: https://lore.kernel.org/r/20200312074337.16198-1-yhchuang@realtek.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * nl80211: clarify code in nl80211_del_station()Johannes Berg2020-03-201-8/+14
| | | | | | | | | | | | | | | | | | | | The long if chain of interface types is hard to read, especially now with the additional condition after it. Use a switch statement to clarify this code. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Link: https://lore.kernel.org/r/20200320113834.2c51b9e8e341.I3fa5dc3f7d3cb1dbbd77191d764586f7da993f3f@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * cfg80211: Configure PMK lifetime and reauth threshold for PMKSA entriesVeerendranath Jakkam2020-03-203-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drivers that trigger roaming need to know the lifetime of the configured PMKSA for deciding whether to trigger the full or PMKSA cache based authentication. The configured PMKSA is invalid after the PMK lifetime has expired and must not be used after that and the STA needs to disassociate if the PMK expires. Hence the STA is expected to refresh the PMK with a full authentication before this happens (e.g., when reassociating to a new BSS the next time or by performing EAPOL reauthentication depending on the AKM) to avoid unnecessary disconnection. The PMK reauthentication threshold is the percentage of the PMK lifetime value and indicates to the driver to trigger a full authentication roam (without PMKSA caching) after the reauthentication threshold time, but before the PMK timer has expired. Authentication methods like SAE need to be able to generate a new PMKSA entry without having to force a disconnection after this threshold timeout. If no roaming occurs between the reauthentication threshold time and PMK lifetime expiration, disassociation is still forced. The new attributes for providing these values correspond to the dot11 MIB variables dot11RSNAConfigPMKLifetime and dot11RSNAConfigPMKReauthThreshold. This type of functionality is already available in cases where user space component is in control of roaming. This commit extends that same capability into cases where parts or all of this functionality is offloaded to the driver. Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org> Signed-off-by: Jouni Malinen <jouni@codeaurora.org> Link: https://lore.kernel.org/r/20200312235903.18462-1-jouni@codeaurora.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * mac80211: Read rx_stats with perCPU pointersSeevalamuthu Mariappan2020-03-201-6/+29
| | | | | | | | | | | | | | | | | | Use perCPU pointers to get rx_stats in sta_set_sinfo when RSS is enabled Signed-off-by: Seevalamuthu Mariappan <seevalam@codeaurora.org> Link: https://lore.kernel.org/r/1584526555-25960-1-git-send-email-seevalam@codeaurora.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * virt_wifi: implement ndo_get_iflinkTaehee Yoo2020-03-201-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ->ndo_get_iflink() is useful for finding lower interface. Test commands: ip link add dummy0 type dummy ip link add vw1 link dummy0 type virt_wifi ip link show vw1 Before: 9: vw1: <BROADCAST,MULTICAST> ... After: 9: vw1@dummy0: <BROADCAST,MULTICAST> ... Signed-off-by: Taehee Yoo <ap420073@gmail.com> Link: https://lore.kernel.org/r/20200305090636.28221-1-ap420073@gmail.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * mac80211: Allow deleting stations in ibss mode to reset their stateNicolas Cavallari2020-03-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Set the NL80211_EXT_FEATURE_DEL_IBSS_STA if the interface support IBSS mode, so that stations can be reset from user space. mac80211 already deletes stations by itself, so mac80211 drivers must already support this. This has been successfully tested with ath9k. Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr> Link: https://lore.kernel.org/r/20200305135754.12094-2-cavallar@lri.fr Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * cfg80211: Add support for userspace to reset stations in IBSS modeNicolas Cavallari2020-03-202-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes, userspace is able to detect that a peer silently lost its state (like, if the peer reboots). wpa_supplicant does this for IBSS-RSN by registering for auth/deauth frames, but when it detects this, it is only able to remove the encryption keys of the peer and close its port. However, the kernel also hold other state about the station, such as BA sessions, probe response parameters and the like. They also need to be resetted correctly. This patch adds the NL80211_EXT_FEATURE_DEL_IBSS_STA feature flag indicating the driver accepts deleting stations in IBSS mode, which should send a deauth and reset the state of the station, just like in mesh point mode. Signed-off-by: Nicolas Cavallari <nicolas.cavallari@green-communications.fr> Link: https://lore.kernel.org/r/20200305135754.12094-1-cavallar@lri.fr [preserve -EINVAL return] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * mac80211: consider WLAN_EID_EXT_HE_OPERATION for parsing CRCJohannes Berg2020-03-201-1/+5
| | | | | | | | | | | | | | | | | | | | We use the parsing CRC for checking if the beacon changed, and if the WLAN_EID_EXT_HE_OPERATION extended element changes we need to track it so we can react to that. Include it in the CRC calculation. Link: https://lore.kernel.org/r/20200131111300.891737-22-luca@coelho.fi Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * nl80211: add PROTECTED_TWT nl80211 extended featureShaul Triebitz2020-03-201-1/+4
| | | | | | | | | | | | | | | | | | | | Add API for telling whether the driver supports protected TWT. The protected_twt capability in the RSNXE will be based on this. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/20200131111300.891737-23-luca@coelho.fi Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * mac80211: HE: set missing bss_conf fields in AP modeShaul Triebitz2020-03-201-3/+9
| | | | | | | | | | | | | | | | | | | | In AP mode, set htc_trig_based_pkt_ext and frame_time_rts_th for driver use. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/20200131111300.891737-19-luca@coelho.fi Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * nl80211: pass HE operation element to the driverShaul Triebitz2020-03-202-2/+7
| | | | | | | | | | | | | | | | | | Pass the AP's HE operation element to the driver. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/20200131111300.891737-18-luca@coelho.fi Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * nl80211/cfg80211: add support for non EDCA based ranging measurementAvraham Stern2020-03-205-2/+84
| | | | | | | | | | | | | | | | | | | | | | Add support for requesting that the ranging measurement will use the trigger-based / non trigger-based flow instead of the EDCA based flow. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/20200131111300.891737-2-luca@coelho.fi Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * mac80211: don't leave skb->next/prev pointing to stackJohannes Berg2020-03-201-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In beacon protection, don't leave skb->next/prev pointing to the on-stack list, even if that's actually harmless since we don't use them again afterwards. While at it, check that the SKB on the list is still the same, as that's required here. If not, the encryption (protection) code is buggy. Fixes: 0a3a84360b37 ("mac80211: Beacon protection using the new BIGTK (AP)") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Link: https://lore.kernel.org/r/20200320102021.1be7823fc05e.Ia89fb79a0469d32137c9a04315a1d2dfc7b7d6f5@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * mac80211: update documentation about tx powerQiujun Huang2020-03-201-0/+5
| | | | | | | | | | | | | | | | | | The structure member added at some point, but the kernel-doc was not updated. Signed-off-by: Qiujun Huang <hqjagain@gmail.com> Link: https://lore.kernel.org/r/20200312144424.3023-1-hqjagain@gmail.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * mac80211: handle no-preauth flag for control portMarkus Theil2020-03-208-1/+18
| | | | | | | | | | | | | | | | | | | | This patch adds support for disabling pre-auth rx over the nl80211 control port for mac80211. Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de> Link: https://lore.kernel.org/r/20200312091055.54257-3-markus.theil@tu-ilmenau.de [fix indentation slightly, squash feature enablement] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * nl80211: add no pre-auth attribute and ext. feature flag for ctrl. portMarkus Theil2020-03-202-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the nl80211 control port is used before this patch, pre-auth frames (0x88c7) are send to userspace uncoditionally. While this enables userspace to only use nl80211 on the station side, it is not always useful for APs. Furthermore, pre-auth frames are ordinary data frames and not related to the control port. Therefore it should for example be possible for pre-auth frames to be bridged onto a wired network on AP side without touching userspace. For backwards compatibility to code already using pre-auth over nl80211, this patch adds a feature flag to disable this behavior, while it remains enabled by default. An additional ext. feature flag is added to detect this from userspace. Thanks to Jouni for pointing out, that pre-auth frames should be handled as ordinary data frames. Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de> Link: https://lore.kernel.org/r/20200312091055.54257-2-markus.theil@tu-ilmenau.de Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * mac80211_hwsim: add frame transmission support over virtioErel Geron2020-03-203-18/+331
| | | | | | | | | | | | | | | | | | | | | | | | | | This allows communication with external entities. It also required fixing up the netlink policy, since NLA_UNSPEC attributes are no longer accepted. Signed-off-by: Erel Geron <erelx.geron@intel.com> [port to backports, inline the ID, use 29 as the ID as requested, drop != NULL checks, reduce ifdefs] Link: https://lore.kernel.org/r/20200305143212.c6e4c87d225b.I7ce60bf143e863dcdf0fb8040aab7168ba549b99@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * cfg80211: fix documentation formatJohannes Berg2020-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | Kernel-doc complains if the line isn't prefixed with an asterisk, fix that. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Link: https://lore.kernel.org/r/20200320144110.2786ad5fb234.I369d103d11c71e39e3a3f97ed68a528c5b875f1e@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | net: dsa: sja1105: Add support for the SGMII portVladimir Oltean2020-03-205-5/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SJA1105 switches R and S have one SerDes port with an 802.3z quasi-compatible PCS, hardwired on port 4. The other ports are still MII/RMII/RGMII. The PCS performs rate adaptation to lower link speeds; the MAC on this port is hardwired at gigabit. Only full duplex is supported. The SGMII port can be configured as part of the static config tables, as well as through a dedicated SPI address region for its pseudo-clause-22 registers. However it looks like the static configuration is not able to change some out-of-reset values (like the value of MII_BMCR), so at the end of the day, having code for it is utterly pointless. We are just going to use the pseudo-C22 interface. Because the PCS gets reset when the switch resets, we have to add even more restoration logic to sja1105_static_config_reload, otherwise the SGMII port breaks after operations such as enabling PTP timestamping which require a switch reset. >From PHYLINK perspective, the switch supports *only* SGMII (it doesn't support 1000Base-X). It also doesn't expose access to the raw config word for in-band AN in registers MII_ADV/MII_LPA. It is able to work in the following modes: - Forced speed - SGMII in-band AN slave (speed received from PHY) - SGMII in-band AN master (acting as a PHY) The latter mode is not supported by this patch. It is even unclear to me how that would be described. There is some code for it left in the patch, but 'an_master' is always passed as false. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge branch 'net-bridge-vlan-options-nest-the-tunnel-options'David S. Miller2020-03-203-22/+74
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nikolay Aleksandrov says: ==================== net: bridge: vlan options: nest the tunnel options After a discussion with Roopa about the new tunnel vlan option, she suggested that we'll be adding more tunnel options and attributes, so it'd be better to have them all grouped together under one main vlan entry tunnel attribute instead of making them all main attributes. Since the tunnel code was added in this net-next cycle and still hasn't been released we can easily nest the BRIDGE_VLANDB_ENTRY_TUNNEL_ID attribute in BRIDGE_VLANDB_ENTRY_TUNNEL_INFO and allow for any new tunnel attributes to be added there. In addition one positive side-effect is that we can remove the outside vlan info flag which controlled the operation (setlink/dellink) and move it under a new nested attribute so user-space can specify it explicitly. Thus the vlan tunnel format becomes: [BRIDGE_VLANDB_ENTRY] [BRIDGE_VLANDB_ENTRY_TUNNEL_INFO] [BRIDGE_VLANDB_TINFO_ID] [BRIDGE_VLANDB_TINFO_CMD] ... ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * | net: bridge: vlan options: move the tunnel command to the nested attributeNikolay Aleksandrov2020-03-202-18/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have a nested tunnel info attribute we can add a separate one for the tunnel command and require it explicitly from user-space. It must be one of RTM_SETLINK/DELLINK. Only RTM_SETLINK requires a valid tunnel id, DELLINK just removes it if it was set before. This allows us to have all tunnel attributes and control in one place, thus removing the need for an outside vlan info flag. Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * | net: bridge: vlan options: nest the tunnel id into a tunnel info attributeNikolay Aleksandrov2020-03-203-8/+47
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While discussing the new API, Roopa mentioned that we'll be adding more tunnel attributes and options in the future, so it's better to make it a nested attribute, since this is still in net-next we can easily change it and nest the tunnel id attribute under BRIDGE_VLANDB_ENTRY_TUNNEL_INFO. The new format is: [BRIDGE_VLANDB_ENTRY] [BRIDGE_VLANDB_ENTRY_TUNNEL_INFO] [BRIDGE_VLANDB_TINFO_ID] Any new tunnel attributes can be nested under BRIDGE_VLANDB_ENTRY_TUNNEL_INFO. Suggested-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: dsa: sja1105: Avoid error message for unknown PHY mode on disabled portsVladimir Oltean2020-03-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When sja1105_init_mii_settings iterates over the port list, it prints this message for disabled ports, because they don't have a valid phy-mode: [ 4.778702] sja1105 spi2.0: Unsupported PHY mode unknown! Suggested-by: Andrew Lunn <andrew@lunn.ch> Suggested-by: Vivien Didelot <vivien.didelot@gmail.com> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Vivien Didelot <vivien.didelot@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge branch 'for-upstream' of ↵David S. Miller2020-03-1940-329/+1845
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next Johan Hedberg says: ==================== pull request: bluetooth-next 2020-03-19 Here's the main bluetooth-next pull request for the 5.7 kernel. - Added wideband speech support to mgmt and the ability for HCI drivers to declare support for it. - Added initial support for L2CAP Enhanced Credit Based Mode - Fixed suspend handling for several use cases - Fixed Extended Advertising related issues - Added support for Realtek 8822CE device - Added DT bindings for QTI chip WCN3991 - Cleanups to replace zero-length arrays with flexible-array members - Several other smaller cleanups & fixes ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * | Bluetooth: Do not cancel advertising when starting a scanDmitry Grinberg2020-03-181-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BlueZ cancels adv when starting a scan, but does not cancel a scan when starting to adv. Neither is required, so this brings both to a consistent state (of not affecting each other). Some very rare (I've never seen one) BT 4.0 chips will fail to do both at once. Even this is ok since the command that will fail will be the second one, and thus the common sense logic of first-come-first-served is preserved for BLE requests. Signed-off-by: Dmitry Grinberg <dmitrygr@google.com> Signed-off-by: Manish Mandlik <mmandlik@google.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: btusb: print Intel fw build version in power-on bootSukumar Ghorai2020-03-161-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To determine the build version of Bluetooth firmware to ensure reported issue related to a particular release. This is very helpful for every fw downloaded to BT controller and issue reported from field test. Signed-off-by: Amit K Bag <amit.k.bag@intel.com> Signed-off-by: Sukumar Ghorai <sukumar.ghorai@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: L2CAP: remove set but not used variable 'credits'YueHaibing2020-03-141-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | net/bluetooth/l2cap_core.c: In function l2cap_ecred_conn_req: net/bluetooth/l2cap_core.c:5848:6: warning: variable credits set but not used [-Wunused-but-set-variable] commit 15f02b910562 ("Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode") involved this unused variable, remove it. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: L2CAP: Fix a condition in l2cap_sock_recvmsg()Dan Carpenter2020-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Smatch complains about the indenting: net/bluetooth/l2cap_sock.c:1027 l2cap_sock_recvmsg() warn: inconsistent indenting It looks like this is supposed to be an "else if" condition. Fixes: 15f02b910562 ("Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: L2CAP: handle l2cap config request during open stateHoward Chung2020-03-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to Core Spec Version 5.2 | Vol 3, Part A 6.1.5, the incoming L2CAP_ConfigReq should be handled during OPEN state. The section below shows the btmon trace when running L2CAP/COS/CFD/BV-12-C before and after this change. === Before === ... > ACL Data RX: Handle 256 flags 0x02 dlen 12 #22 L2CAP: Connection Request (0x02) ident 2 len 4 PSM: 1 (0x0001) Source CID: 65 < ACL Data TX: Handle 256 flags 0x00 dlen 16 #23 L2CAP: Connection Response (0x03) ident 2 len 8 Destination CID: 64 Source CID: 65 Result: Connection successful (0x0000) Status: No further information available (0x0000) < ACL Data TX: Handle 256 flags 0x00 dlen 12 #24 L2CAP: Configure Request (0x04) ident 2 len 4 Destination CID: 65 Flags: 0x0000 > HCI Event: Number of Completed Packets (0x13) plen 5 #25 Num handles: 1 Handle: 256 Count: 1 > HCI Event: Number of Completed Packets (0x13) plen 5 #26 Num handles: 1 Handle: 256 Count: 1 > ACL Data RX: Handle 256 flags 0x02 dlen 16 #27 L2CAP: Configure Request (0x04) ident 3 len 8 Destination CID: 64 Flags: 0x0000 Option: Unknown (0x10) [hint] 01 00 .. < ACL Data TX: Handle 256 flags 0x00 dlen 18 #28 L2CAP: Configure Response (0x05) ident 3 len 10 Source CID: 65 Flags: 0x0000 Result: Success (0x0000) Option: Maximum Transmission Unit (0x01) [mandatory] MTU: 672 > HCI Event: Number of Completed Packets (0x13) plen 5 #29 Num handles: 1 Handle: 256 Count: 1 > ACL Data RX: Handle 256 flags 0x02 dlen 14 #30 L2CAP: Configure Response (0x05) ident 2 len 6 Source CID: 64 Flags: 0x0000 Result: Success (0x0000) > ACL Data RX: Handle 256 flags 0x02 dlen 20 #31 L2CAP: Configure Request (0x04) ident 3 len 12 Destination CID: 64 Flags: 0x0000 Option: Unknown (0x10) [hint] 01 00 91 02 11 11 ...... < ACL Data TX: Handle 256 flags 0x00 dlen 14 #32 L2CAP: Command Reject (0x01) ident 3 len 6 Reason: Invalid CID in request (0x0002) Destination CID: 64 Source CID: 65 > HCI Event: Number of Completed Packets (0x13) plen 5 #33 Num handles: 1 Handle: 256 Count: 1 ... === After === ... > ACL Data RX: Handle 256 flags 0x02 dlen 12 #22 L2CAP: Connection Request (0x02) ident 2 len 4 PSM: 1 (0x0001) Source CID: 65 < ACL Data TX: Handle 256 flags 0x00 dlen 16 #23 L2CAP: Connection Response (0x03) ident 2 len 8 Destination CID: 64 Source CID: 65 Result: Connection successful (0x0000) Status: No further information available (0x0000) < ACL Data TX: Handle 256 flags 0x00 dlen 12 #24 L2CAP: Configure Request (0x04) ident 2 len 4 Destination CID: 65 Flags: 0x0000 > HCI Event: Number of Completed Packets (0x13) plen 5 #25 Num handles: 1 Handle: 256 Count: 1 > HCI Event: Number of Completed Packets (0x13) plen 5 #26 Num handles: 1 Handle: 256 Count: 1 > ACL Data RX: Handle 256 flags 0x02 dlen 16 #27 L2CAP: Configure Request (0x04) ident 3 len 8 Destination CID: 64 Flags: 0x0000 Option: Unknown (0x10) [hint] 01 00 .. < ACL Data TX: Handle 256 flags 0x00 dlen 18 #28 L2CAP: Configure Response (0x05) ident 3 len 10 Source CID: 65 Flags: 0x0000 Result: Success (0x0000) Option: Maximum Transmission Unit (0x01) [mandatory] MTU: 672 > HCI Event: Number of Completed Packets (0x13) plen 5 #29 Num handles: 1 Handle: 256 Count: 1 > ACL Data RX: Handle 256 flags 0x02 dlen 14 #30 L2CAP: Configure Response (0x05) ident 2 len 6 Source CID: 64 Flags: 0x0000 Result: Success (0x0000) > ACL Data RX: Handle 256 flags 0x02 dlen 20 #31 L2CAP: Configure Request (0x04) ident 3 len 12 Destination CID: 64 Flags: 0x0000 Option: Unknown (0x10) [hint] 01 00 91 02 11 11 ..... < ACL Data TX: Handle 256 flags 0x00 dlen 18 #32 L2CAP: Configure Response (0x05) ident 3 len 10 Source CID: 65 Flags: 0x0000 Result: Success (0x0000) Option: Maximum Transmission Unit (0x01) [mandatory] MTU: 672 < ACL Data TX: Handle 256 flags 0x00 dlen 12 #33 L2CAP: Configure Request (0x04) ident 3 len 4 Destination CID: 65 Flags: 0x0000 > HCI Event: Number of Completed Packets (0x13) plen 5 #34 Num handles: 1 Handle: 256 Count: 1 > HCI Event: Number of Completed Packets (0x13) plen 5 #35 Num handles: 1 Handle: 256 Count: 1 ... Signed-off-by: Howard Chung <howardchung@google.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: clean up connection in hci_cs_disconnectJoseph Hwang2020-03-121-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In bluetooth core specification 4.2, Vol 2, Part E, 7.8.9 LE Set Advertise Enable Command, it says The Controller shall continue advertising until ... or until a connection is created or ... In these cases, advertising is then disabled. Hence, advertising would be disabled before a connection is established. In current kernel implementation, advertising would be re-enabled when all connections are terminated. The correct disconnection flow looks like < HCI Command: Disconnect > HCI Event: Command Status Status: Success > HCI Event: Disconnect Complete Status: Success Specifically, the last Disconnect Complete Event would trigger a callback function hci_event.c:hci_disconn_complete_evt() to cleanup the connection and re-enable advertising when proper. However, sometimes, there might occur an exception in the controller when disconnection is being executed. The disconnection flow might then look like < HCI Command: Disconnect > HCI Event: Command Status Status: Unknown Connection Identifier Note that "> HCI Event: Disconnect Complete" is missing when such an exception occurs. This would result in advertising staying disabled forever since the connection in question is not cleaned up correctly. To fix the controller exception issue, we need to do some connection cleanup when the disconnect command status indicates an error. Signed-off-by: Joseph Hwang <josephsih@chromium.org> Signed-off-by: Manish Mandlik <mmandlik@google.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: Pause discovery and advertising during suspendAbhishek Pandit-Subedi2020-03-113-0/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | To prevent spurious wake ups, we disable any discovery or advertising when we enter suspend and restore it when we exit suspend. While paused, we disable any management requests to modify discovery or advertising. Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: Handle LE devices during suspendAbhishek Pandit-Subedi2020-03-112-54/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | To handle LE devices, we must first disable passive scanning and disconnect all connected devices. Once that is complete, we update the whitelist and re-enable scanning Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: Handle BR/EDR devices during suspendAbhishek Pandit-Subedi2020-03-115-10/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | To handle BR/EDR devices, we first disable page scan and disconnect all connected devices. Once that is complete, we add event filters (for devices that can wake the system) and re-enable page scan. Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: Handle PM_SUSPEND_PREPARE and PM_POST_SUSPENDAbhishek Pandit-Subedi2020-03-114-0/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Register for PM_SUSPEND_PREPARE and PM_POST_SUSPEND to make sure the Bluetooth controller is prepared correctly for suspend/resume. Implement the registration, scheduling and task handling portions only in this patch. Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: mgmt: add mgmt_cmd_status in add_advertisingJoseph Hwang2020-03-111-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | If an error occurs during request building in add_advertising(), remember to send MGMT_STATUS_FAILED command status back to bluetoothd. Signed-off-by: Joseph Hwang <josephsih@chromium.org> Signed-off-by: Manish Mandlik <mmandlik@google.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: fix off by one in err_data_reporting cmd masks.Alain Michaud2020-03-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This change fixes the off by one error in the erroneous command bit masks which can lead to the erroneous data commands being sent to a controller that doesn't support them. Signed-off-by: Alain Michaud <alainm@chromium.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: hci_h5: Switch from BT_ERR to bt_dev_err where possibleMarcel Holtmann2020-03-111-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | All HCI device specific error messages shall use bt_dev_err to indicate the device name in the message. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * | Bluetooth: Use bt_dev_err for RPA generation failure messageMarcel Holtmann2020-03-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | When the RPA generation fails, indicate the error with a device specifc error message. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>