]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: hsr: Create and export hsr_get_port_ndev()
authorMD Danish Anwar <danishanwar@ti.com>
Fri, 10 Jan 2025 08:28:51 +0000 (13:58 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 12:55:14 +0000 (13:55 +0100)
commitef964411c8ca775967355d855abc56aeaca3c867
tree31f3199b076e26e3f8545ee854bbe983e6171210
parent57364f7d6d921f6a991d936c5fd6638eb71f3225
net: hsr: Create and export hsr_get_port_ndev()

[ Upstream commit 9c10dd8eed74de9e8adeb820939f8745cd566d4a ]

Create an API to get the net_device to the slave port of HSR device. The
API will take hsr net_device and enum hsr_port_type for which we want the
net_device as arguments.

This API can be used by client drivers who support HSR and want to get
the net_devcie of slave ports from the hsr device. Export this API for
the same.

This API needs the enum hsr_port_type to be accessible by the drivers using
hsr. Move the enum hsr_port_type from net/hsr/hsr_main.h to
include/linux/if_hsr.h for the same.

Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Stable-dep-of: 30296ac76426 ("net: dsa: xrs700x: reject unsupported HSR configurations")
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/if_hsr.h
net/hsr/hsr_device.c
net/hsr/hsr_main.h