static irqreturn_t netxen_msi_intr(int irq, void *data);
static irqreturn_t netxen_msix_intr(int irq, void *data);
+static void netxen_config_indev_addr(struct net_device *dev, unsigned long);
+
/* PCI Device ID Table */
#define ENTRY(device) \
{PCI_DEVICE(PCI_VENDOR_ID_NETXEN, (device)), \
goto err_out_detach;
netif_device_attach(netdev);
+
+ netxen_config_indev_addr(netdev, NETDEV_UP);
}
netxen_schedule_work(adapter, netxen_fw_poll_work, FW_POLL_DELAY);
goto done;
}
+ netxen_config_indev_addr(netdev, NETDEV_UP);
}
netif_device_attach(netdev);
return 1;
}
+static void
+netxen_config_indev_addr(struct net_device *dev, unsigned long event)
+{
+ struct in_device *indev;
+ struct netxen_adapter *adapter = netdev_priv(dev);
+
+ if (netxen_destip_supported(adapter))
+ return;
+
+ indev = in_dev_get(dev);
+ if (!indev)
+ return;
+
+ for_ifa(indev) {
+ switch (event) {
+ case NETDEV_UP:
+ netxen_config_ipaddr(adapter,
+ ifa->ifa_address, NX_IP_UP);
+ break;
+ case NETDEV_DOWN:
+ netxen_config_ipaddr(adapter,
+ ifa->ifa_address, NX_IP_DOWN);
+ break;
+ default:
+ break;
+ }
+ } endfor_ifa(indev);
+
+ in_dev_put(indev);
+ return;
+}
+
static int netxen_netdev_event(struct notifier_block *this,
unsigned long event, void *ptr)
{
struct netxen_adapter *adapter;
struct net_device *dev = (struct net_device *)ptr;
- struct in_device *indev;
recheck:
if (dev == NULL)
adapter = netdev_priv(dev);
- if (!adapter || !netxen_destip_supported(adapter))
+ if (!adapter)
goto done;
if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC)
goto done;
- indev = in_dev_get(dev);
- if (!indev)
- goto done;
-
- for_ifa(indev) {
- switch (event) {
- case NETDEV_UP:
- netxen_config_ipaddr(adapter,
- ifa->ifa_address, NX_IP_UP);
- break;
- case NETDEV_DOWN:
- netxen_config_ipaddr(adapter,
- ifa->ifa_address, NX_IP_DOWN);
- break;
- default:
- break;
- }
- } endfor_ifa(indev);
-
- in_dev_put(indev);
+ netxen_config_indev_addr(dev, event);
done:
return NOTIFY_DONE;
}