|
|
@@ -2144,14 +2144,21 @@ static const struct net_device_ops bcm_sysport_netdev_ops = {
|
|
|
.ndo_select_queue = bcm_sysport_select_queue,
|
|
|
};
|
|
|
|
|
|
-static int bcm_sysport_map_queues(struct net_device *dev,
|
|
|
+static int bcm_sysport_map_queues(struct notifier_block *nb,
|
|
|
struct dsa_notifier_register_info *info)
|
|
|
{
|
|
|
- struct bcm_sysport_priv *priv = netdev_priv(dev);
|
|
|
struct bcm_sysport_tx_ring *ring;
|
|
|
+ struct bcm_sysport_priv *priv;
|
|
|
struct net_device *slave_dev;
|
|
|
unsigned int num_tx_queues;
|
|
|
unsigned int q, start, port;
|
|
|
+ struct net_device *dev;
|
|
|
+
|
|
|
+ priv = container_of(nb, struct bcm_sysport_priv, dsa_notifier);
|
|
|
+ if (priv->netdev != info->master)
|
|
|
+ return 0;
|
|
|
+
|
|
|
+ dev = info->master;
|
|
|
|
|
|
/* We can't be setting up queue inspection for non directly attached
|
|
|
* switches
|
|
|
@@ -2174,6 +2181,7 @@ static int bcm_sysport_map_queues(struct net_device *dev,
|
|
|
if (priv->is_lite)
|
|
|
netif_set_real_num_tx_queues(slave_dev,
|
|
|
slave_dev->num_tx_queues / 2);
|
|
|
+
|
|
|
num_tx_queues = slave_dev->real_num_tx_queues;
|
|
|
|
|
|
if (priv->per_port_num_tx_queues &&
|
|
|
@@ -2201,7 +2209,7 @@ static int bcm_sysport_map_queues(struct net_device *dev,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-static int bcm_sysport_dsa_notifier(struct notifier_block *unused,
|
|
|
+static int bcm_sysport_dsa_notifier(struct notifier_block *nb,
|
|
|
unsigned long event, void *ptr)
|
|
|
{
|
|
|
struct dsa_notifier_register_info *info;
|
|
|
@@ -2211,7 +2219,7 @@ static int bcm_sysport_dsa_notifier(struct notifier_block *unused,
|
|
|
|
|
|
info = ptr;
|
|
|
|
|
|
- return notifier_from_errno(bcm_sysport_map_queues(info->master, info));
|
|
|
+ return notifier_from_errno(bcm_sysport_map_queues(nb, info));
|
|
|
}
|
|
|
|
|
|
#define REV_FMT "v%2x.%02x"
|