Commit 06fb9336 authored by Leo Kim's avatar Leo Kim Committed by Greg Kroah-Hartman

staging: wilc1000: wilc_wfi_cfgoperations.c: replaces PRINT_ER with netdev_err

This patches replaces PRINT_ER with netdev_err.
Removes unnecessary debug logs as well.
Signed-off-by: default avatarLeo Kim <leo.kim@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 65c3f000
...@@ -405,10 +405,8 @@ static void CfgScanResult(enum scan_event scan_event, ...@@ -405,10 +405,8 @@ static void CfgScanResult(enum scan_event scan_event,
if (wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC && if (wiphy->signal_type == CFG80211_SIGNAL_TYPE_UNSPEC &&
(((s32)network_info->s8rssi * 100) < 0 || (((s32)network_info->s8rssi * 100) < 0 ||
((s32)network_info->s8rssi * 100) > 100)) { ((s32)network_info->s8rssi * 100) > 100))
PRINT_ER("wiphy signal type fial\n");
return; return;
}
if (network_info) { if (network_info) {
s32Freq = ieee80211_channel_to_frequency((s32)network_info->u8channel, IEEE80211_BAND_2GHZ); s32Freq = ieee80211_channel_to_frequency((s32)network_info->u8channel, IEEE80211_BAND_2GHZ);
...@@ -436,10 +434,6 @@ static void CfgScanResult(enum scan_event scan_event, ...@@ -436,10 +434,6 @@ static void CfgScanResult(enum scan_event scan_event,
(size_t)network_info->u16IEsLen, (((s32)network_info->s8rssi) * 100), GFP_KERNEL); (size_t)network_info->u16IEsLen, (((s32)network_info->s8rssi) * 100), GFP_KERNEL);
cfg80211_put_bss(wiphy, bss); cfg80211_put_bss(wiphy, bss);
} }
} else {
PRINT_ER("Discovered networks exceeded the max limit\n");
} }
} else { } else {
u32 i; u32 i;
...@@ -531,7 +525,7 @@ static void CfgConnectResult(enum conn_event enuConnDisconnEvent, ...@@ -531,7 +525,7 @@ static void CfgConnectResult(enum conn_event enuConnDisconnEvent,
if (!pstrWFIDrv->p2p_connect) if (!pstrWFIDrv->p2p_connect)
wlan_channel = INVALID_CHANNEL; wlan_channel = INVALID_CHANNEL;
PRINT_ER("Unspecified failure: Connection status %d : MAC status = %d\n", u16ConnectStatus, u8MacStatus); netdev_err(dev, "Unspecified failure\n");
} }
if (u16ConnectStatus == WLAN_STATUS_SUCCESS) { if (u16ConnectStatus == WLAN_STATUS_SUCCESS) {
...@@ -572,8 +566,6 @@ static void CfgConnectResult(enum conn_event enuConnDisconnEvent, ...@@ -572,8 +566,6 @@ static void CfgConnectResult(enum conn_event enuConnDisconnEvent,
u16ConnectStatus, GFP_KERNEL); u16ConnectStatus, GFP_KERNEL);
} else if (enuConnDisconnEvent == CONN_DISCONN_EVENT_DISCONN_NOTIF) { } else if (enuConnDisconnEvent == CONN_DISCONN_EVENT_DISCONN_NOTIF) {
wilc_optaining_ip = false; wilc_optaining_ip = false;
PRINT_ER("Received MAC_DISCONNECTED from firmware with reason %d on dev [%p]\n",
pstrDisconnectNotifInfo->u16reason, priv->dev);
p2p_local_random = 0x01; p2p_local_random = 0x01;
p2p_recv_random = 0x00; p2p_recv_random = 0x00;
wilc_ie = false; wilc_ie = false;
...@@ -612,7 +604,7 @@ static int set_channel(struct wiphy *wiphy, ...@@ -612,7 +604,7 @@ static int set_channel(struct wiphy *wiphy,
result = wilc_set_mac_chnl_num(vif, channelnum); result = wilc_set_mac_chnl_num(vif, channelnum);
if (result != 0) if (result != 0)
PRINT_ER("Error in setting channel %d\n", channelnum); netdev_err(priv->dev, "Error in setting channel\n");
return result; return result;
} }
...@@ -680,8 +672,7 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request) ...@@ -680,8 +672,7 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
(void *)priv, NULL); (void *)priv, NULL);
} }
} else { } else {
PRINT_ER("Requested num of scanned channels is greater than the max, supported" netdev_err(priv->dev, "Requested scanned channels over\n");
" channels\n");
} }
if (s32Error != 0) { if (s32Error != 0) {
...@@ -843,7 +834,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -843,7 +834,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
} else { } else {
s32Error = -ENOTSUPP; s32Error = -ENOTSUPP;
PRINT_ER("Not supported cipher: Error(%d)\n", s32Error); netdev_err(dev, "Not supported cipher\n");
wilc_connecting = 0; wilc_connecting = 0;
return s32Error; return s32Error;
} }
...@@ -909,7 +900,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -909,7 +900,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
pstrNetworkInfo->u8channel, pstrNetworkInfo->u8channel,
pstrNetworkInfo->pJoinParams); pstrNetworkInfo->pJoinParams);
if (s32Error != 0) { if (s32Error != 0) {
PRINT_ER("wilc_set_join_req(): Error(%d)\n", s32Error); netdev_err(dev, "wilc_set_join_req(): Error\n");
s32Error = -ENOENT; s32Error = -ENOENT;
wilc_connecting = 0; wilc_connecting = 0;
return s32Error; return s32Error;
...@@ -944,7 +935,7 @@ static int disconnect(struct wiphy *wiphy, struct net_device *dev, u16 reason_co ...@@ -944,7 +935,7 @@ static int disconnect(struct wiphy *wiphy, struct net_device *dev, u16 reason_co
s32Error = wilc_disconnect(vif, reason_code); s32Error = wilc_disconnect(vif, reason_code);
if (s32Error != 0) { if (s32Error != 0) {
PRINT_ER("Error in disconnecting: Error(%d)\n", s32Error); netdev_err(priv->dev, "Error in disconnecting\n");
s32Error = -EINVAL; s32Error = -EINVAL;
} }
...@@ -1211,7 +1202,7 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, ...@@ -1211,7 +1202,7 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
break; break;
default: default:
PRINT_ER("Not supported cipher: Error(%d)\n", s32Error); netdev_err(netdev, "Not supported cipher\n");
s32Error = -ENOTSUPP; s32Error = -ENOTSUPP;
} }
...@@ -1362,7 +1353,7 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev, ...@@ -1362,7 +1353,7 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev,
} }
if (associatedsta == -1) { if (associatedsta == -1) {
PRINT_ER("Station required is not associated\n"); netdev_err(dev, "sta required is not associated\n");
return -ENOENT; return -ENOENT;
} }
...@@ -1449,8 +1440,7 @@ static int set_wiphy_params(struct wiphy *wiphy, u32 changed) ...@@ -1449,8 +1440,7 @@ static int set_wiphy_params(struct wiphy *wiphy, u32 changed)
PRINT_D(CFG80211_DBG, "Setting CFG params in the host interface\n"); PRINT_D(CFG80211_DBG, "Setting CFG params in the host interface\n");
s32Error = wilc_hif_set_cfg(vif, &pstrCfgParamVal); s32Error = wilc_hif_set_cfg(vif, &pstrCfgParamVal);
if (s32Error) if (s32Error)
PRINT_ER("Error in setting WIPHY PARAMS\n"); netdev_err(priv->dev, "Error in setting WIPHY PARAMS\n");
return s32Error; return s32Error;
} }
...@@ -1485,7 +1475,7 @@ static int set_pmksa(struct wiphy *wiphy, struct net_device *netdev, ...@@ -1485,7 +1475,7 @@ static int set_pmksa(struct wiphy *wiphy, struct net_device *netdev,
if (!(flag == PMKID_FOUND)) if (!(flag == PMKID_FOUND))
priv->pmkid_list.numpmkid++; priv->pmkid_list.numpmkid++;
} else { } else {
PRINT_ER("Invalid PMKID index\n"); netdev_err(netdev, "Invalid PMKID index\n");
s32Error = -EINVAL; s32Error = -EINVAL;
} }
...@@ -1854,16 +1844,14 @@ static int mgmt_tx(struct wiphy *wiphy, ...@@ -1854,16 +1844,14 @@ static int mgmt_tx(struct wiphy *wiphy,
if (ieee80211_is_mgmt(mgmt->frame_control)) { if (ieee80211_is_mgmt(mgmt->frame_control)) {
mgmt_tx = kmalloc(sizeof(struct p2p_mgmt_data), GFP_KERNEL); mgmt_tx = kmalloc(sizeof(struct p2p_mgmt_data), GFP_KERNEL);
if (!mgmt_tx) { if (!mgmt_tx)
PRINT_ER("Failed to allocate memory for mgmt_tx structure\n");
return -EFAULT; return -EFAULT;
}
mgmt_tx->buff = kmalloc(buf_len, GFP_KERNEL); mgmt_tx->buff = kmalloc(buf_len, GFP_KERNEL);
if (!mgmt_tx->buff) { if (!mgmt_tx->buff)
PRINT_ER("Failed to allocate memory for mgmt_tx buff\n");
kfree(mgmt_tx); kfree(mgmt_tx);
return -EFAULT; return -EFAULT;
}
memcpy(mgmt_tx->buff, buf, len); memcpy(mgmt_tx->buff, buf, len);
mgmt_tx->size = len; mgmt_tx->size = len;
...@@ -2072,10 +2060,8 @@ static int set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, ...@@ -2072,10 +2060,8 @@ static int set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
priv = wiphy_priv(wiphy); priv = wiphy_priv(wiphy);
vif = netdev_priv(priv->dev); vif = netdev_priv(priv->dev);
if (!priv->hif_drv) { if (!priv->hif_drv)
PRINT_ER("Driver is NULL\n");
return -EIO; return -EIO;
}
if (wilc_enable_ps) if (wilc_enable_ps)
wilc_set_power_mgmt(vif, enabled, timeout); wilc_set_power_mgmt(vif, enabled, timeout);
...@@ -2168,7 +2154,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev, ...@@ -2168,7 +2154,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
break; break;
default: default:
PRINT_ER("Unknown interface type= %d\n", type); netdev_err(dev, "Unknown interface type= %d\n", type);
return -EINVAL; return -EINVAL;
} }
...@@ -2195,7 +2181,7 @@ static int start_ap(struct wiphy *wiphy, struct net_device *dev, ...@@ -2195,7 +2181,7 @@ static int start_ap(struct wiphy *wiphy, struct net_device *dev,
s32Error = set_channel(wiphy, &settings->chandef); s32Error = set_channel(wiphy, &settings->chandef);
if (s32Error != 0) if (s32Error != 0)
PRINT_ER("Error in setting channel\n"); netdev_err(dev, "Error in setting channel\n");
wilc_wlan_set_bssid(dev, wl->vif[vif->idx]->src_addr, AP_MODE); wilc_wlan_set_bssid(dev, wl->vif[vif->idx]->src_addr, AP_MODE);
wilc_set_power_mgmt(vif, 0, 0); wilc_set_power_mgmt(vif, 0, 0);
...@@ -2247,7 +2233,7 @@ static int stop_ap(struct wiphy *wiphy, struct net_device *dev) ...@@ -2247,7 +2233,7 @@ static int stop_ap(struct wiphy *wiphy, struct net_device *dev)
s32Error = wilc_del_beacon(vif); s32Error = wilc_del_beacon(vif);
if (s32Error) if (s32Error)
PRINT_ER("Host delete beacon fail\n"); netdev_err(dev, "Host delete beacon fail\n");
return s32Error; return s32Error;
} }
...@@ -2317,7 +2303,7 @@ static int add_station(struct wiphy *wiphy, struct net_device *dev, ...@@ -2317,7 +2303,7 @@ static int add_station(struct wiphy *wiphy, struct net_device *dev,
s32Error = wilc_add_station(vif, &strStaParams); s32Error = wilc_add_station(vif, &strStaParams);
if (s32Error) if (s32Error)
PRINT_ER("Host add station fail\n"); netdev_err(dev, "Host add station fail\n");
} }
return s32Error; return s32Error;
...@@ -2352,7 +2338,7 @@ static int del_station(struct wiphy *wiphy, struct net_device *dev, ...@@ -2352,7 +2338,7 @@ static int del_station(struct wiphy *wiphy, struct net_device *dev,
s32Error = wilc_del_station(vif, mac); s32Error = wilc_del_station(vif, mac);
if (s32Error) if (s32Error)
PRINT_ER("Host delete station fail\n"); netdev_err(dev, "Host delete station fail\n");
} }
return s32Error; return s32Error;
} }
...@@ -2424,7 +2410,7 @@ static int change_station(struct wiphy *wiphy, struct net_device *dev, ...@@ -2424,7 +2410,7 @@ static int change_station(struct wiphy *wiphy, struct net_device *dev,
s32Error = wilc_edit_station(vif, &strStaParams); s32Error = wilc_edit_station(vif, &strStaParams);
if (s32Error) if (s32Error)
PRINT_ER("Host edit station fail\n"); netdev_err(dev, "Host edit station fail\n");
} }
return s32Error; return s32Error;
} }
...@@ -2457,8 +2443,7 @@ static struct wireless_dev *add_virtual_intf(struct wiphy *wiphy, ...@@ -2457,8 +2443,7 @@ static struct wireless_dev *add_virtual_intf(struct wiphy *wiphy,
PRINT_D(HOSTAPD_DBG, "Setting monitor flag in private structure\n"); PRINT_D(HOSTAPD_DBG, "Setting monitor flag in private structure\n");
vif = netdev_priv(priv->wdev->netdev); vif = netdev_priv(priv->wdev->netdev);
vif->monitor_flag = 1; vif->monitor_flag = 1;
} else }
PRINT_ER("Error in initializing monitor interface\n ");
} }
return priv->wdev; return priv->wdev;
} }
...@@ -2612,16 +2597,12 @@ static struct wireless_dev *WILC_WFI_CfgAlloc(void) ...@@ -2612,16 +2597,12 @@ static struct wireless_dev *WILC_WFI_CfgAlloc(void)
PRINT_D(CFG80211_DBG, "Allocating wireless device\n"); PRINT_D(CFG80211_DBG, "Allocating wireless device\n");
wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL);
if (!wdev) { if (!wdev)
PRINT_ER("Cannot allocate wireless device\n");
goto _fail_; goto _fail_;
}
wdev->wiphy = wiphy_new(&wilc_cfg80211_ops, sizeof(struct wilc_priv)); wdev->wiphy = wiphy_new(&wilc_cfg80211_ops, sizeof(struct wilc_priv));
if (!wdev->wiphy) { if (!wdev->wiphy)
PRINT_ER("Cannot allocate wiphy\n");
goto _fail_mem_; goto _fail_mem_;
}
WILC_WFI_band_2ghz.ht_cap.ht_supported = 1; WILC_WFI_band_2ghz.ht_cap.ht_supported = 1;
WILC_WFI_band_2ghz.ht_cap.cap |= (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT); WILC_WFI_band_2ghz.ht_cap.cap |= (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT);
...@@ -2649,7 +2630,7 @@ struct wireless_dev *wilc_create_wiphy(struct net_device *net, struct device *de ...@@ -2649,7 +2630,7 @@ struct wireless_dev *wilc_create_wiphy(struct net_device *net, struct device *de
wdev = WILC_WFI_CfgAlloc(); wdev = WILC_WFI_CfgAlloc();
if (!wdev) { if (!wdev) {
PRINT_ER("CfgAlloc Failed\n"); netdev_err(net, "wiphy new allocate failed\n");
return NULL; return NULL;
} }
...@@ -2684,11 +2665,10 @@ struct wireless_dev *wilc_create_wiphy(struct net_device *net, struct device *de ...@@ -2684,11 +2665,10 @@ struct wireless_dev *wilc_create_wiphy(struct net_device *net, struct device *de
set_wiphy_dev(wdev->wiphy, dev); set_wiphy_dev(wdev->wiphy, dev);
s32Error = wiphy_register(wdev->wiphy); s32Error = wiphy_register(wdev->wiphy);
if (s32Error) { if (s32Error)
PRINT_ER("Cannot register wiphy device\n"); netdev_err(net, "Cannot register wiphy device\n");
} else { else
PRINT_D(CFG80211_DBG, "Successful Registering\n"); PRINT_D(CFG80211_DBG, "Successful Registering\n");
}
priv->dev = net; priv->dev = net;
return wdev; return wdev;
...@@ -2707,10 +2687,6 @@ int wilc_init_host_int(struct net_device *net) ...@@ -2707,10 +2687,6 @@ int wilc_init_host_int(struct net_device *net)
setup_timer(&wilc_during_ip_timer, clear_duringIP, 0); setup_timer(&wilc_during_ip_timer, clear_duringIP, 0);
} }
op_ifcs++; op_ifcs++;
if (s32Error < 0) {
PRINT_ER("Failed to creat refresh Timer\n");
return s32Error;
}
priv->gbAutoRateAdjusted = false; priv->gbAutoRateAdjusted = false;
...@@ -2719,7 +2695,7 @@ int wilc_init_host_int(struct net_device *net) ...@@ -2719,7 +2695,7 @@ int wilc_init_host_int(struct net_device *net)
sema_init(&(priv->hSemScanReq), 1); sema_init(&(priv->hSemScanReq), 1);
s32Error = wilc_init(net, &priv->hif_drv); s32Error = wilc_init(net, &priv->hif_drv);
if (s32Error) if (s32Error)
PRINT_ER("Error while initializing hostinterface\n"); netdev_err(net, "Error while initializing hostinterface\n");
return s32Error; return s32Error;
} }
...@@ -2748,7 +2724,7 @@ int wilc_deinit_host_int(struct net_device *net) ...@@ -2748,7 +2724,7 @@ int wilc_deinit_host_int(struct net_device *net)
} }
if (s32Error) if (s32Error)
PRINT_ER("Error while deintializing host interface\n"); netdev_err(net, "Error while deintializing host interface\n");
return s32Error; return s32Error;
} }
......
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