|
11 | 11 | #include <linux/device.h>
|
12 | 12 | #include <linux/skbuff.h>
|
13 | 13 | #include <linux/if_vlan.h>
|
14 |
| -#include <net/switchdev.h> |
15 | 14 |
|
16 | 15 | #include "pci.h"
|
17 | 16 | #include "core.h"
|
@@ -390,13 +389,26 @@ static int mlxsw_sx_port_get_phys_port_name(struct net_device *dev, char *name,
|
390 | 389 | name, len);
|
391 | 390 | }
|
392 | 391 |
|
| 392 | +static int mlxsw_sx_port_get_port_parent_id(struct net_device *dev, |
| 393 | + struct netdev_phys_item_id *ppid) |
| 394 | +{ |
| 395 | + struct mlxsw_sx_port *mlxsw_sx_port = netdev_priv(dev); |
| 396 | + struct mlxsw_sx *mlxsw_sx = mlxsw_sx_port->mlxsw_sx; |
| 397 | + |
| 398 | + ppid->id_len = sizeof(mlxsw_sx->hw_id); |
| 399 | + memcpy(&ppid->id, &mlxsw_sx->hw_id, ppid->id_len); |
| 400 | + |
| 401 | + return 0; |
| 402 | +} |
| 403 | + |
393 | 404 | static const struct net_device_ops mlxsw_sx_port_netdev_ops = {
|
394 | 405 | .ndo_open = mlxsw_sx_port_open,
|
395 | 406 | .ndo_stop = mlxsw_sx_port_stop,
|
396 | 407 | .ndo_start_xmit = mlxsw_sx_port_xmit,
|
397 | 408 | .ndo_change_mtu = mlxsw_sx_port_change_mtu,
|
398 | 409 | .ndo_get_stats64 = mlxsw_sx_port_get_stats64,
|
399 | 410 | .ndo_get_phys_port_name = mlxsw_sx_port_get_phys_port_name,
|
| 411 | + .ndo_get_port_parent_id = mlxsw_sx_port_get_port_parent_id, |
400 | 412 | };
|
401 | 413 |
|
402 | 414 | static void mlxsw_sx_port_get_drvinfo(struct net_device *dev,
|
@@ -901,28 +913,6 @@ static const struct ethtool_ops mlxsw_sx_port_ethtool_ops = {
|
901 | 913 | .set_link_ksettings = mlxsw_sx_port_set_link_ksettings,
|
902 | 914 | };
|
903 | 915 |
|
904 |
| -static int mlxsw_sx_port_attr_get(struct net_device *dev, |
905 |
| - struct switchdev_attr *attr) |
906 |
| -{ |
907 |
| - struct mlxsw_sx_port *mlxsw_sx_port = netdev_priv(dev); |
908 |
| - struct mlxsw_sx *mlxsw_sx = mlxsw_sx_port->mlxsw_sx; |
909 |
| - |
910 |
| - switch (attr->id) { |
911 |
| - case SWITCHDEV_ATTR_ID_PORT_PARENT_ID: |
912 |
| - attr->u.ppid.id_len = sizeof(mlxsw_sx->hw_id); |
913 |
| - memcpy(&attr->u.ppid.id, &mlxsw_sx->hw_id, attr->u.ppid.id_len); |
914 |
| - break; |
915 |
| - default: |
916 |
| - return -EOPNOTSUPP; |
917 |
| - } |
918 |
| - |
919 |
| - return 0; |
920 |
| -} |
921 |
| - |
922 |
| -static const struct switchdev_ops mlxsw_sx_port_switchdev_ops = { |
923 |
| - .switchdev_port_attr_get = mlxsw_sx_port_attr_get, |
924 |
| -}; |
925 |
| - |
926 | 916 | static int mlxsw_sx_hw_id_get(struct mlxsw_sx *mlxsw_sx)
|
927 | 917 | {
|
928 | 918 | char spad_pl[MLXSW_REG_SPAD_LEN] = {0};
|
@@ -1034,7 +1024,6 @@ static int __mlxsw_sx_port_eth_create(struct mlxsw_sx *mlxsw_sx, u8 local_port,
|
1034 | 1024 |
|
1035 | 1025 | dev->netdev_ops = &mlxsw_sx_port_netdev_ops;
|
1036 | 1026 | dev->ethtool_ops = &mlxsw_sx_port_ethtool_ops;
|
1037 |
| - dev->switchdev_ops = &mlxsw_sx_port_switchdev_ops; |
1038 | 1027 |
|
1039 | 1028 | err = mlxsw_sx_port_dev_addr_get(mlxsw_sx_port);
|
1040 | 1029 | if (err) {
|
|
0 commit comments