Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93803b33 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller
Browse files

wireless: Use eth_<foo>_addr instead of memset



Use the built-in function instead of memset.

Miscellanea:

Add #include <linux/etherdevice.h> where appropriate
Use ETH_ALEN instead of 6

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 519983b1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2676,7 +2676,7 @@ static void wifi_setup(struct net_device *dev)
	dev->addr_len           = ETH_ALEN;
	dev->tx_queue_len       = 100; 

	memset(dev->broadcast,0xFF, ETH_ALEN);
	eth_broadcast_addr(dev->broadcast);

	dev->flags              = IFF_BROADCAST|IFF_MULTICAST;
}
@@ -3273,7 +3273,7 @@ static void airo_handle_link(struct airo_info *ai)
		}

		/* Send event to user space */
		memset(wrqu.ap_addr.sa_data, '\0', ETH_ALEN);
		eth_zero_addr(wrqu.ap_addr.sa_data);
		wrqu.ap_addr.sa_family = ARPHRD_ETHER;
		wireless_send_event(ai->dev, SIOCGIWAP, &wrqu, NULL);
	}
+3 −3
Original line number Diff line number Diff line
@@ -1166,7 +1166,7 @@ static int at76_start_monitor(struct at76_priv *priv)
	int ret;

	memset(&scan, 0, sizeof(struct at76_req_scan));
	memset(scan.bssid, 0xff, ETH_ALEN);
	eth_broadcast_addr(scan.bssid);

	scan.channel = priv->channel;
	scan.scan_type = SCAN_TYPE_PASSIVE;
@@ -1427,7 +1427,7 @@ static int at76_startup_device(struct at76_priv *priv)
	at76_wait_completion(priv, CMD_STARTUP);

	/* remove BSSID from previous run */
	memset(priv->bssid, 0, ETH_ALEN);
	eth_zero_addr(priv->bssid);

	priv->scanning = false;

@@ -1973,7 +1973,7 @@ static int at76_hw_scan(struct ieee80211_hw *hw,
	ieee80211_stop_queues(hw);

	memset(&scan, 0, sizeof(struct at76_req_scan));
	memset(scan.bssid, 0xFF, ETH_ALEN);
	eth_broadcast_addr(scan.bssid);

	if (req->n_ssids) {
		scan.scan_type = SCAN_TYPE_ACTIVE;
+1 −1
Original line number Diff line number Diff line
@@ -1182,7 +1182,7 @@ static void ath10k_control_ibss(struct ath10k_vif *arvif,
		if (is_zero_ether_addr(arvif->bssid))
			return;

		memset(arvif->bssid, 0, ETH_ALEN);
		eth_zero_addr(arvif->bssid);

		return;
	}
+1 −1
Original line number Diff line number Diff line
@@ -528,7 +528,7 @@ ath5k_update_bssid_mask_and_opmode(struct ath5k_hw *ah,
	 * together with the BSSID mask when matching addresses.
	 */
	iter_data.hw_macaddr = common->macaddr;
	memset(&iter_data.mask, 0xff, ETH_ALEN);
	eth_broadcast_addr(iter_data.mask);
	iter_data.found_active = false;
	iter_data.need_set_hw_addr = true;
	iter_data.opmode = NL80211_IFTYPE_UNSPECIFIED;
+1 −1
Original line number Diff line number Diff line
@@ -2033,7 +2033,7 @@ static int ath6kl_wow_sta(struct ath6kl *ar, struct ath6kl_vif *vif)
	int ret;

	/* Setup unicast pkt pattern */
	memset(mac_mask, 0xff, ETH_ALEN);
	eth_broadcast_addr(mac_mask);
	ret = ath6kl_wmi_add_wow_pattern_cmd(ar->wmi,
				vif->fw_vif_idx, WOW_LIST_ID,
				ETH_ALEN, 0, ndev->dev_addr,
Loading