3030 * SOFTWARE.
3131 */
3232
33- #include <linux/module.h>
34- #include <linux/mlx5/driver.h>
3533#include <linux/mlx5/port.h>
36- #include <linux/mlx5/cmd.h>
3734#include "mlx5_core.h"
3835
3936int mlx5_core_access_reg (struct mlx5_core_dev * dev , void * data_in ,
@@ -157,44 +154,6 @@ int mlx5_set_port_beacon(struct mlx5_core_dev *dev, u16 beacon_duration)
157154 sizeof (out ), MLX5_REG_MLCR , 0 , 1 );
158155}
159156
160- int mlx5_query_port_proto_cap (struct mlx5_core_dev * dev ,
161- u32 * proto_cap , int proto_mask )
162- {
163- u32 out [MLX5_ST_SZ_DW (ptys_reg )];
164- int err ;
165-
166- err = mlx5_query_port_ptys (dev , out , sizeof (out ), proto_mask , 1 );
167- if (err )
168- return err ;
169-
170- if (proto_mask == MLX5_PTYS_EN )
171- * proto_cap = MLX5_GET (ptys_reg , out , eth_proto_capability );
172- else
173- * proto_cap = MLX5_GET (ptys_reg , out , ib_proto_capability );
174-
175- return 0 ;
176- }
177- EXPORT_SYMBOL_GPL (mlx5_query_port_proto_cap );
178-
179- int mlx5_query_port_proto_admin (struct mlx5_core_dev * dev ,
180- u32 * proto_admin , int proto_mask )
181- {
182- u32 out [MLX5_ST_SZ_DW (ptys_reg )];
183- int err ;
184-
185- err = mlx5_query_port_ptys (dev , out , sizeof (out ), proto_mask , 1 );
186- if (err )
187- return err ;
188-
189- if (proto_mask == MLX5_PTYS_EN )
190- * proto_admin = MLX5_GET (ptys_reg , out , eth_proto_admin );
191- else
192- * proto_admin = MLX5_GET (ptys_reg , out , ib_proto_admin );
193-
194- return 0 ;
195- }
196- EXPORT_SYMBOL_GPL (mlx5_query_port_proto_admin );
197-
198157int mlx5_query_port_link_width_oper (struct mlx5_core_dev * dev ,
199158 u8 * link_width_oper , u8 local_port )
200159{
@@ -211,23 +170,6 @@ int mlx5_query_port_link_width_oper(struct mlx5_core_dev *dev,
211170}
212171EXPORT_SYMBOL_GPL (mlx5_query_port_link_width_oper );
213172
214- int mlx5_query_port_eth_proto_oper (struct mlx5_core_dev * dev ,
215- u32 * proto_oper , u8 local_port )
216- {
217- u32 out [MLX5_ST_SZ_DW (ptys_reg )];
218- int err ;
219-
220- err = mlx5_query_port_ptys (dev , out , sizeof (out ), MLX5_PTYS_EN ,
221- local_port );
222- if (err )
223- return err ;
224-
225- * proto_oper = MLX5_GET (ptys_reg , out , eth_proto_oper );
226-
227- return 0 ;
228- }
229- EXPORT_SYMBOL (mlx5_query_port_eth_proto_oper );
230-
231173int mlx5_query_port_ib_proto_oper (struct mlx5_core_dev * dev ,
232174 u8 * proto_oper , u8 local_port )
233175{
@@ -245,35 +187,6 @@ int mlx5_query_port_ib_proto_oper(struct mlx5_core_dev *dev,
245187}
246188EXPORT_SYMBOL (mlx5_query_port_ib_proto_oper );
247189
248- int mlx5_set_port_ptys (struct mlx5_core_dev * dev , bool an_disable ,
249- u32 proto_admin , int proto_mask )
250- {
251- u32 out [MLX5_ST_SZ_DW (ptys_reg )];
252- u32 in [MLX5_ST_SZ_DW (ptys_reg )];
253- u8 an_disable_admin ;
254- u8 an_disable_cap ;
255- u8 an_status ;
256-
257- mlx5_query_port_autoneg (dev , proto_mask , & an_status ,
258- & an_disable_cap , & an_disable_admin );
259- if (!an_disable_cap && an_disable )
260- return - EPERM ;
261-
262- memset (in , 0 , sizeof (in ));
263-
264- MLX5_SET (ptys_reg , in , local_port , 1 );
265- MLX5_SET (ptys_reg , in , an_disable_admin , an_disable );
266- MLX5_SET (ptys_reg , in , proto_mask , proto_mask );
267- if (proto_mask == MLX5_PTYS_EN )
268- MLX5_SET (ptys_reg , in , eth_proto_admin , proto_admin );
269- else
270- MLX5_SET (ptys_reg , in , ib_proto_admin , proto_admin );
271-
272- return mlx5_core_access_reg (dev , in , sizeof (in ), out ,
273- sizeof (out ), MLX5_REG_PTYS , 0 , 1 );
274- }
275- EXPORT_SYMBOL_GPL (mlx5_set_port_ptys );
276-
277190/* This function should be used after setting a port register only */
278191void mlx5_toggle_port_link (struct mlx5_core_dev * dev )
279192{
@@ -606,25 +519,6 @@ int mlx5_query_port_pfc(struct mlx5_core_dev *dev, u8 *pfc_en_tx, u8 *pfc_en_rx)
606519}
607520EXPORT_SYMBOL_GPL (mlx5_query_port_pfc );
608521
609- void mlx5_query_port_autoneg (struct mlx5_core_dev * dev , int proto_mask ,
610- u8 * an_status ,
611- u8 * an_disable_cap , u8 * an_disable_admin )
612- {
613- u32 out [MLX5_ST_SZ_DW (ptys_reg )];
614-
615- * an_status = 0 ;
616- * an_disable_cap = 0 ;
617- * an_disable_admin = 0 ;
618-
619- if (mlx5_query_port_ptys (dev , out , sizeof (out ), proto_mask , 1 ))
620- return ;
621-
622- * an_status = MLX5_GET (ptys_reg , out , an_status );
623- * an_disable_cap = MLX5_GET (ptys_reg , out , an_disable_cap );
624- * an_disable_admin = MLX5_GET (ptys_reg , out , an_disable_admin );
625- }
626- EXPORT_SYMBOL_GPL (mlx5_query_port_autoneg );
627-
628522int mlx5_max_tc (struct mlx5_core_dev * mdev )
629523{
630524 u8 num_tc = MLX5_CAP_GEN (mdev , max_tc ) ? : 8 ;
0 commit comments