Replace the driver local WLAN_ADDR_LEN constant through the kernel-wide ETH_ALEN definiton.
Signed-off-by: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
#define HFA384x_LEVEL_TO_dBm(v) (0x100 + (v) * 100 / 255 - 100)
+#include <linux/if_ether.h>
+
/*------ Constants --------------------------------------------*/
/*--- Mins & Maxs -----------------------------------*/
#define HFA384x_CMD_ALLOC_LEN_MIN ((u16)4)
include the len or code fields)
--------------------------------------------------------------------*/
/* TODO: fill in the rest of these */
-#define HFA384x_RID_GROUPADDR_LEN ((u16)16 * WLAN_ADDR_LEN)
+#define HFA384x_RID_GROUPADDR_LEN ((u16)16 * ETH_ALEN)
#define HFA384x_RID_CREATEIBSS_LEN ((u16)0)
#define HFA384x_RID_FRAGTHRESH_LEN ((u16)0)
#define HFA384x_RID_RTSTHRESH_LEN ((u16)0)
/*-- Configuration Record: authenticateStation (data portion only) --*/
typedef struct hfa384x_authenticateStation_data
{
- u8 address[WLAN_ADDR_LEN];
+ u8 address[ETH_ALEN];
u16 status;
u16 algorithm;
} __attribute__((packed)) hfa384x_authenticateStation_data_t;
/*-- Configuration Record: associateStation (data portion only) --*/
typedef struct hfa384x_associateStation_data
{
- u8 address[WLAN_ADDR_LEN];
+ u8 address[ETH_ALEN];
u16 status;
u16 type;
} __attribute__((packed)) hfa384x_associateStation_data_t;
/*-- Configuration Record: WEPKeyMapping (data portion only) --*/
typedef struct hfa384x_WEPKeyMapping
{
- u8 address[WLAN_ADDR_LEN];
+ u8 address[ETH_ALEN];
u16 key_index;
u8 key[16];
u8 mic_transmit_key[4];
typedef struct hfa384x_AssocStatus
{
u16 assocstatus;
- u8 sta_addr[WLAN_ADDR_LEN];
+ u8 sta_addr[ETH_ALEN];
/* old_ap_addr is only valid if assocstatus == 2 */
- u8 old_ap_addr[WLAN_ADDR_LEN];
+ u8 old_ap_addr[ETH_ALEN];
u16 reason;
u16 reserved;
} __attribute__((packed)) hfa384x_AssocStatus_t;
typedef struct hfa384x_AuthRequest
{
- u8 sta_addr[WLAN_ADDR_LEN];
+ u8 sta_addr[ETH_ALEN];
u16 algorithm;
} __attribute__((packed)) hfa384x_AuthReq_t;
typedef struct hfa384x_AssocRequest
{
- u8 sta_addr[WLAN_ADDR_LEN];
+ u8 sta_addr[ETH_ALEN];
u16 type;
u8 wpa_data[80];
} __attribute__((packed)) hfa384x_AssocReq_t;
typedef struct hfa384x_MicFailure
{
- u8 sender[WLAN_ADDR_LEN];
- u8 dest[WLAN_ADDR_LEN];
+ u8 sender[ETH_ALEN];
+ u8 dest[ETH_ALEN];
} __attribute__((packed)) hfa384x_MicFailure_t;
/*-- Unsolicited Frame, MAC Mgmt: PSUserCount (AP Only) --*/
typedef struct hfa384x_KeyIDChanged
{
- u8 sta_addr[WLAN_ADDR_LEN];
+ u8 sta_addr[ETH_ALEN];
u16 keyid;
} __attribute__((packed)) hfa384x_KeyIDChanged_t;
typedef struct prism2sta_authlist
{
unsigned int cnt;
- u8 addr[WLAN_AUTH_MAX][WLAN_ADDR_LEN];
+ u8 addr[WLAN_AUTH_MAX][ETH_ALEN];
u8 assoc[WLAN_AUTH_MAX];
} prism2sta_authlist_t;
{
unsigned int modify;
unsigned int cnt;
- u8 addr[WLAN_ACCESS_MAX][WLAN_ADDR_LEN];
+ u8 addr[WLAN_ACCESS_MAX][ETH_ALEN];
unsigned int cnt1;
- u8 addr1[WLAN_ACCESS_MAX][WLAN_ADDR_LEN];
+ u8 addr1[WLAN_ACCESS_MAX][ETH_ALEN];
} prism2sta_accesslist_t;
typedef struct hfa384x
/* Group Addresses - right now, there are up to a total
of MAX_GRP_ADDR group addresses */
- u8 dot11_grp_addr[MAX_GRP_ADDR][WLAN_ADDR_LEN];
+ u8 dot11_grp_addr[MAX_GRP_ADDR][ETH_ALEN];
unsigned int dot11_grpcnt;
/* Component Identities */
switch ( wlandev->macmode ) {
case WLAN_MACMODE_IBSS_STA:
- memcpy(p80211_hdr->a3.a1, &e_hdr.daddr, WLAN_ADDR_LEN);
- memcpy(p80211_hdr->a3.a2, wlandev->netdev->dev_addr, WLAN_ADDR_LEN);
- memcpy(p80211_hdr->a3.a3, wlandev->bssid, WLAN_ADDR_LEN);
+ memcpy(p80211_hdr->a3.a1, &e_hdr.daddr, ETH_ALEN);
+ memcpy(p80211_hdr->a3.a2, wlandev->netdev->dev_addr, ETH_ALEN);
+ memcpy(p80211_hdr->a3.a3, wlandev->bssid, ETH_ALEN);
break;
case WLAN_MACMODE_ESS_STA:
fc |= host2ieee16(WLAN_SET_FC_TODS(1));
- memcpy(p80211_hdr->a3.a1, wlandev->bssid, WLAN_ADDR_LEN);
- memcpy(p80211_hdr->a3.a2, wlandev->netdev->dev_addr, WLAN_ADDR_LEN);
- memcpy(p80211_hdr->a3.a3, &e_hdr.daddr, WLAN_ADDR_LEN);
+ memcpy(p80211_hdr->a3.a1, wlandev->bssid, ETH_ALEN);
+ memcpy(p80211_hdr->a3.a2, wlandev->netdev->dev_addr, ETH_ALEN);
+ memcpy(p80211_hdr->a3.a3, &e_hdr.daddr, ETH_ALEN);
break;
case WLAN_MACMODE_ESS_AP:
fc |= host2ieee16(WLAN_SET_FC_FROMDS(1));
- memcpy(p80211_hdr->a3.a1, &e_hdr.daddr, WLAN_ADDR_LEN);
- memcpy(p80211_hdr->a3.a2, wlandev->bssid, WLAN_ADDR_LEN);
- memcpy(p80211_hdr->a3.a3, &e_hdr.saddr, WLAN_ADDR_LEN);
+ memcpy(p80211_hdr->a3.a1, &e_hdr.daddr, ETH_ALEN);
+ memcpy(p80211_hdr->a3.a2, wlandev->bssid, ETH_ALEN);
+ memcpy(p80211_hdr->a3.a3, &e_hdr.saddr, ETH_ALEN);
break;
default:
WLAN_LOG_ERROR("Error: Converting eth to wlan in unknown mode.\n");
/*================================================================*/
/* System Includes */
+#include <linux/if_ether.h>
+
/*================================================================*/
/* Project Includes */
/* Constants */
/*--- Sizes -----------------------------------------------*/
-#define WLAN_ADDR_LEN 6
#define WLAN_CRC_LEN 4
#define WLAN_BSSID_LEN 6
#define WLAN_BSS_TS_LEN 8
{
u16 fc;
u16 dur;
- u8 a1[WLAN_ADDR_LEN];
- u8 a2[WLAN_ADDR_LEN];
- u8 a3[WLAN_ADDR_LEN];
+ u8 a1[ETH_ALEN];
+ u8 a2[ETH_ALEN];
+ u8 a3[ETH_ALEN];
u16 seq;
} __attribute__((packed)) p80211_hdr_a3_t;
{
u16 fc;
u16 dur;
- u8 a1[WLAN_ADDR_LEN];
- u8 a2[WLAN_ADDR_LEN];
- u8 a3[WLAN_ADDR_LEN];
+ u8 a1[ETH_ALEN];
+ u8 a2[ETH_ALEN];
+ u8 a3[ETH_ALEN];
u16 seq;
- u8 a4[WLAN_ADDR_LEN];
+ u8 a4[ETH_ALEN];
} __attribute__((packed)) p80211_hdr_a4_t;
typedef union p80211_hdr
case WLAN_FTYPE_DATA:
hdrlen = WLAN_HDR_A3_LEN;
if ( WLAN_GET_FC_TODS(fctl) && WLAN_GET_FC_FROMDS(fctl) ) {
- hdrlen += WLAN_ADDR_LEN;
+ hdrlen += ETH_ALEN;
}
break;
case WLAN_FTYPE_CTL:
#include <linux/wireless.h>
#include <linux/sockios.h>
#include <linux/etherdevice.h>
+#include <linux/if_ether.h>
#include <asm/bitops.h>
#include <asm/uaccess.h>
/* perform mcast filtering */
if (wlandev->netdev->flags & IFF_ALLMULTI) {
/* allow my local address through */
- if (memcmp(hdr->a1, wlandev->netdev->dev_addr, WLAN_ADDR_LEN) != 0) {
+ if (memcmp(hdr->a1, wlandev->netdev->dev_addr, ETH_ALEN) != 0) {
/* but reject anything else that isn't multicast */
if (!(hdr->a1[0] & 0x01)) {
dev_kfree_skb(skb);
macaddr->did = DIDmib_dot11mac_dot11OperationTable_dot11MACAddress;
macaddr->status = P80211ENUM_msgitem_status_data_ok;
macaddr->len = sizeof(macaddr->data);
- macaddr->data.len = WLAN_ADDR_LEN;
- memcpy(&macaddr->data.data, new_addr->sa_data, WLAN_ADDR_LEN);
+ macaddr->data.len = ETH_ALEN;
+ memcpy(&macaddr->data.data, new_addr->sa_data, ETH_ALEN);
/* Set up the resultcode argument */
resultcode->did = DIDmsg_dot11req_mibset_resultcode;
#include <asm/bitops.h>
#include <asm/uaccess.h>
#include <asm/byteorder.h>
+#include <linux/if_ether.h>
/*================================================================*/
/* Project Includes */
/* Send the association state first */
data.ap_addr.sa_family = ARPHRD_ETHER;
if (assoc) {
- memcpy(data.ap_addr.sa_data, wlandev->bssid, WLAN_ADDR_LEN);
+ memcpy(data.ap_addr.sa_data, wlandev->bssid, ETH_ALEN);
} else {
- memset(data.ap_addr.sa_data, 0, WLAN_ADDR_LEN);
+ memset(data.ap_addr.sa_data, 0, ETH_ALEN);
}
if (wlan_wext_write)
#include <linux/delay.h>
#include <asm/byteorder.h>
#include <linux/if_arp.h>
+#include <linux/if_ether.h>
#include "wlan_compat.h"
/* Collect the MAC address */
result = hfa384x_drvr_getconfig(hw, HFA384x_RID_CNFOWNMACADDR,
- wlandev->netdev->dev_addr, WLAN_ADDR_LEN);
+ wlandev->netdev->dev_addr, ETH_ALEN);
if ( result != 0 ) {
WLAN_LOG_ERROR("Failed to retrieve mac address\n");
goto failed;
*/
for (i = 0; i < hw->authlist.cnt; i++)
- if (memcmp(rec.sta_addr, hw->authlist.addr[i], WLAN_ADDR_LEN) == 0)
+ if (memcmp(rec.sta_addr, hw->authlist.addr[i], ETH_ALEN) == 0)
break;
if (i >= hw->authlist.cnt) {
** authentication.
*/
- memcpy(rec.address, inf->info.authreq.sta_addr, WLAN_ADDR_LEN);
+ memcpy(rec.address, inf->info.authreq.sta_addr, ETH_ALEN);
rec.status = P80211ENUM_status_unspec_failure;
/*
for (i = 0; i < hw->authlist.cnt; i++)
if (memcmp(rec.address, hw->authlist.addr[i],
- WLAN_ADDR_LEN) == 0) {
+ ETH_ALEN) == 0) {
rec.status = P80211ENUM_status_successful;
break;
}
addr = hw->allow.addr1[0];
}
- for (i = 0; i < cnt; i++, addr += WLAN_ADDR_LEN)
- if (memcmp(rec.address, addr, WLAN_ADDR_LEN) == 0) {
+ for (i = 0; i < cnt; i++, addr += ETH_ALEN)
+ if (memcmp(rec.address, addr, ETH_ALEN) == 0) {
rec.status = P80211ENUM_status_successful;
break;
}
rec.status = P80211ENUM_status_successful;
- for (i = 0; i < cnt; i++, addr += WLAN_ADDR_LEN)
- if (memcmp(rec.address, addr, WLAN_ADDR_LEN) == 0) {
+ for (i = 0; i < cnt; i++, addr += ETH_ALEN)
+ if (memcmp(rec.address, addr, ETH_ALEN) == 0) {
rec.status = P80211ENUM_status_unspec_failure;
break;
}
if (rec.status == P80211ENUM_status_successful) {
for (i = 0; i < hw->authlist.cnt; i++)
- if (memcmp(rec.address, hw->authlist.addr[i], WLAN_ADDR_LEN) == 0)
+ if (memcmp(rec.address, hw->authlist.addr[i], ETH_ALEN) == 0)
break;
if (i >= hw->authlist.cnt) {
rec.status = P80211ENUM_status_ap_full;
} else {
memcpy(hw->authlist.addr[hw->authlist.cnt],
- rec.address, WLAN_ADDR_LEN);
+ rec.address, ETH_ALEN);
hw->authlist.cnt++;
added = 1;
}