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

Commit b8d63078 authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman
Browse files

staging: brcm80211: Convert ETHER_ADDR_LEN to ETH_ALEN



Add an #include of <linux/if_ether.h> to include/proto/ethernet.h
Convert ETHER_ADDR_LEN, remove the #define for ETHER_ADDR_LEN.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ed956868
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -477,7 +477,7 @@ int dhd_prot_init(dhd_pub_t *dhd)
		dhd_os_proto_unblock(dhd);
		return ret;
	}
	memcpy(dhd->mac.octet, buf, ETHER_ADDR_LEN);
	memcpy(dhd->mac.octet, buf, ETH_ALEN);

	dhd_os_proto_unblock(dhd);

+4 −4
Original line number Diff line number Diff line
@@ -1256,7 +1256,7 @@ int dhd_preinit_ioctls(dhd_pub_t *dhd)
	 */
	ret = dhd_custom_get_mac_address(ea_addr.octet);
	if (!ret) {
		bcm_mkiovar("cur_etheraddr", (void *)&ea_addr, ETHER_ADDR_LEN,
		bcm_mkiovar("cur_etheraddr", (void *)&ea_addr, ETH_ALEN,
			    buf, sizeof(buf));
		ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, buf, sizeof(buf));
		if (ret < 0) {
@@ -1264,7 +1264,7 @@ int dhd_preinit_ioctls(dhd_pub_t *dhd)
				   __func__, ret));
		} else
			memcpy(dhd->mac.octet, (void *)&ea_addr,
			       ETHER_ADDR_LEN);
			       ETH_ALEN);
	}
#endif				/* GET_CUSTOM_MAC_ENABLE */

