Commit 4c00f705 authored by Ajay Singh's avatar Ajay Singh Committed by Greg Kroah-Hartman

staging: wilc1000: use is_zero_ether_addr() API to check mac address

Use is_zero_ether_addr() API to check if mac address value is zero.
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9f1bdb71
...@@ -3400,13 +3400,12 @@ int wilc_del_allstation(struct wilc_vif *vif, u8 mac_addr[][ETH_ALEN]) ...@@ -3400,13 +3400,12 @@ int wilc_del_allstation(struct wilc_vif *vif, u8 mac_addr[][ETH_ALEN])
struct wid wid; struct wid wid;
int result; int result;
int i; int i;
u8 zero_addr[ETH_ALEN] = {0};
u8 assoc_sta = 0; u8 assoc_sta = 0;
struct del_all_sta del_sta; struct del_all_sta del_sta;
memset(&del_sta, 0x0, sizeof(del_sta)); memset(&del_sta, 0x0, sizeof(del_sta));
for (i = 0; i < WILC_MAX_NUM_STA; i++) { for (i = 0; i < WILC_MAX_NUM_STA; i++) {
if (memcmp(mac_addr[i], zero_addr, ETH_ALEN)) { if (!is_zero_ether_addr(mac_addr[i])) {
assoc_sta++; assoc_sta++;
ether_addr_copy(del_sta.mac[i], mac_addr[i]); ether_addr_copy(del_sta.mac[i], mac_addr[i]);
} }
......
...@@ -205,11 +205,10 @@ void wilc_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid, u8 mode) ...@@ -205,11 +205,10 @@ void wilc_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid, u8 mode)
int wilc_wlan_get_num_conn_ifcs(struct wilc *wilc) int wilc_wlan_get_num_conn_ifcs(struct wilc *wilc)
{ {
u8 i = 0; u8 i = 0;
u8 null_bssid[6] = {0};
u8 ret_val = 0; u8 ret_val = 0;
for (i = 0; i < wilc->vif_num; i++) for (i = 0; i < wilc->vif_num; i++)
if (memcmp(wilc->vif[i]->bssid, null_bssid, 6)) if (!is_zero_ether_addr(wilc->vif[i]->bssid))
ret_val++; ret_val++;
return ret_val; return ret_val;
......
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