diff options
Diffstat (limited to 'drivers/net/qlcnic')
-rw-r--r-- | drivers/net/qlcnic/qlcnic_main.c | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index 9eb0ced1ffab..17124f6e0a93 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c | |||
@@ -107,7 +107,7 @@ static irqreturn_t qlcnic_msi_intr(int irq, void *data); | |||
107 | static irqreturn_t qlcnic_msix_intr(int irq, void *data); | 107 | static irqreturn_t qlcnic_msix_intr(int irq, void *data); |
108 | 108 | ||
109 | static struct net_device_stats *qlcnic_get_stats(struct net_device *netdev); | 109 | static struct net_device_stats *qlcnic_get_stats(struct net_device *netdev); |
110 | static void qlcnic_config_indev_addr(struct net_device *dev, unsigned long); | 110 | static void qlcnic_restore_indev_addr(struct net_device *dev, unsigned long); |
111 | static int qlcnic_start_firmware(struct qlcnic_adapter *); | 111 | static int qlcnic_start_firmware(struct qlcnic_adapter *); |
112 | 112 | ||
113 | static void qlcnic_alloc_lb_filters_mem(struct qlcnic_adapter *adapter); | 113 | static void qlcnic_alloc_lb_filters_mem(struct qlcnic_adapter *adapter); |
@@ -1759,7 +1759,7 @@ qlcnic_resume(struct pci_dev *pdev) | |||
1759 | if (err) | 1759 | if (err) |
1760 | goto done; | 1760 | goto done; |
1761 | 1761 | ||
1762 | qlcnic_config_indev_addr(netdev, NETDEV_UP); | 1762 | qlcnic_restore_indev_addr(netdev, NETDEV_UP); |
1763 | } | 1763 | } |
1764 | done: | 1764 | done: |
1765 | netif_device_attach(netdev); | 1765 | netif_device_attach(netdev); |
@@ -2958,7 +2958,7 @@ attach: | |||
2958 | if (qlcnic_up(adapter, netdev)) | 2958 | if (qlcnic_up(adapter, netdev)) |
2959 | goto done; | 2959 | goto done; |
2960 | 2960 | ||
2961 | qlcnic_config_indev_addr(netdev, NETDEV_UP); | 2961 | qlcnic_restore_indev_addr(netdev, NETDEV_UP); |
2962 | } | 2962 | } |
2963 | 2963 | ||
2964 | done: | 2964 | done: |
@@ -3120,7 +3120,7 @@ static int qlcnic_attach_func(struct pci_dev *pdev) | |||
3120 | if (err) | 3120 | if (err) |
3121 | goto done; | 3121 | goto done; |
3122 | 3122 | ||
3123 | qlcnic_config_indev_addr(netdev, NETDEV_UP); | 3123 | qlcnic_restore_indev_addr(netdev, NETDEV_UP); |
3124 | } | 3124 | } |
3125 | done: | 3125 | done: |
3126 | netif_device_attach(netdev); | 3126 | netif_device_attach(netdev); |
@@ -4035,10 +4035,10 @@ qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter) | |||
4035 | #define is_qlcnic_netdev(dev) (dev->netdev_ops == &qlcnic_netdev_ops) | 4035 | #define is_qlcnic_netdev(dev) (dev->netdev_ops == &qlcnic_netdev_ops) |
4036 | 4036 | ||
4037 | static void | 4037 | static void |
4038 | qlcnic_config_indev_addr(struct net_device *dev, unsigned long event) | 4038 | qlcnic_config_indev_addr(struct qlcnic_adapter *adapter, |
4039 | struct net_device *dev, unsigned long event) | ||
4039 | { | 4040 | { |
4040 | struct in_device *indev; | 4041 | struct in_device *indev; |
4041 | struct qlcnic_adapter *adapter = netdev_priv(dev); | ||
4042 | 4042 | ||
4043 | indev = in_dev_get(dev); | 4043 | indev = in_dev_get(dev); |
4044 | if (!indev) | 4044 | if (!indev) |
@@ -4062,6 +4062,27 @@ qlcnic_config_indev_addr(struct net_device *dev, unsigned long event) | |||
4062 | in_dev_put(indev); | 4062 | in_dev_put(indev); |
4063 | } | 4063 | } |
4064 | 4064 | ||
4065 | static void | ||
4066 | qlcnic_restore_indev_addr(struct net_device *netdev, unsigned long event) | ||
4067 | { | ||
4068 | struct qlcnic_adapter *adapter = netdev_priv(netdev); | ||
4069 | struct net_device *dev; | ||
4070 | u16 vid; | ||
4071 | |||
4072 | qlcnic_config_indev_addr(adapter, netdev, event); | ||
4073 | |||
4074 | if (!adapter->vlgrp) | ||
4075 | return; | ||
4076 | |||
4077 | for (vid = 0; vid < VLAN_GROUP_ARRAY_LEN; vid++) { | ||
4078 | dev = vlan_group_get_device(adapter->vlgrp, vid); | ||
4079 | if (!dev) | ||
4080 | continue; | ||
4081 | |||
4082 | qlcnic_config_indev_addr(adapter, dev, event); | ||
4083 | } | ||
4084 | } | ||
4085 | |||
4065 | static int qlcnic_netdev_event(struct notifier_block *this, | 4086 | static int qlcnic_netdev_event(struct notifier_block *this, |
4066 | unsigned long event, void *ptr) | 4087 | unsigned long event, void *ptr) |
4067 | { | 4088 | { |
@@ -4088,7 +4109,7 @@ recheck: | |||
4088 | if (!test_bit(__QLCNIC_DEV_UP, &adapter->state)) | 4109 | if (!test_bit(__QLCNIC_DEV_UP, &adapter->state)) |
4089 | goto done; | 4110 | goto done; |
4090 | 4111 | ||
4091 | qlcnic_config_indev_addr(dev, event); | 4112 | qlcnic_config_indev_addr(adapter, dev, event); |
4092 | done: | 4113 | done: |
4093 | return NOTIFY_DONE; | 4114 | return NOTIFY_DONE; |
4094 | } | 4115 | } |
@@ -4105,7 +4126,7 @@ qlcnic_inetaddr_event(struct notifier_block *this, | |||
4105 | dev = ifa->ifa_dev ? ifa->ifa_dev->dev : NULL; | 4126 | dev = ifa->ifa_dev ? ifa->ifa_dev->dev : NULL; |
4106 | 4127 | ||
4107 | recheck: | 4128 | recheck: |
4108 | if (dev == NULL || !netif_running(dev)) | 4129 | if (dev == NULL) |
4109 | goto done; | 4130 | goto done; |
4110 | 4131 | ||
4111 | if (dev->priv_flags & IFF_802_1Q_VLAN) { | 4132 | if (dev->priv_flags & IFF_802_1Q_VLAN) { |
@@ -4148,7 +4169,7 @@ static struct notifier_block qlcnic_inetaddr_cb = { | |||
4148 | }; | 4169 | }; |
4149 | #else | 4170 | #else |
4150 | static void | 4171 | static void |
4151 | qlcnic_config_indev_addr(struct net_device *dev, unsigned long event) | 4172 | qlcnic_restore_indev_addr(struct net_device *dev, unsigned long event) |
4152 | { } | 4173 | { } |
4153 | #endif | 4174 | #endif |
4154 | static struct pci_error_handlers qlcnic_err_handler = { | 4175 | static struct pci_error_handlers qlcnic_err_handler = { |