Commit 1408603c authored by Leo Kim's avatar Leo Kim Committed by Greg Kroah-Hartman

staging: wilc1000: removes unnecessary debug logs

This patch removes unnecessary debug logs.
Signed-off-by: default avatarLeo Kim <leo.kim@atmel.com>
Signed-off-by: default avatarGlen Lee <glen.lee@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 885cabcc
...@@ -70,47 +70,32 @@ static int dev_state_ev_handler(struct notifier_block *this, ...@@ -70,47 +70,32 @@ static int dev_state_ev_handler(struct notifier_block *this,
u8 null_ip[4] = {0}; u8 null_ip[4] = {0};
char wlan_dev_name[5] = "wlan0"; char wlan_dev_name[5] = "wlan0";
if (!dev_iface || !dev_iface->ifa_dev || !dev_iface->ifa_dev->dev) { if (!dev_iface || !dev_iface->ifa_dev || !dev_iface->ifa_dev->dev)
PRINT_D(GENERIC_DBG, "dev_iface = NULL\n");
return NOTIFY_DONE; return NOTIFY_DONE;
}
if (memcmp(dev_iface->ifa_label, "wlan0", 5) && if (memcmp(dev_iface->ifa_label, "wlan0", 5) &&
memcmp(dev_iface->ifa_label, "p2p0", 4)) { memcmp(dev_iface->ifa_label, "p2p0", 4))
PRINT_D(GENERIC_DBG, "Interface is neither WLAN0 nor P2P0\n");
return NOTIFY_DONE; return NOTIFY_DONE;
}
dev = (struct net_device *)dev_iface->ifa_dev->dev; dev = (struct net_device *)dev_iface->ifa_dev->dev;
if (!dev->ieee80211_ptr || !dev->ieee80211_ptr->wiphy) { if (!dev->ieee80211_ptr || !dev->ieee80211_ptr->wiphy)
PRINT_D(GENERIC_DBG, "No Wireless registerd\n");
return NOTIFY_DONE; return NOTIFY_DONE;
}
priv = wiphy_priv(dev->ieee80211_ptr->wiphy); priv = wiphy_priv(dev->ieee80211_ptr->wiphy);
if (!priv) { if (!priv)
PRINT_D(GENERIC_DBG, "No Wireless Priv\n");
return NOTIFY_DONE; return NOTIFY_DONE;
}
hif_drv = (struct host_if_drv *)priv->hif_drv; hif_drv = (struct host_if_drv *)priv->hif_drv;
vif = netdev_priv(dev); vif = netdev_priv(dev);
if (!vif || !hif_drv) { if (!vif || !hif_drv)
PRINT_D(GENERIC_DBG, "No Wireless Priv\n");
return NOTIFY_DONE; return NOTIFY_DONE;
}
PRINT_INFO(GENERIC_DBG, "dev_state_ev_handler +++\n");
switch (event) { switch (event) {
case NETDEV_UP: case NETDEV_UP:
PRINT_D(GENERIC_DBG, "dev_state_ev_handler event=NETDEV_UP %p\n", dev);
PRINT_INFO(GENERIC_DBG, "\n ============== IP Address Obtained ===============\n\n");
if (vif->iftype == STATION_MODE || vif->iftype == CLIENT_MODE) { if (vif->iftype == STATION_MODE || vif->iftype == CLIENT_MODE) {
hif_drv->IFC_UP = 1; hif_drv->IFC_UP = 1;
wilc_optaining_ip = false; wilc_optaining_ip = false;
del_timer(&wilc_during_ip_timer); del_timer(&wilc_during_ip_timer);
PRINT_D(GENERIC_DBG, "IP obtained , enable scan\n");
} }
if (wilc_enable_ps) if (wilc_enable_ps)
...@@ -127,9 +112,6 @@ static int dev_state_ev_handler(struct notifier_block *this, ...@@ -127,9 +112,6 @@ static int dev_state_ev_handler(struct notifier_block *this,
break; break;
case NETDEV_DOWN: case NETDEV_DOWN:
PRINT_D(GENERIC_DBG, "dev_state_ev_handler event=NETDEV_DOWN %p\n", dev);
PRINT_INFO(GENERIC_DBG, "\n ============== IP Address Released ===============\n\n");
if (vif->iftype == STATION_MODE || vif->iftype == CLIENT_MODE) { if (vif->iftype == STATION_MODE || vif->iftype == CLIENT_MODE) {
hif_drv->IFC_UP = 0; hif_drv->IFC_UP = 0;
wilc_optaining_ip = false; wilc_optaining_ip = false;
...@@ -152,9 +134,6 @@ static int dev_state_ev_handler(struct notifier_block *this, ...@@ -152,9 +134,6 @@ static int dev_state_ev_handler(struct notifier_block *this,
break; break;
default: default:
PRINT_INFO(GENERIC_DBG, "dev_state_ev_handler event=default\n");
PRINT_INFO(GENERIC_DBG, "[%s] unknown dev event: %lu\n", dev_iface->ifa_label, event);
break; break;
} }
...@@ -169,7 +148,6 @@ static irqreturn_t isr_uh_routine(int irq, void *user_data) ...@@ -169,7 +148,6 @@ static irqreturn_t isr_uh_routine(int irq, void *user_data)
vif = netdev_priv(dev); vif = netdev_priv(dev);
wilc = vif->wilc; wilc = vif->wilc;
PRINT_D(INT_DBG, "Interrupt received UH\n");
if (wilc->close) { if (wilc->close) {
PRINT_ER("Driver is CLOSING: Can't handle UH interrupt\n"); PRINT_ER("Driver is CLOSING: Can't handle UH interrupt\n");
...@@ -191,7 +169,6 @@ static irqreturn_t isr_bh_routine(int irq, void *userdata) ...@@ -191,7 +169,6 @@ static irqreturn_t isr_bh_routine(int irq, void *userdata)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
PRINT_D(INT_DBG, "Interrupt received BH\n");
wilc_handle_isr(wilc); wilc_handle_isr(wilc);
return IRQ_HANDLED; return IRQ_HANDLED;
...@@ -255,12 +232,9 @@ int wilc_lock_timeout(struct wilc *nic, void *vp, u32 timeout) ...@@ -255,12 +232,9 @@ int wilc_lock_timeout(struct wilc *nic, void *vp, u32 timeout)
/* FIXME: replace with mutex_lock or wait_for_completion */ /* FIXME: replace with mutex_lock or wait_for_completion */
int error = -1; int error = -1;
PRINT_D(LOCK_DBG, "Locking %p\n", vp);
if (vp) if (vp)
error = down_timeout((struct semaphore *)vp, error = down_timeout((struct semaphore *)vp,
msecs_to_jiffies(timeout)); msecs_to_jiffies(timeout));
else
PRINT_ER("Failed, mutex is NULL\n");
return error; return error;
} }
...@@ -358,28 +332,21 @@ static int linux_wlan_txq_task(void *vp) ...@@ -358,28 +332,21 @@ static int linux_wlan_txq_task(void *vp)
up(&wl->txq_thread_started); up(&wl->txq_thread_started);
while (1) { while (1) {
PRINT_D(TX_DBG, "txq_task Taking a nap :)\n");
down(&wl->txq_event); down(&wl->txq_event);
PRINT_D(TX_DBG, "txq_task Who waked me up :$\n");
if (wl->close) { if (wl->close) {
up(&wl->txq_thread_started); up(&wl->txq_thread_started);
while (!kthread_should_stop()) while (!kthread_should_stop())
schedule(); schedule();
PRINT_D(TX_DBG, "TX thread stopped\n");
break; break;
} }
PRINT_D(TX_DBG, "txq_task handle the sending packet and let me go to sleep.\n");
#if !defined USE_TX_BACKOFF_DELAY_IF_NO_BUFFERS #if !defined USE_TX_BACKOFF_DELAY_IF_NO_BUFFERS
ret = wilc_wlan_handle_txq(dev, &txq_count); ret = wilc_wlan_handle_txq(dev, &txq_count);
#else #else
do { do {
ret = wilc_wlan_handle_txq(dev, &txq_count); ret = wilc_wlan_handle_txq(dev, &txq_count);
if (txq_count < FLOW_CONTROL_LOWER_THRESHOLD) { if (txq_count < FLOW_CONTROL_LOWER_THRESHOLD) {
PRINT_D(TX_DBG, "Waking up queue\n");
if (netif_queue_stopped(wl->vif[0]->ndev)) if (netif_queue_stopped(wl->vif[0]->ndev))
netif_wake_queue(wl->vif[0]->ndev); netif_wake_queue(wl->vif[0]->ndev);
if (netif_queue_stopped(wl->vif[1]->ndev)) if (netif_queue_stopped(wl->vif[1]->ndev))
...@@ -428,15 +395,11 @@ int wilc_wlan_get_firmware(struct net_device *dev) ...@@ -428,15 +395,11 @@ int wilc_wlan_get_firmware(struct net_device *dev)
netdev_info(dev, "loading firmware %s\n", firmware); netdev_info(dev, "loading firmware %s\n", firmware);
if (!vif) { if (!vif)
PRINT_ER("vif is NULL\n");
goto _fail_; goto _fail_;
}
if (!(&vif->ndev->dev)) { if (!(&vif->ndev->dev))
PRINT_ER("&vif->ndev->dev is NULL\n");
goto _fail_; goto _fail_;
}
if (request_firmware(&wilc_firmware, firmware, wilc->dev) != 0) { if (request_firmware(&wilc_firmware, firmware, wilc->dev) != 0) {
PRINT_ER("%s - firmare not available\n", firmware); PRINT_ER("%s - firmare not available\n", firmware);
...@@ -459,20 +422,13 @@ static int linux_wlan_start_firmware(struct net_device *dev) ...@@ -459,20 +422,13 @@ static int linux_wlan_start_firmware(struct net_device *dev)
vif = netdev_priv(dev); vif = netdev_priv(dev);
wilc = vif->wilc; wilc = vif->wilc;
PRINT_D(INIT_DBG, "Starting Firmware ...\n");
ret = wilc_wlan_start(wilc); ret = wilc_wlan_start(wilc);
if (ret < 0) { if (ret < 0)
PRINT_ER("Failed to start Firmware\n");
return ret; return ret;
}
PRINT_D(INIT_DBG, "Waiting for Firmware to get ready ...\n");
ret = wilc_lock_timeout(wilc, &wilc->sync_event, 5000); ret = wilc_lock_timeout(wilc, &wilc->sync_event, 5000);
if (ret) { if (ret)
PRINT_D(INIT_DBG, "Firmware start timed out");
return ret; return ret;
}
PRINT_D(INIT_DBG, "Firmware successfully started\n");
return 0; return 0;
} }
...@@ -490,14 +446,12 @@ static int wilc1000_firmware_download(struct net_device *dev) ...@@ -490,14 +446,12 @@ static int wilc1000_firmware_download(struct net_device *dev)
PRINT_ER("Firmware buffer is NULL\n"); PRINT_ER("Firmware buffer is NULL\n");
return -ENOBUFS; return -ENOBUFS;
} }
PRINT_D(INIT_DBG, "Downloading Firmware ...\n");
ret = wilc_wlan_firmware_download(wilc, wilc->firmware->data, ret = wilc_wlan_firmware_download(wilc, wilc->firmware->data,
wilc->firmware->size); wilc->firmware->size);
if (ret < 0) if (ret < 0)
return ret; return ret;
PRINT_D(INIT_DBG, "Freeing FW buffer ...\n");
PRINT_D(INIT_DBG, "Releasing firmware\n");
release_firmware(wilc->firmware); release_firmware(wilc->firmware);
wilc->firmware = NULL; wilc->firmware = NULL;
...@@ -740,7 +694,6 @@ void wilc1000_wlan_deinit(struct net_device *dev) ...@@ -740,7 +694,6 @@ void wilc1000_wlan_deinit(struct net_device *dev)
if (wl->initialized) { if (wl->initialized) {
netdev_info(dev, "Deinitializing wilc1000...\n"); netdev_info(dev, "Deinitializing wilc1000...\n");
PRINT_D(INIT_DBG, "Disabling IRQ\n");
if (!wl->dev_irq_num && if (!wl->dev_irq_num &&
wl->hif_func->disable_interrupt) { wl->hif_func->disable_interrupt) {
mutex_lock(&wl->hif_cs); mutex_lock(&wl->hif_cs);
...@@ -750,29 +703,19 @@ void wilc1000_wlan_deinit(struct net_device *dev) ...@@ -750,29 +703,19 @@ void wilc1000_wlan_deinit(struct net_device *dev)
if (&wl->txq_event) if (&wl->txq_event)
up(&wl->txq_event); up(&wl->txq_event);
PRINT_D(INIT_DBG, "Deinitializing Threads\n");
wlan_deinitialize_threads(dev); wlan_deinitialize_threads(dev);
PRINT_D(INIT_DBG, "Deinitializing IRQ\n");
deinit_irq(dev); deinit_irq(dev);
wilc_wlan_stop(wl); wilc_wlan_stop(wl);
PRINT_D(INIT_DBG, "Deinitializing WILC Wlan\n");
wilc_wlan_cleanup(dev); wilc_wlan_cleanup(dev);
#if defined(PLAT_ALLWINNER_A20) || defined(PLAT_ALLWINNER_A23) || defined(PLAT_ALLWINNER_A31) #if defined(PLAT_ALLWINNER_A20) || defined(PLAT_ALLWINNER_A23) || defined(PLAT_ALLWINNER_A31)
if (!wl->dev_irq_num && if (!wl->dev_irq_num &&
wl->hif_func->disable_interrupt) { wl->hif_func->disable_interrupt) {
PRINT_D(INIT_DBG, "Disabling IRQ 2\n");
mutex_lock(&wl->hif_cs); mutex_lock(&wl->hif_cs);
wl->hif_func->disable_interrupt(wl); wl->hif_func->disable_interrupt(wl);
mutex_unlock(&wl->hif_cs); mutex_unlock(&wl->hif_cs);
} }
#endif #endif
PRINT_D(INIT_DBG, "Deinitializing Locks\n");
wlan_deinit_locks(dev); wlan_deinit_locks(dev);
wl->initialized = false; wl->initialized = false;
...@@ -792,8 +735,6 @@ static int wlan_init_locks(struct net_device *dev) ...@@ -792,8 +735,6 @@ static int wlan_init_locks(struct net_device *dev)
vif = netdev_priv(dev); vif = netdev_priv(dev);
wl = vif->wilc; wl = vif->wilc;
PRINT_D(INIT_DBG, "Initializing Locks ...\n");
mutex_init(&wl->hif_cs); mutex_init(&wl->hif_cs);
mutex_init(&wl->rxq_cs); mutex_init(&wl->rxq_cs);
...@@ -818,8 +759,6 @@ static int wlan_deinit_locks(struct net_device *dev) ...@@ -818,8 +759,6 @@ static int wlan_deinit_locks(struct net_device *dev)
vif = netdev_priv(dev); vif = netdev_priv(dev);
wilc = vif->wilc; wilc = vif->wilc;
PRINT_D(INIT_DBG, "De-Initializing Locks\n");
if (&wilc->hif_cs) if (&wilc->hif_cs)
mutex_destroy(&wilc->hif_cs); mutex_destroy(&wilc->hif_cs);
...@@ -837,8 +776,6 @@ static int wlan_initialize_threads(struct net_device *dev) ...@@ -837,8 +776,6 @@ static int wlan_initialize_threads(struct net_device *dev)
vif = netdev_priv(dev); vif = netdev_priv(dev);
wilc = vif->wilc; wilc = vif->wilc;
PRINT_D(INIT_DBG, "Initializing Threads ...\n");
PRINT_D(INIT_DBG, "Creating kthread for transmission\n");
wilc->txq_thread = kthread_run(linux_wlan_txq_task, (void *)dev, wilc->txq_thread = kthread_run(linux_wlan_txq_task, (void *)dev,
"K_TXQ_TASK"); "K_TXQ_TASK");
if (!wilc->txq_thread) { if (!wilc->txq_thread) {
...@@ -860,7 +797,6 @@ static void wlan_deinitialize_threads(struct net_device *dev) ...@@ -860,7 +797,6 @@ static void wlan_deinitialize_threads(struct net_device *dev)
wl = vif->wilc; wl = vif->wilc;
wl->close = 1; wl->close = 1;
PRINT_D(INIT_DBG, "Deinitializing Threads\n");
if (&wl->txq_event) if (&wl->txq_event)
up(&wl->txq_event); up(&wl->txq_event);
...@@ -884,20 +820,17 @@ int wilc1000_wlan_init(struct net_device *dev, struct wilc_vif *vif) ...@@ -884,20 +820,17 @@ int wilc1000_wlan_init(struct net_device *dev, struct wilc_vif *vif)
ret = wilc_wlan_init(dev); ret = wilc_wlan_init(dev);
if (ret < 0) { if (ret < 0) {
PRINT_ER("Initializing WILC_Wlan FAILED\n");
ret = -EIO; ret = -EIO;
goto _fail_locks_; goto _fail_locks_;
} }
if (wl->gpio >= 0 && init_irq(dev)) { if (wl->gpio >= 0 && init_irq(dev)) {
PRINT_ER("couldn't initialize IRQ\n");
ret = -EIO; ret = -EIO;
goto _fail_locks_; goto _fail_locks_;
} }
ret = wlan_initialize_threads(dev); ret = wlan_initialize_threads(dev);
if (ret < 0) { if (ret < 0) {
PRINT_ER("Initializing Threads FAILED\n");
ret = -EIO; ret = -EIO;
goto _fail_wilc_wlan_; goto _fail_wilc_wlan_;
} }
...@@ -905,27 +838,23 @@ int wilc1000_wlan_init(struct net_device *dev, struct wilc_vif *vif) ...@@ -905,27 +838,23 @@ int wilc1000_wlan_init(struct net_device *dev, struct wilc_vif *vif)
if (!wl->dev_irq_num && if (!wl->dev_irq_num &&
wl->hif_func->enable_interrupt && wl->hif_func->enable_interrupt &&
wl->hif_func->enable_interrupt(wl)) { wl->hif_func->enable_interrupt(wl)) {
PRINT_ER("couldn't initialize IRQ\n");
ret = -EIO; ret = -EIO;
goto _fail_irq_init_; goto _fail_irq_init_;
} }
if (wilc_wlan_get_firmware(dev)) { if (wilc_wlan_get_firmware(dev)) {
PRINT_ER("Can't get firmware\n");
ret = -EIO; ret = -EIO;
goto _fail_irq_enable_; goto _fail_irq_enable_;
} }
ret = wilc1000_firmware_download(dev); ret = wilc1000_firmware_download(dev);
if (ret < 0) { if (ret < 0) {
PRINT_ER("Failed to download firmware\n");
ret = -EIO; ret = -EIO;
goto _fail_irq_enable_; goto _fail_irq_enable_;
} }
ret = linux_wlan_start_firmware(dev); ret = linux_wlan_start_firmware(dev);
if (ret < 0) { if (ret < 0) {
PRINT_ER("Failed to start firmware\n");
ret = -EIO; ret = -EIO;
goto _fail_irq_enable_; goto _fail_irq_enable_;
} }
...@@ -1007,16 +936,11 @@ int wilc_mac_open(struct net_device *ndev) ...@@ -1007,16 +936,11 @@ int wilc_mac_open(struct net_device *ndev)
PRINT_D(INIT_DBG, "MAC OPEN[%p]\n", ndev); PRINT_D(INIT_DBG, "MAC OPEN[%p]\n", ndev);
ret = wilc_init_host_int(ndev); ret = wilc_init_host_int(ndev);
if (ret < 0) { if (ret < 0)
PRINT_ER("Failed to initialize host interface\n");
return ret; return ret;
}
PRINT_D(INIT_DBG, "*** re-init ***\n");
ret = wilc1000_wlan_init(ndev, vif); ret = wilc1000_wlan_init(ndev, vif);
if (ret < 0) { if (ret < 0) {
PRINT_ER("Failed to initialize wilc1000\n");
wilc_deinit_host_int(ndev); wilc_deinit_host_int(ndev);
return ret; return ret;
} }
...@@ -1097,23 +1021,16 @@ static void wilc_set_multicast_list(struct net_device *dev) ...@@ -1097,23 +1021,16 @@ static void wilc_set_multicast_list(struct net_device *dev)
if (!dev) if (!dev)
return; return;
PRINT_D(INIT_DBG, "Setting Multicast List with count = %d.\n", if (dev->flags & IFF_PROMISC)
dev->mc.count);
if (dev->flags & IFF_PROMISC) {
PRINT_D(INIT_DBG, "Set promiscuous mode ON, retrive all packets\n");
return; return;
}
if ((dev->flags & IFF_ALLMULTI) || if ((dev->flags & IFF_ALLMULTI) ||
(dev->mc.count) > WILC_MULTICAST_TABLE_SIZE) { (dev->mc.count) > WILC_MULTICAST_TABLE_SIZE) {
PRINT_D(INIT_DBG, "Disable multicast filter, retrive all multicast packets\n");
wilc_setup_multicast_filter(vif, false, 0); wilc_setup_multicast_filter(vif, false, 0);
return; return;
} }
if ((dev->mc.count) == 0) { if ((dev->mc.count) == 0) {
PRINT_D(INIT_DBG, "Enable multicast filter, retrive directed packets only.\n");
wilc_setup_multicast_filter(vif, true, 0); wilc_setup_multicast_filter(vif, true, 0);
return; return;
} }
...@@ -1160,8 +1077,6 @@ int wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev) ...@@ -1160,8 +1077,6 @@ int wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev)
vif = netdev_priv(ndev); vif = netdev_priv(ndev);
wilc = vif->wilc; wilc = vif->wilc;
PRINT_D(TX_DBG, "Sending packet just received from TCP/IP\n");
if (skb->dev != ndev) { if (skb->dev != ndev) {
PRINT_ER("Packet not destined to this device\n"); PRINT_ER("Packet not destined to this device\n");
return 0; return 0;
...@@ -1169,7 +1084,6 @@ int wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev) ...@@ -1169,7 +1084,6 @@ int wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev)
tx_data = kmalloc(sizeof(*tx_data), GFP_ATOMIC); tx_data = kmalloc(sizeof(*tx_data), GFP_ATOMIC);
if (!tx_data) { if (!tx_data) {
PRINT_ER("Failed to allocate memory for tx_data structure\n");
dev_kfree_skb(skb); dev_kfree_skb(skb);
netif_wake_queue(ndev); netif_wake_queue(ndev);
return 0; return 0;
...@@ -1191,8 +1105,6 @@ int wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev) ...@@ -1191,8 +1105,6 @@ int wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev)
PRINT_D(GENERIC_DBG, "DHCP Message transmitted, type:%x %x %x\n", PRINT_D(GENERIC_DBG, "DHCP Message transmitted, type:%x %x %x\n",
udp_buf[248], udp_buf[249], udp_buf[250]); udp_buf[248], udp_buf[249], udp_buf[250]);
PRINT_D(TX_DBG, "Sending packet - Size = %d - Address = %p - SKB = %p\n", tx_data->size, tx_data->buff, tx_data->skb);
PRINT_D(TX_DBG, "Adding tx packet to TX Queue\n");
vif->netstats.tx_packets++; vif->netstats.tx_packets++;
vif->netstats.tx_bytes += tx_data->size; vif->netstats.tx_bytes += tx_data->size;
tx_data->bssid = wilc->vif[vif->u8IfIdx]->bssid; tx_data->bssid = wilc->vif[vif->u8IfIdx]->bssid;
...@@ -1218,39 +1130,29 @@ int wilc_mac_close(struct net_device *ndev) ...@@ -1218,39 +1130,29 @@ int wilc_mac_close(struct net_device *ndev)
vif = netdev_priv(ndev); vif = netdev_priv(ndev);
if (!vif || !vif->ndev || !vif->ndev->ieee80211_ptr || if (!vif || !vif->ndev || !vif->ndev->ieee80211_ptr ||
!vif->ndev->ieee80211_ptr->wiphy) { !vif->ndev->ieee80211_ptr->wiphy)
PRINT_ER("vif = NULL\n");
return 0; return 0;
}
priv = wiphy_priv(vif->ndev->ieee80211_ptr->wiphy); priv = wiphy_priv(vif->ndev->ieee80211_ptr->wiphy);
wl = vif->wilc; wl = vif->wilc;
if (!priv) { if (!priv)
PRINT_ER("priv = NULL\n");
return 0; return 0;
}
hif_drv = (struct host_if_drv *)priv->hif_drv; hif_drv = (struct host_if_drv *)priv->hif_drv;
PRINT_D(GENERIC_DBG, "Mac close\n"); PRINT_D(GENERIC_DBG, "Mac close\n");
if (!wl) { if (!wl)
PRINT_ER("wl = NULL\n");
return 0; return 0;
}
if (!hif_drv) { if (!hif_drv)
PRINT_ER("hif_drv = NULL\n");
return 0; return 0;
}
if ((wl->open_ifcs) > 0) { if ((wl->open_ifcs) > 0)
wl->open_ifcs--; wl->open_ifcs--;
} else { else
PRINT_ER("ERROR: MAC close called while number of opened interfaces is zero\n");
return 0; return 0;
}
if (vif->ndev) { if (vif->ndev) {
netif_stop_queue(vif->ndev); netif_stop_queue(vif->ndev);
...@@ -1303,8 +1205,6 @@ static int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd) ...@@ -1303,8 +1205,6 @@ static int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
if (strncasecmp(buff, "RSSI", length) == 0) { if (strncasecmp(buff, "RSSI", length) == 0) {
priv = wiphy_priv(vif->ndev->ieee80211_ptr->wiphy); priv = wiphy_priv(vif->ndev->ieee80211_ptr->wiphy);
ret = wilc_get_rssi(vif, &rssi); ret = wilc_get_rssi(vif, &rssi);
if (ret)
PRINT_ER("Failed to send get rssi param's message queue ");
PRINT_INFO(GENERIC_DBG, "RSSI :%d\n", rssi); PRINT_INFO(GENERIC_DBG, "RSSI :%d\n", rssi);
rssi += 5; rssi += 5;
...@@ -1360,10 +1260,9 @@ void wilc_frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset) ...@@ -1360,10 +1260,9 @@ void wilc_frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset)
buff_to_send = buff; buff_to_send = buff;
skb = dev_alloc_skb(frame_len); skb = dev_alloc_skb(frame_len);
if (!skb) { if (!skb)
PRINT_ER("Low memory - packet droped\n");
return; return;
}
skb->dev = wilc_netdev; skb->dev = wilc_netdev;
memcpy(skb_put(skb, frame_len), buff_to_send, frame_len); memcpy(skb_put(skb, frame_len), buff_to_send, frame_len);
...@@ -1453,10 +1352,8 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type, ...@@ -1453,10 +1352,8 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type,
for (i = 0; i < NUM_CONCURRENT_IFC; i++) { for (i = 0; i < NUM_CONCURRENT_IFC; i++) {
ndev = alloc_etherdev(sizeof(struct wilc_vif)); ndev = alloc_etherdev(sizeof(struct wilc_vif));
if (!ndev) { if (!ndev)
PRINT_ER("Failed to allocate ethernet dev\n");
return -1; return -1;
}
vif = netdev_priv(ndev); vif = netdev_priv(ndev);
memset(vif, 0, sizeof(struct wilc_vif)); memset(vif, 0, sizeof(struct wilc_vif));
...@@ -1495,11 +1392,8 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type, ...@@ -1495,11 +1392,8 @@ int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type,
vif->netstats.tx_bytes = 0; vif->netstats.tx_bytes = 0;
} }
if (register_netdev(ndev)) { if (register_netdev(ndev))
PRINT_ER("Device couldn't be registered - %s\n",
ndev->name);
return -1; return -1;
}
vif->iftype = STATION_MODE; vif->iftype = STATION_MODE;
vif->mac_opened = 0; vif->mac_opened = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment