| .. | .. |
|---|
| 130 | 130 | return mlx5e_ethtool_flash_device(priv, flash); |
|---|
| 131 | 131 | } |
|---|
| 132 | 132 | |
|---|
| 133 | | -enum mlx5_ptys_width { |
|---|
| 134 | | - MLX5_PTYS_WIDTH_1X = 1 << 0, |
|---|
| 135 | | - MLX5_PTYS_WIDTH_2X = 1 << 1, |
|---|
| 136 | | - MLX5_PTYS_WIDTH_4X = 1 << 2, |
|---|
| 137 | | - MLX5_PTYS_WIDTH_8X = 1 << 3, |
|---|
| 138 | | - MLX5_PTYS_WIDTH_12X = 1 << 4, |
|---|
| 139 | | -}; |
|---|
| 140 | | - |
|---|
| 141 | 133 | static inline int mlx5_ptys_width_enum_to_int(enum mlx5_ptys_width width) |
|---|
| 142 | 134 | { |
|---|
| 143 | 135 | switch (width) { |
|---|
| .. | .. |
|---|
| 174 | 166 | } |
|---|
| 175 | 167 | } |
|---|
| 176 | 168 | |
|---|
| 177 | | -static int mlx5i_get_port_settings(struct net_device *netdev, |
|---|
| 178 | | - u16 *ib_link_width_oper, u16 *ib_proto_oper) |
|---|
| 179 | | -{ |
|---|
| 180 | | - struct mlx5e_priv *priv = mlx5i_epriv(netdev); |
|---|
| 181 | | - struct mlx5_core_dev *mdev = priv->mdev; |
|---|
| 182 | | - u32 out[MLX5_ST_SZ_DW(ptys_reg)] = {0}; |
|---|
| 183 | | - int ret; |
|---|
| 184 | | - |
|---|
| 185 | | - ret = mlx5_query_port_ptys(mdev, out, sizeof(out), MLX5_PTYS_IB, 1); |
|---|
| 186 | | - if (ret) |
|---|
| 187 | | - return ret; |
|---|
| 188 | | - |
|---|
| 189 | | - *ib_link_width_oper = MLX5_GET(ptys_reg, out, ib_link_width_oper); |
|---|
| 190 | | - *ib_proto_oper = MLX5_GET(ptys_reg, out, ib_proto_oper); |
|---|
| 191 | | - |
|---|
| 192 | | - return 0; |
|---|
| 193 | | -} |
|---|
| 194 | | - |
|---|
| 195 | 169 | static int mlx5i_get_speed_settings(u16 ib_link_width_oper, u16 ib_proto_oper) |
|---|
| 196 | 170 | { |
|---|
| 197 | 171 | int rate, width; |
|---|
| .. | .. |
|---|
| 209 | 183 | static int mlx5i_get_link_ksettings(struct net_device *netdev, |
|---|
| 210 | 184 | struct ethtool_link_ksettings *link_ksettings) |
|---|
| 211 | 185 | { |
|---|
| 186 | + struct mlx5e_priv *priv = mlx5i_epriv(netdev); |
|---|
| 187 | + struct mlx5_core_dev *mdev = priv->mdev; |
|---|
| 212 | 188 | u16 ib_link_width_oper; |
|---|
| 213 | 189 | u16 ib_proto_oper; |
|---|
| 214 | 190 | int speed, ret; |
|---|
| 215 | 191 | |
|---|
| 216 | | - ret = mlx5i_get_port_settings(netdev, &ib_link_width_oper, &ib_proto_oper); |
|---|
| 192 | + ret = mlx5_query_ib_port_oper(mdev, &ib_link_width_oper, &ib_proto_oper, |
|---|
| 193 | + 1); |
|---|
| 217 | 194 | if (ret) |
|---|
| 218 | 195 | return ret; |
|---|
| 219 | 196 | |
|---|
| .. | .. |
|---|
| 235 | 212 | } |
|---|
| 236 | 213 | |
|---|
| 237 | 214 | const struct ethtool_ops mlx5i_ethtool_ops = { |
|---|
| 215 | + .supported_coalesce_params = ETHTOOL_COALESCE_USECS | |
|---|
| 216 | + ETHTOOL_COALESCE_MAX_FRAMES | |
|---|
| 217 | + ETHTOOL_COALESCE_USE_ADAPTIVE, |
|---|
| 238 | 218 | .get_drvinfo = mlx5i_get_drvinfo, |
|---|
| 239 | 219 | .get_strings = mlx5i_get_strings, |
|---|
| 240 | 220 | .get_sset_count = mlx5i_get_sset_count, |
|---|