summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-smbus.c
diff options
context:
space:
mode:
authorVladimir Oltean2019-05-05 12:19:28 +0200
committerDavid S. Miller2019-05-06 06:52:42 +0200
commit640f763f98c2f866a3adc93f20fb36d6d0b4b5b1 (patch)
tree2e26e3f1ec7b63584fca7abb4a698c930a07fe35 /drivers/i2c/i2c-smbus.c
parentnet: dsa: sja1105: Add support for traffic through standalone ports (diff)
downloadkernel-qcow2-linux-640f763f98c2f866a3adc93f20fb36d6d0b4b5b1.tar.gz
kernel-qcow2-linux-640f763f98c2f866a3adc93f20fb36d6d0b4b5b1.tar.xz
kernel-qcow2-linux-640f763f98c2f866a3adc93f20fb36d6d0b4b5b1.zip
net: dsa: sja1105: Add support for Spanning Tree Protocol
While not explicitly documented as supported in UM10944, compliance with the STP states can be obtained by manipulating 3 settings at the (per-port) MAC config level: dynamic learning, inhibiting reception of regular traffic, and inhibiting transmission of regular traffic. In all these modes, transmission and reception of special BPDU frames from the stack is still enabled (not inhibited by the MAC-level settings). On ingress, BPDUs are classified by the MAC filter as link-local (01-80-C2-00-00-00) and forwarded to the CPU port. This mechanism works under all conditions (even without the custom 802.1Q tagging) because the switch hardware inserts the source port and switch ID into bytes 4 and 5 of the MAC-filtered frames. Then the DSA .rcv handler needs to put back zeroes into the MAC address after decoding the source port information. On egress, BPDUs are transmitted using management routes from the xmit worker thread. Again this does not require switch tagging, as the switch port is programmed through SPI to hold a temporary (single-fire) route for a frame with the programmed destination MAC (01-80-C2-00-00-00). STP is activated using the following commands and was tested by connecting two front-panel ports together and noticing that switching loops were prevented (one port remains in the blocking state): $ ip link add name br0 type bridge stp_state 1 && ip link set br0 up $ for eth in $(ls /sys/devices/platform/soc/2100000.spi/spi_master/spi0/spi0.1/net/); do ip link set ${eth} master br0 && ip link set ${eth} up; done Signed-off-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/i2c/i2c-smbus.c')
0 files changed, 0 insertions, 0 deletions