@@ -1534,7 +1534,7 @@ int dhd_iscan_delete_bss(void *dhdp, void *addr, iscan_buf_t *iscan_skip)
					break;

				if (!memcmp
				    (bi->BSSID.octet, addr, ETHER_ADDR_LEN)) {
				    (bi->BSSID.octet, addr, ETH_ALEN)) {
					DHD_ISCAN(("%s: Del BSS[%2.2d:%2.2d] "
					"%X:%X:%X:%X:%X:%X\n",
					__func__, l, i, bi->BSSID.octet[0],
@@ -1672,7 +1672,7 @@ int dhd_iscan_request(void *dhdp, u16 action)
	char buf[WLC_IOCTL_SMLEN];

	memset(&params, 0, sizeof(wl_iscan_params_t));
	memcpy(&params.params.bssid, &ether_bcast, ETHER_ADDR_LEN);
	memcpy(&params.params.bssid, &ether_bcast, ETH_ALEN);

	params.params.bss_type = DOT11_BSSTYPE_ANY;
	params.params.scan_type = DOT11_SCANTYPE_ACTIVE;
+13 −13
Original line number Diff line number Diff line
@@ -210,7 +210,7 @@ typedef struct dhd_if {
	int idx;		/* iface idx in dongle */
	int state;		/* interface state */
	uint subunit;		/* subunit */
	u8 mac_addr[ETHER_ADDR_LEN];	/* assigned MAC address */
	u8 mac_addr[ETH_ALEN];	/* assigned MAC address */
	bool attached;		/* Delayed attachment when unset */
	bool txflowcontrol;	/* Per interface flow control indicator */
	char name[IFNAMSIZ];	/* linux interface name */
@@ -708,7 +708,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)

	/* Send down the multicast list first. */

	buflen = sizeof("mcast_list") + sizeof(cnt) + (cnt * ETHER_ADDR_LEN);
	buflen = sizeof("mcast_list") + sizeof(cnt) + (cnt * ETH_ALEN);
	bufp = buf = kmalloc(buflen, GFP_ATOMIC);
	if (!bufp) {
		DHD_ERROR(("%s: out of memory for mcast_list, cnt %d\n",
@@ -726,8 +726,8 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
	netdev_for_each_mc_addr(ha, dev) {
		if (!cnt)
			break;
		memcpy(bufp, ha->addr, ETHER_ADDR_LEN);
		bufp += ETHER_ADDR_LEN;
		memcpy(bufp, ha->addr, ETH_ALEN);
		bufp += ETH_ALEN;
		cnt--;
	}

@@ -811,7 +811,7 @@ _dhd_set_mac_address(dhd_info_t *dhd, int ifidx, struct ether_addr *addr)

	DHD_TRACE(("%s enter\n", __func__));
	if (!bcm_mkiovar
	    ("cur_etheraddr", (char *)addr, ETHER_ADDR_LEN, buf, 32)) {
	    ("cur_etheraddr", (char *)addr, ETH_ALEN, buf, 32)) {
		DHD_ERROR(("%s: mkiovar failed for cur_etheraddr\n",
			   dhd_ifname(&dhd->pub, ifidx)));
		return -1;
@@ -827,7 +827,7 @@ _dhd_set_mac_address(dhd_info_t *dhd, int ifidx, struct ether_addr *addr)
		DHD_ERROR(("%s: set cur_etheraddr failed\n",
			   dhd_ifname(&dhd->pub, ifidx)));
	} else {
		memcpy(dhd->iflist[ifidx]->net->dev_addr, addr, ETHER_ADDR_LEN);
		memcpy(dhd->iflist[ifidx]->net->dev_addr, addr, ETH_ALEN);
	}

	return ret;
@@ -997,7 +997,7 @@ static int dhd_set_mac_address(struct net_device *dev, void *addr)
		return -1;

	ASSERT(dhd->sysioc_tsk);
	memcpy(&dhd->macvalue, sa->sa_data, ETHER_ADDR_LEN);
	memcpy(&dhd->macvalue, sa->sa_data, ETH_ALEN);
	dhd->set_macaddress = true;
	up(&dhd->sysioc_sem);

@@ -1028,7 +1028,7 @@ int dhd_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf)
		return -ENODEV;

	/* Update multicast statistic */
	if (pktbuf->len >= ETHER_ADDR_LEN) {
	if (pktbuf->len >= ETH_ALEN) {
		u8 *pktdata = (u8 *) (pktbuf->data);
		struct ether_header *eh = (struct ether_header *)pktdata;

@@ -1866,7 +1866,7 @@ static int dhd_open(struct net_device *net)
		}
		atomic_set(&dhd->pend_8021x_cnt, 0);

		memcpy(net->dev_addr, dhd->pub.mac.octet, ETHER_ADDR_LEN);
		memcpy(net->dev_addr, dhd->pub.mac.octet, ETH_ALEN);

#ifdef TOE
		/* Get current TOE mode from dongle */
@@ -1922,7 +1922,7 @@ dhd_add_if(dhd_info_t *dhd, int ifidx, void *handle, char *name,
	dhd->iflist[ifidx] = ifp;
	strlcpy(ifp->name, name, IFNAMSIZ);
	if (mac_addr != NULL)
		memcpy(&ifp->mac_addr, mac_addr, ETHER_ADDR_LEN);
		memcpy(&ifp->mac_addr, mac_addr, ETH_ALEN);

	if (handle == NULL) {
		ifp->state = WLC_E_IF_ADD;
@@ -2281,7 +2281,7 @@ int dhd_net_attach(dhd_pub_t *dhdp, int ifidx)
{
	dhd_info_t *dhd = (dhd_info_t *) dhdp->info;
	struct net_device *net;
	u8 temp_addr[ETHER_ADDR_LEN] = {
	u8 temp_addr[ETH_ALEN] = {
		0x00, 0x90, 0x4c, 0x11, 0x22, 0x33};

	DHD_TRACE(("%s: ifidx %d\n", __func__, ifidx));
@@ -2299,7 +2299,7 @@ int dhd_net_attach(dhd_pub_t *dhdp, int ifidx)
	 */
	if (ifidx != 0) {
		/* for virtual interfaces use the primary MAC  */
		memcpy(temp_addr, dhd->pub.mac.octet, ETHER_ADDR_LEN);
		memcpy(temp_addr, dhd->pub.mac.octet, ETH_ALEN);

	}

@@ -2327,7 +2327,7 @@ int dhd_net_attach(dhd_pub_t *dhdp, int ifidx)

	dhd->pub.rxsz = net->mtu + net->hard_header_len + dhd->pub.hdrlen;

	memcpy(net->dev_addr, temp_addr, ETHER_ADDR_LEN);
	memcpy(net->dev_addr, temp_addr, ETH_ALEN);

	if (register_netdev(net) != 0) {
		DHD_ERROR(("%s: couldn't register the net device\n",
+18 −18
Original line number Diff line number Diff line
@@ -648,7 +648,7 @@ wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,

static void wl_iscan_prep(struct wl_scan_params *params, struct wlc_ssid *ssid)
{
	memcpy(&params->bssid, &ether_bcast, ETHER_ADDR_LEN);
	memcpy(&params->bssid, &ether_bcast, ETH_ALEN);
	params->bss_type = DOT11_BSSTYPE_ANY;
	params->scan_type = 0;
	params->nprobes = -1;
@@ -1044,9 +1044,9 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
	join_params.ssid.SSID_len = htod32(params->ssid_len);
	if (params->bssid)
		memcpy(&join_params.params.bssid, params->bssid,
		       ETHER_ADDR_LEN);
		       ETH_ALEN);
	else
		memset(&join_params.params.bssid, 0, ETHER_ADDR_LEN);
		memset(&join_params.params.bssid, 0, ETH_ALEN);

	err = wl_dev_ioctl(dev, WLC_SET_SSID, &join_params,
			sizeof(join_params));
@@ -1373,7 +1373,7 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
	memcpy(&join_params.ssid.SSID, sme->ssid, join_params.ssid.SSID_len);
	join_params.ssid.SSID_len = htod32(join_params.ssid.SSID_len);
	wl_update_prof(wl, NULL, &join_params.ssid, WL_PROF_SSID);
	memcpy(&join_params.params.bssid, &ether_bcast, ETHER_ADDR_LEN);
	memcpy(&join_params.params.bssid, &ether_bcast, ETH_ALEN);

	wl_ch_to_chanspec(wl->channel, &join_params, &join_params_size);
	WL_DBG(("join_param_size %d\n", join_params_size));
@@ -1406,7 +1406,7 @@ wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
	act = *(bool *) wl_read_prof(wl, WL_PROF_ACT);
	if (likely(act)) {
		scbval.val = reason_code;
		memcpy(&scbval.ea, &wl->bssid, ETHER_ADDR_LEN);
		memcpy(&scbval.ea, &wl->bssid, ETH_ALEN);
		scbval.val = htod32(scbval.val);
		err = wl_dev_ioctl(dev, WLC_DISASSOC, &scbval,
				sizeof(scb_val_t));
@@ -1533,7 +1533,7 @@ wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
	/* Instead of bcast for ea address for default wep keys,
		 driver needs it to be Null */
	if (!is_multicast_ether_addr(mac_addr))
		memcpy((char *)&key.ea, (void *)mac_addr, ETHER_ADDR_LEN);
		memcpy((char *)&key.ea, (void *)mac_addr, ETH_ALEN);
	key.len = (u32) params->key_len;
	/* check for key index change */
	if (key.len == 0) {
@@ -1826,7 +1826,7 @@ wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,

	CHECK_SYS_UP();
	if (unlikely
	    (memcmp(mac, wl_read_prof(wl, WL_PROF_BSSID), ETHER_ADDR_LEN))) {
	    (memcmp(mac, wl_read_prof(wl, WL_PROF_BSSID), ETH_ALEN))) {
		WL_ERR(("Wrong Mac address\n"));
		return -ENOENT;
	}
@@ -2029,11 +2029,11 @@ wl_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
	CHECK_SYS_UP();
	for (i = 0; i < wl->pmk_list->pmkids.npmkid; i++)
		if (!memcmp(pmksa->bssid, &wl->pmk_list->pmkids.pmkid[i].BSSID,
			    ETHER_ADDR_LEN))
			    ETH_ALEN))
			break;
	if (i < WL_NUM_PMKIDS_MAX) {
		memcpy(&wl->pmk_list->pmkids.pmkid[i].BSSID, pmksa->bssid,
		       ETHER_ADDR_LEN);
		       ETH_ALEN);
		memcpy(&wl->pmk_list->pmkids.pmkid[i].PMKID, pmksa->pmkid,
		       WPA2_PMKID_LEN);
		if (i == wl->pmk_list->pmkids.npmkid)
@@ -2064,7 +2064,7 @@ wl_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
	int i;

	CHECK_SYS_UP();
	memcpy(&pmkid.pmkid[0].BSSID, pmksa->bssid, ETHER_ADDR_LEN);
	memcpy(&pmkid.pmkid[0].BSSID, pmksa->bssid, ETH_ALEN);
	memcpy(&pmkid.pmkid[0].PMKID, pmksa->pmkid, WPA2_PMKID_LEN);

	WL_DBG(("del_pmksa,IW_PMKSA_REMOVE - PMKID: %pM =\n",
@@ -2076,7 +2076,7 @@ wl_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
	for (i = 0; i < wl->pmk_list->pmkids.npmkid; i++)
		if (!memcmp
		    (pmksa->bssid, &wl->pmk_list->pmkids.pmkid[i].BSSID,
		     ETHER_ADDR_LEN))
		     ETH_ALEN))
			break;

	if ((wl->pmk_list->pmkids.npmkid > 0)
@@ -2085,7 +2085,7 @@ wl_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
		for (; i < (wl->pmk_list->pmkids.npmkid - 1); i++) {
			memcpy(&wl->pmk_list->pmkids.pmkid[i].BSSID,
			       &wl->pmk_list->pmkids.pmkid[i + 1].BSSID,
			       ETHER_ADDR_LEN);
			       ETH_ALEN);
			memcpy(&wl->pmk_list->pmkids.pmkid[i].PMKID,
			       &wl->pmk_list->pmkids.pmkid[i + 1].PMKID,
			       WPA2_PMKID_LEN);
@@ -2284,7 +2284,7 @@ static s32 wl_inform_single_bss(struct wl_priv *wl, struct wl_bss_info *bi)
	else
		band = wiphy->bands[IEEE80211_BAND_5GHZ];
	notif_bss_info->rssi = bi->RSSI;
	memcpy(mgmt->bssid, &bi->BSSID, ETHER_ADDR_LEN);
	memcpy(mgmt->bssid, &bi->BSSID, ETH_ALEN);
	mgmt_type = wl->active_scan ?
		IEEE80211_STYPE_PROBE_RESP : IEEE80211_STYPE_BEACON;
	if (!memcmp(bi->SSID, sr->ssid.SSID, bi->SSID_len)) {
@@ -2579,7 +2579,7 @@ static s32 wl_update_bss_info(struct wl_priv *wl)
			goto update_bss_info_out;
		}
		bi = (struct wl_bss_info *)(wl->extra_buf + 4);
		if (unlikely(memcmp(&bi->BSSID, &wl->bssid, ETHER_ADDR_LEN))) {
		if (unlikely(memcmp(&bi->BSSID, &wl->bssid, ETH_ALEN))) {
			err = -EIO;
			goto update_bss_info_out;
		}
@@ -2631,7 +2631,7 @@ wl_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
	s32 err = 0;

	wl_get_assoc_ies(wl);
	memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN);
	memcpy(&wl->bssid, &e->addr, ETH_ALEN);
	wl_update_bss_info(wl);
	cfg80211_roamed(ndev,
			(u8 *)&wl->bssid,
@@ -2652,7 +2652,7 @@ wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
	s32 err = 0;

	wl_get_assoc_ies(wl);
	memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN);
	memcpy(&wl->bssid, &e->addr, ETH_ALEN);
	wl_update_bss_info(wl);
	if (test_and_clear_bit(WL_STATUS_CONNECTING, &wl->status)) {
		cfg80211_connect_result(ndev,
@@ -3926,9 +3926,9 @@ wl_update_prof(struct wl_priv *wl, const wl_event_msg_t *e, void *data,
		break;
	case WL_PROF_BSSID:
		if (data)
			memcpy(wl->profile->bssid, data, ETHER_ADDR_LEN);
			memcpy(wl->profile->bssid, data, ETH_ALEN);
		else
			memset(wl->profile->bssid, 0, ETHER_ADDR_LEN);
			memset(wl->profile->bssid, 0, ETH_ALEN);
		break;
	case WL_PROF_SEC:
		memcpy(&wl->profile->sec, data, sizeof(wl->profile->sec));
+1 −1
Original line number Diff line number Diff line
@@ -237,7 +237,7 @@ struct wl_ibss {
struct wl_profile {
	u32 mode;
	struct wlc_ssid ssid;
	u8 bssid[ETHER_ADDR_LEN];
	u8 bssid[ETH_ALEN];
	u16 beacon_interval;
	u8 dtim_period;
	struct wl_security sec;
Loading