net/mlx5e: Move port speed code from en_ethtool.c to en/port.c
authorHuy Nguyen <huyn@mellanox.com>
Thu, 22 Feb 2018 19:22:56 +0000 (13:22 -0600)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 24 May 2018 21:23:33 +0000 (14:23 -0700)
commit2c81bfd5ae5659df44b38ec71c404b4b261a9515
treebeaef7400a3059db6e9b1a772dedf8c1b75758e1
parente549f6f9c098067a99e9de8ac84f5cc2c07ae5c6
net/mlx5e: Move port speed code from en_ethtool.c to en/port.c

Move four below functions from en_ethtool.c to en/port.c. These
functions are used by both en_ethtool.c and en_main.c. Future code
can use these functions without ethtool link mode dependency.
  u32 mlx5e_port_ptys2speed(u32 eth_proto_oper);
  int mlx5e_port_linkspeed(struct mlx5_core_dev *mdev, u32 *speed);
  int mlx5e_port_max_linkspeed(struct mlx5_core_dev *mdev, u32 *speed);
  u32 mlx5e_port_speed2linkmodes(u32 speed);

Delete the speed field from table mlx5e_build_ptys2ethtool_map. This
table only keeps the mapping between the mlx5e link mode and
ethtool link mode. Add new table mlx5e_link_speed for translation
from mlx5e link mode to actual speed.

Signed-off-by: Huy Nguyen <huyn@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/Makefile
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en/Makefile [new file with mode: 0644]
drivers/net/ethernet/mellanox/mlx5/core/en/port.c [new file with mode: 0644]
drivers/net/ethernet/mellanox/mlx5/core/en/port.h [new file with mode: 0644]
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c