mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-23 23:50:51 +07:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller: "Highlights: 1) Support AES128-CCM ciphers in kTLS, from Vakul Garg. 2) Add fib_sync_mem to control the amount of dirty memory we allow to queue up between synchronize RCU calls, from David Ahern. 3) Make flow classifier more lockless, from Vlad Buslov. 4) Add PHY downshift support to aquantia driver, from Heiner Kallweit. 5) Add SKB cache for TCP rx and tx, from Eric Dumazet. This reduces contention on SLAB spinlocks in heavy RPC workloads. 6) Partial GSO offload support in XFRM, from Boris Pismenny. 7) Add fast link down support to ethtool, from Heiner Kallweit. 8) Use siphash for IP ID generator, from Eric Dumazet. 9) Pull nexthops even further out from ipv4/ipv6 routes and FIB entries, from David Ahern. 10) Move skb->xmit_more into a per-cpu variable, from Florian Westphal. 11) Improve eBPF verifier speed and increase maximum program size, from Alexei Starovoitov. 12) Eliminate per-bucket spinlocks in rhashtable, and instead use bit spinlocks. From Neil Brown. 13) Allow tunneling with GUE encap in ipvs, from Jacky Hu. 14) Improve link partner cap detection in generic PHY code, from Heiner Kallweit. 15) Add layer 2 encap support to bpf_skb_adjust_room(), from Alan Maguire. 16) Remove SKB list implementation assumptions in SCTP, your's truly. 17) Various cleanups, optimizations, and simplifications in r8169 driver. From Heiner Kallweit. 18) Add memory accounting on TX and RX path of SCTP, from Xin Long. 19) Switch PHY drivers over to use dynamic featue detection, from Heiner Kallweit. 20) Support flow steering without masking in dpaa2-eth, from Ioana Ciocoi. 21) Implement ndo_get_devlink_port in netdevsim driver, from Jiri Pirko. 22) Increase the strict parsing of current and future netlink attributes, also export such policies to userspace. From Johannes Berg. 23) Allow DSA tag drivers to be modular, from Andrew Lunn. 24) Remove legacy DSA probing support, also from Andrew Lunn. 25) Allow ll_temac driver to be used on non-x86 platforms, from Esben Haabendal. 26) Add a generic tracepoint for TX queue timeouts to ease debugging, from Cong Wang. 27) More indirect call optimizations, from Paolo Abeni" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1763 commits) cxgb4: Fix error path in cxgb4_init_module net: phy: improve pause mode reporting in phy_print_status dt-bindings: net: Fix a typo in the phy-mode list for ethernet bindings net: macb: Change interrupt and napi enable order in open net: ll_temac: Improve error message on error IRQ net/sched: remove block pointer from common offload structure net: ethernet: support of_get_mac_address new ERR_PTR error net: usb: smsc: fix warning reported by kbuild test robot staging: octeon-ethernet: Fix of_get_mac_address ERR_PTR check net: dsa: support of_get_mac_address new ERR_PTR error net: dsa: sja1105: Fix status initialization in sja1105_get_ethtool_stats vrf: sit mtu should not be updated when vrf netdev is the link net: dsa: Fix error cleanup path in dsa_init_module l2tp: Fix possible NULL pointer dereference taprio: add null check on sched_nest to avoid potential null pointer dereference net: mvpp2: cls: fix less than zero check on a u32 variable net_sched: sch_fq: handle non connected flows net_sched: sch_fq: do not assume EDT packets are ordered net: hns3: use devm_kcalloc when allocating desc_cb net: hns3: some cleanup for struct hns3_enet_ring ...
This commit is contained in:
commit
80f232121b
@ -387,14 +387,14 @@ ForEachMacros:
|
||||
- 'rhl_for_each_entry_rcu'
|
||||
- 'rhl_for_each_rcu'
|
||||
- 'rht_for_each'
|
||||
- 'rht_for_each_continue'
|
||||
- 'rht_for_each_from'
|
||||
- 'rht_for_each_entry'
|
||||
- 'rht_for_each_entry_continue'
|
||||
- 'rht_for_each_entry_from'
|
||||
- 'rht_for_each_entry_rcu'
|
||||
- 'rht_for_each_entry_rcu_continue'
|
||||
- 'rht_for_each_entry_rcu_from'
|
||||
- 'rht_for_each_entry_safe'
|
||||
- 'rht_for_each_rcu'
|
||||
- 'rht_for_each_rcu_continue'
|
||||
- 'rht_for_each_rcu_from'
|
||||
- '__rq_for_each_bio'
|
||||
- 'rq_for_each_bvec'
|
||||
- 'rq_for_each_segment'
|
||||
|
9
.mailmap
9
.mailmap
@ -16,6 +16,9 @@ Alan Cox <alan@lxorguk.ukuu.org.uk>
|
||||
Alan Cox <root@hraefn.swansea.linux.org.uk>
|
||||
Aleksey Gorelov <aleksey_gorelov@phoenix.com>
|
||||
Aleksandar Markovic <aleksandar.markovic@mips.com> <aleksandar.markovic@imgtec.com>
|
||||
Alexei Starovoitov <ast@kernel.org> <ast@plumgrid.com>
|
||||
Alexei Starovoitov <ast@kernel.org> <alexei.starovoitov@gmail.com>
|
||||
Alexei Starovoitov <ast@kernel.org> <ast@fb.com>
|
||||
Al Viro <viro@ftp.linux.org.uk>
|
||||
Al Viro <viro@zenIV.linux.org.uk>
|
||||
Andi Shyti <andi@etezian.org> <andi.shyti@samsung.com>
|
||||
@ -46,6 +49,12 @@ Christoph Hellwig <hch@lst.de>
|
||||
Christophe Ricard <christophe.ricard@gmail.com>
|
||||
Corey Minyard <minyard@acm.org>
|
||||
Damian Hobson-Garcia <dhobsong@igel.co.jp>
|
||||
Daniel Borkmann <daniel@iogearbox.net> <dborkman@redhat.com>
|
||||
Daniel Borkmann <daniel@iogearbox.net> <dborkmann@redhat.com>
|
||||
Daniel Borkmann <daniel@iogearbox.net> <danborkmann@iogearbox.net>
|
||||
Daniel Borkmann <daniel@iogearbox.net> <daniel.borkmann@tik.ee.ethz.ch>
|
||||
Daniel Borkmann <daniel@iogearbox.net> <danborkmann@googlemail.com>
|
||||
Daniel Borkmann <daniel@iogearbox.net> <dxchgb@gmail.com>
|
||||
David Brownell <david-b@pacbell.net>
|
||||
David Woodhouse <dwmw2@shinybook.infradead.org>
|
||||
Dengcheng Zhu <dzhu@wavecomp.com> <dengcheng.zhu@mips.com>
|
||||
|
@ -1,3 +1,5 @@
|
||||
This ABI is deprecated and will be removed after 2021. It is
|
||||
replaced with the batadv generic netlink family.
|
||||
|
||||
What: /sys/class/net/<iface>/batman-adv/elp_interval
|
||||
Date: Feb 2014
|
@ -1,3 +1,5 @@
|
||||
This ABI is deprecated and will be removed after 2021. It is
|
||||
replaced with the batadv generic netlink family.
|
||||
|
||||
What: /sys/class/net/<mesh_iface>/mesh/aggregated_ogms
|
||||
Date: May 2010
|
@ -85,8 +85,33 @@ Q: Can loops be supported in a safe way?
|
||||
A: It's not clear yet.
|
||||
|
||||
BPF developers are trying to find a way to
|
||||
support bounded loops where the verifier can guarantee that
|
||||
the program terminates in less than 4096 instructions.
|
||||
support bounded loops.
|
||||
|
||||
Q: What are the verifier limits?
|
||||
--------------------------------
|
||||
A: The only limit known to the user space is BPF_MAXINSNS (4096).
|
||||
It's the maximum number of instructions that the unprivileged bpf
|
||||
program can have. The verifier has various internal limits.
|
||||
Like the maximum number of instructions that can be explored during
|
||||
program analysis. Currently, that limit is set to 1 million.
|
||||
Which essentially means that the largest program can consist
|
||||
of 1 million NOP instructions. There is a limit to the maximum number
|
||||
of subsequent branches, a limit to the number of nested bpf-to-bpf
|
||||
calls, a limit to the number of the verifier states per instruction,
|
||||
a limit to the number of maps used by the program.
|
||||
All these limits can be hit with a sufficiently complex program.
|
||||
There are also non-numerical limits that can cause the program
|
||||
to be rejected. The verifier used to recognize only pointer + constant
|
||||
expressions. Now it can recognize pointer + bounded_register.
|
||||
bpf_lookup_map_elem(key) had a requirement that 'key' must be
|
||||
a pointer to the stack. Now, 'key' can be a pointer to map value.
|
||||
The verifier is steadily getting 'smarter'. The limits are
|
||||
being removed. The only way to know that the program is going to
|
||||
be accepted by the verifier is to try to load it.
|
||||
The bpf development process guarantees that the future kernel
|
||||
versions will accept all bpf programs that were accepted by
|
||||
the earlier versions.
|
||||
|
||||
|
||||
Instruction level questions
|
||||
---------------------------
|
||||
|
@ -82,6 +82,8 @@ sequentially and type id is assigned to each recognized type starting from id
|
||||
#define BTF_KIND_RESTRICT 11 /* Restrict */
|
||||
#define BTF_KIND_FUNC 12 /* Function */
|
||||
#define BTF_KIND_FUNC_PROTO 13 /* Function Proto */
|
||||
#define BTF_KIND_VAR 14 /* Variable */
|
||||
#define BTF_KIND_DATASEC 15 /* Section */
|
||||
|
||||
Note that the type section encodes debug info, not just pure types.
|
||||
``BTF_KIND_FUNC`` is not a type, and it represents a defined subprogram.
|
||||
@ -393,6 +395,61 @@ refers to parameter type.
|
||||
If the function has variable arguments, the last parameter is encoded with
|
||||
``name_off = 0`` and ``type = 0``.
|
||||
|
||||
2.2.14 BTF_KIND_VAR
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
``struct btf_type`` encoding requirement:
|
||||
* ``name_off``: offset to a valid C identifier
|
||||
* ``info.kind_flag``: 0
|
||||
* ``info.kind``: BTF_KIND_VAR
|
||||
* ``info.vlen``: 0
|
||||
* ``type``: the type of the variable
|
||||
|
||||
``btf_type`` is followed by a single ``struct btf_variable`` with the
|
||||
following data::
|
||||
|
||||
struct btf_var {
|
||||
__u32 linkage;
|
||||
};
|
||||
|
||||
``struct btf_var`` encoding:
|
||||
* ``linkage``: currently only static variable 0, or globally allocated
|
||||
variable in ELF sections 1
|
||||
|
||||
Not all type of global variables are supported by LLVM at this point.
|
||||
The following is currently available:
|
||||
|
||||
* static variables with or without section attributes
|
||||
* global variables with section attributes
|
||||
|
||||
The latter is for future extraction of map key/value type id's from a
|
||||
map definition.
|
||||
|
||||
2.2.15 BTF_KIND_DATASEC
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
``struct btf_type`` encoding requirement:
|
||||
* ``name_off``: offset to a valid name associated with a variable or
|
||||
one of .data/.bss/.rodata
|
||||
* ``info.kind_flag``: 0
|
||||
* ``info.kind``: BTF_KIND_DATASEC
|
||||
* ``info.vlen``: # of variables
|
||||
* ``size``: total section size in bytes (0 at compilation time, patched
|
||||
to actual size by BPF loaders such as libbpf)
|
||||
|
||||
``btf_type`` is followed by ``info.vlen`` number of ``struct btf_var_secinfo``.::
|
||||
|
||||
struct btf_var_secinfo {
|
||||
__u32 type;
|
||||
__u32 offset;
|
||||
__u32 size;
|
||||
};
|
||||
|
||||
``struct btf_var_secinfo`` encoding:
|
||||
* ``type``: the type of the BTF_KIND_VAR variable
|
||||
* ``offset``: the in-section offset of the variable
|
||||
* ``size``: the size of the variable in bytes
|
||||
|
||||
3. BTF Kernel API
|
||||
*****************
|
||||
|
||||
|
@ -36,6 +36,16 @@ Two sets of Questions and Answers (Q&A) are maintained.
|
||||
bpf_devel_QA
|
||||
|
||||
|
||||
Program types
|
||||
=============
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
prog_cgroup_sysctl
|
||||
prog_flow_dissector
|
||||
|
||||
|
||||
.. Links:
|
||||
.. _Documentation/networking/filter.txt: ../networking/filter.txt
|
||||
.. _man-pages: https://www.kernel.org/doc/man-pages/
|
||||
|
125
Documentation/bpf/prog_cgroup_sysctl.rst
Normal file
125
Documentation/bpf/prog_cgroup_sysctl.rst
Normal file
@ -0,0 +1,125 @@
|
||||
.. SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
|
||||
|
||||
===========================
|
||||
BPF_PROG_TYPE_CGROUP_SYSCTL
|
||||
===========================
|
||||
|
||||
This document describes ``BPF_PROG_TYPE_CGROUP_SYSCTL`` program type that
|
||||
provides cgroup-bpf hook for sysctl.
|
||||
|
||||
The hook has to be attached to a cgroup and will be called every time a
|
||||
process inside that cgroup tries to read from or write to sysctl knob in proc.
|
||||
|
||||
1. Attach type
|
||||
**************
|
||||
|
||||
``BPF_CGROUP_SYSCTL`` attach type has to be used to attach
|
||||
``BPF_PROG_TYPE_CGROUP_SYSCTL`` program to a cgroup.
|
||||
|
||||
2. Context
|
||||
**********
|
||||
|
||||
``BPF_PROG_TYPE_CGROUP_SYSCTL`` provides access to the following context from
|
||||
BPF program::
|
||||
|
||||
struct bpf_sysctl {
|
||||
__u32 write;
|
||||
__u32 file_pos;
|
||||
};
|
||||
|
||||
* ``write`` indicates whether sysctl value is being read (``0``) or written
|
||||
(``1``). This field is read-only.
|
||||
|
||||
* ``file_pos`` indicates file position sysctl is being accessed at, read
|
||||
or written. This field is read-write. Writing to the field sets the starting
|
||||
position in sysctl proc file ``read(2)`` will be reading from or ``write(2)``
|
||||
will be writing to. Writing zero to the field can be used e.g. to override
|
||||
whole sysctl value by ``bpf_sysctl_set_new_value()`` on ``write(2)`` even
|
||||
when it's called by user space on ``file_pos > 0``. Writing non-zero
|
||||
value to the field can be used to access part of sysctl value starting from
|
||||
specified ``file_pos``. Not all sysctl support access with ``file_pos !=
|
||||
0``, e.g. writes to numeric sysctl entries must always be at file position
|
||||
``0``. See also ``kernel.sysctl_writes_strict`` sysctl.
|
||||
|
||||
See `linux/bpf.h`_ for more details on how context field can be accessed.
|
||||
|
||||
3. Return code
|
||||
**************
|
||||
|
||||
``BPF_PROG_TYPE_CGROUP_SYSCTL`` program must return one of the following
|
||||
return codes:
|
||||
|
||||
* ``0`` means "reject access to sysctl";
|
||||
* ``1`` means "proceed with access".
|
||||
|
||||
If program returns ``0`` user space will get ``-1`` from ``read(2)`` or
|
||||
``write(2)`` and ``errno`` will be set to ``EPERM``.
|
||||
|
||||
4. Helpers
|
||||
**********
|
||||
|
||||
Since sysctl knob is represented by a name and a value, sysctl specific BPF
|
||||
helpers focus on providing access to these properties:
|
||||
|
||||
* ``bpf_sysctl_get_name()`` to get sysctl name as it is visible in
|
||||
``/proc/sys`` into provided by BPF program buffer;
|
||||
|
||||
* ``bpf_sysctl_get_current_value()`` to get string value currently held by
|
||||
sysctl into provided by BPF program buffer. This helper is available on both
|
||||
``read(2)`` from and ``write(2)`` to sysctl;
|
||||
|
||||
* ``bpf_sysctl_get_new_value()`` to get new string value currently being
|
||||
written to sysctl before actual write happens. This helper can be used only
|
||||
on ``ctx->write == 1``;
|
||||
|
||||
* ``bpf_sysctl_set_new_value()`` to override new string value currently being
|
||||
written to sysctl before actual write happens. Sysctl value will be
|
||||
overridden starting from the current ``ctx->file_pos``. If the whole value
|
||||
has to be overridden BPF program can set ``file_pos`` to zero before calling
|
||||
to the helper. This helper can be used only on ``ctx->write == 1``. New
|
||||
string value set by the helper is treated and verified by kernel same way as
|
||||
an equivalent string passed by user space.
|
||||
|
||||
BPF program sees sysctl value same way as user space does in proc filesystem,
|
||||
i.e. as a string. Since many sysctl values represent an integer or a vector
|
||||
of integers, the following helpers can be used to get numeric value from the
|
||||
string:
|
||||
|
||||
* ``bpf_strtol()`` to convert initial part of the string to long integer
|
||||
similar to user space `strtol(3)`_;
|
||||
* ``bpf_strtoul()`` to convert initial part of the string to unsigned long
|
||||
integer similar to user space `strtoul(3)`_;
|
||||
|
||||
See `linux/bpf.h`_ for more details on helpers described here.
|
||||
|
||||
5. Examples
|
||||
***********
|
||||
|
||||
See `test_sysctl_prog.c`_ for an example of BPF program in C that access
|
||||
sysctl name and value, parses string value to get vector of integers and uses
|
||||
the result to make decision whether to allow or deny access to sysctl.
|
||||
|
||||
6. Notes
|
||||
********
|
||||
|
||||
``BPF_PROG_TYPE_CGROUP_SYSCTL`` is intended to be used in **trusted** root
|
||||
environment, for example to monitor sysctl usage or catch unreasonable values
|
||||
an application, running as root in a separate cgroup, is trying to set.
|
||||
|
||||
Since `task_dfl_cgroup(current)` is called at `sys_read` / `sys_write` time it
|
||||
may return results different from that at `sys_open` time, i.e. process that
|
||||
opened sysctl file in proc filesystem may differ from process that is trying
|
||||
to read from / write to it and two such processes may run in different
|
||||
cgroups, what means ``BPF_PROG_TYPE_CGROUP_SYSCTL`` should not be used as a
|
||||
security mechanism to limit sysctl usage.
|
||||
|
||||
As with any cgroup-bpf program additional care should be taken if an
|
||||
application running as root in a cgroup should not be allowed to
|
||||
detach/replace BPF program attached by administrator.
|
||||
|
||||
.. Links
|
||||
.. _linux/bpf.h: ../../include/uapi/linux/bpf.h
|
||||
.. _strtol(3): http://man7.org/linux/man-pages/man3/strtol.3p.html
|
||||
.. _strtoul(3): http://man7.org/linux/man-pages/man3/strtoul.3p.html
|
||||
.. _test_sysctl_prog.c:
|
||||
../../tools/testing/selftests/bpf/progs/test_sysctl_prog.c
|
@ -1,8 +1,8 @@
|
||||
.. SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
==================
|
||||
BPF Flow Dissector
|
||||
==================
|
||||
============================
|
||||
BPF_PROG_TYPE_FLOW_DISSECTOR
|
||||
============================
|
||||
|
||||
Overview
|
||||
========
|
@ -46,9 +46,8 @@ Required properties:
|
||||
- reg: phy id used to communicate to phy.
|
||||
- device_type: Must be "ethernet-phy".
|
||||
|
||||
Optional properties:
|
||||
- local-mac-address: See ethernet.txt in the same directory.
|
||||
- max-frame-size: See ethernet.txt in the same directory.
|
||||
The MAC address will be determined using the optional properties defined in
|
||||
ethernet.txt.
|
||||
|
||||
Example:
|
||||
|
||||
|
@ -24,8 +24,6 @@ Required properties:
|
||||
- phy-mode: See ethernet.txt file in the same directory
|
||||
|
||||
Optional properties:
|
||||
- mac-address: mac address to be assigned to the device. Can be overridden
|
||||
by UEFI.
|
||||
- dma-coherent: Present if dma operations are coherent
|
||||
- amd,per-channel-interrupt: Indicates that Rx and Tx complete will generate
|
||||
a unique interrupt for each DMA channel - this requires an additional
|
||||
@ -34,6 +32,9 @@ Optional properties:
|
||||
0 - 1GbE and 10GbE (default)
|
||||
1 - 2.5GbE and 10GbE
|
||||
|
||||
The MAC address will be determined using the optional properties defined in
|
||||
ethernet.txt.
|
||||
|
||||
The following optional properties are represented by an array with each
|
||||
value corresponding to a particular speed. The first array value represents
|
||||
the setting for the 1GbE speed, the second value for the 2.5GbE speed and
|
||||
|
@ -16,8 +16,8 @@ Required properties:
|
||||
registers (required for Northstar2)
|
||||
- interrupts: Interrupt number
|
||||
|
||||
Optional properties:
|
||||
- mac-address: See ethernet.txt file in the same directory
|
||||
The MAC address will be determined using the optional properties
|
||||
defined in ethernet.txt.
|
||||
|
||||
Examples:
|
||||
|
||||
|
@ -49,10 +49,12 @@ Required properties:
|
||||
|
||||
Optional properties:
|
||||
- dual_emac_res_vlan : Specifies VID to be used to segregate the ports
|
||||
- mac-address : See ethernet.txt file in the same directory
|
||||
- phy_id : Specifies slave phy id (deprecated, use phy-handle)
|
||||
- phy-handle : See ethernet.txt file in the same directory
|
||||
|
||||
The MAC address will be determined using the optional properties
|
||||
defined in ethernet.txt.
|
||||
|
||||
Slave sub-nodes:
|
||||
- fixed-link : See fixed-link.txt file in the same directory
|
||||
|
||||
|
@ -20,11 +20,12 @@ Required properties:
|
||||
Optional properties:
|
||||
- phy-handle: See ethernet.txt file in the same directory.
|
||||
If absent, davinci_emac driver defaults to 100/FULL.
|
||||
- nvmem-cells: phandle, reference to an nvmem node for the MAC address
|
||||
- nvmem-cell-names: string, should be "mac-address" if nvmem is to be used
|
||||
- ti,davinci-rmii-en: 1 byte, 1 means use RMII
|
||||
- ti,davinci-no-bd-ram: boolean, does EMAC have BD RAM?
|
||||
|
||||
The MAC address will be determined using the optional properties
|
||||
defined in ethernet.txt.
|
||||
|
||||
Example (enbw_cmc board):
|
||||
eth0: emac@1e20000 {
|
||||
compatible = "ti,davinci-dm6467-emac";
|
||||
|
@ -1,12 +1,6 @@
|
||||
Distributed Switch Architecture Device Tree Bindings
|
||||
----------------------------------------------------
|
||||
|
||||
Two bindings exist, one of which has been deprecated due to
|
||||
limitations.
|
||||
|
||||
Current Binding
|
||||
---------------
|
||||
|
||||
Switches are true Linux devices and can be probed by any means. Once
|
||||
probed, they register to the DSA framework, passing a node
|
||||
pointer. This node is expected to fulfil the following binding, and
|
||||
@ -71,9 +65,8 @@ properties, described in binding documents:
|
||||
Documentation/devicetree/bindings/net/fixed-link.txt
|
||||
for details.
|
||||
|
||||
- local-mac-address : See
|
||||
Documentation/devicetree/bindings/net/ethernet.txt
|
||||
for details.
|
||||
The MAC address will be determined using the optional properties
|
||||
defined in ethernet.txt.
|
||||
|
||||
Example
|
||||
|
||||
@ -262,152 +255,3 @@ linked into one DSA cluster.
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Deprecated Binding
|
||||
------------------
|
||||
|
||||
The deprecated binding makes use of a platform device to represent the
|
||||
switches. The switches themselves are not Linux devices, and make use
|
||||
of an MDIO bus for management.
|
||||
|
||||
Required properties:
|
||||
- compatible : Should be "marvell,dsa"
|
||||
- #address-cells : Must be 2, first cell is the address on the MDIO bus
|
||||
and second cell is the address in the switch tree.
|
||||
Second cell is used only when cascading/chaining.
|
||||
- #size-cells : Must be 0
|
||||
- dsa,ethernet : Should be a phandle to a valid Ethernet device node
|
||||
- dsa,mii-bus : Should be a phandle to a valid MDIO bus device node
|
||||
|
||||
Optional properties:
|
||||
- interrupts : property with a value describing the switch
|
||||
interrupt number (not supported by the driver)
|
||||
|
||||
A DSA node can contain multiple switch chips which are therefore child nodes of
|
||||
the parent DSA node. The maximum number of allowed child nodes is 4
|
||||
(DSA_MAX_SWITCHES).
|
||||
Each of these switch child nodes should have the following required properties:
|
||||
|
||||
- reg : Contains two fields. The first one describes the
|
||||
address on the MII bus. The second is the switch
|
||||
number that must be unique in cascaded configurations
|
||||
- #address-cells : Must be 1
|
||||
- #size-cells : Must be 0
|
||||
|
||||
A switch child node has the following optional property:
|
||||
|
||||
- eeprom-length : Set to the length of an EEPROM connected to the
|
||||
switch. Must be set if the switch can not detect
|
||||
the presence and/or size of a connected EEPROM,
|
||||
otherwise optional.
|
||||
|
||||
A switch may have multiple "port" children nodes
|
||||
|
||||
Each port children node must have the following mandatory properties:
|
||||
- reg : Describes the port address in the switch
|
||||
- label : Describes the label associated with this port, special
|
||||
labels are "cpu" to indicate a CPU port and "dsa" to
|
||||
indicate an uplink/downlink port.
|
||||
|
||||
Note that a port labelled "dsa" will imply checking for the uplink phandle
|
||||
described below.
|
||||
|
||||
Optional property:
|
||||
- link : Should be a list of phandles to another switch's DSA port.
|
||||
This property is only used when switches are being
|
||||
chained/cascaded together. This port is used as outgoing port
|
||||
towards the phandle port, which can be more than one hop away.
|
||||
|
||||
- phy-handle : Phandle to a PHY on an external MDIO bus, not the
|
||||
switch internal one. See
|
||||
Documentation/devicetree/bindings/net/ethernet.txt
|
||||
for details.
|
||||
|
||||
- phy-mode : String representing the connection to the designated
|
||||
PHY node specified by the 'phy-handle' property. See
|
||||
Documentation/devicetree/bindings/net/ethernet.txt
|
||||
for details.
|
||||
|
||||
- mii-bus : Should be a phandle to a valid MDIO bus device node.
|
||||
This mii-bus will be used in preference to the
|
||||
global dsa,mii-bus defined above, for this switch.
|
||||
|
||||
Optional subnodes:
|
||||
- fixed-link : Fixed-link subnode describing a link to a non-MDIO
|
||||
managed entity. See
|
||||
Documentation/devicetree/bindings/net/fixed-link.txt
|
||||
for details.
|
||||
|
||||
Example:
|
||||
|
||||
dsa@0 {
|
||||
compatible = "marvell,dsa";
|
||||
#address-cells = <2>;
|
||||
#size-cells = <0>;
|
||||
|
||||
interrupts = <10>;
|
||||
dsa,ethernet = <ðernet0>;
|
||||
dsa,mii-bus = <&mii_bus0>;
|
||||
|
||||
switch@0 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
reg = <16 0>; /* MDIO address 16, switch 0 in tree */
|
||||
|
||||
port@0 {
|
||||
reg = <0>;
|
||||
label = "lan1";
|
||||
phy-handle = <&phy0>;
|
||||
};
|
||||
|
||||
port@1 {
|
||||
reg = <1>;
|
||||
label = "lan2";
|
||||
};
|
||||
|
||||
port@5 {
|
||||
reg = <5>;
|
||||
label = "cpu";
|
||||
};
|
||||
|
||||
switch0port6: port@6 {
|
||||
reg = <6>;
|
||||
label = "dsa";
|
||||
link = <&switch1port0
|
||||
&switch2port0>;
|
||||
};
|
||||
};
|
||||
|
||||
switch@1 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
reg = <17 1>; /* MDIO address 17, switch 1 in tree */
|
||||
mii-bus = <&mii_bus1>;
|
||||
reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
|
||||
|
||||
switch1port0: port@0 {
|
||||
reg = <0>;
|
||||
label = "dsa";
|
||||
link = <&switch0port6>;
|
||||
};
|
||||
switch1port1: port@1 {
|
||||
reg = <1>;
|
||||
label = "dsa";
|
||||
link = <&switch2port1>;
|
||||
};
|
||||
};
|
||||
|
||||
switch@2 {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
reg = <18 2>; /* MDIO address 18, switch 2 in tree */
|
||||
mii-bus = <&mii_bus1>;
|
||||
|
||||
switch2port0: port@0 {
|
||||
reg = <0>;
|
||||
label = "dsa";
|
||||
link = <&switch1port1
|
||||
&switch0port6>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
156
Documentation/devicetree/bindings/net/dsa/sja1105.txt
Normal file
156
Documentation/devicetree/bindings/net/dsa/sja1105.txt
Normal file
@ -0,0 +1,156 @@
|
||||
NXP SJA1105 switch driver
|
||||
=========================
|
||||
|
||||
Required properties:
|
||||
|
||||
- compatible:
|
||||
Must be one of:
|
||||
- "nxp,sja1105e"
|
||||
- "nxp,sja1105t"
|
||||
- "nxp,sja1105p"
|
||||
- "nxp,sja1105q"
|
||||
- "nxp,sja1105r"
|
||||
- "nxp,sja1105s"
|
||||
|
||||
Although the device ID could be detected at runtime, explicit bindings
|
||||
are required in order to be able to statically check their validity.
|
||||
For example, SGMII can only be specified on port 4 of R and S devices,
|
||||
and the non-SGMII devices, while pin-compatible, are not equal in terms
|
||||
of support for RGMII internal delays (supported on P/Q/R/S, but not on
|
||||
E/T).
|
||||
|
||||
Optional properties:
|
||||
|
||||
- sja1105,role-mac:
|
||||
- sja1105,role-phy:
|
||||
Boolean properties that can be assigned under each port node. By
|
||||
default (unless otherwise specified) a port is configured as MAC if it
|
||||
is driving a PHY (phy-handle is present) or as PHY if it is PHY-less
|
||||
(fixed-link specified, presumably because it is connected to a MAC).
|
||||
The effect of this property (in either its implicit or explicit form)
|
||||
is:
|
||||
- In the case of MII or RMII it specifies whether the SJA1105 port is a
|
||||
clock source or sink for this interface (not applicable for RGMII
|
||||
where there is a Tx and an Rx clock).
|
||||
- In the case of RGMII it affects the behavior regarding internal
|
||||
delays:
|
||||
1. If sja1105,role-mac is specified, and the phy-mode property is one
|
||||
of "rgmii-id", "rgmii-txid" or "rgmii-rxid", then the entity
|
||||
designated to apply the delay/clock skew necessary for RGMII
|
||||
is the PHY. The SJA1105 MAC does not apply any internal delays.
|
||||
2. If sja1105,role-phy is specified, and the phy-mode property is one
|
||||
of the above, the designated entity to apply the internal delays
|
||||
is the SJA1105 MAC (if hardware-supported). This is only supported
|
||||
by the second-generation (P/Q/R/S) hardware. On a first-generation
|
||||
E or T device, it is an error to specify an RGMII phy-mode other
|
||||
than "rgmii" for a port that is in fixed-link mode. In that case,
|
||||
the clock skew must either be added by the MAC at the other end of
|
||||
the fixed-link, or by PCB serpentine traces on the board.
|
||||
These properties are required, for example, in the case where SJA1105
|
||||
ports are at both ends of a MII/RMII PHY-less setup. One end would need
|
||||
to have sja1105,role-mac, while the other sja1105,role-phy.
|
||||
|
||||
See Documentation/devicetree/bindings/net/dsa/dsa.txt for the list of standard
|
||||
DSA required and optional properties.
|
||||
|
||||
Other observations
|
||||
------------------
|
||||
|
||||
The SJA1105 SPI interface requires a CS-to-CLK time (t2 in UM10944) of at least
|
||||
one half of t_CLK. At an SPI frequency of 1MHz, this means a minimum
|
||||
cs_sck_delay of 500ns. Ensuring that this SPI timing requirement is observed
|
||||
depends on the SPI bus master driver.
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
Ethernet switch connected via SPI to the host, CPU port wired to enet2:
|
||||
|
||||
arch/arm/boot/dts/ls1021a-tsn.dts:
|
||||
|
||||
/* SPI controller of the LS1021 */
|
||||
&dspi0 {
|
||||
sja1105@1 {
|
||||
reg = <0x1>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
compatible = "nxp,sja1105t";
|
||||
spi-max-frequency = <4000000>;
|
||||
fsl,spi-cs-sck-delay = <1000>;
|
||||
fsl,spi-sck-cs-delay = <1000>;
|
||||
ports {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
port@0 {
|
||||
/* ETH5 written on chassis */
|
||||
label = "swp5";
|
||||
phy-handle = <&rgmii_phy6>;
|
||||
phy-mode = "rgmii-id";
|
||||
reg = <0>;
|
||||
/* Implicit "sja1105,role-mac;" */
|
||||
};
|
||||
port@1 {
|
||||
/* ETH2 written on chassis */
|
||||
label = "swp2";
|
||||
phy-handle = <&rgmii_phy3>;
|
||||
phy-mode = "rgmii-id";
|
||||
reg = <1>;
|
||||
/* Implicit "sja1105,role-mac;" */
|
||||
};
|
||||
port@2 {
|
||||
/* ETH3 written on chassis */
|
||||
label = "swp3";
|
||||
phy-handle = <&rgmii_phy4>;
|
||||
phy-mode = "rgmii-id";
|
||||
reg = <2>;
|
||||
/* Implicit "sja1105,role-mac;" */
|
||||
};
|
||||
port@3 {
|
||||
/* ETH4 written on chassis */
|
||||
phy-handle = <&rgmii_phy5>;
|
||||
label = "swp4";
|
||||
phy-mode = "rgmii-id";
|
||||
reg = <3>;
|
||||
/* Implicit "sja1105,role-mac;" */
|
||||
};
|
||||
port@4 {
|
||||
/* Internal port connected to eth2 */
|
||||
ethernet = <&enet2>;
|
||||
phy-mode = "rgmii";
|
||||
reg = <4>;
|
||||
/* Implicit "sja1105,role-phy;" */
|
||||
fixed-link {
|
||||
speed = <1000>;
|
||||
full-duplex;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
/* MDIO controller of the LS1021 */
|
||||
&mdio0 {
|
||||
/* BCM5464 */
|
||||
rgmii_phy3: ethernet-phy@3 {
|
||||
reg = <0x3>;
|
||||
};
|
||||
rgmii_phy4: ethernet-phy@4 {
|
||||
reg = <0x4>;
|
||||
};
|
||||
rgmii_phy5: ethernet-phy@5 {
|
||||
reg = <0x5>;
|
||||
};
|
||||
rgmii_phy6: ethernet-phy@6 {
|
||||
reg = <0x6>;
|
||||
};
|
||||
};
|
||||
|
||||
/* Ethernet master port of the LS1021 */
|
||||
&enet2 {
|
||||
phy-connection-type = "rgmii";
|
||||
status = "ok";
|
||||
fixed-link {
|
||||
speed = <1000>;
|
||||
full-duplex;
|
||||
};
|
||||
};
|
@ -4,12 +4,14 @@ NOTE: All 'phy*' properties documented below are Ethernet specific. For the
|
||||
generic PHY 'phys' property, see
|
||||
Documentation/devicetree/bindings/phy/phy-bindings.txt.
|
||||
|
||||
- local-mac-address: array of 6 bytes, specifies the MAC address that was
|
||||
assigned to the network device;
|
||||
- mac-address: array of 6 bytes, specifies the MAC address that was last used by
|
||||
the boot program; should be used in cases where the MAC address assigned to
|
||||
the device by the boot program is different from the "local-mac-address"
|
||||
property;
|
||||
- local-mac-address: array of 6 bytes, specifies the MAC address that was
|
||||
assigned to the network device;
|
||||
- nvmem-cells: phandle, reference to an nvmem node for the MAC address
|
||||
- nvmem-cell-names: string, should be "mac-address" if nvmem is to be used
|
||||
- max-speed: number, specifies maximum speed in Mbit/s supported by the device;
|
||||
- max-frame-size: number, maximum transfer unit (IEEE defined MTU), rather than
|
||||
the maximum frame size (there's contradiction in the Devicetree
|
||||
@ -36,7 +38,7 @@ Documentation/devicetree/bindings/phy/phy-bindings.txt.
|
||||
* "smii"
|
||||
* "xgmii"
|
||||
* "trgmii"
|
||||
* "2000base-x",
|
||||
* "1000base-x",
|
||||
* "2500base-x",
|
||||
* "rxaui"
|
||||
* "xaui"
|
||||
|
@ -14,7 +14,6 @@ Required properties:
|
||||
the PHY reset signal(optional).
|
||||
- reset-names: should contain the reset signal name "mac"(required)
|
||||
and "phy"(optional).
|
||||
- mac-address: see ethernet.txt [1].
|
||||
- phy-mode: see ethernet.txt [1].
|
||||
- phy-handle: see ethernet.txt [1].
|
||||
- hisilicon,phy-reset-delays-us: triplet of delays if PHY reset signal given.
|
||||
@ -22,6 +21,9 @@ Required properties:
|
||||
The 2nd cell is reset pulse in micro seconds.
|
||||
The 3rd cell is reset post-delay in micro seconds.
|
||||
|
||||
The MAC address will be determined using the optional properties
|
||||
defined in ethernet.txt[1].
|
||||
|
||||
[1] Documentation/devicetree/bindings/net/ethernet.txt
|
||||
|
||||
Example:
|
||||
|
@ -18,7 +18,6 @@ Required properties:
|
||||
- #size-cells: must be <0>.
|
||||
- phy-mode: see ethernet.txt [1].
|
||||
- phy-handle: see ethernet.txt [1].
|
||||
- mac-address: see ethernet.txt [1].
|
||||
- clocks: clock phandle and specifier pair.
|
||||
- clock-names: contain the clock name "mac_core"(required) and "mac_ifc"(optional).
|
||||
- resets: should contain the phandle to the MAC core reset signal(optional),
|
||||
@ -31,6 +30,9 @@ Required properties:
|
||||
The 2nd cell is reset pulse in micro seconds.
|
||||
The 3rd cell is reset post-delay in micro seconds.
|
||||
|
||||
The MAC address will be determined using the properties defined in
|
||||
ethernet.txt[1].
|
||||
|
||||
- PHY subnode: inherits from phy binding [2]
|
||||
|
||||
[1] Documentation/devicetree/bindings/net/ethernet.txt
|
||||
|
@ -135,14 +135,14 @@ Optional properties:
|
||||
are swapped. The netcp driver will swap the two DWORDs
|
||||
back to the proper order when this property is set to 2
|
||||
when it obtains the mac address from efuse.
|
||||
- local-mac-address: the driver is designed to use the of_get_mac_address api
|
||||
only if efuse-mac is 0. When efuse-mac is 0, the MAC
|
||||
address is obtained from local-mac-address. If this
|
||||
attribute is not present, then the driver will use a
|
||||
random MAC address.
|
||||
- "netcp-device label": phandle to the device specification for each of NetCP
|
||||
sub-module attached to this interface.
|
||||
|
||||
The MAC address will be determined using the optional properties defined in
|
||||
ethernet.txt, as provided by the of_get_mac_address API and only if efuse-mac
|
||||
is set to 0. If any of the optional MAC address properties are not present,
|
||||
then the driver will use random MAC address.
|
||||
|
||||
Example binding:
|
||||
|
||||
netcp: netcp@2000000 {
|
||||
|
@ -26,9 +26,8 @@ Required properties:
|
||||
Optional elements: 'tsu_clk'
|
||||
- clocks: Phandles to input clocks.
|
||||
|
||||
Optional properties:
|
||||
- nvmem-cells: phandle, reference to an nvmem node for the MAC address
|
||||
- nvmem-cell-names: string, should be "mac-address" if nvmem is to be used
|
||||
The MAC address will be determined using the optional properties
|
||||
defined in ethernet.txt.
|
||||
|
||||
Optional properties for PHY child node:
|
||||
- reset-gpios : Should specify the gpio for phy reset
|
||||
|
@ -11,7 +11,9 @@ Optional properties:
|
||||
- #address-cells: must be 1 when using sub-nodes.
|
||||
- #size-cells: must be 0 when using sub-nodes.
|
||||
- phy-handle: see ethernet.txt file in the same directory.
|
||||
- local-mac-address: see ethernet.txt file in the same directory.
|
||||
|
||||
The MAC address will be determined using the optional properties
|
||||
defined in ethernet.txt.
|
||||
|
||||
Sub-nodes:
|
||||
Each PHY can be represented as a sub-node. This is not mandatory.
|
||||
|
@ -0,0 +1,48 @@
|
||||
Properties for the MDIO bus multiplexer/glue of Amlogic G12a SoC family.
|
||||
|
||||
This is a special case of a MDIO bus multiplexer. It allows to choose between
|
||||
the internal mdio bus leading to the embedded 10/100 PHY or the external
|
||||
MDIO bus.
|
||||
|
||||
Required properties in addition to the generic multiplexer properties:
|
||||
- compatible : amlogic,g12a-mdio-mux
|
||||
- reg: physical address and length of the multiplexer/glue registers
|
||||
- clocks: list of clock phandle, one for each entry clock-names.
|
||||
- clock-names: should contain the following:
|
||||
* "pclk" : peripheral clock.
|
||||
* "clkin0" : platform crytal
|
||||
* "clkin1" : SoC 50MHz MPLL
|
||||
|
||||
Example :
|
||||
|
||||
mdio_mux: mdio-multiplexer@4c000 {
|
||||
compatible = "amlogic,g12a-mdio-mux";
|
||||
reg = <0x0 0x4c000 0x0 0xa4>;
|
||||
clocks = <&clkc CLKID_ETH_PHY>,
|
||||
<&xtal>,
|
||||
<&clkc CLKID_MPLL_5OM>;
|
||||
clock-names = "pclk", "clkin0", "clkin1";
|
||||
mdio-parent-bus = <&mdio0>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
ext_mdio: mdio@0 {
|
||||
reg = <0>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
};
|
||||
|
||||
int_mdio: mdio@1 {
|
||||
reg = <1>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
internal_ephy: ethernet-phy@8 {
|
||||
compatible = "ethernet-phy-id0180.3301",
|
||||
"ethernet-phy-ieee802.3-c22";
|
||||
interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
|
||||
reg = <8>;
|
||||
max-speed = <100>;
|
||||
};
|
||||
};
|
||||
};
|
@ -21,8 +21,9 @@ Optional properties:
|
||||
- spi-max-frequency: Maximum frequency of the SPI bus when accessing the ENC28J60.
|
||||
According to the ENC28J80 datasheet, the chip allows a maximum of 20 MHz, however,
|
||||
board designs may need to limit this value.
|
||||
- local-mac-address: See ethernet.txt in the same directory.
|
||||
|
||||
The MAC address will be determined using the optional properties
|
||||
defined in ethernet.txt.
|
||||
|
||||
Example (for NXP i.MX28 with pin control stuff for GPIO irq):
|
||||
|
||||
|
@ -7,9 +7,8 @@ The Device Tree properties, if present, override the OTP and EEPROM.
|
||||
Required properties:
|
||||
- compatible: Should be one of "usb424,7800", "usb424,7801" or "usb424,7850".
|
||||
|
||||
Optional properties:
|
||||
- local-mac-address: see ethernet.txt
|
||||
- mac-address: see ethernet.txt
|
||||
The MAC address will be determined using the optional properties
|
||||
defined in ethernet.txt.
|
||||
|
||||
Optional properties of the embedded PHY:
|
||||
- microchip,led-modes: a 0..4 element vector, with each element configuring
|
||||
|
@ -51,6 +51,10 @@ Optional Properties:
|
||||
to ensure the integrated PHY is used. The absence of this property indicates
|
||||
the muxers should be configured so that the external PHY is used.
|
||||
|
||||
- resets: The reset-controller phandle and specifier for the PHY reset signal.
|
||||
|
||||
- reset-names: Must be "phy" for the PHY reset signal.
|
||||
|
||||
- reset-gpios: The GPIO phandle and specifier for the PHY reset signal.
|
||||
|
||||
- reset-assert-us: Delay after the reset was asserted in microseconds.
|
||||
@ -67,6 +71,8 @@ ethernet-phy@0 {
|
||||
interrupts = <35 IRQ_TYPE_EDGE_RISING>;
|
||||
reg = <0>;
|
||||
|
||||
resets = <&rst 8>;
|
||||
reset-names = "phy";
|
||||
reset-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
|
||||
reset-assert-us = <1000>;
|
||||
reset-deassert-us = <2000>;
|
||||
|
@ -23,7 +23,6 @@ Optional properties:
|
||||
Numbers smaller than 1000000 or greater than 16000000
|
||||
are invalid. Missing the property will set the SPI
|
||||
frequency to 8000000 Hertz.
|
||||
- local-mac-address : see ./ethernet.txt
|
||||
- qca,legacy-mode : Set the SPI data transfer of the QCA7000 to legacy mode.
|
||||
In this mode the SPI master must toggle the chip select
|
||||
between each data word. In burst mode these gaps aren't
|
||||
@ -31,6 +30,9 @@ Optional properties:
|
||||
the QCA7000 is setup via GPIO pin strapping. If the
|
||||
property is missing the driver defaults to burst mode.
|
||||
|
||||
The MAC address will be determined using the optional properties
|
||||
defined in ethernet.txt.
|
||||
|
||||
SPI Example:
|
||||
|
||||
/* Freescale i.MX28 SPI master*/
|
||||
|
@ -11,20 +11,21 @@ Required properties:
|
||||
- compatible: should contain one of the following:
|
||||
* "qcom,qca6174-bt"
|
||||
* "qcom,wcn3990-bt"
|
||||
* "qcom,wcn3998-bt"
|
||||
|
||||
Optional properties for compatible string qcom,qca6174-bt:
|
||||
|
||||
- enable-gpios: gpio specifier used to enable chip
|
||||
- clocks: clock provided to the controller (SUSCLK_32KHZ)
|
||||
|
||||
Required properties for compatible string qcom,wcn3990-bt:
|
||||
Required properties for compatible string qcom,wcn399x-bt:
|
||||
|
||||
- vddio-supply: VDD_IO supply regulator handle.
|
||||
- vddxo-supply: VDD_XO supply regulator handle.
|
||||
- vddrf-supply: VDD_RF supply regulator handle.
|
||||
- vddch0-supply: VDD_CH0 supply regulator handle.
|
||||
|
||||
Optional properties for compatible string qcom,wcn3990-bt:
|
||||
Optional properties for compatible string qcom,wcn399x-bt:
|
||||
|
||||
- max-speed: see Documentation/devicetree/bindings/serial/slave-device.txt
|
||||
|
||||
|
@ -21,10 +21,12 @@ Required properties:
|
||||
range.
|
||||
|
||||
Optional properties:
|
||||
- mac-address: 6 bytes, mac address
|
||||
- max-frame-size: Maximum Transfer Unit (IEEE defined MTU), rather
|
||||
than the maximum frame size.
|
||||
|
||||
The MAC address will be determined using the optional properties
|
||||
defined in ethernet.txt.
|
||||
|
||||
Example:
|
||||
|
||||
aliases {
|
||||
|
@ -103,8 +103,6 @@ Required properties:
|
||||
|
||||
Optional properties:
|
||||
- dma-coherent: Present if dma operations are coherent
|
||||
- mac-address: See ethernet.txt in the same directory
|
||||
- local-mac-address: See ethernet.txt in the same directory
|
||||
- phy-reset-gpios: Phandle and specifier for any GPIO used to reset the PHY.
|
||||
See ../gpio/gpio.txt.
|
||||
- snps,en-lpi: If present it enables use of the AXI low-power interface
|
||||
@ -133,6 +131,9 @@ Optional properties:
|
||||
- device_type: Must be "ethernet-phy".
|
||||
- fixed-mode device tree subnode: see fixed-link.txt in the same directory
|
||||
|
||||
The MAC address will be determined using the optional properties
|
||||
defined in ethernet.txt.
|
||||
|
||||
Examples:
|
||||
ethernet2@40010000 {
|
||||
clock-names = "phy_ref_clk", "apb_pclk";
|
||||
|
@ -31,8 +31,8 @@ Required properties:
|
||||
- socionext,syscon-phy-mode: A phandle to syscon with one argument
|
||||
that configures phy mode. The argument is the ID of MAC instance.
|
||||
|
||||
Optional properties:
|
||||
- local-mac-address: See ethernet.txt in the same directory.
|
||||
The MAC address will be determined using the optional properties
|
||||
defined in ethernet.txt.
|
||||
|
||||
Required subnode:
|
||||
- mdio: A container for child nodes representing phy nodes.
|
||||
|
@ -26,11 +26,12 @@ Required properties:
|
||||
Optional properties: (See ethernet.txt file in the same directory)
|
||||
- dma-coherent: Boolean property, must only be present if memory
|
||||
accesses performed by the device are cache coherent.
|
||||
- local-mac-address: See ethernet.txt in the same directory.
|
||||
- mac-address: See ethernet.txt in the same directory.
|
||||
- max-speed: See ethernet.txt in the same directory.
|
||||
- max-frame-size: See ethernet.txt in the same directory.
|
||||
|
||||
The MAC address will be determined using the optional properties
|
||||
defined in ethernet.txt.
|
||||
|
||||
Example:
|
||||
eth0: ethernet@522d0000 {
|
||||
compatible = "socionext,synquacer-netsec";
|
||||
|
@ -13,11 +13,12 @@ properties:
|
||||
|
||||
Optional properties:
|
||||
|
||||
- mac-address: See ethernet.txt in the parent directory
|
||||
- local-mac-address: See ethernet.txt in the parent directory
|
||||
- ieee80211-freq-limit: See ieee80211.txt
|
||||
- mediatek,mtd-eeprom: Specify a MTD partition + offset containing EEPROM data
|
||||
|
||||
The driver is using of_get_mac_address API, so the MAC address can be as well
|
||||
be set with corresponding optional properties defined in net/ethernet.txt.
|
||||
|
||||
Optional nodes:
|
||||
- led: Properties for a connected LED
|
||||
Optional properties:
|
||||
|
@ -34,9 +34,9 @@ Optional properties:
|
||||
ath9k wireless chip (in this case the calibration /
|
||||
EEPROM data will be loaded from userspace using the
|
||||
kernel firmware loader).
|
||||
- mac-address: See ethernet.txt in the parent directory
|
||||
- local-mac-address: See ethernet.txt in the parent directory
|
||||
|
||||
The MAC address will be determined using the optional properties defined in
|
||||
net/ethernet.txt.
|
||||
|
||||
In this example, the node is defined as child node of the PCI controller:
|
||||
&pci0 {
|
||||
|
@ -27,24 +27,8 @@ Load the batman-adv module into your kernel::
|
||||
$ insmod batman-adv.ko
|
||||
|
||||
The module is now waiting for activation. You must add some interfaces on which
|
||||
batman can operate. After loading the module batman advanced will scan your
|
||||
systems interfaces to search for compatible interfaces. Once found, it will
|
||||
create subfolders in the ``/sys`` directories of each supported interface,
|
||||
e.g.::
|
||||
|
||||
$ ls /sys/class/net/eth0/batman_adv/
|
||||
elp_interval iface_status mesh_iface throughput_override
|
||||
|
||||
If an interface does not have the ``batman_adv`` subfolder, it probably is not
|
||||
supported. Not supported interfaces are: loopback, non-ethernet and batman's
|
||||
own interfaces.
|
||||
|
||||
Note: After the module was loaded it will continuously watch for new
|
||||
interfaces to verify the compatibility. There is no need to reload the module
|
||||
if you plug your USB wifi adapter into your machine after batman advanced was
|
||||
initially loaded.
|
||||
|
||||
The batman-adv soft-interface can be created using the iproute2 tool ``ip``::
|
||||
batman-adv can operate. The batman-adv soft-interface can be created using the
|
||||
iproute2 tool ``ip``::
|
||||
|
||||
$ ip link add name bat0 type batadv
|
||||
|
||||
@ -52,57 +36,46 @@ To activate a given interface simply attach it to the ``bat0`` interface::
|
||||
|
||||
$ ip link set dev eth0 master bat0
|
||||
|
||||
Repeat this step for all interfaces you wish to add. Now batman starts
|
||||
Repeat this step for all interfaces you wish to add. Now batman-adv starts
|
||||
using/broadcasting on this/these interface(s).
|
||||
|
||||
By reading the "iface_status" file you can check its status::
|
||||
|
||||
$ cat /sys/class/net/eth0/batman_adv/iface_status
|
||||
active
|
||||
|
||||
To deactivate an interface you have to detach it from the "bat0" interface::
|
||||
|
||||
$ ip link set dev eth0 nomaster
|
||||
|
||||
The same can also be done using the batctl interface subcommand::
|
||||
|
||||
All mesh wide settings can be found in batman's own interface folder::
|
||||
batctl -m bat0 interface create
|
||||
batctl -m bat0 interface add -M eth0
|
||||
|
||||
$ ls /sys/class/net/bat0/mesh/
|
||||
aggregated_ogms fragmentation isolation_mark routing_algo
|
||||
ap_isolation gw_bandwidth log_level vlan0
|
||||
bonding gw_mode multicast_mode
|
||||
bridge_loop_avoidance gw_sel_class network_coding
|
||||
distributed_arp_table hop_penalty orig_interval
|
||||
To detach eth0 and destroy bat0::
|
||||
|
||||
There is a special folder for debugging information::
|
||||
batctl -m bat0 interface del -M eth0
|
||||
batctl -m bat0 interface destroy
|
||||
|
||||
$ ls /sys/kernel/debug/batman_adv/bat0/
|
||||
bla_backbone_table log neighbors transtable_local
|
||||
bla_claim_table mcast_flags originators
|
||||
dat_cache nc socket
|
||||
gateways nc_nodes transtable_global
|
||||
There are additional settings for each batadv mesh interface, vlan and hardif
|
||||
which can be modified using batctl. Detailed information about this can be found
|
||||
in its manual.
|
||||
|
||||
Some of the files contain all sort of status information regarding the mesh
|
||||
network. For example, you can view the table of originators (mesh
|
||||
participants) with::
|
||||
For instance, you can check the current originator interval (value
|
||||
in milliseconds which determines how often batman-adv sends its broadcast
|
||||
packets)::
|
||||
|
||||
$ cat /sys/kernel/debug/batman_adv/bat0/originators
|
||||
|
||||
Other files allow to change batman's behaviour to better fit your requirements.
|
||||
For instance, you can check the current originator interval (value in
|
||||
milliseconds which determines how often batman sends its broadcast packets)::
|
||||
|
||||
$ cat /sys/class/net/bat0/mesh/orig_interval
|
||||
$ batctl -M bat0 orig_interval
|
||||
1000
|
||||
|
||||
and also change its value::
|
||||
|
||||
$ echo 3000 > /sys/class/net/bat0/mesh/orig_interval
|
||||
$ batctl -M bat0 orig_interval 3000
|
||||
|
||||
In very mobile scenarios, you might want to adjust the originator interval to a
|
||||
lower value. This will make the mesh more responsive to topology changes, but
|
||||
will also increase the overhead.
|
||||
|
||||
Information about the current state can be accessed via the batadv generic
|
||||
netlink family. batctl provides human readable version via its debug tables
|
||||
subcommands.
|
||||
|
||||
|
||||
Usage
|
||||
=====
|
||||
@ -147,43 +120,16 @@ batman-adv module. When building batman-adv as part of kernel, use "make
|
||||
menuconfig" and enable the option ``B.A.T.M.A.N. debugging``
|
||||
(``CONFIG_BATMAN_ADV_DEBUG=y``).
|
||||
|
||||
Those additional debug messages can be accessed using a special file in
|
||||
debugfs::
|
||||
Those additional debug messages can be accessed using the perf infrastructure::
|
||||
|
||||
$ cat /sys/kernel/debug/batman_adv/bat0/log
|
||||
$ trace-cmd stream -e batadv:batadv_dbg
|
||||
|
||||
The additional debug output is by default disabled. It can be enabled during
|
||||
run time. Following log_levels are defined:
|
||||
run time::
|
||||
|
||||
.. flat-table::
|
||||
$ batctl -m bat0 loglevel routes tt
|
||||
|
||||
* - 0
|
||||
- All debug output disabled
|
||||
* - 1
|
||||
- Enable messages related to routing / flooding / broadcasting
|
||||
* - 2
|
||||
- Enable messages related to route added / changed / deleted
|
||||
* - 4
|
||||
- Enable messages related to translation table operations
|
||||
* - 8
|
||||
- Enable messages related to bridge loop avoidance
|
||||
* - 16
|
||||
- Enable messages related to DAT, ARP snooping and parsing
|
||||
* - 32
|
||||
- Enable messages related to network coding
|
||||
* - 64
|
||||
- Enable messages related to multicast
|
||||
* - 128
|
||||
- Enable messages related to throughput meter
|
||||
* - 255
|
||||
- Enable all messages
|
||||
|
||||
The debug output can be changed at runtime using the file
|
||||
``/sys/class/net/bat0/mesh/log_level``. e.g.::
|
||||
|
||||
$ echo 6 > /sys/class/net/bat0/mesh/log_level
|
||||
|
||||
will enable debug messages for when routes change.
|
||||
will enable debug messages for when routes and translation table entries change.
|
||||
|
||||
Counters for different types of packets entering and leaving the batman-adv
|
||||
module are available through ethtool::
|
||||
|
@ -41,3 +41,8 @@ fw.ncsi
|
||||
|
||||
Version of the software responsible for supporting/handling the
|
||||
Network Controller Sideband Interface.
|
||||
|
||||
fw.psid
|
||||
=======
|
||||
|
||||
Unique identifier of the firmware parameter set.
|
||||
|
@ -1,3 +1,4 @@
|
||||
=============================================
|
||||
Broadcom Starfighter 2 Ethernet switch driver
|
||||
=============================================
|
||||
|
||||
@ -25,27 +26,27 @@ are connected at a lower speed.
|
||||
The switch hardware block is typically interfaced using MMIO accesses and
|
||||
contains a bunch of sub-blocks/registers:
|
||||
|
||||
* SWITCH_CORE: common switch registers
|
||||
* SWITCH_REG: external interfaces switch register
|
||||
* SWITCH_MDIO: external MDIO bus controller (there is another one in SWITCH_CORE,
|
||||
- ``SWITCH_CORE``: common switch registers
|
||||
- ``SWITCH_REG``: external interfaces switch register
|
||||
- ``SWITCH_MDIO``: external MDIO bus controller (there is another one in SWITCH_CORE,
|
||||
which is used for indirect PHY accesses)
|
||||
* SWITCH_INDIR_RW: 64-bits wide register helper block
|
||||
* SWITCH_INTRL2_0/1: Level-2 interrupt controllers
|
||||
* SWITCH_ACB: Admission control block
|
||||
* SWITCH_FCB: Fail-over control block
|
||||
- ``SWITCH_INDIR_RW``: 64-bits wide register helper block
|
||||
- ``SWITCH_INTRL2_0/1``: Level-2 interrupt controllers
|
||||
- ``SWITCH_ACB``: Admission control block
|
||||
- ``SWITCH_FCB``: Fail-over control block
|
||||
|
||||
Implementation details
|
||||
======================
|
||||
|
||||
The driver is located in drivers/net/dsa/bcm_sf2.c and is implemented as a DSA
|
||||
driver; see Documentation/networking/dsa/dsa.txt for details on the subsystem
|
||||
The driver is located in ``drivers/net/dsa/bcm_sf2.c`` and is implemented as a DSA
|
||||
driver; see ``Documentation/networking/dsa/dsa.rst`` for details on the subsystem
|
||||
and what it provides.
|
||||
|
||||
The SF2 switch is configured to enable a Broadcom specific 4-bytes switch tag
|
||||
which gets inserted by the switch for every packet forwarded to the CPU
|
||||
interface, conversely, the CPU network interface should insert a similar tag for
|
||||
packets entering the CPU port. The tag format is described in
|
||||
net/dsa/tag_brcm.c.
|
||||
``net/dsa/tag_brcm.c``.
|
||||
|
||||
Overall, the SF2 driver is a fairly regular DSA driver; there are a few
|
||||
specifics covered below.
|
||||
@ -54,7 +55,7 @@ Device Tree probing
|
||||
-------------------
|
||||
|
||||
The DSA platform device driver is probed using a specific compatible string
|
||||
provided in net/dsa/dsa.c. The reason for that is because the DSA subsystem gets
|
||||
provided in ``net/dsa/dsa.c``. The reason for that is because the DSA subsystem gets
|
||||
registered as a platform device driver currently. DSA will provide the needed
|
||||
device_node pointers which are then accessible by the switch driver setup
|
||||
function to setup resources such as register ranges and interrupts. This
|
||||
@ -70,7 +71,7 @@ Broadcom switches connected to a SF2 require the use of the DSA slave MDIO bus
|
||||
in order to properly configure them. By default, the SF2 pseudo-PHY address, and
|
||||
an external switch pseudo-PHY address will both be snooping for incoming MDIO
|
||||
transactions, since they are at the same address (30), resulting in some kind of
|
||||
"double" programming. Using DSA, and setting ds->phys_mii_mask accordingly, we
|
||||
"double" programming. Using DSA, and setting ``ds->phys_mii_mask`` accordingly, we
|
||||
selectively divert reads and writes towards external Broadcom switches
|
||||
pseudo-PHY addresses. Newer revisions of the SF2 hardware have introduced a
|
||||
configurable pseudo-PHY address which circumvents the initial design limitation.
|
||||
@ -86,7 +87,7 @@ firmware gets reloaded. The SF2 driver relies on such events to properly set its
|
||||
MoCA interface carrier state and properly report this to the networking stack.
|
||||
|
||||
The MoCA interfaces are supported using the PHY library's fixed PHY/emulated PHY
|
||||
device and the switch driver registers a fixed_link_update callback for such
|
||||
device and the switch driver registers a ``fixed_link_update`` callback for such
|
||||
PHYs which reflects the link state obtained from the interrupt handler.
|
||||
|
||||
|
@ -1,10 +1,8 @@
|
||||
Distributed Switch Architecture
|
||||
===============================
|
||||
|
||||
Introduction
|
||||
============
|
||||
Architecture
|
||||
============
|
||||
|
||||
This document describes the Distributed Switch Architecture (DSA) subsystem
|
||||
This document describes the **Distributed Switch Architecture (DSA)** subsystem
|
||||
design principles, limitations, interactions with other subsystems, and how to
|
||||
develop drivers for this subsystem as well as a TODO for developers interested
|
||||
in joining the effort.
|
||||
@ -70,11 +68,11 @@ Switch tagging protocols
|
||||
DSA currently supports 5 different tagging protocols, and a tag-less mode as
|
||||
well. The different protocols are implemented in:
|
||||
|
||||
net/dsa/tag_trailer.c: Marvell's 4 trailer tag mode (legacy)
|
||||
net/dsa/tag_dsa.c: Marvell's original DSA tag
|
||||
net/dsa/tag_edsa.c: Marvell's enhanced DSA tag
|
||||
net/dsa/tag_brcm.c: Broadcom's 4 bytes tag
|
||||
net/dsa/tag_qca.c: Qualcomm's 2 bytes tag
|
||||
- ``net/dsa/tag_trailer.c``: Marvell's 4 trailer tag mode (legacy)
|
||||
- ``net/dsa/tag_dsa.c``: Marvell's original DSA tag
|
||||
- ``net/dsa/tag_edsa.c``: Marvell's enhanced DSA tag
|
||||
- ``net/dsa/tag_brcm.c``: Broadcom's 4 bytes tag
|
||||
- ``net/dsa/tag_qca.c``: Qualcomm's 2 bytes tag
|
||||
|
||||
The exact format of the tag protocol is vendor specific, but in general, they
|
||||
all contain something which:
|
||||
@ -89,7 +87,7 @@ Master network devices are regular, unmodified Linux network device drivers for
|
||||
the CPU/management Ethernet interface. Such a driver might occasionally need to
|
||||
know whether DSA is enabled (e.g.: to enable/disable specific offload features),
|
||||
but the DSA subsystem has been proven to work with industry standard drivers:
|
||||
e1000e, mv643xx_eth etc. without having to introduce modifications to these
|
||||
``e1000e,`` ``mv643xx_eth`` etc. without having to introduce modifications to these
|
||||
drivers. Such network devices are also often referred to as conduit network
|
||||
devices since they act as a pipe between the host processor and the hardware
|
||||
Ethernet switch.
|
||||
@ -100,40 +98,42 @@ Networking stack hooks
|
||||
When a master netdev is used with DSA, a small hook is placed in in the
|
||||
networking stack is in order to have the DSA subsystem process the Ethernet
|
||||
switch specific tagging protocol. DSA accomplishes this by registering a
|
||||
specific (and fake) Ethernet type (later becoming skb->protocol) with the
|
||||
networking stack, this is also known as a ptype or packet_type. A typical
|
||||
specific (and fake) Ethernet type (later becoming ``skb->protocol``) with the
|
||||
networking stack, this is also known as a ``ptype`` or ``packet_type``. A typical
|
||||
Ethernet Frame receive sequence looks like this:
|
||||
|
||||
Master network device (e.g.: e1000e):
|
||||
|
||||
Receive interrupt fires:
|
||||
- receive function is invoked
|
||||
- basic packet processing is done: getting length, status etc.
|
||||
- packet is prepared to be processed by the Ethernet layer by calling
|
||||
eth_type_trans
|
||||
1. Receive interrupt fires:
|
||||
|
||||
net/ethernet/eth.c:
|
||||
- receive function is invoked
|
||||
- basic packet processing is done: getting length, status etc.
|
||||
- packet is prepared to be processed by the Ethernet layer by calling
|
||||
``eth_type_trans``
|
||||
|
||||
eth_type_trans(skb, dev)
|
||||
if (dev->dsa_ptr != NULL)
|
||||
-> skb->protocol = ETH_P_XDSA
|
||||
2. net/ethernet/eth.c::
|
||||
|
||||
drivers/net/ethernet/*:
|
||||
eth_type_trans(skb, dev)
|
||||
if (dev->dsa_ptr != NULL)
|
||||
-> skb->protocol = ETH_P_XDSA
|
||||
|
||||
netif_receive_skb(skb)
|
||||
-> iterate over registered packet_type
|
||||
-> invoke handler for ETH_P_XDSA, calls dsa_switch_rcv()
|
||||
3. drivers/net/ethernet/\*::
|
||||
|
||||
net/dsa/dsa.c:
|
||||
-> dsa_switch_rcv()
|
||||
-> invoke switch tag specific protocol handler in
|
||||
net/dsa/tag_*.c
|
||||
netif_receive_skb(skb)
|
||||
-> iterate over registered packet_type
|
||||
-> invoke handler for ETH_P_XDSA, calls dsa_switch_rcv()
|
||||
|
||||
net/dsa/tag_*.c:
|
||||
-> inspect and strip switch tag protocol to determine originating port
|
||||
-> locate per-port network device
|
||||
-> invoke eth_type_trans() with the DSA slave network device
|
||||
-> invoked netif_receive_skb()
|
||||
4. net/dsa/dsa.c::
|
||||
|
||||
-> dsa_switch_rcv()
|
||||
-> invoke switch tag specific protocol handler in 'net/dsa/tag_*.c'
|
||||
|
||||
5. net/dsa/tag_*.c:
|
||||
|
||||
- inspect and strip switch tag protocol to determine originating port
|
||||
- locate per-port network device
|
||||
- invoke ``eth_type_trans()`` with the DSA slave network device
|
||||
- invoked ``netif_receive_skb()``
|
||||
|
||||
Past this point, the DSA slave network devices get delivered regular Ethernet
|
||||
frames that can be processed by the networking stack.
|
||||
@ -162,7 +162,7 @@ invoke a specific transmit routine which takes care of adding the relevant
|
||||
switch tag in the Ethernet frames.
|
||||
|
||||
These frames are then queued for transmission using the master network device
|
||||
ndo_start_xmit() function, since they contain the appropriate switch tag, the
|
||||
``ndo_start_xmit()`` function, since they contain the appropriate switch tag, the
|
||||
Ethernet switch will be able to process these incoming frames from the
|
||||
management interface and delivers these frames to the physical switch port.
|
||||
|
||||
@ -170,23 +170,25 @@ Graphical representation
|
||||
------------------------
|
||||
|
||||
Summarized, this is basically how DSA looks like from a network device
|
||||
perspective:
|
||||
perspective::
|
||||
|
||||
|
||||
|---------------------------
|
||||
| CPU network device (eth0)|
|
||||
----------------------------
|
||||
| <tag added by switch |
|
||||
| |
|
||||
| |
|
||||
| tag added by CPU> |
|
||||
|--------------------------------------------|
|
||||
| Switch driver |
|
||||
|--------------------------------------------|
|
||||
|| || ||
|
||||
|-------| |-------| |-------|
|
||||
| sw0p0 | | sw0p1 | | sw0p2 |
|
||||
|-------| |-------| |-------|
|
||||
|
||||
|
||||
|---------------------------
|
||||
| CPU network device (eth0)|
|
||||
----------------------------
|
||||
| <tag added by switch |
|
||||
| |
|
||||
| |
|
||||
| tag added by CPU> |
|
||||
|--------------------------------------------|
|
||||
| Switch driver |
|
||||
|--------------------------------------------|
|
||||
|| || ||
|
||||
|-------| |-------| |-------|
|
||||
| sw0p0 | | sw0p1 | | sw0p2 |
|
||||
|-------| |-------| |-------|
|
||||
|
||||
Slave MDIO bus
|
||||
--------------
|
||||
@ -207,31 +209,32 @@ PHYs, external PHYs, or even external switches.
|
||||
Data structures
|
||||
---------------
|
||||
|
||||
DSA data structures are defined in include/net/dsa.h as well as
|
||||
net/dsa/dsa_priv.h.
|
||||
DSA data structures are defined in ``include/net/dsa.h`` as well as
|
||||
``net/dsa/dsa_priv.h``:
|
||||
|
||||
dsa_chip_data: platform data configuration for a given switch device, this
|
||||
structure describes a switch device's parent device, its address, as well as
|
||||
various properties of its ports: names/labels, and finally a routing table
|
||||
indication (when cascading switches)
|
||||
- ``dsa_chip_data``: platform data configuration for a given switch device,
|
||||
this structure describes a switch device's parent device, its address, as
|
||||
well as various properties of its ports: names/labels, and finally a routing
|
||||
table indication (when cascading switches)
|
||||
|
||||
dsa_platform_data: platform device configuration data which can reference a
|
||||
collection of dsa_chip_data structure if multiples switches are cascaded, the
|
||||
master network device this switch tree is attached to needs to be referenced
|
||||
- ``dsa_platform_data``: platform device configuration data which can reference
|
||||
a collection of dsa_chip_data structure if multiples switches are cascaded,
|
||||
the master network device this switch tree is attached to needs to be
|
||||
referenced
|
||||
|
||||
dsa_switch_tree: structure assigned to the master network device under
|
||||
"dsa_ptr", this structure references a dsa_platform_data structure as well as
|
||||
the tagging protocol supported by the switch tree, and which receive/transmit
|
||||
function hooks should be invoked, information about the directly attached switch
|
||||
is also provided: CPU port. Finally, a collection of dsa_switch are referenced
|
||||
to address individual switches in the tree.
|
||||
- ``dsa_switch_tree``: structure assigned to the master network device under
|
||||
``dsa_ptr``, this structure references a dsa_platform_data structure as well as
|
||||
the tagging protocol supported by the switch tree, and which receive/transmit
|
||||
function hooks should be invoked, information about the directly attached
|
||||
switch is also provided: CPU port. Finally, a collection of dsa_switch are
|
||||
referenced to address individual switches in the tree.
|
||||
|
||||
dsa_switch: structure describing a switch device in the tree, referencing a
|
||||
dsa_switch_tree as a backpointer, slave network devices, master network device,
|
||||
and a reference to the backing dsa_switch_ops
|
||||
- ``dsa_switch``: structure describing a switch device in the tree, referencing
|
||||
a ``dsa_switch_tree`` as a backpointer, slave network devices, master network
|
||||
device, and a reference to the backing``dsa_switch_ops``
|
||||
|
||||
dsa_switch_ops: structure referencing function pointers, see below for a full
|
||||
description.
|
||||
- ``dsa_switch_ops``: structure referencing function pointers, see below for a
|
||||
full description.
|
||||
|
||||
Design limitations
|
||||
==================
|
||||
@ -240,7 +243,7 @@ Limits on the number of devices and ports
|
||||
-----------------------------------------
|
||||
|
||||
DSA currently limits the number of maximum switches within a tree to 4
|
||||
(DSA_MAX_SWITCHES), and the number of ports per switch to 12 (DSA_MAX_PORTS).
|
||||
(``DSA_MAX_SWITCHES``), and the number of ports per switch to 12 (``DSA_MAX_PORTS``).
|
||||
These limits could be extended to support larger configurations would this need
|
||||
arise.
|
||||
|
||||
@ -279,15 +282,15 @@ Interactions with other subsystems
|
||||
|
||||
DSA currently leverages the following subsystems:
|
||||
|
||||
- MDIO/PHY library: drivers/net/phy/phy.c, mdio_bus.c
|
||||
- Switchdev: net/switchdev/*
|
||||
- MDIO/PHY library: ``drivers/net/phy/phy.c``, ``mdio_bus.c``
|
||||
- Switchdev:``net/switchdev/*``
|
||||
- Device Tree for various of_* functions
|
||||
|
||||
MDIO/PHY library
|
||||
----------------
|
||||
|
||||
Slave network devices exposed by DSA may or may not be interfacing with PHY
|
||||
devices (struct phy_device as defined in include/linux/phy.h), but the DSA
|
||||
devices (``struct phy_device`` as defined in ``include/linux/phy.h)``, but the DSA
|
||||
subsystem deals with all possible combinations:
|
||||
|
||||
- internal PHY devices, built into the Ethernet switch hardware
|
||||
@ -296,16 +299,16 @@ subsystem deals with all possible combinations:
|
||||
- special, non-autonegotiated or non MDIO-managed PHY devices: SFPs, MoCA; a.k.a
|
||||
fixed PHYs
|
||||
|
||||
The PHY configuration is done by the dsa_slave_phy_setup() function and the
|
||||
The PHY configuration is done by the ``dsa_slave_phy_setup()`` function and the
|
||||
logic basically looks like this:
|
||||
|
||||
- if Device Tree is used, the PHY device is looked up using the standard
|
||||
"phy-handle" property, if found, this PHY device is created and registered
|
||||
using of_phy_connect()
|
||||
using ``of_phy_connect()``
|
||||
|
||||
- if Device Tree is used, and the PHY device is "fixed", that is, conforms to
|
||||
the definition of a non-MDIO managed PHY as defined in
|
||||
Documentation/devicetree/bindings/net/fixed-link.txt, the PHY is registered
|
||||
``Documentation/devicetree/bindings/net/fixed-link.txt``, the PHY is registered
|
||||
and connected transparently using the special fixed MDIO bus driver
|
||||
|
||||
- finally, if the PHY is built into the switch, as is very common with
|
||||
@ -331,8 +334,8 @@ Device Tree
|
||||
-----------
|
||||
|
||||
DSA features a standardized binding which is documented in
|
||||
Documentation/devicetree/bindings/net/dsa/dsa.txt. PHY/MDIO library helper
|
||||
functions such as of_get_phy_mode(), of_phy_connect() are also used to query
|
||||
``Documentation/devicetree/bindings/net/dsa/dsa.txt``. PHY/MDIO library helper
|
||||
functions such as ``of_get_phy_mode()``, ``of_phy_connect()`` are also used to query
|
||||
per-port PHY specific details: interface connection, MDIO bus location etc..
|
||||
|
||||
Driver development
|
||||
@ -341,8 +344,8 @@ Driver development
|
||||
DSA switch drivers need to implement a dsa_switch_ops structure which will
|
||||
contain the various members described below.
|
||||
|
||||
register_switch_driver() registers this dsa_switch_ops in its internal list
|
||||
of drivers to probe for. unregister_switch_driver() does the exact opposite.
|
||||
``register_switch_driver()`` registers this dsa_switch_ops in its internal list
|
||||
of drivers to probe for. ``unregister_switch_driver()`` does the exact opposite.
|
||||
|
||||
Unless requested differently by setting the priv_size member accordingly, DSA
|
||||
does not allocate any driver private context space.
|
||||
@ -350,17 +353,17 @@ does not allocate any driver private context space.
|
||||
Switch configuration
|
||||
--------------------
|
||||
|
||||
- tag_protocol: this is to indicate what kind of tagging protocol is supported,
|
||||
should be a valid value from the dsa_tag_protocol enum
|
||||
- ``tag_protocol``: this is to indicate what kind of tagging protocol is supported,
|
||||
should be a valid value from the ``dsa_tag_protocol`` enum
|
||||
|
||||
- probe: probe routine which will be invoked by the DSA platform device upon
|
||||
- ``probe``: probe routine which will be invoked by the DSA platform device upon
|
||||
registration to test for the presence/absence of a switch device. For MDIO
|
||||
devices, it is recommended to issue a read towards internal registers using
|
||||
the switch pseudo-PHY and return whether this is a supported device. For other
|
||||
buses, return a non-NULL string
|
||||
|
||||
- setup: setup function for the switch, this function is responsible for setting
|
||||
up the dsa_switch_ops private structure with all it needs: register maps,
|
||||
- ``setup``: setup function for the switch, this function is responsible for setting
|
||||
up the ``dsa_switch_ops`` private structure with all it needs: register maps,
|
||||
interrupts, mutexes, locks etc.. This function is also expected to properly
|
||||
configure the switch to separate all network interfaces from each other, that
|
||||
is, they should be isolated by the switch hardware itself, typically by creating
|
||||
@ -375,27 +378,27 @@ Switch configuration
|
||||
PHY devices and link management
|
||||
-------------------------------
|
||||
|
||||
- get_phy_flags: Some switches are interfaced to various kinds of Ethernet PHYs,
|
||||
- ``get_phy_flags``: Some switches are interfaced to various kinds of Ethernet PHYs,
|
||||
if the PHY library PHY driver needs to know about information it cannot obtain
|
||||
on its own (e.g.: coming from switch memory mapped registers), this function
|
||||
should return a 32-bits bitmask of "flags", that is private between the switch
|
||||
driver and the Ethernet PHY driver in drivers/net/phy/*.
|
||||
driver and the Ethernet PHY driver in ``drivers/net/phy/\*``.
|
||||
|
||||
- phy_read: Function invoked by the DSA slave MDIO bus when attempting to read
|
||||
- ``phy_read``: Function invoked by the DSA slave MDIO bus when attempting to read
|
||||
the switch port MDIO registers. If unavailable, return 0xffff for each read.
|
||||
For builtin switch Ethernet PHYs, this function should allow reading the link
|
||||
status, auto-negotiation results, link partner pages etc..
|
||||
|
||||
- phy_write: Function invoked by the DSA slave MDIO bus when attempting to write
|
||||
- ``phy_write``: Function invoked by the DSA slave MDIO bus when attempting to write
|
||||
to the switch port MDIO registers. If unavailable return a negative error
|
||||
code.
|
||||
|
||||
- adjust_link: Function invoked by the PHY library when a slave network device
|
||||
- ``adjust_link``: Function invoked by the PHY library when a slave network device
|
||||
is attached to a PHY device. This function is responsible for appropriately
|
||||
configuring the switch port link parameters: speed, duplex, pause based on
|
||||
what the phy_device is providing.
|
||||
what the ``phy_device`` is providing.
|
||||
|
||||
- fixed_link_update: Function invoked by the PHY library, and specifically by
|
||||
- ``fixed_link_update``: Function invoked by the PHY library, and specifically by
|
||||
the fixed PHY driver asking the switch driver for link parameters that could
|
||||
not be auto-negotiated, or obtained by reading the PHY registers through MDIO.
|
||||
This is particularly useful for specific kinds of hardware such as QSGMII,
|
||||
@ -405,87 +408,87 @@ PHY devices and link management
|
||||
Ethtool operations
|
||||
------------------
|
||||
|
||||
- get_strings: ethtool function used to query the driver's strings, will
|
||||
- ``get_strings``: ethtool function used to query the driver's strings, will
|
||||
typically return statistics strings, private flags strings etc.
|
||||
|
||||
- get_ethtool_stats: ethtool function used to query per-port statistics and
|
||||
- ``get_ethtool_stats``: ethtool function used to query per-port statistics and
|
||||
return their values. DSA overlays slave network devices general statistics:
|
||||
RX/TX counters from the network device, with switch driver specific statistics
|
||||
per port
|
||||
|
||||
- get_sset_count: ethtool function used to query the number of statistics items
|
||||
- ``get_sset_count``: ethtool function used to query the number of statistics items
|
||||
|
||||
- get_wol: ethtool function used to obtain Wake-on-LAN settings per-port, this
|
||||
- ``get_wol``: ethtool function used to obtain Wake-on-LAN settings per-port, this
|
||||
function may, for certain implementations also query the master network device
|
||||
Wake-on-LAN settings if this interface needs to participate in Wake-on-LAN
|
||||
|
||||
- set_wol: ethtool function used to configure Wake-on-LAN settings per-port,
|
||||
- ``set_wol``: ethtool function used to configure Wake-on-LAN settings per-port,
|
||||
direct counterpart to set_wol with similar restrictions
|
||||
|
||||
- set_eee: ethtool function which is used to configure a switch port EEE (Green
|
||||
- ``set_eee``: ethtool function which is used to configure a switch port EEE (Green
|
||||
Ethernet) settings, can optionally invoke the PHY library to enable EEE at the
|
||||
PHY level if relevant. This function should enable EEE at the switch port MAC
|
||||
controller and data-processing logic
|
||||
|
||||
- get_eee: ethtool function which is used to query a switch port EEE settings,
|
||||
- ``get_eee``: ethtool function which is used to query a switch port EEE settings,
|
||||
this function should return the EEE state of the switch port MAC controller
|
||||
and data-processing logic as well as query the PHY for its currently configured
|
||||
EEE settings
|
||||
|
||||
- get_eeprom_len: ethtool function returning for a given switch the EEPROM
|
||||
- ``get_eeprom_len``: ethtool function returning for a given switch the EEPROM
|
||||
length/size in bytes
|
||||
|
||||
- get_eeprom: ethtool function returning for a given switch the EEPROM contents
|
||||
- ``get_eeprom``: ethtool function returning for a given switch the EEPROM contents
|
||||
|
||||
- set_eeprom: ethtool function writing specified data to a given switch EEPROM
|
||||
- ``set_eeprom``: ethtool function writing specified data to a given switch EEPROM
|
||||
|
||||
- get_regs_len: ethtool function returning the register length for a given
|
||||
- ``get_regs_len``: ethtool function returning the register length for a given
|
||||
switch
|
||||
|
||||
- get_regs: ethtool function returning the Ethernet switch internal register
|
||||
- ``get_regs``: ethtool function returning the Ethernet switch internal register
|
||||
contents. This function might require user-land code in ethtool to
|
||||
pretty-print register values and registers
|
||||
|
||||
Power management
|
||||
----------------
|
||||
|
||||
- suspend: function invoked by the DSA platform device when the system goes to
|
||||
- ``suspend``: function invoked by the DSA platform device when the system goes to
|
||||
suspend, should quiesce all Ethernet switch activities, but keep ports
|
||||
participating in Wake-on-LAN active as well as additional wake-up logic if
|
||||
supported
|
||||
|
||||
- resume: function invoked by the DSA platform device when the system resumes,
|
||||
- ``resume``: function invoked by the DSA platform device when the system resumes,
|
||||
should resume all Ethernet switch activities and re-configure the switch to be
|
||||
in a fully active state
|
||||
|
||||
- port_enable: function invoked by the DSA slave network device ndo_open
|
||||
- ``port_enable``: function invoked by the DSA slave network device ndo_open
|
||||
function when a port is administratively brought up, this function should be
|
||||
fully enabling a given switch port. DSA takes care of marking the port with
|
||||
BR_STATE_BLOCKING if the port is a bridge member, or BR_STATE_FORWARDING if it
|
||||
``BR_STATE_BLOCKING`` if the port is a bridge member, or ``BR_STATE_FORWARDING`` if it
|
||||
was not, and propagating these changes down to the hardware
|
||||
|
||||
- port_disable: function invoked by the DSA slave network device ndo_close
|
||||
- ``port_disable``: function invoked by the DSA slave network device ndo_close
|
||||
function when a port is administratively brought down, this function should be
|
||||
fully disabling a given switch port. DSA takes care of marking the port with
|
||||
BR_STATE_DISABLED and propagating changes to the hardware if this port is
|
||||
``BR_STATE_DISABLED`` and propagating changes to the hardware if this port is
|
||||
disabled while being a bridge member
|
||||
|
||||
Bridge layer
|
||||
------------
|
||||
|
||||
- port_bridge_join: bridge layer function invoked when a given switch port is
|
||||
- ``port_bridge_join``: bridge layer function invoked when a given switch port is
|
||||
added to a bridge, this function should be doing the necessary at the switch
|
||||
level to permit the joining port from being added to the relevant logical
|
||||
domain for it to ingress/egress traffic with other members of the bridge.
|
||||
|
||||
- port_bridge_leave: bridge layer function invoked when a given switch port is
|
||||
- ``port_bridge_leave``: bridge layer function invoked when a given switch port is
|
||||
removed from a bridge, this function should be doing the necessary at the
|
||||
switch level to deny the leaving port from ingress/egress traffic from the
|
||||
remaining bridge members. When the port leaves the bridge, it should be aged
|
||||
out at the switch hardware for the switch to (re) learn MAC addresses behind
|
||||
this port.
|
||||
|
||||
- port_stp_state_set: bridge layer function invoked when a given switch port STP
|
||||
- ``port_stp_state_set``: bridge layer function invoked when a given switch port STP
|
||||
state is computed by the bridge layer and should be propagated to switch
|
||||
hardware to forward/block/learn traffic. The switch driver is responsible for
|
||||
computing a STP state change based on current and asked parameters and perform
|
||||
@ -494,7 +497,7 @@ Bridge layer
|
||||
Bridge VLAN filtering
|
||||
---------------------
|
||||
|
||||
- port_vlan_filtering: bridge layer function invoked when the bridge gets
|
||||
- ``port_vlan_filtering``: bridge layer function invoked when the bridge gets
|
||||
configured for turning on or off VLAN filtering. If nothing specific needs to
|
||||
be done at the hardware level, this callback does not need to be implemented.
|
||||
When VLAN filtering is turned on, the hardware must be programmed with
|
||||
@ -504,61 +507,61 @@ Bridge VLAN filtering
|
||||
accept any 802.1Q frames irrespective of their VLAN ID, and untagged frames are
|
||||
allowed.
|
||||
|
||||
- port_vlan_prepare: bridge layer function invoked when the bridge prepares the
|
||||
- ``port_vlan_prepare``: bridge layer function invoked when the bridge prepares the
|
||||
configuration of a VLAN on the given port. If the operation is not supported
|
||||
by the hardware, this function should return -EOPNOTSUPP to inform the bridge
|
||||
by the hardware, this function should return ``-EOPNOTSUPP`` to inform the bridge
|
||||
code to fallback to a software implementation. No hardware setup must be done
|
||||
in this function. See port_vlan_add for this and details.
|
||||
|
||||
- port_vlan_add: bridge layer function invoked when a VLAN is configured
|
||||
- ``port_vlan_add``: bridge layer function invoked when a VLAN is configured
|
||||
(tagged or untagged) for the given switch port
|
||||
|
||||
- port_vlan_del: bridge layer function invoked when a VLAN is removed from the
|
||||
- ``port_vlan_del``: bridge layer function invoked when a VLAN is removed from the
|
||||
given switch port
|
||||
|
||||
- port_vlan_dump: bridge layer function invoked with a switchdev callback
|
||||
- ``port_vlan_dump``: bridge layer function invoked with a switchdev callback
|
||||
function that the driver has to call for each VLAN the given port is a member
|
||||
of. A switchdev object is used to carry the VID and bridge flags.
|
||||
|
||||
- port_fdb_add: bridge layer function invoked when the bridge wants to install a
|
||||
- ``port_fdb_add``: bridge layer function invoked when the bridge wants to install a
|
||||
Forwarding Database entry, the switch hardware should be programmed with the
|
||||
specified address in the specified VLAN Id in the forwarding database
|
||||
associated with this VLAN ID. If the operation is not supported, this
|
||||
function should return -EOPNOTSUPP to inform the bridge code to fallback to
|
||||
function should return ``-EOPNOTSUPP`` to inform the bridge code to fallback to
|
||||
a software implementation.
|
||||
|
||||
Note: VLAN ID 0 corresponds to the port private database, which, in the context
|
||||
of DSA, would be the its port-based VLAN, used by the associated bridge device.
|
||||
.. note:: VLAN ID 0 corresponds to the port private database, which, in the context
|
||||
of DSA, would be the its port-based VLAN, used by the associated bridge device.
|
||||
|
||||
- port_fdb_del: bridge layer function invoked when the bridge wants to remove a
|
||||
- ``port_fdb_del``: bridge layer function invoked when the bridge wants to remove a
|
||||
Forwarding Database entry, the switch hardware should be programmed to delete
|
||||
the specified MAC address from the specified VLAN ID if it was mapped into
|
||||
this port forwarding database
|
||||
|
||||
- port_fdb_dump: bridge layer function invoked with a switchdev callback
|
||||
- ``port_fdb_dump``: bridge layer function invoked with a switchdev callback
|
||||
function that the driver has to call for each MAC address known to be behind
|
||||
the given port. A switchdev object is used to carry the VID and FDB info.
|
||||
|
||||
- port_mdb_prepare: bridge layer function invoked when the bridge prepares the
|
||||
- ``port_mdb_prepare``: bridge layer function invoked when the bridge prepares the
|
||||
installation of a multicast database entry. If the operation is not supported,
|
||||
this function should return -EOPNOTSUPP to inform the bridge code to fallback
|
||||
this function should return ``-EOPNOTSUPP`` to inform the bridge code to fallback
|
||||
to a software implementation. No hardware setup must be done in this function.
|
||||
See port_fdb_add for this and details.
|
||||
See ``port_fdb_add`` for this and details.
|
||||
|
||||
- port_mdb_add: bridge layer function invoked when the bridge wants to install
|
||||
- ``port_mdb_add``: bridge layer function invoked when the bridge wants to install
|
||||
a multicast database entry, the switch hardware should be programmed with the
|
||||
specified address in the specified VLAN ID in the forwarding database
|
||||
associated with this VLAN ID.
|
||||
|
||||
Note: VLAN ID 0 corresponds to the port private database, which, in the context
|
||||
of DSA, would be the its port-based VLAN, used by the associated bridge device.
|
||||
.. note:: VLAN ID 0 corresponds to the port private database, which, in the context
|
||||
of DSA, would be the its port-based VLAN, used by the associated bridge device.
|
||||
|
||||
- port_mdb_del: bridge layer function invoked when the bridge wants to remove a
|
||||
- ``port_mdb_del``: bridge layer function invoked when the bridge wants to remove a
|
||||
multicast database entry, the switch hardware should be programmed to delete
|
||||
the specified MAC address from the specified VLAN ID if it was mapped into
|
||||
this port forwarding database.
|
||||
|
||||
- port_mdb_dump: bridge layer function invoked with a switchdev callback
|
||||
- ``port_mdb_dump``: bridge layer function invoked with a switchdev callback
|
||||
function that the driver has to call for each MAC address known to be behind
|
||||
the given port. A switchdev object is used to carry the VID and MDB info.
|
||||
|
||||
@ -577,7 +580,7 @@ two subsystems and get the best of both worlds.
|
||||
Other hanging fruits
|
||||
--------------------
|
||||
|
||||
- making the number of ports fully dynamic and not dependent on DSA_MAX_PORTS
|
||||
- making the number of ports fully dynamic and not dependent on ``DSA_MAX_PORTS``
|
||||
- allowing more than one CPU/management interface:
|
||||
http://comments.gmane.org/gmane.linux.network/365657
|
||||
- porting more drivers from other vendors:
|
11
Documentation/networking/dsa/index.rst
Normal file
11
Documentation/networking/dsa/index.rst
Normal file
@ -0,0 +1,11 @@
|
||||
===============================
|
||||
Distributed Switch Architecture
|
||||
===============================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
dsa
|
||||
bcm_sf2
|
||||
lan9303
|
||||
sja1105
|
@ -1,3 +1,4 @@
|
||||
==============================
|
||||
LAN9303 Ethernet switch driver
|
||||
==============================
|
||||
|
||||
@ -9,10 +10,9 @@ host master network interface (e.g. fixed link).
|
||||
Driver details
|
||||
==============
|
||||
|
||||
The driver is implemented as a DSA driver, see
|
||||
Documentation/networking/dsa/dsa.txt.
|
||||
The driver is implemented as a DSA driver, see ``Documentation/networking/dsa/dsa.rst``.
|
||||
|
||||
See Documentation/devicetree/bindings/net/dsa/lan9303.txt for device tree
|
||||
See ``Documentation/devicetree/bindings/net/dsa/lan9303.txt`` for device tree
|
||||
binding.
|
||||
|
||||
The LAN9303 can be managed both via MDIO and I2C, both supported by this driver.
|
220
Documentation/networking/dsa/sja1105.rst
Normal file
220
Documentation/networking/dsa/sja1105.rst
Normal file
@ -0,0 +1,220 @@
|
||||
=========================
|
||||
NXP SJA1105 switch driver
|
||||
=========================
|
||||
|
||||
Overview
|
||||
========
|
||||
|
||||
The NXP SJA1105 is a family of 6 devices:
|
||||
|
||||
- SJA1105E: First generation, no TTEthernet
|
||||
- SJA1105T: First generation, TTEthernet
|
||||
- SJA1105P: Second generation, no TTEthernet, no SGMII
|
||||
- SJA1105Q: Second generation, TTEthernet, no SGMII
|
||||
- SJA1105R: Second generation, no TTEthernet, SGMII
|
||||
- SJA1105S: Second generation, TTEthernet, SGMII
|
||||
|
||||
These are SPI-managed automotive switches, with all ports being gigabit
|
||||
capable, and supporting MII/RMII/RGMII and optionally SGMII on one port.
|
||||
|
||||
Being automotive parts, their configuration interface is geared towards
|
||||
set-and-forget use, with minimal dynamic interaction at runtime. They
|
||||
require a static configuration to be composed by software and packed
|
||||
with CRC and table headers, and sent over SPI.
|
||||
|
||||
The static configuration is composed of several configuration tables. Each
|
||||
table takes a number of entries. Some configuration tables can be (partially)
|
||||
reconfigured at runtime, some not. Some tables are mandatory, some not:
|
||||
|
||||
============================= ================== =============================
|
||||
Table Mandatory Reconfigurable
|
||||
============================= ================== =============================
|
||||
Schedule no no
|
||||
Schedule entry points if Scheduling no
|
||||
VL Lookup no no
|
||||
VL Policing if VL Lookup no
|
||||
VL Forwarding if VL Lookup no
|
||||
L2 Lookup no no
|
||||
L2 Policing yes no
|
||||
VLAN Lookup yes yes
|
||||
L2 Forwarding yes partially (fully on P/Q/R/S)
|
||||
MAC Config yes partially (fully on P/Q/R/S)
|
||||
Schedule Params if Scheduling no
|
||||
Schedule Entry Points Params if Scheduling no
|
||||
VL Forwarding Params if VL Forwarding no
|
||||
L2 Lookup Params no partially (fully on P/Q/R/S)
|
||||
L2 Forwarding Params yes no
|
||||
Clock Sync Params no no
|
||||
AVB Params no no
|
||||
General Params yes partially
|
||||
Retagging no yes
|
||||
xMII Params yes no
|
||||
SGMII no yes
|
||||
============================= ================== =============================
|
||||
|
||||
|
||||
Also the configuration is write-only (software cannot read it back from the
|
||||
switch except for very few exceptions).
|
||||
|
||||
The driver creates a static configuration at probe time, and keeps it at
|
||||
all times in memory, as a shadow for the hardware state. When required to
|
||||
change a hardware setting, the static configuration is also updated.
|
||||
If that changed setting can be transmitted to the switch through the dynamic
|
||||
reconfiguration interface, it is; otherwise the switch is reset and
|
||||
reprogrammed with the updated static configuration.
|
||||
|
||||
Traffic support
|
||||
===============
|
||||
|
||||
The switches do not support switch tagging in hardware. But they do support
|
||||
customizing the TPID by which VLAN traffic is identified as such. The switch
|
||||
driver is leveraging ``CONFIG_NET_DSA_TAG_8021Q`` by requesting that special
|
||||
VLANs (with a custom TPID of ``ETH_P_EDSA`` instead of ``ETH_P_8021Q``) are
|
||||
installed on its ports when not in ``vlan_filtering`` mode. This does not
|
||||
interfere with the reception and transmission of real 802.1Q-tagged traffic,
|
||||
because the switch does no longer parse those packets as VLAN after the TPID
|
||||
change.
|
||||
The TPID is restored when ``vlan_filtering`` is requested by the user through
|
||||
the bridge layer, and general IP termination becomes no longer possible through
|
||||
the switch netdevices in this mode.
|
||||
|
||||
The switches have two programmable filters for link-local destination MACs.
|
||||
These are used to trap BPDUs and PTP traffic to the master netdevice, and are
|
||||
further used to support STP and 1588 ordinary clock/boundary clock
|
||||
functionality.
|
||||
|
||||
The following traffic modes are supported over the switch netdevices:
|
||||
|
||||
+--------------------+------------+------------------+------------------+
|
||||
| | Standalone | Bridged with | Bridged with |
|
||||
| | ports | vlan_filtering 0 | vlan_filtering 1 |
|
||||
+====================+============+==================+==================+
|
||||
| Regular traffic | Yes | Yes | No (use master) |
|
||||
+--------------------+------------+------------------+------------------+
|
||||
| Management traffic | Yes | Yes | Yes |
|
||||
| (BPDU, PTP) | | | |
|
||||
+--------------------+------------+------------------+------------------+
|
||||
|
||||
Switching features
|
||||
==================
|
||||
|
||||
The driver supports the configuration of L2 forwarding rules in hardware for
|
||||
port bridging. The forwarding, broadcast and flooding domain between ports can
|
||||
be restricted through two methods: either at the L2 forwarding level (isolate
|
||||
one bridge's ports from another's) or at the VLAN port membership level
|
||||
(isolate ports within the same bridge). The final forwarding decision taken by
|
||||
the hardware is a logical AND of these two sets of rules.
|
||||
|
||||
The hardware tags all traffic internally with a port-based VLAN (pvid), or it
|
||||
decodes the VLAN information from the 802.1Q tag. Advanced VLAN classification
|
||||
is not possible. Once attributed a VLAN tag, frames are checked against the
|
||||
port's membership rules and dropped at ingress if they don't match any VLAN.
|
||||
This behavior is available when switch ports are enslaved to a bridge with
|
||||
``vlan_filtering 1``.
|
||||
|
||||
Normally the hardware is not configurable with respect to VLAN awareness, but
|
||||
by changing what TPID the switch searches 802.1Q tags for, the semantics of a
|
||||
bridge with ``vlan_filtering 0`` can be kept (accept all traffic, tagged or
|
||||
untagged), and therefore this mode is also supported.
|
||||
|
||||
Segregating the switch ports in multiple bridges is supported (e.g. 2 + 2), but
|
||||
all bridges should have the same level of VLAN awareness (either both have
|
||||
``vlan_filtering`` 0, or both 1). Also an inevitable limitation of the fact
|
||||
that VLAN awareness is global at the switch level is that once a bridge with
|
||||
``vlan_filtering`` enslaves at least one switch port, the other un-bridged
|
||||
ports are no longer available for standalone traffic termination.
|
||||
|
||||
Topology and loop detection through STP is supported.
|
||||
|
||||
L2 FDB manipulation (add/delete/dump) is currently possible for the first
|
||||
generation devices. Aging time of FDB entries, as well as enabling fully static
|
||||
management (no address learning and no flooding of unknown traffic) is not yet
|
||||
configurable in the driver.
|
||||
|
||||
A special comment about bridging with other netdevices (illustrated with an
|
||||
example):
|
||||
|
||||
A board has eth0, eth1, swp0@eth1, swp1@eth1, swp2@eth1, swp3@eth1.
|
||||
The switch ports (swp0-3) are under br0.
|
||||
It is desired that eth0 is turned into another switched port that communicates
|
||||
with swp0-3.
|
||||
|
||||
If br0 has vlan_filtering 0, then eth0 can simply be added to br0 with the
|
||||
intended results.
|
||||
If br0 has vlan_filtering 1, then a new br1 interface needs to be created that
|
||||
enslaves eth0 and eth1 (the DSA master of the switch ports). This is because in
|
||||
this mode, the switch ports beneath br0 are not capable of regular traffic, and
|
||||
are only used as a conduit for switchdev operations.
|
||||
|
||||
Device Tree bindings and board design
|
||||
=====================================
|
||||
|
||||
This section references ``Documentation/devicetree/bindings/net/dsa/sja1105.txt``
|
||||
and aims to showcase some potential switch caveats.
|
||||
|
||||
RMII PHY role and out-of-band signaling
|
||||
---------------------------------------
|
||||
|
||||
In the RMII spec, the 50 MHz clock signals are either driven by the MAC or by
|
||||
an external oscillator (but not by the PHY).
|
||||
But the spec is rather loose and devices go outside it in several ways.
|
||||
Some PHYs go against the spec and may provide an output pin where they source
|
||||
the 50 MHz clock themselves, in an attempt to be helpful.
|
||||
On the other hand, the SJA1105 is only binary configurable - when in the RMII
|
||||
MAC role it will also attempt to drive the clock signal. To prevent this from
|
||||
happening it must be put in RMII PHY role.
|
||||
But doing so has some unintended consequences.
|
||||
In the RMII spec, the PHY can transmit extra out-of-band signals via RXD[1:0].
|
||||
These are practically some extra code words (/J/ and /K/) sent prior to the
|
||||
preamble of each frame. The MAC does not have this out-of-band signaling
|
||||
mechanism defined by the RMII spec.
|
||||
So when the SJA1105 port is put in PHY role to avoid having 2 drivers on the
|
||||
clock signal, inevitably an RMII PHY-to-PHY connection is created. The SJA1105
|
||||
emulates a PHY interface fully and generates the /J/ and /K/ symbols prior to
|
||||
frame preambles, which the real PHY is not expected to understand. So the PHY
|
||||
simply encodes the extra symbols received from the SJA1105-as-PHY onto the
|
||||
100Base-Tx wire.
|
||||
On the other side of the wire, some link partners might discard these extra
|
||||
symbols, while others might choke on them and discard the entire Ethernet
|
||||
frames that follow along. This looks like packet loss with some link partners
|
||||
but not with others.
|
||||
The take-away is that in RMII mode, the SJA1105 must be let to drive the
|
||||
reference clock if connected to a PHY.
|
||||
|
||||
RGMII fixed-link and internal delays
|
||||
------------------------------------
|
||||
|
||||
As mentioned in the bindings document, the second generation of devices has
|
||||
tunable delay lines as part of the MAC, which can be used to establish the
|
||||
correct RGMII timing budget.
|
||||
When powered up, these can shift the Rx and Tx clocks with a phase difference
|
||||
between 73.8 and 101.7 degrees.
|
||||
The catch is that the delay lines need to lock onto a clock signal with a
|
||||
stable frequency. This means that there must be at least 2 microseconds of
|
||||
silence between the clock at the old vs at the new frequency. Otherwise the
|
||||
lock is lost and the delay lines must be reset (powered down and back up).
|
||||
In RGMII the clock frequency changes with link speed (125 MHz at 1000 Mbps, 25
|
||||
MHz at 100 Mbps and 2.5 MHz at 10 Mbps), and link speed might change during the
|
||||
AN process.
|
||||
In the situation where the switch port is connected through an RGMII fixed-link
|
||||
to a link partner whose link state life cycle is outside the control of Linux
|
||||
(such as a different SoC), then the delay lines would remain unlocked (and
|
||||
inactive) until there is manual intervention (ifdown/ifup on the switch port).
|
||||
The take-away is that in RGMII mode, the switch's internal delays are only
|
||||
reliable if the link partner never changes link speeds, or if it does, it does
|
||||
so in a way that is coordinated with the switch port (practically, both ends of
|
||||
the fixed-link are under control of the same Linux system).
|
||||
As to why would a fixed-link interface ever change link speeds: there are
|
||||
Ethernet controllers out there which come out of reset in 100 Mbps mode, and
|
||||
their driver inevitably needs to change the speed and clock frequency if it's
|
||||
required to work at gigabit.
|
||||
|
||||
MDIO bus and PHY management
|
||||
---------------------------
|
||||
|
||||
The SJA1105 does not have an MDIO bus and does not perform in-band AN either.
|
||||
Therefore there is no link state notification coming from the switch device.
|
||||
A board would need to hook up the PHYs connected to the switch to any other
|
||||
MDIO bus available to Linux within the system (e.g. to the DSA master's MDIO
|
||||
bus). Link state management then works by the driver manually keeping in sync
|
||||
(over SPI commands) the MAC link speed with the settings negotiated by the PHY.
|
@ -9,7 +9,6 @@ Contents:
|
||||
netdev-FAQ
|
||||
af_xdp
|
||||
batman-adv
|
||||
bpf_flow_dissector
|
||||
can
|
||||
can_ucan_protocol
|
||||
device_drivers/freescale/dpaa2/index
|
||||
@ -25,6 +24,7 @@ Contents:
|
||||
device_drivers/intel/i40e
|
||||
device_drivers/intel/iavf
|
||||
device_drivers/intel/ice
|
||||
dsa/index
|
||||
devlink-info-versions
|
||||
ieee802154
|
||||
kapi
|
||||
|
@ -81,6 +81,11 @@ fib_multipath_hash_policy - INTEGER
|
||||
0 - Layer 3
|
||||
1 - Layer 4
|
||||
|
||||
fib_sync_mem - UNSIGNED INTEGER
|
||||
Amount of dirty memory from fib entries that can be backlogged before
|
||||
synchronize_rcu is forced.
|
||||
Default: 512kB Minimum: 64kB Maximum: 64MB
|
||||
|
||||
ip_forward_update_priority - INTEGER
|
||||
Whether to update SKB priority from "TOS" field in IPv4 header after it
|
||||
is forwarded. The new SKB priority is mapped from TOS field value
|
||||
@ -1910,16 +1915,41 @@ enhanced_dad - BOOLEAN
|
||||
|
||||
icmp/*:
|
||||
ratelimit - INTEGER
|
||||
Limit the maximal rates for sending ICMPv6 packets.
|
||||
Limit the maximal rates for sending ICMPv6 messages.
|
||||
0 to disable any limiting,
|
||||
otherwise the minimal space between responses in milliseconds.
|
||||
Default: 1000
|
||||
|
||||
ratemask - list of comma separated ranges
|
||||
For ICMPv6 message types matching the ranges in the ratemask, limit
|
||||
the sending of the message according to ratelimit parameter.
|
||||
|
||||
The format used for both input and output is a comma separated
|
||||
list of ranges (e.g. "0-127,129" for ICMPv6 message type 0 to 127 and
|
||||
129). Writing to the file will clear all previous ranges of ICMPv6
|
||||
message types and update the current list with the input.
|
||||
|
||||
Refer to: https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml
|
||||
for numerical values of ICMPv6 message types, e.g. echo request is 128
|
||||
and echo reply is 129.
|
||||
|
||||
Default: 0-1,3-127 (rate limit ICMPv6 errors except Packet Too Big)
|
||||
|
||||
echo_ignore_all - BOOLEAN
|
||||
If set non-zero, then the kernel will ignore all ICMP ECHO
|
||||
requests sent to it over the IPv6 protocol.
|
||||
Default: 0
|
||||
|
||||
echo_ignore_multicast - BOOLEAN
|
||||
If set non-zero, then the kernel will ignore all ICMP ECHO
|
||||
requests sent to it over the IPv6 protocol via multicast.
|
||||
Default: 0
|
||||
|
||||
echo_ignore_anycast - BOOLEAN
|
||||
If set non-zero, then the kernel will ignore all ICMP ECHO
|
||||
requests sent to it over the IPv6 protocol destined to anycast address.
|
||||
Default: 0
|
||||
|
||||
xfrm6_gc_thresh - INTEGER
|
||||
(Obsolete since linux-4.14)
|
||||
The threshold at which we will start garbage collecting for IPv6
|
||||
|
149
Documentation/packing.txt
Normal file
149
Documentation/packing.txt
Normal file
@ -0,0 +1,149 @@
|
||||
================================================
|
||||
Generic bitfield packing and unpacking functions
|
||||
================================================
|
||||
|
||||
Problem statement
|
||||
-----------------
|
||||
|
||||
When working with hardware, one has to choose between several approaches of
|
||||
interfacing with it.
|
||||
One can memory-map a pointer to a carefully crafted struct over the hardware
|
||||
device's memory region, and access its fields as struct members (potentially
|
||||
declared as bitfields). But writing code this way would make it less portable,
|
||||
due to potential endianness mismatches between the CPU and the hardware device.
|
||||
Additionally, one has to pay close attention when translating register
|
||||
definitions from the hardware documentation into bit field indices for the
|
||||
structs. Also, some hardware (typically networking equipment) tends to group
|
||||
its register fields in ways that violate any reasonable word boundaries
|
||||
(sometimes even 64 bit ones). This creates the inconvenience of having to
|
||||
define "high" and "low" portions of register fields within the struct.
|
||||
A more robust alternative to struct field definitions would be to extract the
|
||||
required fields by shifting the appropriate number of bits. But this would
|
||||
still not protect from endianness mismatches, except if all memory accesses
|
||||
were performed byte-by-byte. Also the code can easily get cluttered, and the
|
||||
high-level idea might get lost among the many bit shifts required.
|
||||
Many drivers take the bit-shifting approach and then attempt to reduce the
|
||||
clutter with tailored macros, but more often than not these macros take
|
||||
shortcuts that still prevent the code from being truly portable.
|
||||
|
||||
The solution
|
||||
------------
|
||||
|
||||
This API deals with 2 basic operations:
|
||||
- Packing a CPU-usable number into a memory buffer (with hardware
|
||||
constraints/quirks)
|
||||
- Unpacking a memory buffer (which has hardware constraints/quirks)
|
||||
into a CPU-usable number.
|
||||
|
||||
The API offers an abstraction over said hardware constraints and quirks,
|
||||
over CPU endianness and therefore between possible mismatches between
|
||||
the two.
|
||||
|
||||
The basic unit of these API functions is the u64. From the CPU's
|
||||
perspective, bit 63 always means bit offset 7 of byte 7, albeit only
|
||||
logically. The question is: where do we lay this bit out in memory?
|
||||
|
||||
The following examples cover the memory layout of a packed u64 field.
|
||||
The byte offsets in the packed buffer are always implicitly 0, 1, ... 7.
|
||||
What the examples show is where the logical bytes and bits sit.
|
||||
|
||||
1. Normally (no quirks), we would do it like this:
|
||||
|
||||
63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32
|
||||
7 6 5 4
|
||||
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
|
||||
3 2 1 0
|
||||
|
||||
That is, the MSByte (7) of the CPU-usable u64 sits at memory offset 0, and the
|
||||
LSByte (0) of the u64 sits at memory offset 7.
|
||||
This corresponds to what most folks would regard to as "big endian", where
|
||||
bit i corresponds to the number 2^i. This is also referred to in the code
|
||||
comments as "logical" notation.
|
||||
|
||||
|
||||
2. If QUIRK_MSB_ON_THE_RIGHT is set, we do it like this:
|
||||
|
||||
56 57 58 59 60 61 62 63 48 49 50 51 52 53 54 55 40 41 42 43 44 45 46 47 32 33 34 35 36 37 38 39
|
||||
7 6 5 4
|
||||
24 25 26 27 28 29 30 31 16 17 18 19 20 21 22 23 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7
|
||||
3 2 1 0
|
||||
|
||||
That is, QUIRK_MSB_ON_THE_RIGHT does not affect byte positioning, but
|
||||
inverts bit offsets inside a byte.
|
||||
|
||||
|
||||
3. If QUIRK_LITTLE_ENDIAN is set, we do it like this:
|
||||
|
||||
39 38 37 36 35 34 33 32 47 46 45 44 43 42 41 40 55 54 53 52 51 50 49 48 63 62 61 60 59 58 57 56
|
||||
4 5 6 7
|
||||
7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24
|
||||
0 1 2 3
|
||||
|
||||
Therefore, QUIRK_LITTLE_ENDIAN means that inside the memory region, every
|
||||
byte from each 4-byte word is placed at its mirrored position compared to
|
||||
the boundary of that word.
|
||||
|
||||
4. If QUIRK_MSB_ON_THE_RIGHT and QUIRK_LITTLE_ENDIAN are both set, we do it
|
||||
like this:
|
||||
|
||||
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
||||
4 5 6 7
|
||||
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
||||
0 1 2 3
|
||||
|
||||
|
||||
5. If just QUIRK_LSW32_IS_FIRST is set, we do it like this:
|
||||
|
||||
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
|
||||
3 2 1 0
|
||||
63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32
|
||||
7 6 5 4
|
||||
|
||||
In this case the 8 byte memory region is interpreted as follows: first
|
||||
4 bytes correspond to the least significant 4-byte word, next 4 bytes to
|
||||
the more significant 4-byte word.
|
||||
|
||||
|
||||
6. If QUIRK_LSW32_IS_FIRST and QUIRK_MSB_ON_THE_RIGHT are set, we do it like
|
||||
this:
|
||||
|
||||
24 25 26 27 28 29 30 31 16 17 18 19 20 21 22 23 8 9 10 11 12 13 14 15 0 1 2 3 4 5 6 7
|
||||
3 2 1 0
|
||||
56 57 58 59 60 61 62 63 48 49 50 51 52 53 54 55 40 41 42 43 44 45 46 47 32 33 34 35 36 37 38 39
|
||||
7 6 5 4
|
||||
|
||||
|
||||
7. If QUIRK_LSW32_IS_FIRST and QUIRK_LITTLE_ENDIAN are set, it looks like
|
||||
this:
|
||||
|
||||
7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24
|
||||
0 1 2 3
|
||||
39 38 37 36 35 34 33 32 47 46 45 44 43 42 41 40 55 54 53 52 51 50 49 48 63 62 61 60 59 58 57 56
|
||||
4 5 6 7
|
||||
|
||||
|
||||
8. If QUIRK_LSW32_IS_FIRST, QUIRK_LITTLE_ENDIAN and QUIRK_MSB_ON_THE_RIGHT
|
||||
are set, it looks like this:
|
||||
|
||||
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
||||
0 1 2 3
|
||||
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
||||
4 5 6 7
|
||||
|
||||
|
||||
We always think of our offsets as if there were no quirk, and we translate
|
||||
them afterwards, before accessing the memory region.
|
||||
|
||||
Intended use
|
||||
------------
|
||||
|
||||
Drivers that opt to use this API first need to identify which of the above 3
|
||||
quirk combinations (for a total of 8) match what the hardware documentation
|
||||
describes. Then they should wrap the packing() function, creating a new
|
||||
xxx_packing() that calls it using the proper QUIRK_* one-hot bits set.
|
||||
|
||||
The packing() function returns an int-encoded error code, which protects the
|
||||
programmer against incorrect API use. The errors are not expected to occur
|
||||
durring runtime, therefore it is reasonable for xxx_packing() to return void
|
||||
and simply swallow those errors. Optionally it can dump stack or print the
|
||||
error description.
|
39
MAINTAINERS
39
MAINTAINERS
@ -2796,10 +2796,13 @@ M: Simon Wunderlich <sw@simonwunderlich.de>
|
||||
M: Antonio Quartulli <a@unstable.cc>
|
||||
L: b.a.t.m.a.n@lists.open-mesh.org (moderated for non-subscribers)
|
||||
W: https://www.open-mesh.org/
|
||||
B: https://www.open-mesh.org/projects/batman-adv/issues
|
||||
C: irc://chat.freenode.net/batman
|
||||
Q: https://patchwork.open-mesh.org/project/batman/list/
|
||||
T: git https://git.open-mesh.org/linux-merge.git
|
||||
S: Maintained
|
||||
F: Documentation/ABI/testing/sysfs-class-net-batman-adv
|
||||
F: Documentation/ABI/testing/sysfs-class-net-mesh
|
||||
F: Documentation/ABI/obsolete/sysfs-class-net-batman-adv
|
||||
F: Documentation/ABI/obsolete/sysfs-class-net-mesh
|
||||
F: Documentation/networking/batman-adv.rst
|
||||
F: include/uapi/linux/batadv_packet.h
|
||||
F: include/uapi/linux/batman_adv.h
|
||||
@ -9814,6 +9817,8 @@ F: Documentation/devicetree/bindings/mmc/mtk-sd.txt
|
||||
MEDIATEK MT76 WIRELESS LAN DRIVER
|
||||
M: Felix Fietkau <nbd@nbd.name>
|
||||
M: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
|
||||
R: Ryder Lee <ryder.lee@mediatek.com>
|
||||
R: Roy Luo <royluo@google.com>
|
||||
L: linux-wireless@vger.kernel.org
|
||||
S: Maintained
|
||||
F: drivers/net/wireless/mediatek/mt76/
|
||||
@ -9912,15 +9917,6 @@ F: drivers/net/ethernet/mellanox/mlx5/core/accel/*
|
||||
F: drivers/net/ethernet/mellanox/mlx5/core/fpga/*
|
||||
F: include/linux/mlx5/mlx5_ifc_fpga.h
|
||||
|
||||
MELLANOX ETHERNET INNOVA IPSEC DRIVER
|
||||
R: Boris Pismenny <borisp@mellanox.com>
|
||||
L: netdev@vger.kernel.org
|
||||
S: Supported
|
||||
W: http://www.mellanox.com
|
||||
Q: http://patchwork.ozlabs.org/project/netdev/list/
|
||||
F: drivers/net/ethernet/mellanox/mlx5/core/en_ipsec/*
|
||||
F: drivers/net/ethernet/mellanox/mlx5/core/ipsec*
|
||||
|
||||
MELLANOX ETHERNET SWITCH DRIVERS
|
||||
M: Jiri Pirko <jiri@mellanox.com>
|
||||
M: Ido Schimmel <idosch@mellanox.com>
|
||||
@ -10783,6 +10779,7 @@ L: linux-block@vger.kernel.org
|
||||
L: nbd@other.debian.org
|
||||
F: Documentation/blockdev/nbd.txt
|
||||
F: drivers/block/nbd.c
|
||||
F: include/trace/events/nbd.h
|
||||
F: include/uapi/linux/nbd.h
|
||||
|
||||
NETWORK DROP MONITOR
|
||||
@ -11170,6 +11167,12 @@ S: Maintained
|
||||
F: Documentation/devicetree/bindings/sound/sgtl5000.txt
|
||||
F: sound/soc/codecs/sgtl5000*
|
||||
|
||||
NXP SJA1105 ETHERNET SWITCH DRIVER
|
||||
M: Vladimir Oltean <olteanv@gmail.com>
|
||||
L: linux-kernel@vger.kernel.org
|
||||
S: Maintained
|
||||
F: drivers/net/dsa/sja1105
|
||||
|
||||
NXP TDA998X DRM DRIVER
|
||||
M: Russell King <linux@armlinux.org.uk>
|
||||
S: Maintained
|
||||
@ -11723,6 +11726,14 @@ L: linux-i2c@vger.kernel.org
|
||||
S: Orphan
|
||||
F: drivers/i2c/busses/i2c-pasemi.c
|
||||
|
||||
PACKING
|
||||
M: Vladimir Oltean <olteanv@gmail.com>
|
||||
L: netdev@vger.kernel.org
|
||||
S: Supported
|
||||
F: lib/packing.c
|
||||
F: include/linux/packing.h
|
||||
F: Documentation/packing.txt
|
||||
|
||||
PADATA PARALLEL EXECUTION MECHANISM
|
||||
M: Steffen Klassert <steffen.klassert@secunet.com>
|
||||
L: linux-crypto@vger.kernel.org
|
||||
@ -13449,6 +13460,12 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.g
|
||||
S: Maintained
|
||||
F: drivers/net/wireless/realtek/rtlwifi/
|
||||
|
||||
REALTEK WIRELESS DRIVER (rtw88)
|
||||
M: Yan-Hsuan Chuang <yhchuang@realtek.com>
|
||||
L: linux-wireless@vger.kernel.org
|
||||
S: Maintained
|
||||
F: drivers/net/wireless/realtek/rtw88/
|
||||
|
||||
RTL8XXXU WIRELESS DRIVER (rtl8xxxu)
|
||||
M: Jes Sorensen <Jes.Sorensen@gmail.com>
|
||||
L: linux-wireless@vger.kernel.org
|
||||
|
3
Makefile
3
Makefile
@ -401,6 +401,7 @@ NM = $(CROSS_COMPILE)nm
|
||||
STRIP = $(CROSS_COMPILE)strip
|
||||
OBJCOPY = $(CROSS_COMPILE)objcopy
|
||||
OBJDUMP = $(CROSS_COMPILE)objdump
|
||||
PAHOLE = pahole
|
||||
LEX = flex
|
||||
YACC = bison
|
||||
AWK = awk
|
||||
@ -455,7 +456,7 @@ KBUILD_LDFLAGS :=
|
||||
GCC_PLUGINS_CFLAGS :=
|
||||
|
||||
export ARCH SRCARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC
|
||||
export CPP AR NM STRIP OBJCOPY OBJDUMP KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS
|
||||
export CPP AR NM STRIP OBJCOPY OBJDUMP PAHOLE KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS
|
||||
export MAKE LEX YACC AWK INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE
|
||||
export HOSTCXX KBUILD_HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#define SIOCSPGRP _IOW('s', 8, pid_t)
|
||||
#define SIOCGPGRP _IOR('s', 9, pid_t)
|
||||
|
||||
#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
|
||||
#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
|
||||
#define SIOCGSTAMP_OLD 0x8906 /* Get stamp (timeval) */
|
||||
#define SIOCGSTAMPNS_OLD 0x8907 /* Get stamp (timespec) */
|
||||
|
||||
#endif /* _ASM_ALPHA_SOCKIOS_H */
|
||||
|
@ -92,7 +92,8 @@ static void __init kirkwood_dt_eth_fixup(void)
|
||||
continue;
|
||||
|
||||
/* skip disabled nodes or nodes with valid MAC address*/
|
||||
if (!of_device_is_available(pnp) || of_get_mac_address(np))
|
||||
if (!of_device_is_available(pnp) ||
|
||||
!IS_ERR(of_get_mac_address(np)))
|
||||
goto eth_fixup_skip;
|
||||
|
||||
clk = of_clk_get(pnp, 0);
|
||||
|
@ -277,6 +277,7 @@ __AARCH64_INSN_FUNCS(adrp, 0x9F000000, 0x90000000)
|
||||
__AARCH64_INSN_FUNCS(prfm, 0x3FC00000, 0x39800000)
|
||||
__AARCH64_INSN_FUNCS(prfm_lit, 0xFF000000, 0xD8000000)
|
||||
__AARCH64_INSN_FUNCS(str_reg, 0x3FE0EC00, 0x38206800)
|
||||
__AARCH64_INSN_FUNCS(ldadd, 0x3F20FC00, 0xB8200000)
|
||||
__AARCH64_INSN_FUNCS(ldr_reg, 0x3FE0EC00, 0x38606800)
|
||||
__AARCH64_INSN_FUNCS(ldr_lit, 0xBF000000, 0x18000000)
|
||||
__AARCH64_INSN_FUNCS(ldrsw_lit, 0xFF000000, 0x98000000)
|
||||
@ -394,6 +395,13 @@ u32 aarch64_insn_gen_load_store_ex(enum aarch64_insn_register reg,
|
||||
enum aarch64_insn_register state,
|
||||
enum aarch64_insn_size_type size,
|
||||
enum aarch64_insn_ldst_type type);
|
||||
u32 aarch64_insn_gen_ldadd(enum aarch64_insn_register result,
|
||||
enum aarch64_insn_register address,
|
||||
enum aarch64_insn_register value,
|
||||
enum aarch64_insn_size_type size);
|
||||
u32 aarch64_insn_gen_stadd(enum aarch64_insn_register address,
|
||||
enum aarch64_insn_register value,
|
||||
enum aarch64_insn_size_type size);
|
||||
u32 aarch64_insn_gen_add_sub_imm(enum aarch64_insn_register dst,
|
||||
enum aarch64_insn_register src,
|
||||
int imm, enum aarch64_insn_variant variant,
|
||||
|
@ -734,6 +734,46 @@ u32 aarch64_insn_gen_load_store_ex(enum aarch64_insn_register reg,
|
||||
state);
|
||||
}
|
||||
|
||||
u32 aarch64_insn_gen_ldadd(enum aarch64_insn_register result,
|
||||
enum aarch64_insn_register address,
|
||||
enum aarch64_insn_register value,
|
||||
enum aarch64_insn_size_type size)
|
||||
{
|
||||
u32 insn = aarch64_insn_get_ldadd_value();
|
||||
|
||||
switch (size) {
|
||||
case AARCH64_INSN_SIZE_32:
|
||||
case AARCH64_INSN_SIZE_64:
|
||||
break;
|
||||
default:
|
||||
pr_err("%s: unimplemented size encoding %d\n", __func__, size);
|
||||
return AARCH64_BREAK_FAULT;
|
||||
}
|
||||
|
||||
insn = aarch64_insn_encode_ldst_size(size, insn);
|
||||
|
||||
insn = aarch64_insn_encode_register(AARCH64_INSN_REGTYPE_RT, insn,
|
||||
result);
|
||||
|
||||
insn = aarch64_insn_encode_register(AARCH64_INSN_REGTYPE_RN, insn,
|
||||
address);
|
||||
|
||||
return aarch64_insn_encode_register(AARCH64_INSN_REGTYPE_RS, insn,
|
||||
value);
|
||||
}
|
||||
|
||||
u32 aarch64_insn_gen_stadd(enum aarch64_insn_register address,
|
||||
enum aarch64_insn_register value,
|
||||
enum aarch64_insn_size_type size)
|
||||
{
|
||||
/*
|
||||
* STADD is simply encoded as an alias for LDADD with XZR as
|
||||
* the destination register.
|
||||
*/
|
||||
return aarch64_insn_gen_ldadd(AARCH64_INSN_REG_ZR, address,
|
||||
value, size);
|
||||
}
|
||||
|
||||
static u32 aarch64_insn_encode_prfm_imm(enum aarch64_insn_prfm_type type,
|
||||
enum aarch64_insn_prfm_target target,
|
||||
enum aarch64_insn_prfm_policy policy,
|
||||
|
@ -100,11 +100,9 @@
|
||||
#define A64_STXR(sf, Rt, Rn, Rs) \
|
||||
A64_LSX(sf, Rt, Rn, Rs, STORE_EX)
|
||||
|
||||
/* Prefetch */
|
||||
#define A64_PRFM(Rn, type, target, policy) \
|
||||
aarch64_insn_gen_prefetch(Rn, AARCH64_INSN_PRFM_TYPE_##type, \
|
||||
AARCH64_INSN_PRFM_TARGET_##target, \
|
||||
AARCH64_INSN_PRFM_POLICY_##policy)
|
||||
/* LSE atomics */
|
||||
#define A64_STADD(sf, Rn, Rs) \
|
||||
aarch64_insn_gen_stadd(Rn, Rs, A64_SIZE(sf))
|
||||
|
||||
/* Add/subtract (immediate) */
|
||||
#define A64_ADDSUB_IMM(sf, Rd, Rn, imm12, type) \
|
||||
|
@ -365,7 +365,7 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx,
|
||||
const bool is64 = BPF_CLASS(code) == BPF_ALU64 ||
|
||||
BPF_CLASS(code) == BPF_JMP;
|
||||
const bool isdw = BPF_SIZE(code) == BPF_DW;
|
||||
u8 jmp_cond;
|
||||
u8 jmp_cond, reg;
|
||||
s32 jmp_offset;
|
||||
|
||||
#define check_imm(bits, imm) do { \
|
||||
@ -756,19 +756,28 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx,
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
/* STX XADD: lock *(u32 *)(dst + off) += src */
|
||||
case BPF_STX | BPF_XADD | BPF_W:
|
||||
/* STX XADD: lock *(u64 *)(dst + off) += src */
|
||||
case BPF_STX | BPF_XADD | BPF_DW:
|
||||
emit_a64_mov_i(1, tmp, off, ctx);
|
||||
emit(A64_ADD(1, tmp, tmp, dst), ctx);
|
||||
emit(A64_PRFM(tmp, PST, L1, STRM), ctx);
|
||||
emit(A64_LDXR(isdw, tmp2, tmp), ctx);
|
||||
emit(A64_ADD(isdw, tmp2, tmp2, src), ctx);
|
||||
emit(A64_STXR(isdw, tmp2, tmp, tmp3), ctx);
|
||||
jmp_offset = -3;
|
||||
check_imm19(jmp_offset);
|
||||
emit(A64_CBNZ(0, tmp3, jmp_offset), ctx);
|
||||
if (!off) {
|
||||
reg = dst;
|
||||
} else {
|
||||
emit_a64_mov_i(1, tmp, off, ctx);
|
||||
emit(A64_ADD(1, tmp, tmp, dst), ctx);
|
||||
reg = tmp;
|
||||
}
|
||||
if (cpus_have_cap(ARM64_HAS_LSE_ATOMICS)) {
|
||||
emit(A64_STADD(isdw, reg, src), ctx);
|
||||
} else {
|
||||
emit(A64_LDXR(isdw, tmp2, reg), ctx);
|
||||
emit(A64_ADD(isdw, tmp2, tmp2, src), ctx);
|
||||
emit(A64_STXR(isdw, tmp2, reg, tmp3), ctx);
|
||||
jmp_offset = -3;
|
||||
check_imm19(jmp_offset);
|
||||
emit(A64_CBNZ(0, tmp3, jmp_offset), ctx);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -1,21 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
#ifndef _ASM_IA64_SOCKIOS_H
|
||||
#define _ASM_IA64_SOCKIOS_H
|
||||
|
||||
/*
|
||||
* Socket-level I/O control calls.
|
||||
*
|
||||
* Based on <asm-i386/sockios.h>.
|
||||
*
|
||||
* Modified 1998, 1999
|
||||
* David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
|
||||
*/
|
||||
#define FIOSETOWN 0x8901
|
||||
#define SIOCSPGRP 0x8902
|
||||
#define FIOGETOWN 0x8903
|
||||
#define SIOCGPGRP 0x8904
|
||||
#define SIOCATMARK 0x8905
|
||||
#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
|
||||
#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
|
||||
|
||||
#endif /* _ASM_IA64_SOCKIOS_H */
|
@ -21,7 +21,7 @@
|
||||
#define SIOCSPGRP _IOW('s', 8, pid_t)
|
||||
#define SIOCGPGRP _IOR('s', 9, pid_t)
|
||||
|
||||
#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
|
||||
#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
|
||||
#define SIOCGSTAMP_OLD 0x8906 /* Get stamp (timeval) */
|
||||
#define SIOCGSTAMPNS_OLD 0x8907 /* Get stamp (timespec) */
|
||||
|
||||
#endif /* _ASM_SOCKIOS_H */
|
||||
|
@ -1,14 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
#ifndef __ARCH_PARISC_SOCKIOS__
|
||||
#define __ARCH_PARISC_SOCKIOS__
|
||||
|
||||
/* Socket-level I/O control calls. */
|
||||
#define FIOSETOWN 0x8901
|
||||
#define SIOCSPGRP 0x8902
|
||||
#define FIOGETOWN 0x8903
|
||||
#define SIOCGPGRP 0x8904
|
||||
#define SIOCATMARK 0x8905
|
||||
#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
|
||||
#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
|
||||
|
||||
#endif
|
@ -105,7 +105,7 @@ static int __init tsi108_eth_of_init(void)
|
||||
}
|
||||
|
||||
mac_addr = of_get_mac_address(np);
|
||||
if (mac_addr)
|
||||
if (!IS_ERR(mac_addr))
|
||||
memcpy(tsi_eth_data.mac_addr, mac_addr, 6);
|
||||
|
||||
ph = of_get_property(np, "mdio-handle", NULL);
|
||||
|
@ -10,6 +10,7 @@
|
||||
#define SIOCSPGRP _IOW('s', 8, pid_t)
|
||||
#define SIOCGPGRP _IOR('s', 9, pid_t)
|
||||
|
||||
#define SIOCGSTAMP _IOR('s', 100, struct timeval) /* Get stamp (timeval) */
|
||||
#define SIOCGSTAMPNS _IOR('s', 101, struct timespec) /* Get stamp (timespec) */
|
||||
#define SIOCGSTAMP_OLD _IOR('s', 100, struct timeval) /* Get stamp (timeval) */
|
||||
#define SIOCGSTAMPNS_OLD _IOR('s', 101, struct timespec) /* Get stamp (timespec) */
|
||||
|
||||
#endif /* __ASM_SH_SOCKIOS_H */
|
||||
|
@ -1,15 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
#ifndef _ASM_SPARC_SOCKIOS_H
|
||||
#define _ASM_SPARC_SOCKIOS_H
|
||||
|
||||
/* Socket-level I/O control calls. */
|
||||
#define FIOSETOWN 0x8901
|
||||
#define SIOCSPGRP 0x8902
|
||||
#define FIOGETOWN 0x8903
|
||||
#define SIOCGPGRP 0x8904
|
||||
#define SIOCATMARK 0x8905
|
||||
#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
|
||||
#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
|
||||
|
||||
#endif /* !(_ASM_SPARC_SOCKIOS_H) */
|
||||
|
@ -1043,7 +1043,7 @@ static int vector_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
vector_send(vp->tx_queue);
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
if (skb->xmit_more) {
|
||||
if (netdev_xmit_more()) {
|
||||
mod_timer(&vp->tl, vp->coalesce);
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
@ -1 +0,0 @@
|
||||
#include <asm-generic/sockios.h>
|
@ -117,6 +117,8 @@ static bool is_simm32(s64 value)
|
||||
#define IA32_JLE 0x7E
|
||||
#define IA32_JG 0x7F
|
||||
|
||||
#define COND_JMP_OPCODE_INVALID (0xFF)
|
||||
|
||||
/*
|
||||
* Map eBPF registers to IA32 32bit registers or stack scratch space.
|
||||
*
|
||||
@ -698,19 +700,12 @@ static inline void emit_ia32_neg64(const u8 dst[], bool dstk, u8 **pprog)
|
||||
STACK_VAR(dst_hi));
|
||||
}
|
||||
|
||||
/* xor ecx,ecx */
|
||||
EMIT2(0x31, add_2reg(0xC0, IA32_ECX, IA32_ECX));
|
||||
/* sub dreg_lo,ecx */
|
||||
EMIT2(0x2B, add_2reg(0xC0, dreg_lo, IA32_ECX));
|
||||
/* mov dreg_lo,ecx */
|
||||
EMIT2(0x89, add_2reg(0xC0, dreg_lo, IA32_ECX));
|
||||
|
||||
/* xor ecx,ecx */
|
||||
EMIT2(0x31, add_2reg(0xC0, IA32_ECX, IA32_ECX));
|
||||
/* sbb dreg_hi,ecx */
|
||||
EMIT2(0x19, add_2reg(0xC0, dreg_hi, IA32_ECX));
|
||||
/* mov dreg_hi,ecx */
|
||||
EMIT2(0x89, add_2reg(0xC0, dreg_hi, IA32_ECX));
|
||||
/* neg dreg_lo */
|
||||
EMIT2(0xF7, add_1reg(0xD8, dreg_lo));
|
||||
/* adc dreg_hi,0x0 */
|
||||
EMIT3(0x83, add_1reg(0xD0, dreg_hi), 0x00);
|
||||
/* neg dreg_hi */
|
||||
EMIT2(0xF7, add_1reg(0xD8, dreg_hi));
|
||||
|
||||
if (dstk) {
|
||||
/* mov dword ptr [ebp+off],dreg_lo */
|
||||
@ -1613,6 +1608,75 @@ static inline void emit_push_r64(const u8 src[], u8 **pprog)
|
||||
*pprog = prog;
|
||||
}
|
||||
|
||||
static u8 get_cond_jmp_opcode(const u8 op, bool is_cmp_lo)
|
||||
{
|
||||
u8 jmp_cond;
|
||||
|
||||
/* Convert BPF opcode to x86 */
|
||||
switch (op) {
|
||||
case BPF_JEQ:
|
||||
jmp_cond = IA32_JE;
|
||||
break;
|
||||
case BPF_JSET:
|
||||
case BPF_JNE:
|
||||
jmp_cond = IA32_JNE;
|
||||
break;
|
||||
case BPF_JGT:
|
||||
/* GT is unsigned '>', JA in x86 */
|
||||
jmp_cond = IA32_JA;
|
||||
break;
|
||||
case BPF_JLT:
|
||||
/* LT is unsigned '<', JB in x86 */
|
||||
jmp_cond = IA32_JB;
|
||||
break;
|
||||
case BPF_JGE:
|
||||
/* GE is unsigned '>=', JAE in x86 */
|
||||
jmp_cond = IA32_JAE;
|
||||
break;
|
||||
case BPF_JLE:
|
||||
/* LE is unsigned '<=', JBE in x86 */
|
||||
jmp_cond = IA32_JBE;
|
||||
break;
|
||||
case BPF_JSGT:
|
||||
if (!is_cmp_lo)
|
||||
/* Signed '>', GT in x86 */
|
||||
jmp_cond = IA32_JG;
|
||||
else
|
||||
/* GT is unsigned '>', JA in x86 */
|
||||
jmp_cond = IA32_JA;
|
||||
break;
|
||||
case BPF_JSLT:
|
||||
if (!is_cmp_lo)
|
||||
/* Signed '<', LT in x86 */
|
||||
jmp_cond = IA32_JL;
|
||||
else
|
||||
/* LT is unsigned '<', JB in x86 */
|
||||
jmp_cond = IA32_JB;
|
||||
break;
|
||||
case BPF_JSGE:
|
||||
if (!is_cmp_lo)
|
||||
/* Signed '>=', GE in x86 */
|
||||
jmp_cond = IA32_JGE;
|
||||
else
|
||||
/* GE is unsigned '>=', JAE in x86 */
|
||||
jmp_cond = IA32_JAE;
|
||||
break;
|
||||
case BPF_JSLE:
|
||||
if (!is_cmp_lo)
|
||||
/* Signed '<=', LE in x86 */
|
||||
jmp_cond = IA32_JLE;
|
||||
else
|
||||
/* LE is unsigned '<=', JBE in x86 */
|
||||
jmp_cond = IA32_JBE;
|
||||
break;
|
||||
default: /* to silence GCC warning */
|
||||
jmp_cond = COND_JMP_OPCODE_INVALID;
|
||||
break;
|
||||
}
|
||||
|
||||
return jmp_cond;
|
||||
}
|
||||
|
||||
static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image,
|
||||
int oldproglen, struct jit_context *ctx)
|
||||
{
|
||||
@ -2069,10 +2133,6 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image,
|
||||
case BPF_JMP | BPF_JLT | BPF_X:
|
||||
case BPF_JMP | BPF_JGE | BPF_X:
|
||||
case BPF_JMP | BPF_JLE | BPF_X:
|
||||
case BPF_JMP | BPF_JSGT | BPF_X:
|
||||
case BPF_JMP | BPF_JSLE | BPF_X:
|
||||
case BPF_JMP | BPF_JSLT | BPF_X:
|
||||
case BPF_JMP | BPF_JSGE | BPF_X:
|
||||
case BPF_JMP32 | BPF_JEQ | BPF_X:
|
||||
case BPF_JMP32 | BPF_JNE | BPF_X:
|
||||
case BPF_JMP32 | BPF_JGT | BPF_X:
|
||||
@ -2118,6 +2178,40 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image,
|
||||
EMIT2(0x39, add_2reg(0xC0, dreg_lo, sreg_lo));
|
||||
goto emit_cond_jmp;
|
||||
}
|
||||
case BPF_JMP | BPF_JSGT | BPF_X:
|
||||
case BPF_JMP | BPF_JSLE | BPF_X:
|
||||
case BPF_JMP | BPF_JSLT | BPF_X:
|
||||
case BPF_JMP | BPF_JSGE | BPF_X: {
|
||||
u8 dreg_lo = dstk ? IA32_EAX : dst_lo;
|
||||
u8 dreg_hi = dstk ? IA32_EDX : dst_hi;
|
||||
u8 sreg_lo = sstk ? IA32_ECX : src_lo;
|
||||
u8 sreg_hi = sstk ? IA32_EBX : src_hi;
|
||||
|
||||
if (dstk) {
|
||||
EMIT3(0x8B, add_2reg(0x40, IA32_EBP, IA32_EAX),
|
||||
STACK_VAR(dst_lo));
|
||||
EMIT3(0x8B,
|
||||
add_2reg(0x40, IA32_EBP,
|
||||
IA32_EDX),
|
||||
STACK_VAR(dst_hi));
|
||||
}
|
||||
|
||||
if (sstk) {
|
||||
EMIT3(0x8B, add_2reg(0x40, IA32_EBP, IA32_ECX),
|
||||
STACK_VAR(src_lo));
|
||||
EMIT3(0x8B,
|
||||
add_2reg(0x40, IA32_EBP,
|
||||
IA32_EBX),
|
||||
STACK_VAR(src_hi));
|
||||
}
|
||||
|
||||
/* cmp dreg_hi,sreg_hi */
|
||||
EMIT2(0x39, add_2reg(0xC0, dreg_hi, sreg_hi));
|
||||
EMIT2(IA32_JNE, 10);
|
||||
/* cmp dreg_lo,sreg_lo */
|
||||
EMIT2(0x39, add_2reg(0xC0, dreg_lo, sreg_lo));
|
||||
goto emit_cond_jmp_signed;
|
||||
}
|
||||
case BPF_JMP | BPF_JSET | BPF_X:
|
||||
case BPF_JMP32 | BPF_JSET | BPF_X: {
|
||||
bool is_jmp64 = BPF_CLASS(insn->code) == BPF_JMP;
|
||||
@ -2194,10 +2288,6 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image,
|
||||
case BPF_JMP | BPF_JLT | BPF_K:
|
||||
case BPF_JMP | BPF_JGE | BPF_K:
|
||||
case BPF_JMP | BPF_JLE | BPF_K:
|
||||
case BPF_JMP | BPF_JSGT | BPF_K:
|
||||
case BPF_JMP | BPF_JSLE | BPF_K:
|
||||
case BPF_JMP | BPF_JSLT | BPF_K:
|
||||
case BPF_JMP | BPF_JSGE | BPF_K:
|
||||
case BPF_JMP32 | BPF_JEQ | BPF_K:
|
||||
case BPF_JMP32 | BPF_JNE | BPF_K:
|
||||
case BPF_JMP32 | BPF_JGT | BPF_K:
|
||||
@ -2238,50 +2328,9 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image,
|
||||
/* cmp dreg_lo,sreg_lo */
|
||||
EMIT2(0x39, add_2reg(0xC0, dreg_lo, sreg_lo));
|
||||
|
||||
emit_cond_jmp: /* Convert BPF opcode to x86 */
|
||||
switch (BPF_OP(code)) {
|
||||
case BPF_JEQ:
|
||||
jmp_cond = IA32_JE;
|
||||
break;
|
||||
case BPF_JSET:
|
||||
case BPF_JNE:
|
||||
jmp_cond = IA32_JNE;
|
||||
break;
|
||||
case BPF_JGT:
|
||||
/* GT is unsigned '>', JA in x86 */
|
||||
jmp_cond = IA32_JA;
|
||||
break;
|
||||
case BPF_JLT:
|
||||
/* LT is unsigned '<', JB in x86 */
|
||||
jmp_cond = IA32_JB;
|
||||
break;
|
||||
case BPF_JGE:
|
||||
/* GE is unsigned '>=', JAE in x86 */
|
||||
jmp_cond = IA32_JAE;
|
||||
break;
|
||||
case BPF_JLE:
|
||||
/* LE is unsigned '<=', JBE in x86 */
|
||||
jmp_cond = IA32_JBE;
|
||||
break;
|
||||
case BPF_JSGT:
|
||||
/* Signed '>', GT in x86 */
|
||||
jmp_cond = IA32_JG;
|
||||
break;
|
||||
case BPF_JSLT:
|
||||
/* Signed '<', LT in x86 */
|
||||
jmp_cond = IA32_JL;
|
||||
break;
|
||||
case BPF_JSGE:
|
||||
/* Signed '>=', GE in x86 */
|
||||
jmp_cond = IA32_JGE;
|
||||
break;
|
||||
case BPF_JSLE:
|
||||
/* Signed '<=', LE in x86 */
|
||||
jmp_cond = IA32_JLE;
|
||||
break;
|
||||
default: /* to silence GCC warning */
|
||||
emit_cond_jmp: jmp_cond = get_cond_jmp_opcode(BPF_OP(code), false);
|
||||
if (jmp_cond == COND_JMP_OPCODE_INVALID)
|
||||
return -EFAULT;
|
||||
}
|
||||
jmp_offset = addrs[i + insn->off] - addrs[i];
|
||||
if (is_imm8(jmp_offset)) {
|
||||
EMIT2(jmp_cond, jmp_offset);
|
||||
@ -2291,7 +2340,66 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image,
|
||||
pr_err("cond_jmp gen bug %llx\n", jmp_offset);
|
||||
return -EFAULT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BPF_JMP | BPF_JSGT | BPF_K:
|
||||
case BPF_JMP | BPF_JSLE | BPF_K:
|
||||
case BPF_JMP | BPF_JSLT | BPF_K:
|
||||
case BPF_JMP | BPF_JSGE | BPF_K: {
|
||||
u8 dreg_lo = dstk ? IA32_EAX : dst_lo;
|
||||
u8 dreg_hi = dstk ? IA32_EDX : dst_hi;
|
||||
u8 sreg_lo = IA32_ECX;
|
||||
u8 sreg_hi = IA32_EBX;
|
||||
u32 hi;
|
||||
|
||||
if (dstk) {
|
||||
EMIT3(0x8B, add_2reg(0x40, IA32_EBP, IA32_EAX),
|
||||
STACK_VAR(dst_lo));
|
||||
EMIT3(0x8B,
|
||||
add_2reg(0x40, IA32_EBP,
|
||||
IA32_EDX),
|
||||
STACK_VAR(dst_hi));
|
||||
}
|
||||
|
||||
/* mov ecx,imm32 */
|
||||
EMIT2_off32(0xC7, add_1reg(0xC0, IA32_ECX), imm32);
|
||||
hi = imm32 & (1 << 31) ? (u32)~0 : 0;
|
||||
/* mov ebx,imm32 */
|
||||
EMIT2_off32(0xC7, add_1reg(0xC0, IA32_EBX), hi);
|
||||
/* cmp dreg_hi,sreg_hi */
|
||||
EMIT2(0x39, add_2reg(0xC0, dreg_hi, sreg_hi));
|
||||
EMIT2(IA32_JNE, 10);
|
||||
/* cmp dreg_lo,sreg_lo */
|
||||
EMIT2(0x39, add_2reg(0xC0, dreg_lo, sreg_lo));
|
||||
|
||||
/*
|
||||
* For simplicity of branch offset computation,
|
||||
* let's use fixed jump coding here.
|
||||
*/
|
||||
emit_cond_jmp_signed: /* Check the condition for low 32-bit comparison */
|
||||
jmp_cond = get_cond_jmp_opcode(BPF_OP(code), true);
|
||||
if (jmp_cond == COND_JMP_OPCODE_INVALID)
|
||||
return -EFAULT;
|
||||
jmp_offset = addrs[i + insn->off] - addrs[i] + 8;
|
||||
if (is_simm32(jmp_offset)) {
|
||||
EMIT2_off32(0x0F, jmp_cond + 0x10, jmp_offset);
|
||||
} else {
|
||||
pr_err("cond_jmp gen bug %llx\n", jmp_offset);
|
||||
return -EFAULT;
|
||||
}
|
||||
EMIT2(0xEB, 6);
|
||||
|
||||
/* Check the condition for high 32-bit comparison */
|
||||
jmp_cond = get_cond_jmp_opcode(BPF_OP(code), false);
|
||||
if (jmp_cond == COND_JMP_OPCODE_INVALID)
|
||||
return -EFAULT;
|
||||
jmp_offset = addrs[i + insn->off] - addrs[i];
|
||||
if (is_simm32(jmp_offset)) {
|
||||
EMIT2_off32(0x0F, jmp_cond + 0x10, jmp_offset);
|
||||
} else {
|
||||
pr_err("cond_jmp gen bug %llx\n", jmp_offset);
|
||||
return -EFAULT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BPF_JMP | BPF_JA:
|
||||
|
@ -26,7 +26,7 @@
|
||||
#define SIOCSPGRP _IOW('s', 8, pid_t)
|
||||
#define SIOCGPGRP _IOR('s', 9, pid_t)
|
||||
|
||||
#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
|
||||
#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
|
||||
#define SIOCGSTAMP_OLD 0x8906 /* Get stamp (timeval) */
|
||||
#define SIOCGSTAMPNS_OLD 0x8907 /* Get stamp (timespec) */
|
||||
|
||||
#endif /* _XTENSA_SOCKIOS_H */
|
||||
|
@ -465,8 +465,8 @@ static int crypto_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh,
|
||||
return err;
|
||||
}
|
||||
|
||||
err = nlmsg_parse(nlh, crypto_msg_min[type], attrs, CRYPTOCFGA_MAX,
|
||||
crypto_policy, extack);
|
||||
err = nlmsg_parse_deprecated(nlh, crypto_msg_min[type], attrs,
|
||||
CRYPTOCFGA_MAX, crypto_policy, extack);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
|
@ -2826,8 +2826,8 @@ static int ia_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
|
||||
case 0x6:
|
||||
{
|
||||
ia_cmds.status = 0;
|
||||
printk("skb = 0x%lx\n", (long)skb_peek(&iadev->tx_backlog));
|
||||
printk("rtn_q: 0x%lx\n",(long)ia_deque_rtn_q(&iadev->tx_return_q));
|
||||
printk("skb = 0x%p\n", skb_peek(&iadev->tx_backlog));
|
||||
printk("rtn_q: 0x%p\n",ia_deque_rtn_q(&iadev->tx_return_q));
|
||||
}
|
||||
break;
|
||||
case 0x8:
|
||||
|
@ -114,7 +114,7 @@ static int drbd_msg_put_info(struct sk_buff *skb, const char *info)
|
||||
if (!info || !info[0])
|
||||
return 0;
|
||||
|
||||
nla = nla_nest_start(skb, DRBD_NLA_CFG_REPLY);
|
||||
nla = nla_nest_start_noflag(skb, DRBD_NLA_CFG_REPLY);
|
||||
if (!nla)
|
||||
return err;
|
||||
|
||||
@ -135,7 +135,7 @@ static int drbd_msg_sprintf_info(struct sk_buff *skb, const char *fmt, ...)
|
||||
int err = -EMSGSIZE;
|
||||
int len;
|
||||
|
||||
nla = nla_nest_start(skb, DRBD_NLA_CFG_REPLY);
|
||||
nla = nla_nest_start_noflag(skb, DRBD_NLA_CFG_REPLY);
|
||||
if (!nla)
|
||||
return err;
|
||||
|
||||
@ -3269,7 +3269,7 @@ static int nla_put_drbd_cfg_context(struct sk_buff *skb,
|
||||
struct drbd_device *device)
|
||||
{
|
||||
struct nlattr *nla;
|
||||
nla = nla_nest_start(skb, DRBD_NLA_CFG_CONTEXT);
|
||||
nla = nla_nest_start_noflag(skb, DRBD_NLA_CFG_CONTEXT);
|
||||
if (!nla)
|
||||
goto nla_put_failure;
|
||||
if (device &&
|
||||
@ -3837,7 +3837,7 @@ static int nla_put_status_info(struct sk_buff *skb, struct drbd_device *device,
|
||||
if (err)
|
||||
goto nla_put_failure;
|
||||
|
||||
nla = nla_nest_start(skb, DRBD_NLA_STATE_INFO);
|
||||
nla = nla_nest_start_noflag(skb, DRBD_NLA_STATE_INFO);
|
||||
if (!nla)
|
||||
goto nla_put_failure;
|
||||
if (nla_put_u32(skb, T_sib_reason, sib ? sib->sib_reason : SIB_GET_STATUS_REPLY) ||
|
||||
|
@ -35,7 +35,8 @@ int drbd_nla_parse_nested(struct nlattr *tb[], int maxtype, struct nlattr *nla,
|
||||
|
||||
err = drbd_nla_check_mandatory(maxtype, nla);
|
||||
if (!err)
|
||||
err = nla_parse_nested(tb, maxtype, nla, policy, NULL);
|
||||
err = nla_parse_nested_deprecated(tb, maxtype, nla, policy,
|
||||
NULL);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
@ -44,6 +44,9 @@
|
||||
#include <linux/nbd-netlink.h>
|
||||
#include <net/genetlink.h>
|
||||
|
||||
#define CREATE_TRACE_POINTS
|
||||
#include <trace/events/nbd.h>
|
||||
|
||||
static DEFINE_IDR(nbd_index_idr);
|
||||
static DEFINE_MUTEX(nbd_index_mutex);
|
||||
static int nbd_total_devices = 0;
|
||||
@ -510,6 +513,10 @@ static int nbd_send_cmd(struct nbd_device *nbd, struct nbd_cmd *cmd, int index)
|
||||
if (sent) {
|
||||
if (sent >= sizeof(request)) {
|
||||
skip = sent - sizeof(request);
|
||||
|
||||
/* initialize handle for tracing purposes */
|
||||
handle = nbd_cmd_handle(cmd);
|
||||
|
||||
goto send_pages;
|
||||
}
|
||||
iov_iter_advance(&from, sent);
|
||||
@ -526,11 +533,14 @@ static int nbd_send_cmd(struct nbd_device *nbd, struct nbd_cmd *cmd, int index)
|
||||
handle = nbd_cmd_handle(cmd);
|
||||
memcpy(request.handle, &handle, sizeof(handle));
|
||||
|
||||
trace_nbd_send_request(&request, nbd->index, blk_mq_rq_from_pdu(cmd));
|
||||
|
||||
dev_dbg(nbd_to_dev(nbd), "request %p: sending control (%s@%llu,%uB)\n",
|
||||
req, nbdcmd_to_ascii(type),
|
||||
(unsigned long long)blk_rq_pos(req) << 9, blk_rq_bytes(req));
|
||||
result = sock_xmit(nbd, index, 1, &from,
|
||||
(type == NBD_CMD_WRITE) ? MSG_MORE : 0, &sent);
|
||||
trace_nbd_header_sent(req, handle);
|
||||
if (result <= 0) {
|
||||
if (was_interrupted(result)) {
|
||||
/* If we havne't sent anything we can just return BUSY,
|
||||
@ -603,6 +613,7 @@ static int nbd_send_cmd(struct nbd_device *nbd, struct nbd_cmd *cmd, int index)
|
||||
bio = next;
|
||||
}
|
||||
out:
|
||||
trace_nbd_payload_sent(req, handle);
|
||||
nsock->pending = NULL;
|
||||
nsock->sent = 0;
|
||||
return 0;
|
||||
@ -650,6 +661,7 @@ static struct nbd_cmd *nbd_read_stat(struct nbd_device *nbd, int index)
|
||||
tag, req);
|
||||
return ERR_PTR(-ENOENT);
|
||||
}
|
||||
trace_nbd_header_received(req, handle);
|
||||
cmd = blk_mq_rq_to_pdu(req);
|
||||
|
||||
mutex_lock(&cmd->lock);
|
||||
@ -703,6 +715,7 @@ static struct nbd_cmd *nbd_read_stat(struct nbd_device *nbd, int index)
|
||||
}
|
||||
}
|
||||
out:
|
||||
trace_nbd_payload_received(req, handle);
|
||||
mutex_unlock(&cmd->lock);
|
||||
return ret ? ERR_PTR(ret) : cmd;
|
||||
}
|
||||
@ -1797,8 +1810,10 @@ static int nbd_genl_connect(struct sk_buff *skb, struct genl_info *info)
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
ret = nla_parse_nested(socks, NBD_SOCK_MAX, attr,
|
||||
nbd_sock_policy, info->extack);
|
||||
ret = nla_parse_nested_deprecated(socks, NBD_SOCK_MAX,
|
||||
attr,
|
||||
nbd_sock_policy,
|
||||
info->extack);
|
||||
if (ret != 0) {
|
||||
printk(KERN_ERR "nbd: error processing sock list\n");
|
||||
ret = -EINVAL;
|
||||
@ -1968,8 +1983,10 @@ static int nbd_genl_reconfigure(struct sk_buff *skb, struct genl_info *info)
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
ret = nla_parse_nested(socks, NBD_SOCK_MAX, attr,
|
||||
nbd_sock_policy, info->extack);
|
||||
ret = nla_parse_nested_deprecated(socks, NBD_SOCK_MAX,
|
||||
attr,
|
||||
nbd_sock_policy,
|
||||
info->extack);
|
||||
if (ret != 0) {
|
||||
printk(KERN_ERR "nbd: error processing sock list\n");
|
||||
ret = -EINVAL;
|
||||
@ -1999,22 +2016,22 @@ static int nbd_genl_reconfigure(struct sk_buff *skb, struct genl_info *info)
|
||||
static const struct genl_ops nbd_connect_genl_ops[] = {
|
||||
{
|
||||
.cmd = NBD_CMD_CONNECT,
|
||||
.policy = nbd_attr_policy,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = nbd_genl_connect,
|
||||
},
|
||||
{
|
||||
.cmd = NBD_CMD_DISCONNECT,
|
||||
.policy = nbd_attr_policy,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = nbd_genl_disconnect,
|
||||
},
|
||||
{
|
||||
.cmd = NBD_CMD_RECONFIGURE,
|
||||
.policy = nbd_attr_policy,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = nbd_genl_reconfigure,
|
||||
},
|
||||
{
|
||||
.cmd = NBD_CMD_STATUS,
|
||||
.policy = nbd_attr_policy,
|
||||
.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
|
||||
.doit = nbd_genl_status,
|
||||
},
|
||||
};
|
||||
@ -2031,6 +2048,7 @@ static struct genl_family nbd_genl_family __ro_after_init = {
|
||||
.ops = nbd_connect_genl_ops,
|
||||
.n_ops = ARRAY_SIZE(nbd_connect_genl_ops),
|
||||
.maxattr = NBD_ATTR_MAX,
|
||||
.policy = nbd_attr_policy,
|
||||
.mcgrps = nbd_mcast_grps,
|
||||
.n_mcgrps = ARRAY_SIZE(nbd_mcast_grps),
|
||||
};
|
||||
@ -2050,7 +2068,7 @@ static int populate_nbd_status(struct nbd_device *nbd, struct sk_buff *reply)
|
||||
*/
|
||||
if (refcount_read(&nbd->config_refs))
|
||||
connected = 1;
|
||||
dev_opt = nla_nest_start(reply, NBD_DEVICE_ITEM);
|
||||
dev_opt = nla_nest_start_noflag(reply, NBD_DEVICE_ITEM);
|
||||
if (!dev_opt)
|
||||
return -EMSGSIZE;
|
||||
ret = nla_put_u32(reply, NBD_DEVICE_INDEX, nbd->index);
|
||||
@ -2098,7 +2116,7 @@ static int nbd_genl_status(struct sk_buff *skb, struct genl_info *info)
|
||||
goto out;
|
||||
}
|
||||
|
||||
dev_list = nla_nest_start(reply, NBD_ATTR_DEVICE_LIST);
|
||||
dev_list = nla_nest_start_noflag(reply, NBD_ATTR_DEVICE_LIST);
|
||||
if (index == -1) {
|
||||
ret = idr_for_each(&nbd_index_idr, &status_cb, reply);
|
||||
if (ret) {
|
||||
|
@ -336,7 +336,7 @@ config BT_MRVL
|
||||
The core driver to support Marvell Bluetooth devices.
|
||||
|
||||
This driver is required if you want to support
|
||||
Marvell Bluetooth devices, such as 8688/8787/8797/8887/8897/8977/8997.
|
||||
Marvell Bluetooth devices, such as 8688/8787/8797/8887/8897/8977/8987/8997.
|
||||
|
||||
Say Y here to compile Marvell Bluetooth driver
|
||||
into the kernel or say M to compile it as module.
|
||||
@ -350,7 +350,7 @@ config BT_MRVL_SDIO
|
||||
The driver for Marvell Bluetooth chipsets with SDIO interface.
|
||||
|
||||
This driver is required if you want to use Marvell Bluetooth
|
||||
devices with SDIO interface. Currently SD8688/SD8787/SD8797/SD8887/SD8897/SD8977/SD8997
|
||||
devices with SDIO interface. Currently SD8688/SD8787/SD8797/SD8887/SD8897/SD8977/SD8987/SD8997
|
||||
chipsets are supported.
|
||||
|
||||
Say Y here to compile support for Marvell BT-over-SDIO driver
|
||||
@ -379,6 +379,17 @@ config BT_WILINK
|
||||
Say Y here to compile support for Texas Instrument's WiLink7 driver
|
||||
into the kernel or say M to compile it as module (btwilink).
|
||||
|
||||
config BT_MTKSDIO
|
||||
tristate "MediaTek HCI SDIO driver"
|
||||
depends on MMC
|
||||
help
|
||||
MediaTek Bluetooth HCI SDIO driver.
|
||||
This driver is required if you want to use MediaTek Bluetooth
|
||||
with SDIO interface.
|
||||
|
||||
Say Y here to compile support for MediaTek Bluetooth SDIO devices
|
||||
into the kernel or say M to compile it as module (btmtksdio).
|
||||
|
||||
config BT_MTKUART
|
||||
tristate "MediaTek HCI UART driver"
|
||||
depends on SERIAL_DEV_BUS
|
||||
|
@ -20,6 +20,7 @@ obj-$(CONFIG_BT_ATH3K) += ath3k.o
|
||||
obj-$(CONFIG_BT_MRVL) += btmrvl.o
|
||||
obj-$(CONFIG_BT_MRVL_SDIO) += btmrvl_sdio.o
|
||||
obj-$(CONFIG_BT_WILINK) += btwilink.o
|
||||
obj-$(CONFIG_BT_MTKSDIO) += btmtksdio.o
|
||||
obj-$(CONFIG_BT_MTKUART) += btmtkuart.o
|
||||
obj-$(CONFIG_BT_QCOMSMD) += btqcomsmd.o
|
||||
obj-$(CONFIG_BT_BCM) += btbcm.o
|
||||
|
@ -34,9 +34,11 @@
|
||||
|
||||
#define BDADDR_BCM20702A0 (&(bdaddr_t) {{0x00, 0xa0, 0x02, 0x70, 0x20, 0x00}})
|
||||
#define BDADDR_BCM20702A1 (&(bdaddr_t) {{0x00, 0x00, 0xa0, 0x02, 0x70, 0x20}})
|
||||
#define BDADDR_BCM2076B1 (&(bdaddr_t) {{0x79, 0x56, 0x00, 0xa0, 0x76, 0x20}})
|
||||
#define BDADDR_BCM43430A0 (&(bdaddr_t) {{0xac, 0x1f, 0x12, 0xa0, 0x43, 0x43}})
|
||||
#define BDADDR_BCM4324B3 (&(bdaddr_t) {{0x00, 0x00, 0x00, 0xb3, 0x24, 0x43}})
|
||||
#define BDADDR_BCM4330B1 (&(bdaddr_t) {{0x00, 0x00, 0x00, 0xb1, 0x30, 0x43}})
|
||||
#define BDADDR_BCM43341B (&(bdaddr_t) {{0xac, 0x1f, 0x00, 0x1b, 0x34, 0x43}})
|
||||
|
||||
int btbcm_check_bdaddr(struct hci_dev *hdev)
|
||||
{
|
||||
@ -69,6 +71,9 @@ int btbcm_check_bdaddr(struct hci_dev *hdev)
|
||||
* The address 20:70:02:A0:00:00 indicates a BCM20702A1 controller
|
||||
* with no configured address.
|
||||
*
|
||||
* The address 20:76:A0:00:56:79 indicates a BCM2076B1 controller
|
||||
* with no configured address.
|
||||
*
|
||||
* The address 43:24:B3:00:00:00 indicates a BCM4324B3 controller
|
||||
* with waiting for configuration state.
|
||||
*
|
||||
@ -80,9 +85,11 @@ int btbcm_check_bdaddr(struct hci_dev *hdev)
|
||||
*/
|
||||
if (!bacmp(&bda->bdaddr, BDADDR_BCM20702A0) ||
|
||||
!bacmp(&bda->bdaddr, BDADDR_BCM20702A1) ||
|
||||
!bacmp(&bda->bdaddr, BDADDR_BCM2076B1) ||
|
||||
!bacmp(&bda->bdaddr, BDADDR_BCM4324B3) ||
|
||||
!bacmp(&bda->bdaddr, BDADDR_BCM4330B1) ||
|
||||
!bacmp(&bda->bdaddr, BDADDR_BCM43430A0)) {
|
||||
!bacmp(&bda->bdaddr, BDADDR_BCM43430A0) ||
|
||||
!bacmp(&bda->bdaddr, BDADDR_BCM43341B)) {
|
||||
bt_dev_info(hdev, "BCM: Using default device address (%pMR)",
|
||||
&bda->bdaddr);
|
||||
set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
|
||||
@ -333,6 +340,7 @@ struct bcm_subver_table {
|
||||
static const struct bcm_subver_table bcm_uart_subver_table[] = {
|
||||
{ 0x4103, "BCM4330B1" }, /* 002.001.003 */
|
||||
{ 0x410e, "BCM43341B0" }, /* 002.001.014 */
|
||||
{ 0x4204, "BCM2076B1" }, /* 002.002.004 */
|
||||
{ 0x4406, "BCM4324B3" }, /* 002.004.006 */
|
||||
{ 0x6109, "BCM4335C0" }, /* 003.001.009 */
|
||||
{ 0x610c, "BCM4354" }, /* 003.001.012 */
|
||||
|
@ -235,6 +235,29 @@ static const struct btmrvl_sdio_card_reg btmrvl_reg_8977 = {
|
||||
.fw_dump_end = 0xf8,
|
||||
};
|
||||
|
||||
static const struct btmrvl_sdio_card_reg btmrvl_reg_8987 = {
|
||||
.cfg = 0x00,
|
||||
.host_int_mask = 0x08,
|
||||
.host_intstatus = 0x0c,
|
||||
.card_status = 0x5c,
|
||||
.sq_read_base_addr_a0 = 0xf8,
|
||||
.sq_read_base_addr_a1 = 0xf9,
|
||||
.card_revision = 0xc8,
|
||||
.card_fw_status0 = 0xe8,
|
||||
.card_fw_status1 = 0xe9,
|
||||
.card_rx_len = 0xea,
|
||||
.card_rx_unit = 0xeb,
|
||||
.io_port_0 = 0xe4,
|
||||
.io_port_1 = 0xe5,
|
||||
.io_port_2 = 0xe6,
|
||||
.int_read_to_clear = true,
|
||||
.host_int_rsr = 0x04,
|
||||
.card_misc_cfg = 0xd8,
|
||||
.fw_dump_ctrl = 0xf0,
|
||||
.fw_dump_start = 0xf1,
|
||||
.fw_dump_end = 0xf8,
|
||||
};
|
||||
|
||||
static const struct btmrvl_sdio_card_reg btmrvl_reg_8997 = {
|
||||
.cfg = 0x00,
|
||||
.host_int_mask = 0x08,
|
||||
@ -312,6 +335,15 @@ static const struct btmrvl_sdio_device btmrvl_sdio_sd8977 = {
|
||||
.supports_fw_dump = true,
|
||||
};
|
||||
|
||||
static const struct btmrvl_sdio_device btmrvl_sdio_sd8987 = {
|
||||
.helper = NULL,
|
||||
.firmware = "mrvl/sd8987_uapsta.bin",
|
||||
.reg = &btmrvl_reg_8987,
|
||||
.support_pscan_win_report = true,
|
||||
.sd_blksz_fw_dl = 256,
|
||||
.supports_fw_dump = true,
|
||||
};
|
||||
|
||||
static const struct btmrvl_sdio_device btmrvl_sdio_sd8997 = {
|
||||
.helper = NULL,
|
||||
.firmware = "mrvl/sd8997_uapsta.bin",
|
||||
@ -343,6 +375,9 @@ static const struct sdio_device_id btmrvl_sdio_ids[] = {
|
||||
/* Marvell SD8977 Bluetooth device */
|
||||
{ SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x9146),
|
||||
.driver_data = (unsigned long)&btmrvl_sdio_sd8977 },
|
||||
/* Marvell SD8987 Bluetooth device */
|
||||
{ SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x914A),
|
||||
.driver_data = (unsigned long)&btmrvl_sdio_sd8987 },
|
||||
/* Marvell SD8997 Bluetooth device */
|
||||
{ SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x9142),
|
||||
.driver_data = (unsigned long)&btmrvl_sdio_sd8997 },
|
||||
@ -1797,4 +1832,5 @@ MODULE_FIRMWARE("mrvl/sd8797_uapsta.bin");
|
||||
MODULE_FIRMWARE("mrvl/sd8887_uapsta.bin");
|
||||
MODULE_FIRMWARE("mrvl/sd8897_uapsta.bin");
|
||||
MODULE_FIRMWARE("mrvl/sd8977_uapsta.bin");
|
||||
MODULE_FIRMWARE("mrvl/sd8987_uapsta.bin");
|
||||
MODULE_FIRMWARE("mrvl/sd8997_uapsta.bin");
|
||||
|
1101
drivers/bluetooth/btmtksdio.c
Normal file
1101
drivers/bluetooth/btmtksdio.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -661,7 +661,7 @@ static int btmtkuart_change_baudrate(struct hci_dev *hdev)
|
||||
{
|
||||
struct btmtkuart_dev *bdev = hci_get_drvdata(hdev);
|
||||
struct btmtk_hci_wmt_params wmt_params;
|
||||
u32 baudrate;
|
||||
__le32 baudrate;
|
||||
u8 param;
|
||||
int err;
|
||||
|
||||
|
@ -336,7 +336,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
|
||||
{
|
||||
struct rome_config config;
|
||||
int err;
|
||||
u8 rom_ver;
|
||||
u8 rom_ver = 0;
|
||||
|
||||
bt_dev_dbg(hdev, "QCA setup on UART");
|
||||
|
||||
@ -344,7 +344,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
|
||||
|
||||
/* Download rampatch file */
|
||||
config.type = TLV_TYPE_PATCH;
|
||||
if (soc_type == QCA_WCN3990) {
|
||||
if (qca_is_wcn399x(soc_type)) {
|
||||
/* Firmware files to download are based on ROM version.
|
||||
* ROM version is derived from last two bytes of soc_ver.
|
||||
*/
|
||||
@ -365,7 +365,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
|
||||
|
||||
/* Download NVM configuration */
|
||||
config.type = TLV_TYPE_NVM;
|
||||
if (soc_type == QCA_WCN3990)
|
||||
if (qca_is_wcn399x(soc_type))
|
||||
snprintf(config.fwname, sizeof(config.fwname),
|
||||
"qca/crnv%02x.bin", rom_ver);
|
||||
else
|
||||
@ -410,6 +410,7 @@ int qca_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(qca_set_bdaddr);
|
||||
|
||||
|
||||
MODULE_AUTHOR("Ben Young Tae Kim <ytkim@qca.qualcomm.com>");
|
||||
MODULE_DESCRIPTION("Bluetooth support for Qualcomm Atheros family ver " VERSION);
|
||||
MODULE_VERSION(VERSION);
|
||||
|
@ -41,7 +41,7 @@
|
||||
#define QCA_WCN3990_POWERON_PULSE 0xFC
|
||||
#define QCA_WCN3990_POWEROFF_PULSE 0xC0
|
||||
|
||||
enum qca_bardrate {
|
||||
enum qca_baudrate {
|
||||
QCA_BAUDRATE_115200 = 0,
|
||||
QCA_BAUDRATE_57600,
|
||||
QCA_BAUDRATE_38400,
|
||||
@ -132,7 +132,8 @@ enum qca_btsoc_type {
|
||||
QCA_INVALID = -1,
|
||||
QCA_AR3002,
|
||||
QCA_ROME,
|
||||
QCA_WCN3990
|
||||
QCA_WCN3990,
|
||||
QCA_WCN3998,
|
||||
};
|
||||
|
||||
#if IS_ENABLED(CONFIG_BT_QCA)
|
||||
@ -142,6 +143,10 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
|
||||
enum qca_btsoc_type soc_type, u32 soc_ver);
|
||||
int qca_read_soc_version(struct hci_dev *hdev, u32 *soc_version);
|
||||
int qca_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr);
|
||||
static inline bool qca_is_wcn399x(enum qca_btsoc_type soc_type)
|
||||
{
|
||||
return soc_type == QCA_WCN3990 || soc_type == QCA_WCN3998;
|
||||
}
|
||||
#else
|
||||
|
||||
static inline int qca_set_bdaddr_rome(struct hci_dev *hdev, const bdaddr_t *bdaddr)
|
||||
@ -165,4 +170,8 @@ static inline int qca_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static inline bool qca_is_wcn399x(enum qca_btsoc_type soc_type)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
@ -376,20 +376,7 @@ static struct sdio_driver btsdio_driver = {
|
||||
.id_table = btsdio_table,
|
||||
};
|
||||
|
||||
static int __init btsdio_init(void)
|
||||
{
|
||||
BT_INFO("Generic Bluetooth SDIO driver ver %s", VERSION);
|
||||
|
||||
return sdio_register_driver(&btsdio_driver);
|
||||
}
|
||||
|
||||
static void __exit btsdio_exit(void)
|
||||
{
|
||||
sdio_unregister_driver(&btsdio_driver);
|
||||
}
|
||||
|
||||
module_init(btsdio_init);
|
||||
module_exit(btsdio_exit);
|
||||
module_sdio_driver(btsdio_driver);
|
||||
|
||||
MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
|
||||
MODULE_DESCRIPTION("Generic Bluetooth SDIO driver ver " VERSION);
|
||||
|
@ -228,9 +228,15 @@ static int bcm_gpio_set_power(struct bcm_device *dev, bool powered)
|
||||
int err;
|
||||
|
||||
if (powered && !dev->res_enabled) {
|
||||
err = regulator_bulk_enable(BCM_NUM_SUPPLIES, dev->supplies);
|
||||
if (err)
|
||||
return err;
|
||||
/* Intel Macs use bcm_apple_get_resources() and don't
|
||||
* have regulator supplies configured.
|
||||
*/
|
||||
if (dev->supplies[0].supply) {
|
||||
err = regulator_bulk_enable(BCM_NUM_SUPPLIES,
|
||||
dev->supplies);
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
/* LPO clock needs to be 32.768 kHz */
|
||||
err = clk_set_rate(dev->lpo_clk, 32768);
|
||||
@ -259,7 +265,13 @@ static int bcm_gpio_set_power(struct bcm_device *dev, bool powered)
|
||||
if (!powered && dev->res_enabled) {
|
||||
clk_disable_unprepare(dev->txco_clk);
|
||||
clk_disable_unprepare(dev->lpo_clk);
|
||||
regulator_bulk_disable(BCM_NUM_SUPPLIES, dev->supplies);
|
||||
|
||||
/* Intel Macs use bcm_apple_get_resources() and don't
|
||||
* have regulator supplies configured.
|
||||
*/
|
||||
if (dev->supplies[0].supply)
|
||||
regulator_bulk_disable(BCM_NUM_SUPPLIES,
|
||||
dev->supplies);
|
||||
}
|
||||
|
||||
/* wait for device to power on and come out of reset */
|
||||
|
@ -536,7 +536,7 @@ static void h5_unslip_one_byte(struct h5 *h5, unsigned char c)
|
||||
skb_put_data(h5->rx_skb, byte, 1);
|
||||
h5->rx_pending--;
|
||||
|
||||
BT_DBG("unsliped 0x%02hhx, rx_pending %zu", *byte, h5->rx_pending);
|
||||
BT_DBG("unslipped 0x%02hhx, rx_pending %zu", *byte, h5->rx_pending);
|
||||
}
|
||||
|
||||
static void h5_reset_rx(struct h5 *h5)
|
||||
|
@ -54,9 +54,6 @@
|
||||
#define HCI_IBS_WAKE_ACK 0xFC
|
||||
#define HCI_MAX_IBS_SIZE 10
|
||||
|
||||
/* Controller states */
|
||||
#define STATE_IN_BAND_SLEEP_ENABLED 1
|
||||
|
||||
#define IBS_WAKE_RETRANS_TIMEOUT_MS 100
|
||||
#define IBS_TX_IDLE_TIMEOUT_MS 2000
|
||||
#define CMD_TRANS_TIMEOUT_MS 100
|
||||
@ -67,6 +64,10 @@
|
||||
/* Controller debug log header */
|
||||
#define QCA_DEBUG_HANDLE 0x2EDC
|
||||
|
||||
enum qca_flags {
|
||||
QCA_IBS_ENABLED,
|
||||
};
|
||||
|
||||
/* HCI_IBS transmit side sleep protocol states */
|
||||
enum tx_ibs_states {
|
||||
HCI_IBS_TX_ASLEEP,
|
||||
@ -174,6 +175,21 @@ static int qca_power_setup(struct hci_uart *hu, bool on);
|
||||
static void qca_power_shutdown(struct hci_uart *hu);
|
||||
static int qca_power_off(struct hci_dev *hdev);
|
||||
|
||||
static enum qca_btsoc_type qca_soc_type(struct hci_uart *hu)
|
||||
{
|
||||
enum qca_btsoc_type soc_type;
|
||||
|
||||
if (hu->serdev) {
|
||||
struct qca_serdev *qsd = serdev_device_get_drvdata(hu->serdev);
|
||||
|
||||
soc_type = qsd->btsoc_type;
|
||||
} else {
|
||||
soc_type = QCA_ROME;
|
||||
}
|
||||
|
||||
return soc_type;
|
||||
}
|
||||
|
||||
static void __serial_clock_on(struct tty_struct *tty)
|
||||
{
|
||||
/* TODO: Some chipset requires to enable UART clock on client
|
||||
@ -506,8 +522,10 @@ static int qca_open(struct hci_uart *hu)
|
||||
if (hu->serdev) {
|
||||
|
||||
qcadev = serdev_device_get_drvdata(hu->serdev);
|
||||
if (qcadev->btsoc_type != QCA_WCN3990) {
|
||||
if (!qca_is_wcn399x(qcadev->btsoc_type)) {
|
||||
gpiod_set_value_cansleep(qcadev->bt_en, 1);
|
||||
/* Controller needs time to bootup. */
|
||||
msleep(150);
|
||||
} else {
|
||||
hu->init_speed = qcadev->init_speed;
|
||||
hu->oper_speed = qcadev->oper_speed;
|
||||
@ -612,7 +630,7 @@ static int qca_close(struct hci_uart *hu)
|
||||
|
||||
if (hu->serdev) {
|
||||
qcadev = serdev_device_get_drvdata(hu->serdev);
|
||||
if (qcadev->btsoc_type == QCA_WCN3990)
|
||||
if (qca_is_wcn399x(qcadev->btsoc_type))
|
||||
qca_power_shutdown(hu);
|
||||
else
|
||||
gpiod_set_value_cansleep(qcadev->bt_en, 0);
|
||||
@ -775,7 +793,7 @@ static int qca_enqueue(struct hci_uart *hu, struct sk_buff *skb)
|
||||
/* Don't go to sleep in middle of patch download or
|
||||
* Out-Of-Band(GPIOs control) sleep is selected.
|
||||
*/
|
||||
if (!test_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags)) {
|
||||
if (!test_bit(QCA_IBS_ENABLED, &qca->flags)) {
|
||||
skb_queue_tail(&qca->txq, skb);
|
||||
spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
|
||||
return 0;
|
||||
@ -963,7 +981,6 @@ static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate)
|
||||
{
|
||||
struct hci_uart *hu = hci_get_drvdata(hdev);
|
||||
struct qca_data *qca = hu->priv;
|
||||
struct qca_serdev *qcadev;
|
||||
struct sk_buff *skb;
|
||||
u8 cmd[] = { 0x01, 0x48, 0xFC, 0x01, 0x00 };
|
||||
|
||||
@ -985,18 +1002,17 @@ static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate)
|
||||
skb_queue_tail(&qca->txq, skb);
|
||||
hci_uart_tx_wakeup(hu);
|
||||
|
||||
qcadev = serdev_device_get_drvdata(hu->serdev);
|
||||
|
||||
/* Wait for the baudrate change request to be sent */
|
||||
|
||||
while (!skb_queue_empty(&qca->txq))
|
||||
usleep_range(100, 200);
|
||||
|
||||
serdev_device_wait_until_sent(hu->serdev,
|
||||
if (hu->serdev)
|
||||
serdev_device_wait_until_sent(hu->serdev,
|
||||
msecs_to_jiffies(CMD_TRANS_TIMEOUT_MS));
|
||||
|
||||
/* Give the controller time to process the request */
|
||||
if (qcadev->btsoc_type == QCA_WCN3990)
|
||||
if (qca_is_wcn399x(qca_soc_type(hu)))
|
||||
msleep(10);
|
||||
else
|
||||
msleep(300);
|
||||
@ -1072,10 +1088,7 @@ static unsigned int qca_get_speed(struct hci_uart *hu,
|
||||
|
||||
static int qca_check_speeds(struct hci_uart *hu)
|
||||
{
|
||||
struct qca_serdev *qcadev;
|
||||
|
||||
qcadev = serdev_device_get_drvdata(hu->serdev);
|
||||
if (qcadev->btsoc_type == QCA_WCN3990) {
|
||||
if (qca_is_wcn399x(qca_soc_type(hu))) {
|
||||
if (!qca_get_speed(hu, QCA_INIT_SPEED) &&
|
||||
!qca_get_speed(hu, QCA_OPER_SPEED))
|
||||
return -EINVAL;
|
||||
@ -1091,7 +1104,6 @@ static int qca_check_speeds(struct hci_uart *hu)
|
||||
static int qca_set_speed(struct hci_uart *hu, enum qca_speed_type speed_type)
|
||||
{
|
||||
unsigned int speed, qca_baudrate;
|
||||
struct qca_serdev *qcadev;
|
||||
int ret = 0;
|
||||
|
||||
if (speed_type == QCA_INIT_SPEED) {
|
||||
@ -1099,6 +1111,8 @@ static int qca_set_speed(struct hci_uart *hu, enum qca_speed_type speed_type)
|
||||
if (speed)
|
||||
host_set_baudrate(hu, speed);
|
||||
} else {
|
||||
enum qca_btsoc_type soc_type = qca_soc_type(hu);
|
||||
|
||||
speed = qca_get_speed(hu, QCA_OPER_SPEED);
|
||||
if (!speed)
|
||||
return 0;
|
||||
@ -1106,8 +1120,7 @@ static int qca_set_speed(struct hci_uart *hu, enum qca_speed_type speed_type)
|
||||
/* Disable flow control for wcn3990 to deassert RTS while
|
||||
* changing the baudrate of chip and host.
|
||||
*/
|
||||
qcadev = serdev_device_get_drvdata(hu->serdev);
|
||||
if (qcadev->btsoc_type == QCA_WCN3990)
|
||||
if (qca_is_wcn399x(soc_type))
|
||||
hci_uart_set_flow_control(hu, true);
|
||||
|
||||
qca_baudrate = qca_get_baudrate_value(speed);
|
||||
@ -1119,7 +1132,7 @@ static int qca_set_speed(struct hci_uart *hu, enum qca_speed_type speed_type)
|
||||
host_set_baudrate(hu, speed);
|
||||
|
||||
error:
|
||||
if (qcadev->btsoc_type == QCA_WCN3990)
|
||||
if (qca_is_wcn399x(soc_type))
|
||||
hci_uart_set_flow_control(hu, false);
|
||||
}
|
||||
|
||||
@ -1181,20 +1194,18 @@ static int qca_setup(struct hci_uart *hu)
|
||||
struct hci_dev *hdev = hu->hdev;
|
||||
struct qca_data *qca = hu->priv;
|
||||
unsigned int speed, qca_baudrate = QCA_BAUDRATE_115200;
|
||||
struct qca_serdev *qcadev;
|
||||
enum qca_btsoc_type soc_type = qca_soc_type(hu);
|
||||
int ret;
|
||||
int soc_ver = 0;
|
||||
|
||||
qcadev = serdev_device_get_drvdata(hu->serdev);
|
||||
|
||||
ret = qca_check_speeds(hu);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Patch downloading has to be done without IBS mode */
|
||||
clear_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags);
|
||||
clear_bit(QCA_IBS_ENABLED, &qca->flags);
|
||||
|
||||
if (qcadev->btsoc_type == QCA_WCN3990) {
|
||||
if (qca_is_wcn399x(soc_type)) {
|
||||
bt_dev_info(hdev, "setting up wcn3990");
|
||||
|
||||
/* Enable NON_PERSISTENT_SETUP QUIRK to ensure to execute
|
||||
@ -1225,7 +1236,7 @@ static int qca_setup(struct hci_uart *hu)
|
||||
qca_baudrate = qca_get_baudrate_value(speed);
|
||||
}
|
||||
|
||||
if (qcadev->btsoc_type != QCA_WCN3990) {
|
||||
if (!qca_is_wcn399x(soc_type)) {
|
||||
/* Get QCA version information */
|
||||
ret = qca_read_soc_version(hdev, &soc_ver);
|
||||
if (ret)
|
||||
@ -1234,9 +1245,9 @@ static int qca_setup(struct hci_uart *hu)
|
||||
|
||||
bt_dev_info(hdev, "QCA controller version 0x%08x", soc_ver);
|
||||
/* Setup patch / NVM configurations */
|
||||
ret = qca_uart_setup(hdev, qca_baudrate, qcadev->btsoc_type, soc_ver);
|
||||
ret = qca_uart_setup(hdev, qca_baudrate, soc_type, soc_ver);
|
||||
if (!ret) {
|
||||
set_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags);
|
||||
set_bit(QCA_IBS_ENABLED, &qca->flags);
|
||||
qca_debugfs_init(hdev);
|
||||
} else if (ret == -ENOENT) {
|
||||
/* No patch/nvm-config found, run with original fw/config */
|
||||
@ -1250,7 +1261,7 @@ static int qca_setup(struct hci_uart *hu)
|
||||
}
|
||||
|
||||
/* Setup bdaddr */
|
||||
if (qcadev->btsoc_type == QCA_WCN3990)
|
||||
if (qca_is_wcn399x(soc_type))
|
||||
hu->hdev->set_bdaddr = qca_set_bdaddr;
|
||||
else
|
||||
hu->hdev->set_bdaddr = qca_set_bdaddr_rome;
|
||||
@ -1273,7 +1284,7 @@ static struct hci_uart_proto qca_proto = {
|
||||
.dequeue = qca_dequeue,
|
||||
};
|
||||
|
||||
static const struct qca_vreg_data qca_soc_data = {
|
||||
static const struct qca_vreg_data qca_soc_data_wcn3990 = {
|
||||
.soc_type = QCA_WCN3990,
|
||||
.vregs = (struct qca_vreg []) {
|
||||
{ "vddio", 1800000, 1900000, 15000 },
|
||||
@ -1284,6 +1295,17 @@ static const struct qca_vreg_data qca_soc_data = {
|
||||
.num_vregs = 4,
|
||||
};
|
||||
|
||||
static const struct qca_vreg_data qca_soc_data_wcn3998 = {
|
||||
.soc_type = QCA_WCN3998,
|
||||
.vregs = (struct qca_vreg []) {
|
||||
{ "vddio", 1800000, 1900000, 10000 },
|
||||
{ "vddxo", 1800000, 1900000, 80000 },
|
||||
{ "vddrf", 1300000, 1352000, 300000 },
|
||||
{ "vddch0", 3300000, 3300000, 450000 },
|
||||
},
|
||||
.num_vregs = 4,
|
||||
};
|
||||
|
||||
static void qca_power_shutdown(struct hci_uart *hu)
|
||||
{
|
||||
struct qca_data *qca = hu->priv;
|
||||
@ -1294,7 +1316,7 @@ static void qca_power_shutdown(struct hci_uart *hu)
|
||||
* data in skb's.
|
||||
*/
|
||||
spin_lock_irqsave(&qca->hci_ibs_lock, flags);
|
||||
clear_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags);
|
||||
clear_bit(QCA_IBS_ENABLED, &qca->flags);
|
||||
qca_flush(hu);
|
||||
spin_unlock_irqrestore(&qca->hci_ibs_lock, flags);
|
||||
|
||||
@ -1417,8 +1439,8 @@ static int qca_serdev_probe(struct serdev_device *serdev)
|
||||
qcadev->serdev_hu.serdev = serdev;
|
||||
data = of_device_get_match_data(&serdev->dev);
|
||||
serdev_device_set_drvdata(serdev, qcadev);
|
||||
if (data && data->soc_type == QCA_WCN3990) {
|
||||
qcadev->btsoc_type = QCA_WCN3990;
|
||||
if (data && qca_is_wcn399x(data->soc_type)) {
|
||||
qcadev->btsoc_type = data->soc_type;
|
||||
qcadev->bt_power = devm_kzalloc(&serdev->dev,
|
||||
sizeof(struct qca_power),
|
||||
GFP_KERNEL);
|
||||
@ -1482,7 +1504,7 @@ static void qca_serdev_remove(struct serdev_device *serdev)
|
||||
{
|
||||
struct qca_serdev *qcadev = serdev_device_get_drvdata(serdev);
|
||||
|
||||
if (qcadev->btsoc_type == QCA_WCN3990)
|
||||
if (qca_is_wcn399x(qcadev->btsoc_type))
|
||||
qca_power_shutdown(&qcadev->serdev_hu);
|
||||
else
|
||||
clk_disable_unprepare(qcadev->susclk);
|
||||
@ -1492,7 +1514,8 @@ static void qca_serdev_remove(struct serdev_device *serdev)
|
||||
|
||||
static const struct of_device_id qca_bluetooth_of_match[] = {
|
||||
{ .compatible = "qcom,qca6174-bt" },
|
||||
{ .compatible = "qcom,wcn3990-bt", .data = &qca_soc_data},
|
||||
{ .compatible = "qcom,wcn3990-bt", .data = &qca_soc_data_wcn3990},
|
||||
{ .compatible = "qcom,wcn3998-bt", .data = &qca_soc_data_wcn3998},
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, qca_bluetooth_of_match);
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <net/neighbour.h>
|
||||
#include <net/route.h>
|
||||
#include <net/netevent.h>
|
||||
#include <net/addrconf.h>
|
||||
#include <net/ipv6_stubs.h>
|
||||
#include <net/ip6_route.h>
|
||||
#include <rdma/ib_addr.h>
|
||||
#include <rdma/ib_sa.h>
|
||||
@ -86,8 +86,8 @@ static inline bool ib_nl_is_good_ip_resp(const struct nlmsghdr *nlh)
|
||||
if (nlh->nlmsg_flags & RDMA_NL_LS_F_ERR)
|
||||
return false;
|
||||
|
||||
ret = nla_parse(tb, LS_NLA_TYPE_MAX - 1, nlmsg_data(nlh),
|
||||
nlmsg_len(nlh), ib_nl_addr_policy, NULL);
|
||||
ret = nla_parse_deprecated(tb, LS_NLA_TYPE_MAX - 1, nlmsg_data(nlh),
|
||||
nlmsg_len(nlh), ib_nl_addr_policy, NULL);
|
||||
if (ret)
|
||||
return false;
|
||||
|
||||
@ -351,7 +351,7 @@ static bool has_gateway(const struct dst_entry *dst, sa_family_t family)
|
||||
|
||||
if (family == AF_INET) {
|
||||
rt = container_of(dst, struct rtable, dst);
|
||||
return rt->rt_uses_gateway;
|
||||
return rt->rt_gw_family == AF_INET;
|
||||
}
|
||||
|
||||
rt6 = container_of(dst, struct rt6_info, dst);
|
||||
|
@ -506,14 +506,14 @@ int iwpm_parse_nlmsg(struct netlink_callback *cb, int policy_max,
|
||||
int ret;
|
||||
const char *err_str = "";
|
||||
|
||||
ret = nlmsg_validate(cb->nlh, nlh_len, policy_max - 1, nlmsg_policy,
|
||||
NULL);
|
||||
ret = nlmsg_validate_deprecated(cb->nlh, nlh_len, policy_max - 1,
|
||||
nlmsg_policy, NULL);
|
||||
if (ret) {
|
||||
err_str = "Invalid attribute";
|
||||
goto parse_nlmsg_error;
|
||||
}
|
||||
ret = nlmsg_parse(cb->nlh, nlh_len, nltb, policy_max - 1,
|
||||
nlmsg_policy, NULL);
|
||||
ret = nlmsg_parse_deprecated(cb->nlh, nlh_len, nltb, policy_max - 1,
|
||||
nlmsg_policy, NULL);
|
||||
if (ret) {
|
||||
err_str = "Unable to parse the nlmsg";
|
||||
goto parse_nlmsg_error;
|
||||
|
@ -292,7 +292,8 @@ static int fill_res_info_entry(struct sk_buff *msg,
|
||||
{
|
||||
struct nlattr *entry_attr;
|
||||
|
||||
entry_attr = nla_nest_start(msg, RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY);
|
||||
entry_attr = nla_nest_start_noflag(msg,
|
||||
RDMA_NLDEV_ATTR_RES_SUMMARY_ENTRY);
|
||||
if (!entry_attr)
|
||||
return -EMSGSIZE;
|
||||
|
||||
@ -327,7 +328,7 @@ static int fill_res_info(struct sk_buff *msg, struct ib_device *device)
|
||||
if (fill_nldev_handle(msg, device))
|
||||
return -EMSGSIZE;
|
||||
|
||||
table_attr = nla_nest_start(msg, RDMA_NLDEV_ATTR_RES_SUMMARY);
|
||||
table_attr = nla_nest_start_noflag(msg, RDMA_NLDEV_ATTR_RES_SUMMARY);
|
||||
if (!table_attr)
|
||||
return -EMSGSIZE;
|
||||
|
||||
@ -607,8 +608,8 @@ static int nldev_get_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
|
||||
u32 index;
|
||||
int err;
|
||||
|
||||
err = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
|
||||
nldev_policy, extack);
|
||||
err = nlmsg_parse_deprecated(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
|
||||
nldev_policy, extack);
|
||||
if (err || !tb[RDMA_NLDEV_ATTR_DEV_INDEX])
|
||||
return -EINVAL;
|
||||
|
||||
@ -652,8 +653,8 @@ static int nldev_set_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
|
||||
u32 index;
|
||||
int err;
|
||||
|
||||
err = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1, nldev_policy,
|
||||
extack);
|
||||
err = nlmsg_parse_deprecated(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
|
||||
nldev_policy, extack);
|
||||
if (err || !tb[RDMA_NLDEV_ATTR_DEV_INDEX])
|
||||
return -EINVAL;
|
||||
|
||||
@ -721,8 +722,8 @@ static int nldev_port_get_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
|
||||
u32 port;
|
||||
int err;
|
||||
|
||||
err = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
|
||||
nldev_policy, extack);
|
||||
err = nlmsg_parse_deprecated(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
|
||||
nldev_policy, extack);
|
||||
if (err ||
|
||||
!tb[RDMA_NLDEV_ATTR_DEV_INDEX] ||
|
||||
!tb[RDMA_NLDEV_ATTR_PORT_INDEX])
|
||||
@ -777,8 +778,8 @@ static int nldev_port_get_dumpit(struct sk_buff *skb,
|
||||
int err;
|
||||
unsigned int p;
|
||||
|
||||
err = nlmsg_parse(cb->nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
|
||||
nldev_policy, NULL);
|
||||
err = nlmsg_parse_deprecated(cb->nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
|
||||
nldev_policy, NULL);
|
||||
if (err || !tb[RDMA_NLDEV_ATTR_DEV_INDEX])
|
||||
return -EINVAL;
|
||||
|
||||
@ -832,8 +833,8 @@ static int nldev_res_get_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
|
||||
u32 index;
|
||||
int ret;
|
||||
|
||||
ret = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
|
||||
nldev_policy, extack);
|
||||
ret = nlmsg_parse_deprecated(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
|
||||
nldev_policy, extack);
|
||||
if (ret || !tb[RDMA_NLDEV_ATTR_DEV_INDEX])
|
||||
return -EINVAL;
|
||||
|
||||
@ -981,8 +982,8 @@ static int res_get_common_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
|
||||
struct sk_buff *msg;
|
||||
int ret;
|
||||
|
||||
ret = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
|
||||
nldev_policy, extack);
|
||||
ret = nlmsg_parse_deprecated(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
|
||||
nldev_policy, extack);
|
||||
if (ret || !tb[RDMA_NLDEV_ATTR_DEV_INDEX] || !fe->id || !tb[fe->id])
|
||||
return -EINVAL;
|
||||
|
||||
@ -1070,8 +1071,8 @@ static int res_get_common_dumpit(struct sk_buff *skb,
|
||||
u32 index, port = 0;
|
||||
bool filled = false;
|
||||
|
||||
err = nlmsg_parse(cb->nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
|
||||
nldev_policy, NULL);
|
||||
err = nlmsg_parse_deprecated(cb->nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
|
||||
nldev_policy, NULL);
|
||||
/*
|
||||
* Right now, we are expecting the device index to get res information,
|
||||
* but it is possible to extend this code to return all devices in
|
||||
@ -1108,7 +1109,7 @@ static int res_get_common_dumpit(struct sk_buff *skb,
|
||||
goto err;
|
||||
}
|
||||
|
||||
table_attr = nla_nest_start(skb, fe->nldev_attr);
|
||||
table_attr = nla_nest_start_noflag(skb, fe->nldev_attr);
|
||||
if (!table_attr) {
|
||||
ret = -EMSGSIZE;
|
||||
goto err;
|
||||
@ -1134,7 +1135,7 @@ static int res_get_common_dumpit(struct sk_buff *skb,
|
||||
|
||||
filled = true;
|
||||
|
||||
entry_attr = nla_nest_start(skb, fe->entry);
|
||||
entry_attr = nla_nest_start_noflag(skb, fe->entry);
|
||||
if (!entry_attr) {
|
||||
ret = -EMSGSIZE;
|
||||
rdma_restrack_put(res);
|
||||
@ -1249,8 +1250,8 @@ static int nldev_newlink(struct sk_buff *skb, struct nlmsghdr *nlh,
|
||||
char type[IFNAMSIZ];
|
||||
int err;
|
||||
|
||||
err = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
|
||||
nldev_policy, extack);
|
||||
err = nlmsg_parse_deprecated(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
|
||||
nldev_policy, extack);
|
||||
if (err || !tb[RDMA_NLDEV_ATTR_DEV_NAME] ||
|
||||
!tb[RDMA_NLDEV_ATTR_LINK_TYPE] || !tb[RDMA_NLDEV_ATTR_NDEV_NAME])
|
||||
return -EINVAL;
|
||||
@ -1293,8 +1294,8 @@ static int nldev_dellink(struct sk_buff *skb, struct nlmsghdr *nlh,
|
||||
u32 index;
|
||||
int err;
|
||||
|
||||
err = nlmsg_parse(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
|
||||
nldev_policy, extack);
|
||||
err = nlmsg_parse_deprecated(nlh, 0, tb, RDMA_NLDEV_ATTR_MAX - 1,
|
||||
nldev_policy, extack);
|
||||
if (err || !tb[RDMA_NLDEV_ATTR_DEV_INDEX])
|
||||
return -EINVAL;
|
||||
|
||||
|
@ -1028,8 +1028,8 @@ int ib_nl_handle_set_timeout(struct sk_buff *skb,
|
||||
!(NETLINK_CB(skb).sk))
|
||||
return -EPERM;
|
||||
|
||||
ret = nla_parse(tb, LS_NLA_TYPE_MAX - 1, nlmsg_data(nlh),
|
||||
nlmsg_len(nlh), ib_nl_policy, NULL);
|
||||
ret = nla_parse_deprecated(tb, LS_NLA_TYPE_MAX - 1, nlmsg_data(nlh),
|
||||
nlmsg_len(nlh), ib_nl_policy, NULL);
|
||||
attr = (const struct nlattr *)tb[LS_NLA_TYPE_TIMEOUT];
|
||||
if (ret || !attr)
|
||||
goto settimeout_out;
|
||||
@ -1080,8 +1080,8 @@ static inline int ib_nl_is_good_resolve_resp(const struct nlmsghdr *nlh)
|
||||
if (nlh->nlmsg_flags & RDMA_NL_LS_F_ERR)
|
||||
return 0;
|
||||
|
||||
ret = nla_parse(tb, LS_NLA_TYPE_MAX - 1, nlmsg_data(nlh),
|
||||
nlmsg_len(nlh), ib_nl_policy, NULL);
|
||||
ret = nla_parse_deprecated(tb, LS_NLA_TYPE_MAX - 1, nlmsg_data(nlh),
|
||||
nlmsg_len(nlh), ib_nl_policy, NULL);
|
||||
if (ret)
|
||||
return 0;
|
||||
|
||||
|
@ -149,7 +149,7 @@ static int fill_res_qp_entry(struct sk_buff *msg,
|
||||
if (qhp->ucontext)
|
||||
return 0;
|
||||
|
||||
table_attr = nla_nest_start(msg, RDMA_NLDEV_ATTR_DRIVER);
|
||||
table_attr = nla_nest_start_noflag(msg, RDMA_NLDEV_ATTR_DRIVER);
|
||||
if (!table_attr)
|
||||
goto err;
|
||||
|
||||
@ -216,7 +216,7 @@ static int fill_res_ep_entry(struct sk_buff *msg,
|
||||
if (!uep)
|
||||
return 0;
|
||||
|
||||
table_attr = nla_nest_start(msg, RDMA_NLDEV_ATTR_DRIVER);
|
||||
table_attr = nla_nest_start_noflag(msg, RDMA_NLDEV_ATTR_DRIVER);
|
||||
if (!table_attr)
|
||||
goto err_free_uep;
|
||||
|
||||
@ -387,7 +387,7 @@ static int fill_res_cq_entry(struct sk_buff *msg,
|
||||
if (ibcq->uobject)
|
||||
return 0;
|
||||
|
||||
table_attr = nla_nest_start(msg, RDMA_NLDEV_ATTR_DRIVER);
|
||||
table_attr = nla_nest_start_noflag(msg, RDMA_NLDEV_ATTR_DRIVER);
|
||||
if (!table_attr)
|
||||
goto err;
|
||||
|
||||
@ -447,7 +447,7 @@ static int fill_res_mr_entry(struct sk_buff *msg,
|
||||
if (!stag)
|
||||
return 0;
|
||||
|
||||
table_attr = nla_nest_start(msg, RDMA_NLDEV_ATTR_DRIVER);
|
||||
table_attr = nla_nest_start_noflag(msg, RDMA_NLDEV_ATTR_DRIVER);
|
||||
if (!table_attr)
|
||||
goto err;
|
||||
|
||||
|
@ -423,8 +423,7 @@ static netdev_tx_t hfi1_netdev_start_xmit(struct sk_buff *skb,
|
||||
|
||||
static u16 hfi1_vnic_select_queue(struct net_device *netdev,
|
||||
struct sk_buff *skb,
|
||||
struct net_device *sb_dev,
|
||||
select_queue_fallback_t fallback)
|
||||
struct net_device *sb_dev)
|
||||
{
|
||||
struct hfi1_vnic_vport_info *vinfo = opa_vnic_dev_priv(netdev);
|
||||
struct opa_vnic_skb_mdata *mdata;
|
||||
|
@ -148,7 +148,7 @@ int mlx5_cmd_alloc_memic(struct mlx5_memic *memic, phys_addr_t *addr,
|
||||
return ret;
|
||||
}
|
||||
|
||||
*addr = pci_resource_start(dev->pdev, 0) +
|
||||
*addr = dev->bar_addr +
|
||||
MLX5_GET64(alloc_memic_out, out, memic_start_addr);
|
||||
|
||||
return 0;
|
||||
@ -167,7 +167,7 @@ int mlx5_cmd_dealloc_memic(struct mlx5_memic *memic, u64 addr, u64 length)
|
||||
u64 start_page_idx;
|
||||
int err;
|
||||
|
||||
addr -= pci_resource_start(dev->pdev, 0);
|
||||
addr -= dev->bar_addr;
|
||||
start_page_idx = (addr - hw_start_addr) >> PAGE_SHIFT;
|
||||
|
||||
MLX5_SET(dealloc_memic_in, in, opcode, MLX5_CMD_OP_DEALLOC_MEMIC);
|
||||
|
@ -181,7 +181,7 @@ static int mlx5_netdev_event(struct notifier_block *this,
|
||||
ibdev->rep->vport);
|
||||
if (rep_ndev == ndev)
|
||||
roce->netdev = ndev;
|
||||
} else if (ndev->dev.parent == &mdev->pdev->dev) {
|
||||
} else if (ndev->dev.parent == mdev->device) {
|
||||
roce->netdev = ndev;
|
||||
}
|
||||
write_unlock(&roce->netdev_lock);
|
||||
@ -2011,7 +2011,7 @@ static phys_addr_t uar_index2pfn(struct mlx5_ib_dev *dev,
|
||||
|
||||
fw_uars_per_page = MLX5_CAP_GEN(dev->mdev, uar_4k) ? MLX5_UARS_IN_PAGE : 1;
|
||||
|
||||
return (pci_resource_start(dev->mdev->pdev, 0) >> PAGE_SHIFT) + uar_idx / fw_uars_per_page;
|
||||
return (dev->mdev->bar_addr >> PAGE_SHIFT) + uar_idx / fw_uars_per_page;
|
||||
}
|
||||
|
||||
static int get_command(unsigned long offset)
|
||||
@ -2202,7 +2202,7 @@ static int dm_mmap(struct ib_ucontext *context, struct vm_area_struct *vma)
|
||||
page_idx + npages)
|
||||
return -EINVAL;
|
||||
|
||||
pfn = ((pci_resource_start(dev->mdev->pdev, 0) +
|
||||
pfn = ((dev->mdev->bar_addr +
|
||||
MLX5_CAP64_DEV_MEM(dev->mdev, memic_bar_start_addr)) >>
|
||||
PAGE_SHIFT) +
|
||||
page_idx;
|
||||
@ -2285,7 +2285,7 @@ struct ib_dm *mlx5_ib_alloc_dm(struct ib_device *ibdev,
|
||||
goto err_free;
|
||||
|
||||
start_offset = memic_addr & ~PAGE_MASK;
|
||||
page_idx = (memic_addr - pci_resource_start(memic->dev->pdev, 0) -
|
||||
page_idx = (memic_addr - memic->dev->bar_addr -
|
||||
MLX5_CAP64_DEV_MEM(memic->dev, memic_bar_start_addr)) >>
|
||||
PAGE_SHIFT;
|
||||
|
||||
@ -2328,7 +2328,7 @@ int mlx5_ib_dealloc_dm(struct ib_dm *ibdm)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
page_idx = (dm->dev_addr - pci_resource_start(memic->dev->pdev, 0) -
|
||||
page_idx = (dm->dev_addr - memic->dev->bar_addr -
|
||||
MLX5_CAP64_DEV_MEM(memic->dev, memic_bar_start_addr)) >>
|
||||
PAGE_SHIFT;
|
||||
bitmap_clear(to_mucontext(ibdm->uobject->context)->dm_pages,
|
||||
@ -4356,9 +4356,13 @@ static void delay_drop_handler(struct work_struct *work)
|
||||
static void handle_general_event(struct mlx5_ib_dev *ibdev, struct mlx5_eqe *eqe,
|
||||
struct ib_event *ibev)
|
||||
{
|
||||
u8 port = (eqe->data.port.port >> 4) & 0xf;
|
||||
|
||||
switch (eqe->sub_type) {
|
||||
case MLX5_GENERAL_SUBTYPE_DELAY_DROP_TIMEOUT:
|
||||
schedule_work(&ibdev->delay_drop.delay_drop_work);
|
||||
if (mlx5_ib_port_link_layer(&ibdev->ib_dev, port) ==
|
||||
IB_LINK_LAYER_ETHERNET)
|
||||
schedule_work(&ibdev->delay_drop.delay_drop_work);
|
||||
break;
|
||||
default: /* do nothing */
|
||||
return;
|
||||
@ -5675,7 +5679,8 @@ static int mlx5_ib_init_multiport_master(struct mlx5_ib_dev *dev)
|
||||
}
|
||||
|
||||
if (bound) {
|
||||
dev_dbg(&mpi->mdev->pdev->dev, "removing port from unaffiliated list.\n");
|
||||
dev_dbg(mpi->mdev->device,
|
||||
"removing port from unaffiliated list.\n");
|
||||
mlx5_ib_dbg(dev, "port %d bound\n", i + 1);
|
||||
list_del(&mpi->list);
|
||||
break;
|
||||
@ -5874,7 +5879,7 @@ int mlx5_ib_stage_init_init(struct mlx5_ib_dev *dev)
|
||||
dev->ib_dev.local_dma_lkey = 0 /* not supported for now */;
|
||||
dev->ib_dev.phys_port_cnt = dev->num_ports;
|
||||
dev->ib_dev.num_comp_vectors = mlx5_comp_vectors_count(mdev);
|
||||
dev->ib_dev.dev.parent = &mdev->pdev->dev;
|
||||
dev->ib_dev.dev.parent = mdev->device;
|
||||
|
||||
mutex_init(&dev->cap_mask_mutex);
|
||||
INIT_LIST_HEAD(&dev->qp_list);
|
||||
@ -6563,7 +6568,8 @@ static void *mlx5_ib_add_slave_port(struct mlx5_core_dev *mdev)
|
||||
|
||||
if (!bound) {
|
||||
list_add_tail(&mpi->list, &mlx5_ib_unaffiliated_port_list);
|
||||
dev_dbg(&mdev->pdev->dev, "no suitable IB device found to bind to, added to unaffiliated list.\n");
|
||||
dev_dbg(mdev->device,
|
||||
"no suitable IB device found to bind to, added to unaffiliated list.\n");
|
||||
}
|
||||
mutex_unlock(&mlx5_ib_multiport_mutex);
|
||||
|
||||
|
@ -1194,8 +1194,7 @@ static struct ib_mr *mlx5_ib_get_memic_mr(struct ib_pd *pd, u64 memic_addr,
|
||||
MLX5_SET64(mkc, mkc, len, length);
|
||||
MLX5_SET(mkc, mkc, pd, to_mpd(pd)->pdn);
|
||||
MLX5_SET(mkc, mkc, qpn, 0xffffff);
|
||||
MLX5_SET64(mkc, mkc, start_addr,
|
||||
memic_addr - pci_resource_start(dev->mdev->pdev, 0));
|
||||
MLX5_SET64(mkc, mkc, start_addr, memic_addr - dev->mdev->bar_addr);
|
||||
|
||||
err = mlx5_core_create_mkey(mdev, &mr->mmkey, in, inlen);
|
||||
if (err)
|
||||
|
@ -5122,7 +5122,7 @@ static int _mlx5_ib_post_send(struct ib_qp *ibqp, const struct ib_send_wr *wr,
|
||||
wmb();
|
||||
|
||||
/* currently we support only regular doorbells */
|
||||
mlx5_write64((__be32 *)ctrl, bf->bfreg->map + bf->offset, NULL);
|
||||
mlx5_write64((__be32 *)ctrl, bf->bfreg->map + bf->offset);
|
||||
/* Make sure doorbells don't leak out of SQ spinlock
|
||||
* and reach the HCA out of order.
|
||||
*/
|
||||
|
@ -1407,7 +1407,7 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
|
||||
if (neigh->nud_state & NUD_VALID) {
|
||||
nes_debug(NES_DBG_CM, "Neighbor MAC address for 0x%08X"
|
||||
" is %pM, Gateway is 0x%08X \n", dst_ip,
|
||||
neigh->ha, ntohl(rt->rt_gateway));
|
||||
neigh->ha, ntohl(rt->rt_gw4));
|
||||
|
||||
if (arpindex >= 0) {
|
||||
if (ether_addr_equal(nesadapter->arp_table[arpindex].mac_addr, neigh->ha)) {
|
||||
|
@ -95,8 +95,7 @@ static netdev_tx_t opa_netdev_start_xmit(struct sk_buff *skb,
|
||||
}
|
||||
|
||||
static u16 opa_vnic_select_queue(struct net_device *netdev, struct sk_buff *skb,
|
||||
struct net_device *sb_dev,
|
||||
select_queue_fallback_t fallback)
|
||||
struct net_device *sb_dev)
|
||||
{
|
||||
struct opa_vnic_adapter *adapter = opa_vnic_priv(netdev);
|
||||
struct opa_vnic_skb_mdata *mdata;
|
||||
@ -106,8 +105,7 @@ static u16 opa_vnic_select_queue(struct net_device *netdev, struct sk_buff *skb,
|
||||
mdata = skb_push(skb, sizeof(*mdata));
|
||||
mdata->entropy = opa_vnic_calc_entropy(skb);
|
||||
mdata->vl = opa_vnic_get_vl(adapter, skb);
|
||||
rc = adapter->rn_ops->ndo_select_queue(netdev, skb,
|
||||
sb_dev, fallback);
|
||||
rc = adapter->rn_ops->ndo_select_queue(netdev, skb, sb_dev);
|
||||
skb_pull(skb, sizeof(*mdata));
|
||||
return rc;
|
||||
}
|
||||
|
@ -958,6 +958,7 @@ static void write_iso_callback(struct urb *urb)
|
||||
*/
|
||||
static int starturbs(struct bc_state *bcs)
|
||||
{
|
||||
struct usb_device *udev = bcs->cs->hw.bas->udev;
|
||||
struct bas_bc_state *ubc = bcs->hw.bas;
|
||||
struct urb *urb;
|
||||
int j, k;
|
||||
@ -975,8 +976,8 @@ static int starturbs(struct bc_state *bcs)
|
||||
rc = -EFAULT;
|
||||
goto error;
|
||||
}
|
||||
usb_fill_int_urb(urb, bcs->cs->hw.bas->udev,
|
||||
usb_rcvisocpipe(urb->dev, 3 + 2 * bcs->channel),
|
||||
usb_fill_int_urb(urb, udev,
|
||||
usb_rcvisocpipe(udev, 3 + 2 * bcs->channel),
|
||||
ubc->isoinbuf + k * BAS_INBUFSIZE,
|
||||
BAS_INBUFSIZE, read_iso_callback, bcs,
|
||||
BAS_FRAMETIME);
|
||||
@ -1006,8 +1007,8 @@ static int starturbs(struct bc_state *bcs)
|
||||
rc = -EFAULT;
|
||||
goto error;
|
||||
}
|
||||
usb_fill_int_urb(urb, bcs->cs->hw.bas->udev,
|
||||
usb_sndisocpipe(urb->dev, 4 + 2 * bcs->channel),
|
||||
usb_fill_int_urb(urb, udev,
|
||||
usb_sndisocpipe(udev, 4 + 2 * bcs->channel),
|
||||
ubc->isooutbuf->data,
|
||||
sizeof(ubc->isooutbuf->data),
|
||||
write_iso_callback, &ubc->isoouturbs[k],
|
||||
|
@ -2041,9 +2041,9 @@ setup_hw(struct hfc_pci *hc)
|
||||
}
|
||||
|
||||
printk(KERN_INFO
|
||||
"HFC-PCI: defined at mem %#lx fifo %#lx(%#lx) IRQ %d HZ %d\n",
|
||||
(u_long) hc->hw.pci_io, (u_long) hc->hw.fifos,
|
||||
(u_long) hc->hw.dmahandle, hc->irq, HZ);
|
||||
"HFC-PCI: defined at mem %#lx fifo %p(%pad) IRQ %d HZ %d\n",
|
||||
(u_long) hc->hw.pci_io, hc->hw.fifos,
|
||||
&hc->hw.dmahandle, hc->irq, HZ);
|
||||
|
||||
/* enable memory mapped ports, disable busmaster */
|
||||
pci_write_config_word(hc->pdev, PCI_COMMAND, PCI_ENA_MEMIO);
|
||||
|
@ -1294,9 +1294,9 @@ void HiSax_reportcard(int cardnr, int sel)
|
||||
printk(KERN_DEBUG "HiSax: reportcard No %d\n", cardnr + 1);
|
||||
printk(KERN_DEBUG "HiSax: Type %s\n", CardType[cs->typ]);
|
||||
printk(KERN_DEBUG "HiSax: debuglevel %x\n", cs->debug);
|
||||
printk(KERN_DEBUG "HiSax: HiSax_reportcard address 0x%lX\n",
|
||||
(ulong) & HiSax_reportcard);
|
||||
printk(KERN_DEBUG "HiSax: cs 0x%lX\n", (ulong) cs);
|
||||
printk(KERN_DEBUG "HiSax: HiSax_reportcard address 0x%px\n",
|
||||
HiSax_reportcard);
|
||||
printk(KERN_DEBUG "HiSax: cs 0x%px\n", cs);
|
||||
printk(KERN_DEBUG "HiSax: HW_Flags %lx bc0 flg %lx bc1 flg %lx\n",
|
||||
cs->HW_Flags, cs->bcs[0].Flag, cs->bcs[1].Flag);
|
||||
printk(KERN_DEBUG "HiSax: bcs 0 mode %d ch%d\n",
|
||||
|
@ -1888,8 +1888,9 @@ static u32 isdn_ppp_mp_get_seq(int short_seq,
|
||||
return seq;
|
||||
}
|
||||
|
||||
struct sk_buff *isdn_ppp_mp_discard(ippp_bundle *mp,
|
||||
struct sk_buff *from, struct sk_buff *to)
|
||||
static struct sk_buff *isdn_ppp_mp_discard(ippp_bundle *mp,
|
||||
struct sk_buff *from,
|
||||
struct sk_buff *to)
|
||||
{
|
||||
if (from)
|
||||
while (from != to) {
|
||||
@ -1900,8 +1901,8 @@ struct sk_buff *isdn_ppp_mp_discard(ippp_bundle *mp,
|
||||
return from;
|
||||
}
|
||||
|
||||
void isdn_ppp_mp_reassembly(isdn_net_dev *net_dev, isdn_net_local *lp,
|
||||
struct sk_buff *from, struct sk_buff *to)
|
||||
static void isdn_ppp_mp_reassembly(isdn_net_dev *net_dev, isdn_net_local *lp,
|
||||
struct sk_buff *from, struct sk_buff *to)
|
||||
{
|
||||
ippp_bundle *mp = net_dev->pb;
|
||||
int proto;
|
||||
|
@ -97,6 +97,12 @@ lirc_mode2_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)
|
||||
return &bpf_map_update_elem_proto;
|
||||
case BPF_FUNC_map_delete_elem:
|
||||
return &bpf_map_delete_elem_proto;
|
||||
case BPF_FUNC_map_push_elem:
|
||||
return &bpf_map_push_elem_proto;
|
||||
case BPF_FUNC_map_pop_elem:
|
||||
return &bpf_map_pop_elem_proto;
|
||||
case BPF_FUNC_map_peek_elem:
|
||||
return &bpf_map_peek_elem_proto;
|
||||
case BPF_FUNC_ktime_get_ns:
|
||||
return &bpf_ktime_get_ns_proto;
|
||||
case BPF_FUNC_tail_call:
|
||||
|
@ -505,6 +505,7 @@ source "drivers/net/hyperv/Kconfig"
|
||||
config NETDEVSIM
|
||||
tristate "Simulated networking device"
|
||||
depends on DEBUG_FS
|
||||
select NET_DEVLINK
|
||||
help
|
||||
This driver is a developer testing tool and software model that can
|
||||
be used to test various control path networking APIs, especially
|
||||
|
@ -116,11 +116,15 @@ static struct net_device * __init ipddp_init(void)
|
||||
*/
|
||||
static netdev_tx_t ipddp_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
{
|
||||
__be32 paddr = skb_rtable(skb)->rt_gateway;
|
||||
struct rtable *rtable = skb_rtable(skb);
|
||||
__be32 paddr = 0;
|
||||
struct ddpehdr *ddp;
|
||||
struct ipddp_route *rt;
|
||||
struct atalk_addr *our_addr;
|
||||
|
||||
if (rtable->rt_gw_family == AF_INET)
|
||||
paddr = rtable->rt_gw4;
|
||||
|
||||
spin_lock(&ipddp_route_lock);
|
||||
|
||||
/*
|
||||
|
@ -4118,8 +4118,7 @@ static inline int bond_slave_override(struct bonding *bond,
|
||||
|
||||
|
||||
static u16 bond_select_queue(struct net_device *dev, struct sk_buff *skb,
|
||||
struct net_device *sb_dev,
|
||||
select_queue_fallback_t fallback)
|
||||
struct net_device *sb_dev)
|
||||
{
|
||||
/* This helper function exists to help dev_pick_tx get the correct
|
||||
* destination queue. Using a helper function skips a call to
|
||||
|
@ -546,7 +546,7 @@ static int bond_fill_info(struct sk_buff *skb,
|
||||
if (nla_put_u32(skb, IFLA_BOND_ARP_INTERVAL, bond->params.arp_interval))
|
||||
goto nla_put_failure;
|
||||
|
||||
targets = nla_nest_start(skb, IFLA_BOND_ARP_IP_TARGET);
|
||||
targets = nla_nest_start_noflag(skb, IFLA_BOND_ARP_IP_TARGET);
|
||||
if (!targets)
|
||||
goto nla_put_failure;
|
||||
|
||||
@ -644,7 +644,7 @@ static int bond_fill_info(struct sk_buff *skb,
|
||||
if (!bond_3ad_get_active_agg_info(bond, &info)) {
|
||||
struct nlattr *nest;
|
||||
|
||||
nest = nla_nest_start(skb, IFLA_BOND_AD_INFO);
|
||||
nest = nla_nest_start_noflag(skb, IFLA_BOND_AD_INFO);
|
||||
if (!nest)
|
||||
goto nla_put_failure;
|
||||
|
||||
@ -711,7 +711,7 @@ static int bond_fill_linkxstats(struct sk_buff *skb,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
nest = nla_nest_start(skb, LINK_XSTATS_TYPE_BOND);
|
||||
nest = nla_nest_start_noflag(skb, LINK_XSTATS_TYPE_BOND);
|
||||
if (!nest)
|
||||
return -EMSGSIZE;
|
||||
if (BOND_MODE(bond) == BOND_MODE_8023AD) {
|
||||
@ -722,7 +722,7 @@ static int bond_fill_linkxstats(struct sk_buff *skb,
|
||||
else
|
||||
stats = &BOND_AD_INFO(bond).stats;
|
||||
|
||||
nest2 = nla_nest_start(skb, BOND_XSTATS_3AD);
|
||||
nest2 = nla_nest_start_noflag(skb, BOND_XSTATS_3AD);
|
||||
if (!nest2) {
|
||||
nla_nest_end(skb, nest);
|
||||
return -EMSGSIZE;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user