staging: wilc1000: remove inetaddr notifier

Driver registers an inetaddr notifier to disable powersave while the ip
address is being obtained which should be controlled only by cfg80211.

Signed-off-by: Adham Abozaeid <adham.abozaeid@microchip.com>
Link: https://lore.kernel.org/r/20190725213125.2810-2-adham.abozaeid@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Adham Abozaeid 2019-07-25 21:31:33 +00:00 committed by Greg Kroah-Hartman
parent 8e7cb7352e
commit f68dc00ee7

View file

@ -504,12 +504,6 @@ static int wlan_initialize_threads(struct net_device *dev)
return 0;
}
static int dev_state_ev_handler(struct notifier_block *this,
unsigned long event, void *ptr);
static struct notifier_block g_dev_notifier = {
.notifier_call = dev_state_ev_handler
};
static int wilc_wlan_initialize(struct net_device *dev, struct wilc_vif *vif)
{
int ret = 0;
@ -575,7 +569,6 @@ static int wilc_wlan_initialize(struct net_device *dev, struct wilc_vif *vif)
ret = -EIO;
goto fail_fw_start;
}
register_inetaddr_notifier(&g_dev_notifier);
wl->initialized = true;
return 0;
@ -781,7 +774,6 @@ static int wilc_mac_close(struct net_device *ndev)
if (wl->open_ifcs == 0) {
netdev_dbg(ndev, "Deinitializing wilc1000\n");
wl->close = 1;
unregister_inetaddr_notifier(&g_dev_notifier);
wilc_wlan_deinitialize(ndev);
}
@ -864,63 +856,6 @@ static const struct net_device_ops wilc_netdev_ops = {
.ndo_set_rx_mode = wilc_set_multicast_list,
};
static int dev_state_ev_handler(struct notifier_block *this,
unsigned long event, void *ptr)
{
struct in_ifaddr *dev_iface = ptr;
struct wilc_priv *priv;
struct host_if_drv *hif_drv;
struct net_device *dev;
struct wilc_vif *vif;
if (!dev_iface || !dev_iface->ifa_dev || !dev_iface->ifa_dev->dev)
return NOTIFY_DONE;
dev = (struct net_device *)dev_iface->ifa_dev->dev;
if (dev->netdev_ops != &wilc_netdev_ops)
return NOTIFY_DONE;
if (!dev->ieee80211_ptr || !dev->ieee80211_ptr->wiphy)
return NOTIFY_DONE;
vif = netdev_priv(dev);
priv = &vif->priv;
hif_drv = (struct host_if_drv *)priv->hif_drv;
switch (event) {
case NETDEV_UP:
if (vif->iftype == WILC_STATION_MODE ||
vif->iftype == WILC_CLIENT_MODE) {
hif_drv->ifc_up = 1;
vif->obtaining_ip = false;
del_timer(&vif->during_ip_timer);
}
if (vif->wilc->enable_ps)
wilc_set_power_mgmt(vif, 1, 0);
break;
case NETDEV_DOWN:
if (vif->iftype == WILC_STATION_MODE ||
vif->iftype == WILC_CLIENT_MODE) {
hif_drv->ifc_up = 0;
vif->obtaining_ip = false;
wilc_set_power_mgmt(vif, 0, 0);
}
wilc_resolve_disconnect_aberration(vif);
break;
default:
break;
}
return NOTIFY_DONE;
}
void wilc_netdev_cleanup(struct wilc *wilc)
{
int i;