]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum: Add couple of lower device helper functions
authorJiri Pirko <jiri@mellanox.com>
Mon, 4 Jul 2016 06:23:12 +0000 (08:23 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Jul 2016 01:25:15 +0000 (18:25 -0700)
commitc076733b3cba81f301e026bb55559f5151fbfbcf
tree0f35230adc52699ef4949d4515e6ffc01422f916
parentb9543b2872ecdfd37e25d874f9b1a0a620fea1bf
mlxsw: spectrum: Add couple of lower device helper functions

Add functions that iterate over lower devices and find port device.
As a dependency add netdev_for_each_all_lower_dev and
netdev_for_each_all_lower_dev_rcu macro with
netdev_all_lower_get_next and netdev_all_lower_get_next_rcu shelpers.

Also, add functions to return mlxsw struct according to lower device
found and mlxsw_port struct with a reference to lower device.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/spectrum.h
include/linux/netdevice.h
net/core/dev.c