2011-02-13 14:40:57

by Stanislav Fomichev

[permalink] [raw]
Subject: [PATCH 1/8] brcm80211: replace dot11_header with ieee80211_hdr

This is a series of patches which remove brcm specific definitions.
Tested on MacBook 7.1.

Signed-off-by: Stanislav Fomichev <[email protected]>
---
drivers/staging/brcm80211/include/proto/802.11.h | 10 ----
drivers/staging/brcm80211/sys/wlc_ampdu.c | 18 +++---
drivers/staging/brcm80211/sys/wlc_mac80211.c | 64 +++++++++++-----------
3 files changed, 41 insertions(+), 51 deletions(-)

diff --git a/drivers/staging/brcm80211/include/proto/802.11.h b/drivers/staging/brcm80211/include/proto/802.11.h
index ffde19c..3bc066a 100644
--- a/drivers/staging/brcm80211/include/proto/802.11.h
+++ b/drivers/staging/brcm80211/include/proto/802.11.h
@@ -45,16 +45,6 @@

#define DOT11_OUI_LEN 3

-BWL_PRE_PACKED_STRUCT struct dot11_header {
- u16 fc;
- u16 durid;
- struct ether_addr a1;
- struct ether_addr a2;
- struct ether_addr a3;
- u16 seq;
- struct ether_addr a4;
-} BWL_POST_PACKED_STRUCT;
-
BWL_PRE_PACKED_STRUCT struct dot11_rts_frame {
u16 fc;
u16 durid;
diff --git a/drivers/staging/brcm80211/sys/wlc_ampdu.c b/drivers/staging/brcm80211/sys/wlc_ampdu.c
index d749917..74da502 100644
--- a/drivers/staging/brcm80211/sys/wlc_ampdu.c
+++ b/drivers/staging/brcm80211/sys/wlc_ampdu.c
@@ -154,10 +154,10 @@ static void wlc_ampdu_dotxstatus_complete(struct ampdu_info *ampdu,
static inline u16 pkt_txh_seqnum(struct wlc_info *wlc, struct sk_buff *p)
{
d11txh_t *txh;
- struct dot11_header *h;
+ struct ieee80211_hdr *h;
txh = (d11txh_t *) p->data;
- h = (struct dot11_header *)((u8 *) (txh + 1) + D11_PHY_HDR_LEN);
- return ltoh16(h->seq) >> SEQNUM_SHIFT;
+ h = (struct ieee80211_hdr *)((u8 *) (txh + 1) + D11_PHY_HDR_LEN);
+ return le16_to_cpu(h->seq_ctrl) >> SEQNUM_SHIFT;
}

struct ampdu_info *wlc_ampdu_attach(struct wlc_info *wlc)
@@ -510,7 +510,7 @@ wlc_sendampdu(struct ampdu_info *ampdu, wlc_txq_info_t *qi,
u32 ampdu_len, maxlen = 0;
d11txh_t *txh = NULL;
u8 *plcp;
- struct dot11_header *h;
+ struct ieee80211_hdr *h;
struct scb *scb;
scb_ampdu_t *scb_ampdu;
scb_ampdu_tid_ini_t *ini;
@@ -596,8 +596,8 @@ wlc_sendampdu(struct ampdu_info *ampdu, wlc_txq_info_t *qi,
ASSERT(tx_info->flags & IEEE80211_TX_CTL_AMPDU);
txh = (d11txh_t *) p->data;
plcp = (u8 *) (txh + 1);
- h = (struct dot11_header *)(plcp + D11_PHY_HDR_LEN);
- seq = ltoh16(h->seq) >> SEQNUM_SHIFT;
+ h = (struct ieee80211_hdr *)(plcp + D11_PHY_HDR_LEN);
+ seq = le16_to_cpu(h->seq_ctrl) >> SEQNUM_SHIFT;
index = TX_SEQ_TO_INDEX(seq);

/* check mcl fields and test whether it can be agg'd */
@@ -968,7 +968,7 @@ wlc_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
u8 bitmap[8], queue, tid;
d11txh_t *txh;
u8 *plcp;
- struct dot11_header *h;
+ struct ieee80211_hdr *h;
u16 seq, start_seq = 0, bindex, index, mcl;
u8 mcs = 0;
bool ba_recd = false, ack_recd = false;
@@ -1089,8 +1089,8 @@ wlc_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
txh = (d11txh_t *) p->data;
mcl = ltoh16(txh->MacTxControlLow);
plcp = (u8 *) (txh + 1);
- h = (struct dot11_header *)(plcp + D11_PHY_HDR_LEN);
- seq = ltoh16(h->seq) >> SEQNUM_SHIFT;
+ h = (struct ieee80211_hdr *)(plcp + D11_PHY_HDR_LEN);
+ seq = le16_to_cpu(h->seq_ctrl) >> SEQNUM_SHIFT;

if (tot_mpdu == 0) {
mcs = plcp[0] & MIMO_PLCP_MCS_MASK;
diff --git a/drivers/staging/brcm80211/sys/wlc_mac80211.c b/drivers/staging/brcm80211/sys/wlc_mac80211.c
index e37e805..96ff02f 100644
--- a/drivers/staging/brcm80211/sys/wlc_mac80211.c
+++ b/drivers/staging/brcm80211/sys/wlc_mac80211.c
@@ -1735,7 +1735,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
ASSERT(sizeof(cck_phy_hdr_t) == D11_PHY_HDR_LEN);
ASSERT(sizeof(d11txh_t) == D11_TXH_LEN);
ASSERT(sizeof(d11rxhdr_t) == RXHDR_LEN);
- ASSERT(sizeof(struct dot11_header) == DOT11_A4_HDR_LEN);
+ ASSERT(sizeof(struct ieee80211_hdr) == DOT11_A4_HDR_LEN);
ASSERT(sizeof(struct dot11_rts_frame) == DOT11_RTS_LEN);
ASSERT(sizeof(struct dot11_management_header) == DOT11_MGMT_HDR_LEN);
ASSERT(sizeof(struct dot11_bcn_prb) == DOT11_BCN_PRB_LEN);
@@ -5113,12 +5113,12 @@ wlc_sendpkt_mac80211(struct wlc_info *wlc, struct sk_buff *sdu,
uint fifo;
void *pkt;
struct scb *scb = &global_scb;
- struct dot11_header *d11_header = (struct dot11_header *)(sdu->data);
+ struct ieee80211_hdr *d11_header = (struct ieee80211_hdr *)(sdu->data);
u16 type, fc;

ASSERT(sdu);

- fc = ltoh16(d11_header->fc);
+ fc = le16_to_cpu(d11_header->frame_control);
type = FC_TYPE(fc);

/* 802.11 standard requires management traffic to go at highest priority */
@@ -5650,7 +5650,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
uint nfrags, uint queue, uint next_frag_len,
wsec_key_t *key, ratespec_t rspec_override)
{
- struct dot11_header *h;
+ struct ieee80211_hdr *h;
d11txh_t *txh;
u8 *plcp, plcp_fallback[D11_PHY_HDR_LEN];
struct osl_info *osh;
@@ -5693,8 +5693,8 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
osh = wlc->osh;

/* locate 802.11 MAC header */
- h = (struct dot11_header *)(p->data);
- fc = ltoh16(h->fc);
+ h = (struct ieee80211_hdr *)(p->data);
+ fc = le16_to_cpu(h->frame_control);
type = FC_TYPE(fc);

qos = (type == FC_TYPE_DATA && FC_SUBTYPE_ANY_QOS(FC_SUBTYPE(fc)));
@@ -5740,7 +5740,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
/* extract fragment number from frame first */
seq = ltoh16(seq) & FRAGNUM_MASK;
seq |= (SCB_SEQNUM(scb, p->priority) << SEQNUM_SHIFT);
- h->seq = htol16(seq);
+ h->seq_ctrl = cpu_to_le16(seq);

frameid = ((seq << TXFID_SEQ_SHIFT) & TXFID_SEQ_MASK) |
(queue & TXFID_QUEUE_MASK);
@@ -5810,7 +5810,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
rspec[k] = WLC_RATE_1M;
} else {
if (WLANTSEL_ENAB(wlc) &&
- !is_multicast_ether_addr(h->a1.octet)) {
+ !is_multicast_ether_addr(h->addr1)) {
/* set tx antenna config */
wlc_antsel_antcfg_get(wlc->asi, false, false, 0,
0, &antcfg, &fbantcfg);
@@ -5973,11 +5973,11 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,

/* DUR field for main rate */
if ((fc != FC_PS_POLL) &&
- !is_multicast_ether_addr(h->a1.octet) && !use_rifs) {
+ !is_multicast_ether_addr(h->addr1) && !use_rifs) {
durid =
wlc_compute_frame_dur(wlc, rspec[0], preamble_type[0],
next_frag_len);
- h->durid = htol16(durid);
+ h->duration_id = cpu_to_le16(durid);
} else if (use_rifs) {
/* NAV protect to end of next max packet size */
durid =
@@ -5985,13 +5985,13 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
preamble_type[0],
DOT11_MAX_FRAG_LEN);
durid += RIFS_11N_TIME;
- h->durid = htol16(durid);
+ h->duration_id = cpu_to_le16(durid);
}

/* DUR field for fallback rate */
if (fc == FC_PS_POLL)
- txh->FragDurFallback = h->durid;
- else if (is_multicast_ether_addr(h->a1.octet) || use_rifs)
+ txh->FragDurFallback = h->duration_id;
+ else if (is_multicast_ether_addr(h->addr1) || use_rifs)
txh->FragDurFallback = 0;
else {
durid = wlc_compute_frame_dur(wlc, rspec[1],
@@ -6003,7 +6003,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
if (frag == 0)
mcl |= TXC_STARTMSDU;

- if (!is_multicast_ether_addr(h->a1.octet))
+ if (!is_multicast_ether_addr(h->addr1))
mcl |= TXC_IMMEDACK;

if (BAND_5G(wlc->band->bandtype))
@@ -6031,14 +6031,14 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
}

/* MacFrameControl */
- bcopy((char *)&h->fc, (char *)&txh->MacFrameControl, sizeof(u16));
+ bcopy((char *)&h->frame_control, (char *)&txh->MacFrameControl, sizeof(u16));

txh->TxFesTimeNormal = htol16(0);

txh->TxFesTimeFallback = htol16(0);

/* TxFrameRA */
- bcopy((char *)&h->a1, (char *)&txh->TxFrameRA, ETH_ALEN);
+ bcopy((char *)h->addr1, (char *)&txh->TxFrameRA, ETH_ALEN);

/* TxFrameID */
txh->TxFrameID = htol16(frameid);
@@ -6125,10 +6125,10 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,

if (use_cts) {
rts->fc = htol16(FC_CTS);
- bcopy((char *)&h->a2, (char *)&rts->ra, ETH_ALEN);
+ bcopy((char *)h->addr2, (char *)&rts->ra, ETH_ALEN);
} else {
rts->fc = htol16((u16) FC_RTS);
- bcopy((char *)&h->a1, (char *)&rts->ra,
+ bcopy((char *)h->addr1, (char *)&rts->ra,
2 * ETH_ALEN);
}

@@ -6232,7 +6232,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
if (SCB_WME(scb) && qos && wlc->edcf_txop[ac]) {
uint frag_dur, dur, dur_fallback;

- ASSERT(!is_multicast_ether_addr(h->a1.octet));
+ ASSERT(!is_multicast_ether_addr(h->addr1));

/* WME: Update TXOP threshold */
if ((!(tx_info->flags & IEEE80211_TX_CTL_AMPDU)) && (frag == 0)) {
@@ -6534,7 +6534,7 @@ wlc_dotxstatus(struct wlc_info *wlc, tx_status_t *txs, u32 frm_tx2)
int tx_rts, tx_frame_count, tx_rts_count;
uint totlen, supr_status;
bool lastframe;
- struct dot11_header *h;
+ struct ieee80211_hdr *h;
u16 fc;
u16 mcl;
struct ieee80211_tx_info *tx_info;
@@ -6590,8 +6590,8 @@ wlc_dotxstatus(struct wlc_info *wlc, tx_status_t *txs, u32 frm_tx2)
goto fatal;

tx_info = IEEE80211_SKB_CB(p);
- h = (struct dot11_header *)((u8 *) (txh + 1) + D11_PHY_HDR_LEN);
- fc = ltoh16(h->fc);
+ h = (struct ieee80211_hdr *)((u8 *) (txh + 1) + D11_PHY_HDR_LEN);
+ fc = le16_to_cpu(h->frame_control);

scb = (struct scb *)tx_info->control.sta->drv_priv;

@@ -6985,7 +6985,7 @@ void wlc_bss_list_free(struct wlc_info *wlc, wlc_bss_list_t *bss_list)
void BCMFASTPATH wlc_recv(struct wlc_info *wlc, struct sk_buff *p)
{
d11rxhdr_t *rxh;
- struct dot11_header *h;
+ struct ieee80211_hdr *h;
struct osl_info *osh;
u16 fc;
uint len;
@@ -7015,7 +7015,7 @@ void BCMFASTPATH wlc_recv(struct wlc_info *wlc, struct sk_buff *p)
skb_pull(p, 2);
}

- h = (struct dot11_header *)(p->data + D11_PHY_HDR_LEN);
+ h = (struct ieee80211_hdr *)(p->data + D11_PHY_HDR_LEN);
len = p->len;

if (rxh->RxStatus1 & RXS_FCSERR) {
@@ -7029,8 +7029,8 @@ void BCMFASTPATH wlc_recv(struct wlc_info *wlc, struct sk_buff *p)
}

/* check received pkt has at least frame control field */
- if (len >= D11_PHY_HDR_LEN + sizeof(h->fc)) {
- fc = ltoh16(h->fc);
+ if (len >= D11_PHY_HDR_LEN + sizeof(h->frame_control)) {
+ fc = le16_to_cpu(h->frame_control);
} else {
WLCNTINCR(wlc->pub->_cnt->rxrunt);
goto toss;
@@ -7042,10 +7042,10 @@ void BCMFASTPATH wlc_recv(struct wlc_info *wlc, struct sk_buff *p)
if (!is_amsdu) {
/* CTS and ACK CTL frames are w/o a2 */
if (FC_TYPE(fc) == FC_TYPE_DATA || FC_TYPE(fc) == FC_TYPE_MNG) {
- if ((is_zero_ether_addr(h->a2.octet) ||
- is_multicast_ether_addr(h->a2.octet))) {
+ if ((is_zero_ether_addr(h->addr2) ||
+ is_multicast_ether_addr(h->addr2))) {
WL_ERROR("wl%d: %s: dropping a frame with invalid src mac address, a2: %pM\n",
- wlc->pub->unit, __func__, &h->a2);
+ wlc->pub->unit, __func__, h->addr2);
WLCNTINCR(wlc->pub->_cnt->rxbadsrcmac);
goto toss;
}
@@ -7818,7 +7818,7 @@ int wlc_prep_pdu(struct wlc_info *wlc, struct sk_buff *pdu, uint *fifop)
struct osl_info *osh;
uint fifo;
d11txh_t *txh;
- struct dot11_header *h;
+ struct ieee80211_hdr *h;
struct scb *scb;
u16 fc;

@@ -7827,9 +7827,9 @@ int wlc_prep_pdu(struct wlc_info *wlc, struct sk_buff *pdu, uint *fifop)
ASSERT(pdu);
txh = (d11txh_t *) (pdu->data);
ASSERT(txh);
- h = (struct dot11_header *)((u8 *) (txh + 1) + D11_PHY_HDR_LEN);
+ h = (struct ieee80211_hdr *)((u8 *) (txh + 1) + D11_PHY_HDR_LEN);
ASSERT(h);
- fc = ltoh16(h->fc);
+ fc = le16_to_cpu(h->frame_control);

/* get the pkt queue info. This was put at wlc_sendctl or wlc_send for PDU */
fifo = ltoh16(txh->TxFrameID) & TXFID_QUEUE_MASK;
--
1.7.1



2011-02-13 14:40:59

by Stanislav Fomichev

[permalink] [raw]
Subject: [PATCH 3/8] brcm80211: replace dot11_management_header with ieee80211_mgmt

Signed-off-by: Stanislav Fomichev <[email protected]>
---
drivers/staging/brcm80211/include/proto/802.11.h | 8 --------
drivers/staging/brcm80211/sys/wlc_mac80211.c | 16 ++++++++--------
2 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/brcm80211/include/proto/802.11.h b/drivers/staging/brcm80211/include/proto/802.11.h
index db4328d..11f7987 100644
--- a/drivers/staging/brcm80211/include/proto/802.11.h
+++ b/drivers/staging/brcm80211/include/proto/802.11.h
@@ -52,14 +52,6 @@
#define DOT11_BA_BITMAP_LEN 128
#define DOT11_BA_LEN 4

-BWL_PRE_PACKED_STRUCT struct dot11_management_header {
- u16 fc;
- u16 durid;
- struct ether_addr da;
- struct ether_addr sa;
- struct ether_addr bssid;
- u16 seq;
-} BWL_POST_PACKED_STRUCT;
#define DOT11_MGMT_HDR_LEN 24

BWL_PRE_PACKED_STRUCT struct dot11_bcn_prb {
diff --git a/drivers/staging/brcm80211/sys/wlc_mac80211.c b/drivers/staging/brcm80211/sys/wlc_mac80211.c
index 391e958..ddaa515 100644
--- a/drivers/staging/brcm80211/sys/wlc_mac80211.c
+++ b/drivers/staging/brcm80211/sys/wlc_mac80211.c
@@ -1737,7 +1737,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
ASSERT(sizeof(d11rxhdr_t) == RXHDR_LEN);
ASSERT(sizeof(struct ieee80211_hdr) == DOT11_A4_HDR_LEN);
ASSERT(sizeof(struct ieee80211_rts) == DOT11_RTS_LEN);
- ASSERT(sizeof(struct dot11_management_header) == DOT11_MGMT_HDR_LEN);
+ ASSERT(IEEE80211_MIN_ACTION_SIZE - 1 == DOT11_MGMT_HDR_LEN);
ASSERT(sizeof(struct dot11_bcn_prb) == DOT11_BCN_PRB_LEN);
ASSERT(sizeof(tx_status_t) == TXSTATUS_LEN);
ASSERT(sizeof(ht_cap_ie_t) == HT_CAP_IE_LEN);
@@ -7614,7 +7614,7 @@ wlc_bcn_prb_template(struct wlc_info *wlc, uint type, ratespec_t bcn_rspec,
wlc_bsscfg_t *cfg, u16 *buf, int *len)
{
cck_phy_hdr_t *plcp;
- struct dot11_management_header *h;
+ struct ieee80211_mgmt *h;
int hdr_len, body_len;

ASSERT(*len >= 142);
@@ -7647,20 +7647,20 @@ wlc_bcn_prb_template(struct wlc_info *wlc, uint type, ratespec_t bcn_rspec,
wlc_beacon_phytxctl_txant_upd(wlc, bcn_rspec);

if (MBSS_BCN_ENAB(cfg) && type == FC_BEACON)
- h = (struct dot11_management_header *)&plcp[0];
+ h = (struct ieee80211_mgmt *)&plcp[0];
else
- h = (struct dot11_management_header *)&plcp[1];
+ h = (struct ieee80211_mgmt *)&plcp[1];

/* fill in 802.11 header */
- h->fc = htol16((u16) type);
+ h->frame_control = cpu_to_le16((u16) type);

/* DUR is 0 for multicast bcn, or filled in by MAC for prb resp */
/* A1 filled in by MAC for prb resp, broadcast for bcn */
if (type == FC_BEACON)
- bcopy((const char *)&ether_bcast, (char *)&h->da,
+ bcopy((const char *)&ether_bcast, h->da,
ETH_ALEN);
- bcopy((char *)&cfg->cur_etheraddr, (char *)&h->sa, ETH_ALEN);
- bcopy((char *)&cfg->BSSID, (char *)&h->bssid, ETH_ALEN);
+ bcopy((char *)&cfg->cur_etheraddr, h->sa, ETH_ALEN);
+ bcopy((char *)&cfg->BSSID, h->bssid, ETH_ALEN);

/* SEQ filled in by MAC */

--
1.7.1


2011-02-13 14:41:01

by Stanislav Fomichev

[permalink] [raw]
Subject: [PATCH 4/8] brcm80211: replace ht_cap_ie with ieee80211_ht_cap

Signed-off-by: Stanislav Fomichev <[email protected]>
---
drivers/staging/brcm80211/include/proto/802.11.h | 26 ----------------------
drivers/staging/brcm80211/sys/wlc_mac80211.c | 22 +++++++++---------
drivers/staging/brcm80211/sys/wlc_mac80211.h | 2 +-
drivers/staging/brcm80211/sys/wlc_pub.h | 7 ++++-
drivers/staging/brcm80211/sys/wlc_stf.c | 14 ++++++------
5 files changed, 24 insertions(+), 47 deletions(-)

diff --git a/drivers/staging/brcm80211/include/proto/802.11.h b/drivers/staging/brcm80211/include/proto/802.11.h
index 11f7987..3238dad 100644
--- a/drivers/staging/brcm80211/include/proto/802.11.h
+++ b/drivers/staging/brcm80211/include/proto/802.11.h
@@ -228,34 +228,8 @@ typedef struct d11cnt {

#define MCSSET_LEN 16

-BWL_PRE_PACKED_STRUCT struct ht_cap_ie {
- u16 cap;
- u8 params;
- u8 supp_mcs[MCSSET_LEN];
- u16 ext_htcap;
- u32 txbf_cap;
- u8 as_cap;
-} BWL_POST_PACKED_STRUCT;
-typedef struct ht_cap_ie ht_cap_ie_t;
-
#define HT_CAP_IE_LEN 26

-#define HT_CAP_LDPC_CODING 0x0001
-#define HT_CAP_40MHZ 0x0002
-#define HT_CAP_MIMO_PS_MASK 0x000C
-#define HT_CAP_MIMO_PS_SHIFT 0x0002
-#define HT_CAP_MIMO_PS_OFF 0x0003
-#define HT_CAP_MIMO_PS_ON 0x0000
-#define HT_CAP_GF 0x0010
-#define HT_CAP_SHORT_GI_20 0x0020
-#define HT_CAP_SHORT_GI_40 0x0040
-#define HT_CAP_TX_STBC 0x0080
-#define HT_CAP_RX_STBC_MASK 0x0300
-#define HT_CAP_RX_STBC_SHIFT 8
-#define HT_CAP_MAX_AMSDU 0x0800
-#define HT_CAP_DSSS_CCK 0x1000
-#define HT_CAP_40MHZ_INTOLERANT 0x4000
-
#define HT_CAP_RX_STBC_NO 0x0
#define HT_CAP_RX_STBC_ONE_STREAM 0x1

diff --git a/drivers/staging/brcm80211/sys/wlc_mac80211.c b/drivers/staging/brcm80211/sys/wlc_mac80211.c
index ddaa515..ce13e2e 100644
--- a/drivers/staging/brcm80211/sys/wlc_mac80211.c
+++ b/drivers/staging/brcm80211/sys/wlc_mac80211.c
@@ -1170,9 +1170,9 @@ void wlc_protection_upd(struct wlc_info *wlc, uint idx, int val)

static void wlc_ht_update_sgi_rx(struct wlc_info *wlc, int val)
{
- wlc->ht_cap.cap &= ~(HT_CAP_SHORT_GI_20 | HT_CAP_SHORT_GI_40);
- wlc->ht_cap.cap |= (val & WLC_N_SGI_20) ? HT_CAP_SHORT_GI_20 : 0;
- wlc->ht_cap.cap |= (val & WLC_N_SGI_40) ? HT_CAP_SHORT_GI_40 : 0;
+ wlc->ht_cap.cap_info &= ~(IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_40);
+ wlc->ht_cap.cap_info |= (val & WLC_N_SGI_20) ? IEEE80211_HT_CAP_SGI_20 : 0;
+ wlc->ht_cap.cap_info |= (val & WLC_N_SGI_40) ? IEEE80211_HT_CAP_SGI_40 : 0;

if (wlc->pub->up) {
wlc_update_beacon(wlc);
@@ -1184,9 +1184,9 @@ static void wlc_ht_update_ldpc(struct wlc_info *wlc, s8 val)
{
wlc->stf->ldpc = val;

- wlc->ht_cap.cap &= ~HT_CAP_LDPC_CODING;
+ wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_LDPC_CODING;
if (wlc->stf->ldpc != OFF)
- wlc->ht_cap.cap |= HT_CAP_LDPC_CODING;
+ wlc->ht_cap.cap_info |= IEEE80211_HT_CAP_LDPC_CODING;

if (wlc->pub->up) {
wlc_update_beacon(wlc);
@@ -1740,7 +1740,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
ASSERT(IEEE80211_MIN_ACTION_SIZE - 1 == DOT11_MGMT_HDR_LEN);
ASSERT(sizeof(struct dot11_bcn_prb) == DOT11_BCN_PRB_LEN);
ASSERT(sizeof(tx_status_t) == TXSTATUS_LEN);
- ASSERT(sizeof(ht_cap_ie_t) == HT_CAP_IE_LEN);
+ ASSERT(sizeof(struct ieee80211_ht_cap) == HT_CAP_IE_LEN);
#ifdef BRCM_FULLMAC
ASSERT(offsetof(wl_scan_params_t, channel_list) ==
WL_SCAN_PARAMS_FIXED_SIZE);
@@ -1944,7 +1944,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
wlc_wme_initparams_sta(wlc, &wlc->wme_param_ie);

wlc->mimoft = FT_HT;
- wlc->ht_cap.cap = HT_CAP;
+ wlc->ht_cap.cap_info = HT_CAP;
if (HT_ENAB(wlc->pub))
wlc->stf->ldpc = AUTO;

@@ -1981,14 +1981,14 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
if (n_disabled & WLFEATURE_DISABLE_11N_STBC_TX) {
wlc->bandstate[BAND_2G_INDEX]->band_stf_stbc_tx = OFF;
wlc->bandstate[BAND_5G_INDEX]->band_stf_stbc_tx = OFF;
- wlc->ht_cap.cap &= ~HT_CAP_TX_STBC;
+ wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_TX_STBC;
}
if (n_disabled & WLFEATURE_DISABLE_11N_STBC_RX)
wlc_stf_stbc_rx_set(wlc, HT_CAP_RX_STBC_NO);

/* apply the GF override from nvram conf */
if (n_disabled & WLFEATURE_DISABLE_11N_GF)
- wlc->ht_cap.cap &= ~HT_CAP_GF;
+ wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_GRN_FLD;

/* initialize radio_mpc_disable according to wlc->mpc */
wlc_radio_mpc_upd(wlc);
@@ -8269,8 +8269,8 @@ void wlc_reset_bmac_done(struct wlc_info *wlc)

void wlc_ht_mimops_cap_update(struct wlc_info *wlc, u8 mimops_mode)
{
- wlc->ht_cap.cap &= ~HT_CAP_MIMO_PS_MASK;
- wlc->ht_cap.cap |= (mimops_mode << HT_CAP_MIMO_PS_SHIFT);
+ wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_SM_PS;
+ wlc->ht_cap.cap_info |= (mimops_mode << IEEE80211_HT_CAP_SM_PS_SHIFT);

if (AP_ENAB(wlc->pub) && wlc->clk) {
wlc_update_beacon(wlc);
diff --git a/drivers/staging/brcm80211/sys/wlc_mac80211.h b/drivers/staging/brcm80211/sys/wlc_mac80211.h
index 5df996b..d0c274b 100644
--- a/drivers/staging/brcm80211/sys/wlc_mac80211.h
+++ b/drivers/staging/brcm80211/sys/wlc_mac80211.h
@@ -677,7 +677,7 @@ struct wlc_info {
s8 cck_40txbw; /* 11N, cck tx b/w override when in 40MHZ mode */
s8 ofdm_40txbw; /* 11N, ofdm tx b/w override when in 40MHZ mode */
s8 mimo_40txbw; /* 11N, mimo tx b/w override when in 40MHZ mode */
- ht_cap_ie_t ht_cap; /* HT CAP IE being advertised by this node */
+ struct ieee80211_ht_cap ht_cap; /* HT CAP IE being advertised by this node */

uint seckeys; /* 54 key table shm address */
uint tkmickeys; /* 12 TKIP MIC key table shm address */
diff --git a/drivers/staging/brcm80211/sys/wlc_pub.h b/drivers/staging/brcm80211/sys/wlc_pub.h
index aff4130..c304156 100644
--- a/drivers/staging/brcm80211/sys/wlc_pub.h
+++ b/drivers/staging/brcm80211/sys/wlc_pub.h
@@ -145,8 +145,11 @@ struct rsn_parms {
#define AMPDU_DEF_MPDU_DENSITY 6 /* default mpdu density (110 ==> 4us) */

/* defaults for the HT (MIMO) bss */
-#define HT_CAP ((HT_CAP_MIMO_PS_OFF << HT_CAP_MIMO_PS_SHIFT) | HT_CAP_40MHZ | \
- HT_CAP_GF | HT_CAP_MAX_AMSDU | HT_CAP_DSSS_CCK)
+#define HT_CAP ((WLAN_HT_CAP_SM_PS_DISABLED << IEEE80211_HT_CAP_SM_PS_SHIFT) | \
+ IEEE80211_HT_CAP_SUP_WIDTH_20_40 | \
+ IEEE80211_HT_CAP_GRN_FLD | \
+ IEEE80211_HT_CAP_MAX_AMSDU | \
+ IEEE80211_HT_CAP_DSSSCCK40)

/* WLC packet type is a void * */
typedef void *wlc_pkt_t;
diff --git a/drivers/staging/brcm80211/sys/wlc_stf.c b/drivers/staging/brcm80211/sys/wlc_stf.c
index 8975b09..bb56a88 100644
--- a/drivers/staging/brcm80211/sys/wlc_stf.c
+++ b/drivers/staging/brcm80211/sys/wlc_stf.c
@@ -76,8 +76,8 @@ static void wlc_stf_stbc_rx_ht_update(struct wlc_info *wlc, int val)
return;
}

- wlc->ht_cap.cap &= ~HT_CAP_RX_STBC_MASK;
- wlc->ht_cap.cap |= (val << HT_CAP_RX_STBC_SHIFT);
+ wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_RX_STBC;
+ wlc->ht_cap.cap_info |= (val << IEEE80211_HT_CAP_RX_STBC_SHIFT);

if (wlc->pub->up) {
wlc_update_beacon(wlc);
@@ -153,7 +153,7 @@ wlc_stf_ss_algo_channel_get(struct wlc_info *wlc, u16 *ss_algo_channel,

static s8 wlc_stf_stbc_rx_get(struct wlc_info *wlc)
{
- return (wlc->ht_cap.cap & HT_CAP_RX_STBC_MASK) >> HT_CAP_RX_STBC_SHIFT;
+ return (wlc->ht_cap.cap_info & IEEE80211_HT_CAP_RX_STBC) >> IEEE80211_HT_CAP_RX_STBC_SHIFT;
}

static bool wlc_stf_stbc_tx_set(struct wlc_info *wlc, s32 int_val)
@@ -167,9 +167,9 @@ static bool wlc_stf_stbc_tx_set(struct wlc_info *wlc, s32 int_val)

if ((int_val == OFF) || (wlc->stf->txstreams == 1)
|| !WLC_STBC_CAP_PHY(wlc))
- wlc->ht_cap.cap &= ~HT_CAP_TX_STBC;
+ wlc->ht_cap.cap_info &= ~IEEE80211_HT_CAP_TX_STBC;
else
- wlc->ht_cap.cap |= HT_CAP_TX_STBC;
+ wlc->ht_cap.cap_info |= IEEE80211_HT_CAP_TX_STBC;

wlc->bandstate[BAND_2G_INDEX]->band_stf_stbc_tx = (s8) int_val;
wlc->bandstate[BAND_5G_INDEX]->band_stf_stbc_tx = (s8) int_val;
@@ -341,7 +341,7 @@ int wlc_stf_rxchain_set(struct wlc_info *wlc, s32 int_val)

if (rxchain_cnt != old_rxchain_cnt) {
mimops_mode =
- (rxchain_cnt == 1) ? HT_CAP_MIMO_PS_ON : HT_CAP_MIMO_PS_OFF;
+ (rxchain_cnt == 1) ? WLAN_HT_CAP_SM_PS_STATIC : WLAN_HT_CAP_SM_PS_DISABLED;
wlc->mimops_PM = mimops_mode;
if (AP_ENAB(wlc->pub)) {
wlc_phy_stf_chain_set(wlc->band->pi, wlc->stf->txchain,
@@ -353,7 +353,7 @@ int wlc_stf_rxchain_set(struct wlc_info *wlc, s32 int_val)
return BCME_OK;
}
if (wlc->pub->associated) {
- if (mimops_mode == HT_CAP_MIMO_PS_OFF) {
+ if (mimops_mode == WLAN_HT_CAP_SM_PS_DISABLED) {
/* if mimops is off, turn on the Rx chain first */
wlc_phy_stf_chain_set(wlc->band->pi,
wlc->stf->txchain,
--
1.7.1


2011-02-18 21:04:17

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 1/8] brcm80211: replace dot11_header with ieee80211_hdr

On Sun, Feb 13, 2011 at 05:40:36PM +0300, Stanislav Fomichev wrote:
> This is a series of patches which remove brcm specific definitions.
> Tested on MacBook 7.1.
>
> Signed-off-by: Stanislav Fomichev <[email protected]>
> ---
> drivers/staging/brcm80211/include/proto/802.11.h | 10 ----
> drivers/staging/brcm80211/sys/wlc_ampdu.c | 18 +++---
> drivers/staging/brcm80211/sys/wlc_mac80211.c | 64 +++++++++++-----------

You really need to do this against linux-next, as I can't apply any of
these patches.

Care to respin them and resend?

thanks,

greg k-h

2011-02-13 14:41:08

by Stanislav Fomichev

[permalink] [raw]
Subject: [PATCH 8/8] brcm80211: replace ether_addr with u8[ETH_ALEN]

Removed proto/ethernet.h as a side effect.

Signed-off-by: Stanislav Fomichev <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 2 +-
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 2 +-
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 50 +++++++++---------
.../staging/brcm80211/brcmfmac/dhd_custom_gpio.c | 5 +-
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 16 +++---
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 1 -
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 56 +++++++++----------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 3 +-
drivers/staging/brcm80211/brcmfmac/wl_iw.c | 49 ++++++++---------
drivers/staging/brcm80211/brcmfmac/wl_iw.h | 3 +-
drivers/staging/brcm80211/include/bcmcdc.h | 4 +-
drivers/staging/brcm80211/include/bcmutils.h | 6 +-
drivers/staging/brcm80211/include/proto/bcmevent.h | 2 +-
drivers/staging/brcm80211/include/proto/ethernet.h | 36 -------------
drivers/staging/brcm80211/include/proto/wpa.h | 2 -
drivers/staging/brcm80211/include/wlioctl.h | 23 ++++----
drivers/staging/brcm80211/sys/wl_mac80211.c | 4 +-
drivers/staging/brcm80211/sys/wlc_alloc.c | 14 -----
drivers/staging/brcm80211/sys/wlc_ampdu.c | 2 +-
drivers/staging/brcm80211/sys/wlc_bmac.c | 38 ++++++-------
drivers/staging/brcm80211/sys/wlc_bmac.h | 10 ++--
drivers/staging/brcm80211/sys/wlc_bsscfg.h | 8 +--
drivers/staging/brcm80211/sys/wlc_key.h | 2 +-
drivers/staging/brcm80211/sys/wlc_mac80211.c | 38 ++++++-------
drivers/staging/brcm80211/sys/wlc_mac80211.h | 11 ++--
drivers/staging/brcm80211/sys/wlc_pub.h | 14 +----
drivers/staging/brcm80211/sys/wlc_scb.h | 1 -
drivers/staging/brcm80211/util/bcmsrom.c | 18 +++----
drivers/staging/brcm80211/util/bcmutils.c | 6 +-
29 files changed, 170 insertions(+), 256 deletions(-)
delete mode 100644 drivers/staging/brcm80211/include/proto/ethernet.h

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 69c6a02..79c17cc 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -95,7 +95,7 @@ typedef struct dhd_pub {
/* Dongle media info */
bool iswl; /* Dongle-resident driver is wl */
unsigned long drv_version; /* Version of dongle-resident driver */
- struct ether_addr mac; /* MAC address obtained from dongle */
+ u8 mac[ETH_ALEN]; /* MAC address obtained from dongle */
dngl_stats_t dstats; /* Stats for dongle-based data */

/* Additional stats for the bus level */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index 9dabd67..cc7bf2c 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -477,7 +477,7 @@ int dhd_prot_init(dhd_pub_t *dhd)
dhd_os_proto_unblock(dhd);
return ret;
}
- memcpy(dhd->mac.octet, buf, ETH_ALEN);
+ memcpy(dhd->mac, buf, ETH_ALEN);

dhd_os_proto_unblock(dhd);

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 077ccc7..8a9383a 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -157,7 +157,7 @@ static int dhd_dump(dhd_pub_t *dhdp, char *buf, int buflen)
bcm_bprintf(strbuf, "pub.hdrlen %d pub.maxctl %d pub.rxsz %d\n",
dhdp->hdrlen, dhdp->maxctl, dhdp->rxsz);
bcm_bprintf(strbuf, "pub.iswl %d pub.drv_version %ld pub.mac %pM\n",
- dhdp->iswl, dhdp->drv_version, &dhdp->mac);
+ dhdp->iswl, dhdp->drv_version, dhdp->mac);
bcm_bprintf(strbuf, "pub.bcmerror %d tickcnt %d\n", dhdp->bcmerror,
dhdp->tickcnt);

@@ -1242,7 +1242,7 @@ int dhd_preinit_ioctls(dhd_pub_t *dhd)
int scan_unassoc_time = 40;
#ifdef GET_CUSTOM_MAC_ENABLE
int ret = 0;
- struct ether_addr ea_addr;
+ u8 ea_addr[ETH_ALEN];
#endif /* GET_CUSTOM_MAC_ENABLE */

dhd_os_proto_block(dhd);
@@ -1254,16 +1254,16 @@ int dhd_preinit_ioctls(dhd_pub_t *dhd)
** firmware but unique per board mac address maybe provided by
** customer code
*/
- ret = dhd_custom_get_mac_address(ea_addr.octet);
+ ret = dhd_custom_get_mac_address(ea_addr);
if (!ret) {
- bcm_mkiovar("cur_etheraddr", (void *)&ea_addr, ETH_ALEN,
+ bcm_mkiovar("cur_etheraddr", ea_addr, ETH_ALEN,
buf, sizeof(buf));
ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, buf, sizeof(buf));
if (ret < 0) {
DHD_ERROR(("%s: can't set MAC address , error=%d\n",
__func__, ret));
} else
- memcpy(dhd->mac.octet, &ea_addr, ETH_ALEN);
+ memcpy(dhd->mac, ea_addr, ETH_ALEN);
}
#endif /* GET_CUSTOM_MAC_ENABLE */

@@ -1473,9 +1473,9 @@ int dhd_iscan_print_cache(iscan_buf_t *iscan_skip)

DHD_ISCAN(("%s[%2.2d:%2.2d] %X:%X:%X:%X:%X:%X\n",
iscan_cur != iscan_skip ? "BSS" : "bss", l,
- i, bi->BSSID.octet[0], bi->BSSID.octet[1],
- bi->BSSID.octet[2], bi->BSSID.octet[3],
- bi->BSSID.octet[4], bi->BSSID.octet[5]));
+ i, bi->BSSID[0], bi->BSSID[1],
+ bi->BSSID[2], bi->BSSID[3],
+ bi->BSSID[4], bi->BSSID[5]));

bi = (wl_bss_info_t *)((unsigned long)bi +
dtoh32(bi->length));
@@ -1533,13 +1533,13 @@ int dhd_iscan_delete_bss(void *dhdp, void *addr, iscan_buf_t *iscan_skip)
break;

if (!memcmp
- (bi->BSSID.octet, addr, ETH_ALEN)) {
+ (bi->BSSID, 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],
- bi->BSSID.octet[1], bi->BSSID.octet[2],
- bi->BSSID.octet[3], bi->BSSID.octet[4],
- bi->BSSID.octet[5]));
+ __func__, l, i, bi->BSSID[0],
+ bi->BSSID[1], bi->BSSID[2],
+ bi->BSSID[3], bi->BSSID[4],
+ bi->BSSID[5]));

bi_new = bi;
bi = (wl_bss_info_t *)((unsigned long)bi +
@@ -1560,12 +1560,12 @@ int dhd_iscan_delete_bss(void *dhdp, void *addr, iscan_buf_t *iscan_skip)
if (bi && bi_new) {
DHD_ISCAN(("%s: Moved up BSS[%2.2d:%2.2d]" "%X:%X:%X:%X:%X:%X\n",
__func__, l, j,
- bi->BSSID.octet[0],
- bi->BSSID.octet[1],
- bi->BSSID.octet[2],
- bi->BSSID.octet[3],
- bi->BSSID.octet[4],
- bi->BSSID.octet[5]));
+ bi->BSSID[0],
+ bi->BSSID[1],
+ bi->BSSID[2],
+ bi->BSSID[3],
+ bi->BSSID[4],
+ bi->BSSID[5]));

bi_next =
(wl_bss_info_t *)((unsigned long)bi +
@@ -1641,12 +1641,12 @@ int dhd_iscan_remove_duplicates(void *dhdp, iscan_buf_t *iscan_cur)
break;

DHD_ISCAN(("%s: Find dups for BSS[%2.2d] %X:%X:%X:%X:%X:%X\n",
- __func__, i, bi->BSSID.octet[0],
- bi->BSSID.octet[1], bi->BSSID.octet[2],
- bi->BSSID.octet[3], bi->BSSID.octet[4],
- bi->BSSID.octet[5]));
+ __func__, i, bi->BSSID[0],
+ bi->BSSID[1], bi->BSSID[2],
+ bi->BSSID[3], bi->BSSID[4],
+ bi->BSSID[5]));

- dhd_iscan_delete_bss(dhdp, bi->BSSID.octet, iscan_cur);
+ dhd_iscan_delete_bss(dhdp, bi->BSSID, iscan_cur);

bi = (wl_bss_info_t *)((unsigned long)bi + dtoh32(bi->length));
}
@@ -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, ETH_ALEN);
+ memset(params.params.bssid, 255, ETH_ALEN);

params.params.bss_type = DOT11_BSSTYPE_ANY;
params.params.scan_type = DOT11_SCANTYPE_ACTIVE;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c b/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c
index 06e2e85..b5d84bb 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c
@@ -149,9 +149,8 @@ int dhd_custom_get_mac_address(unsigned char *buf)
#ifdef EXAMPLE_GET_MAC
/* EXAMPLE code */
{
- struct ether_addr ea_example = {
- {0x00, 0x11, 0x22, 0x33, 0x44, 0xFF} };
- memcpy(buf, &ea_example, sizeof(struct ether_addr));
+ u8 ea_example[ETH_ALEN] = {0x00, 0x11, 0x22, 0x33, 0x44, 0xFF};
+ memcpy(buf, ea_example, sizeof(ea_example));
}
#endif /* EXAMPLE_GET_MAC */

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index a3db566..1ce08d9 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -36,7 +36,6 @@
#include <bcmutils.h>
#include <bcmendian.h>

-#include <proto/ethernet.h>
#include <dngl_stats.h>
#include <dhd.h>
#include <dhd_bus.h>
@@ -46,6 +45,7 @@
#include <wl_cfg80211.h>

#define EPI_VERSION_STR "4.218.248.5"
+#define ETHER_TYPE_BRCM 0x886c

#if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC)
#include <linux/wifi_tiwlan.h>
@@ -247,7 +247,7 @@ typedef struct dhd_info {
struct semaphore sysioc_sem;
bool set_multicast;
bool set_macaddress;
- struct ether_addr macvalue;
+ u8 macvalue[ETH_ALEN];
wait_queue_head_t ctrl_wait;
atomic_t pend_8021x_cnt;

@@ -803,7 +803,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
}

static int
-_dhd_set_mac_address(dhd_info_t *dhd, int ifidx, struct ether_addr *addr)
+_dhd_set_mac_address(dhd_info_t *dhd, int ifidx, u8 addr[ETH_ALEN])
{
char buf[32];
wl_ioctl_t ioc;
@@ -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, ETH_ALEN, buf, 32)) {
+ ("cur_etheraddr", addr, ETH_ALEN, buf, 32)) {
DHD_ERROR(("%s: mkiovar failed for cur_etheraddr\n",
dhd_ifname(&dhd->pub, ifidx)));
return -1;
@@ -976,7 +976,7 @@ static int _dhd_sysioc_thread(void *data)
if (dhd->set_macaddress) {
dhd->set_macaddress = false;
_dhd_set_mac_address(dhd, i,
- &dhd->macvalue);
+ dhd->macvalue);
}
}
}
@@ -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, ETH_ALEN);
+ memcpy(dhd->macvalue, sa->sa_data, ETH_ALEN);
dhd->set_macaddress = true;
up(&dhd->sysioc_sem);

@@ -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, ETH_ALEN);
+ memcpy(net->dev_addr, dhd->pub.mac, ETH_ALEN);

#ifdef TOE
/* Get current TOE mode from dongle */
@@ -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, ETH_ALEN);
+ memcpy(temp_addr, dhd->pub.mac, ETH_ALEN);

}

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 11680ee..13cd15c 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -44,7 +44,6 @@
#include <sbsdpcmdev.h>
#include <bcmsdpcm.h>

-#include <proto/ethernet.h>
#include <proto/802.1d.h>
#include <proto/802.11.h>

diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index 6f7277d..b4384f0 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -20,7 +20,6 @@

#include <bcmutils.h>
#include <bcmendian.h>
-#include <proto/ethernet.h>

#include <asm/uaccess.h>

@@ -648,7 +647,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, ETH_ALEN);
+ memset(params->bssid, 255, ETH_ALEN);
params->bss_type = DOT11_BSSTYPE_ANY;
params->scan_type = 0;
params->nprobes = -1;
@@ -1042,9 +1041,9 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
memcpy(join_params.ssid.SSID, params->ssid, params->ssid_len);
join_params.ssid.SSID_len = htod32(params->ssid_len);
if (params->bssid)
- memcpy(&join_params.params.bssid, params->bssid, ETH_ALEN);
+ memcpy(join_params.params.bssid, params->bssid, ETH_ALEN);
else
- memset(&join_params.params.bssid, 0, ETH_ALEN);
+ memset(join_params.params.bssid, 0, ETH_ALEN);

err = wl_dev_ioctl(dev, WLC_SET_SSID, &join_params,
sizeof(join_params));
@@ -1371,7 +1370,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, ETH_ALEN);
+ memset(join_params.params.bssid, 255, ETH_ALEN);

wl_ch_to_chanspec(wl->channel, &join_params, &join_params_size);
WL_DBG("join_param_size %d\n", join_params_size);
@@ -1404,7 +1403,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, ETH_ALEN);
+ memcpy(scbval.ea, wl->bssid, ETH_ALEN);
scbval.val = htod32(scbval.val);
err = wl_dev_ioctl(dev, WLC_DISASSOC, &scbval,
sizeof(scb_val_t));
@@ -1531,7 +1530,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(&key.ea, mac_addr, ETH_ALEN);
+ memcpy(key.ea, mac_addr, ETH_ALEN);
key.len = (u32) params->key_len;
/* check for key index change */
if (key.len == 0) {
@@ -2003,7 +2002,7 @@ wl_update_pmklist(struct net_device *dev, struct wl_pmk_list *pmk_list,
WL_DBG("No of elements %d\n", pmk_list->pmkids.npmkid);
for (i = 0; i < pmk_list->pmkids.npmkid; i++) {
WL_DBG("PMKID[%d]: %pM =\n", i,
- &pmk_list->pmkids.pmkid[i].BSSID);
+ pmk_list->pmkids.pmkid[i].BSSID);
for (j = 0; j < WPA2_PMKID_LEN; j++) {
WL_DBG("%02x\n", pmk_list->pmkids.pmkid[i].PMKID[j]);
}
@@ -2026,11 +2025,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,
+ if (!memcmp(pmksa->bssid, wl->pmk_list->pmkids.pmkid[i].BSSID,
ETH_ALEN))
break;
if (i < WL_NUM_PMKIDS_MAX) {
- memcpy(&wl->pmk_list->pmkids.pmkid[i].BSSID, pmksa->bssid,
+ memcpy(wl->pmk_list->pmkids.pmkid[i].BSSID, pmksa->bssid,
ETH_ALEN);
memcpy(&wl->pmk_list->pmkids.pmkid[i].PMKID, pmksa->pmkid,
WPA2_PMKID_LEN);
@@ -2040,7 +2039,7 @@ wl_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
err = -EINVAL;
}
WL_DBG("set_pmksa,IW_PMKSA_ADD - PMKID: %pM =\n",
- &wl->pmk_list->pmkids.pmkid[wl->pmk_list->pmkids.npmkid].BSSID);
+ wl->pmk_list->pmkids.pmkid[wl->pmk_list->pmkids.npmkid].BSSID);
for (i = 0; i < WPA2_PMKID_LEN; i++) {
WL_DBG("%02x\n",
wl->pmk_list->pmkids.pmkid[wl->pmk_list->pmkids.npmkid].
@@ -2062,18 +2061,18 @@ wl_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
int i;

CHECK_SYS_UP();
- memcpy(&pmkid.pmkid[0].BSSID, pmksa->bssid, ETH_ALEN);
+ 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",
- &pmkid.pmkid[0].BSSID);
+ pmkid.pmkid[0].BSSID);
for (i = 0; i < WPA2_PMKID_LEN; i++) {
WL_DBG("%02x\n", pmkid.pmkid[0].PMKID[i]);
}

for (i = 0; i < wl->pmk_list->pmkids.npmkid; i++)
if (!memcmp
- (pmksa->bssid, &wl->pmk_list->pmkids.pmkid[i].BSSID,
+ (pmksa->bssid, wl->pmk_list->pmkids.pmkid[i].BSSID,
ETH_ALEN))
break;

@@ -2081,8 +2080,8 @@ wl_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
&& (i < wl->pmk_list->pmkids.npmkid)) {
memset(&wl->pmk_list->pmkids.pmkid[i], 0, sizeof(pmkid_t));
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,
+ memcpy(wl->pmk_list->pmkids.pmkid[i].BSSID,
+ wl->pmk_list->pmkids.pmkid[i + 1].BSSID,
ETH_ALEN);
memcpy(&wl->pmk_list->pmkids.pmkid[i].PMKID,
&wl->pmk_list->pmkids.pmkid[i + 1].PMKID,
@@ -2282,7 +2281,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, ETH_ALEN);
+ 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)) {
@@ -2317,7 +2316,7 @@ static s32 wl_inform_single_bss(struct wl_priv *wl, struct wl_bss_info *bi)
WL_DBG("SSID : \"%s\", rssi %d, channel %d, capability : 0x04%x, bssid %pM\n",
bi->SSID,
notif_bss_info->rssi, notif_bss_info->channel,
- mgmt->u.beacon.capab_info, &bi->BSSID);
+ mgmt->u.beacon.capab_info, bi->BSSID);

signal = notif_bss_info->rssi * 100;
if (unlikely(!cfg80211_inform_bss_frame(wiphy, channel, mgmt,
@@ -2390,8 +2389,7 @@ wl_notify_connect_status(struct wl_priv *wl, struct net_device *ndev,
if (wl_is_linkup(wl, e)) {
wl_link_up(wl);
if (wl_is_ibssmode(wl)) {
- cfg80211_ibss_joined(ndev, (s8 *)&e->addr,
- GFP_KERNEL);
+ cfg80211_ibss_joined(ndev, e->addr, GFP_KERNEL);
WL_DBG("joined in IBSS network\n");
} else {
wl_bss_connect_done(wl, ndev, e, data, true);
@@ -2562,7 +2560,7 @@ static s32 wl_update_bss_info(struct wl_priv *wl)

ssid = (struct wlc_ssid *)wl_read_prof(wl, WL_PROF_SSID);
bss =
- cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid,
+ cfg80211_get_bss(wl_to_wiphy(wl), NULL, wl->bssid,
ssid->SSID, ssid->SSID_len, WLAN_CAPABILITY_ESS,
WLAN_CAPABILITY_ESS);

@@ -2577,7 +2575,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, ETH_ALEN))) {
+ if (unlikely(memcmp(bi->BSSID, wl->bssid, ETH_ALEN))) {
err = -EIO;
goto update_bss_info_out;
}
@@ -2629,10 +2627,10 @@ 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, ETH_ALEN);
+ memcpy(wl->bssid, e->addr, ETH_ALEN);
wl_update_bss_info(wl);
cfg80211_roamed(ndev,
- (u8 *)&wl->bssid,
+ wl->bssid,
conn_info->req_ie, conn_info->req_ie_len,
conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL);
WL_DBG("Report roaming result\n");
@@ -2650,11 +2648,11 @@ 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, ETH_ALEN);
+ 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,
- (u8 *)&wl->bssid,
+ wl->bssid,
conn_info->req_ie,
conn_info->req_ie_len,
conn_info->resp_ie,
@@ -2665,7 +2663,7 @@ wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
completed ? "succeeded" : "failed");
} else {
cfg80211_roamed(ndev,
- (u8 *)&wl->bssid,
+ wl->bssid,
conn_info->req_ie, conn_info->req_ie_len,
conn_info->resp_ie, conn_info->resp_ie_len,
GFP_KERNEL);
@@ -2689,7 +2687,7 @@ wl_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
else
key_type = NL80211_KEYTYPE_PAIRWISE;

- cfg80211_michael_mic_failure(ndev, (u8 *)&e->addr, key_type, -1,
+ cfg80211_michael_mic_failure(ndev, e->addr, key_type, -1,
NULL, GFP_KERNEL);
rtnl_unlock();

@@ -3899,7 +3897,7 @@ static void *wl_read_prof(struct wl_priv *wl, s32 item)
case WL_PROF_ACT:
return &wl->profile->active;
case WL_PROF_BSSID:
- return &wl->profile->bssid;
+ return wl->profile->bssid;
case WL_PROF_SSID:
return &wl->profile->ssid;
}
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
index 482691b..b7e2e59 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
@@ -20,7 +20,6 @@
#include <linux/wireless.h>
#include <linux/wireless.h>
#include <net/cfg80211.h>
-#include <proto/ethernet.h>
#include <wlioctl.h>

struct wl_conf;
@@ -316,7 +315,7 @@ struct wl_priv {
cfg80211 layer */
struct wl_ie ie; /* information element object for
internal purpose */
- struct ether_addr bssid; /* bssid of currently engaged network */
+ u8 bssid[ETH_ALEN]; /* bssid of currently engaged network */
struct semaphore event_sync; /* for synchronization of main event
thread */
struct wl_profile *profile; /* holding dongle profile */
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_iw.c b/drivers/staging/brcm80211/brcmfmac/wl_iw.c
index fbee070..1932bd9 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_iw.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_iw.c
@@ -23,7 +23,6 @@

#include <bcmutils.h>
#include <bcmendian.h>
-#include <proto/ethernet.h>

#include <linux/if_arp.h>
#include <asm/uaccess.h>
@@ -35,7 +34,6 @@
typedef const struct si_pub si_t;
#include <wlioctl.h>

-#include <proto/ethernet.h>
#include <dngl_stats.h>
#include <dhd.h>

@@ -688,9 +686,9 @@ wl_iw_set_spy(struct net_device *dev,
if (!extra)
return -EINVAL;

- iw->spy_num = min_t(int, ARRAY_SIZE(iw->spy_addr), dwrq->length);
+ iw->spy_num = min_t(int, IW_MAX_SPY, dwrq->length);
for (i = 0; i < iw->spy_num; i++)
- memcpy(&iw->spy_addr[i], addr[i].sa_data, ETH_ALEN);
+ memcpy(iw->spy_addr[i], addr[i].sa_data, ETH_ALEN);
memset(iw->spy_qual, 0, sizeof(iw->spy_qual));

return 0;
@@ -712,7 +710,7 @@ wl_iw_get_spy(struct net_device *dev,

dwrq->length = iw->spy_num;
for (i = 0; i < iw->spy_num; i++) {
- memcpy(addr[i].sa_data, &iw->spy_addr[i], ETH_ALEN);
+ memcpy(addr[i].sa_data, iw->spy_addr[i], ETH_ALEN);
addr[i].sa_family = AF_UNIX;
memcpy(&qual[i], &iw->spy_qual[i], sizeof(struct iw_quality));
iw->spy_qual[i].updated = 0;
@@ -785,7 +783,7 @@ wl_iw_set_wap(struct net_device *dev,

memcpy(join_params.ssid.SSID, g_ssid.SSID, g_ssid.SSID_len);
join_params.ssid.SSID_len = htod32(g_ssid.SSID_len);
- memcpy(&join_params.params.bssid, awrq->sa_data, ETH_ALEN);
+ memcpy(join_params.params.bssid, awrq->sa_data, ETH_ALEN);

WL_TRACE("%s target_channel=%d\n",
__func__, g_wl_iw_params.target_channel);
@@ -840,7 +838,7 @@ wl_iw_mlme(struct net_device *dev,
}

scbval.val = mlme->reason_code;
- memcpy(&scbval.ea, &mlme->addr.sa_data, ETH_ALEN);
+ memcpy(scbval.ea, mlme->addr.sa_data, ETH_ALEN);

if (mlme->cmd == IW_MLME_DISASSOC) {
scbval.val = htod32(scbval.val);
@@ -911,7 +909,7 @@ wl_iw_get_aplist(struct net_device *dev,
if (!(dtoh16(bi->capability) & DOT11_CAP_ESS))
continue;

- memcpy(addr[dwrq->length].sa_data, &bi->BSSID, ETH_ALEN);
+ memcpy(addr[dwrq->length].sa_data, bi->BSSID, ETH_ALEN);
addr[dwrq->length].sa_family = ARPHRD_ETHER;
qual[dwrq->length].qual = rssi_to_qual(dtoh16(bi->RSSI));
qual[dwrq->length].level = 0x100 + dtoh16(bi->RSSI);
@@ -983,7 +981,7 @@ wl_iw_iscan_get_aplist(struct net_device *dev,
if (!(dtoh16(bi->capability) & DOT11_CAP_ESS))
continue;

- memcpy(addr[dwrq->length].sa_data, &bi->BSSID,
+ memcpy(addr[dwrq->length].sa_data, bi->BSSID,
ETH_ALEN);
addr[dwrq->length].sa_family = ARPHRD_ETHER;
qual[dwrq->length].qual =
@@ -1015,7 +1013,7 @@ static int wl_iw_iscan_prep(wl_scan_params_t *params, wlc_ssid_t *ssid)
{
int err = 0;

- memcpy(&params->bssid, &ether_bcast, ETH_ALEN);
+ memset(params->bssid, 255, ETH_ALEN);
params->bss_type = DOT11_BSSTYPE_ANY;
params->scan_type = 0;
params->nprobes = -1;
@@ -1512,7 +1510,7 @@ wl_iw_get_scan_prep(wl_scan_results_t *list,

iwe.cmd = SIOCGIWAP;
iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
- memcpy(iwe.u.ap_addr.sa_data, &bi->BSSID, ETH_ALEN);
+ memcpy(iwe.u.ap_addr.sa_data, bi->BSSID, ETH_ALEN);
event =
IWE_STREAM_ADD_EVENT(info, event, end, &iwe,
IW_EV_ADDR_LEN);
@@ -1781,8 +1779,7 @@ wl_iw_iscan_get_scan(struct net_device *dev,
return -E2BIG;
iwe.cmd = SIOCGIWAP;
iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
- memcpy(iwe.u.ap_addr.sa_data, &bi->BSSID,
- ETH_ALEN);
+ memcpy(iwe.u.ap_addr.sa_data, bi->BSSID, ETH_ALEN);
event =
IWE_STREAM_ADD_EVENT(info, event, end, &iwe,
IW_EV_ADDR_LEN);
@@ -1919,7 +1916,7 @@ wl_iw_set_essid(struct net_device *dev,

memcpy(&join_params.ssid.SSID, g_ssid.SSID, g_ssid.SSID_len);
join_params.ssid.SSID_len = htod32(g_ssid.SSID_len);
- memcpy(&join_params.params.bssid, &ether_bcast, ETH_ALEN);
+ memset(join_params.params.bssid, 255, ETH_ALEN);

wl_iw_ch_to_chanspec(g_wl_iw_params.target_channel, &join_params,
&join_params_size);
@@ -2545,7 +2542,7 @@ wl_iw_set_encodeext(struct net_device *dev,
key.len = iwe->key_len;

if (!is_multicast_ether_addr(iwe->addr.sa_data))
- memcpy(&key.ea, &iwe->addr.sa_data, ETH_ALEN);
+ memcpy(key.ea, iwe->addr.sa_data, ETH_ALEN);

if (key.len == 0) {
if (iwe->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
@@ -2650,13 +2647,13 @@ wl_iw_set_pmksa(struct net_device *dev,
uint j;
pmkidptr = &pmkid;

- memcpy(&pmkidptr->pmkid[0].BSSID,
+ memcpy(pmkidptr->pmkid[0].BSSID,
&iwpmksa->bssid.sa_data[0], ETH_ALEN);
memcpy(&pmkidptr->pmkid[0].PMKID,
&iwpmksa->pmkid[0], WPA2_PMKID_LEN);

WL_WSEC("wl_iw_set_pmksa:IW_PMKSA_REMOVE:PMKID: %pM = ",
- &pmkidptr->pmkid[0].BSSID);
+ pmkidptr->pmkid[0].BSSID);
for (j = 0; j < WPA2_PMKID_LEN; j++)
WL_WSEC("%02x ", pmkidptr->pmkid[0].PMKID[j]);
WL_WSEC("\n");
@@ -2665,15 +2662,15 @@ wl_iw_set_pmksa(struct net_device *dev,
for (i = 0; i < pmkid_list.pmkids.npmkid; i++)
if (!memcmp
(&iwpmksa->bssid.sa_data[0],
- &pmkid_list.pmkids.pmkid[i].BSSID, ETH_ALEN))
+ pmkid_list.pmkids.pmkid[i].BSSID, ETH_ALEN))
break;

if ((pmkid_list.pmkids.npmkid > 0)
&& (i < pmkid_list.pmkids.npmkid)) {
memset(&pmkid_list.pmkids.pmkid[i], 0, sizeof(pmkid_t));
for (; i < (pmkid_list.pmkids.npmkid - 1); i++) {
- memcpy(&pmkid_list.pmkids.pmkid[i].BSSID,
- &pmkid_list.pmkids.pmkid[i + 1].BSSID,
+ memcpy(pmkid_list.pmkids.pmkid[i].BSSID,
+ pmkid_list.pmkids.pmkid[i + 1].BSSID,
ETH_ALEN);
memcpy(&pmkid_list.pmkids.pmkid[i].PMKID,
&pmkid_list.pmkids.pmkid[i + 1].PMKID,
@@ -2688,10 +2685,10 @@ wl_iw_set_pmksa(struct net_device *dev,
for (i = 0; i < pmkid_list.pmkids.npmkid; i++)
if (!memcmp
(&iwpmksa->bssid.sa_data[0],
- &pmkid_list.pmkids.pmkid[i].BSSID, ETH_ALEN))
+ pmkid_list.pmkids.pmkid[i].BSSID, ETH_ALEN))
break;
if (i < MAXPMKID) {
- memcpy(&pmkid_list.pmkids.pmkid[i].BSSID,
+ memcpy(pmkid_list.pmkids.pmkid[i].BSSID,
&iwpmksa->bssid.sa_data[0],
ETH_ALEN);
memcpy(&pmkid_list.pmkids.pmkid[i].PMKID,
@@ -2706,7 +2703,7 @@ wl_iw_set_pmksa(struct net_device *dev,
uint k;
k = pmkid_list.pmkids.npmkid;
WL_WSEC("wl_iw_set_pmksa,IW_PMKSA_ADD - PMKID: %pM = ",
- &pmkid_list.pmkids.pmkid[k].BSSID);
+ pmkid_list.pmkids.pmkid[k].BSSID);
for (j = 0; j < WPA2_PMKID_LEN; j++)
WL_WSEC("%02x ",
pmkid_list.pmkids.pmkid[k].PMKID[j]);
@@ -2718,7 +2715,7 @@ wl_iw_set_pmksa(struct net_device *dev,
for (i = 0; i < pmkid_list.pmkids.npmkid; i++) {
uint j;
WL_WSEC("PMKID[%d]: %pM = ",
- i, &pmkid_list.pmkids.pmkid[i].BSSID);
+ i, pmkid_list.pmkids.pmkid[i].BSSID);
for (j = 0; j < WPA2_PMKID_LEN; j++)
WL_WSEC("%02x ", pmkid_list.pmkids.pmkid[i].PMKID[j]);
WL_WSEC("\n");
@@ -3482,8 +3479,8 @@ void wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void *data)
if (pmkidcand->preauth)
iwpmkidcand->flags |=
IW_PMKID_CAND_PREAUTH;
- memcpy(&iwpmkidcand->bssid.sa_data,
- &pmkidcand->BSSID,
+ memcpy(iwpmkidcand->bssid.sa_data,
+ pmkidcand->BSSID,
ETH_ALEN);
#ifndef SANDGATE2G
wireless_send_event(dev, cmd, &wrqu,
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_iw.h b/drivers/staging/brcm80211/brcmfmac/wl_iw.h
index c8637c5..08e11fb 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_iw.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_iw.h
@@ -19,7 +19,6 @@

#include <linux/wireless.h>

-#include <proto/ethernet.h>
#include <wlioctl.h>

#define WL_SCAN_PARAMS_SSID_MAX 10
@@ -92,7 +91,7 @@ typedef struct wl_iw {
u32 gwsec;
bool privacy_invoked;

- struct ether_addr spy_addr[IW_MAX_SPY];
+ u8 spy_addr[IW_MAX_SPY][ETH_ALEN];
struct iw_quality spy_qual[IW_MAX_SPY];
void *wlinfo;
dhd_pub_t *pub;
diff --git a/drivers/staging/brcm80211/include/bcmcdc.h b/drivers/staging/brcm80211/include/bcmcdc.h
index 10c1ddc..6dbc94c 100644
--- a/drivers/staging/brcm80211/include/bcmcdc.h
+++ b/drivers/staging/brcm80211/include/bcmcdc.h
@@ -13,7 +13,7 @@
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <proto/ethernet.h>
+#include <linux/if_ether.h>

typedef struct cdc_ioctl {
u32 cmd; /* ioctl command value */
@@ -24,7 +24,7 @@ typedef struct cdc_ioctl {
} cdc_ioctl_t;

/* Max valid buffer size that can be sent to the dongle */
-#define CDC_MAX_MSG_SIZE ETHER_MAX_LEN
+#define CDC_MAX_MSG_SIZE (ETH_FRAME_LEN + ETH_FCS_LEN)

/* len field is divided into input and output buffer lengths */
#define CDCL_IOC_OUTLEN_MASK 0x0000FFFF /* maximum or expected
diff --git a/drivers/staging/brcm80211/include/bcmutils.h b/drivers/staging/brcm80211/include/bcmutils.h
index a8f76d8..58a170e 100644
--- a/drivers/staging/brcm80211/include/bcmutils.h
+++ b/drivers/staging/brcm80211/include/bcmutils.h
@@ -17,6 +17,8 @@
#ifndef _bcmutils_h_
#define _bcmutils_h_

+#include <linux/if_ether.h>
+
/* Buffer structure for collecting string-formatted data
* using bcm_bprintf() API.
* Use bcm_binit() to initialize before use
@@ -88,8 +90,6 @@

/* forward definition of ether_addr structure used by some function prototypes */

- struct ether_addr;
-
extern int ether_isbcast(const void *ea);
extern int ether_isnulladdr(const void *ea);

@@ -157,7 +157,7 @@ extern struct sk_buff *pktq_mdeq(struct pktq *pq, uint prec_bmp, int *prec_out);
extern uint pkttotlen(struct osl_info *osh, struct sk_buff *p);

/* ethernet address */
- extern int bcm_ether_atoe(char *p, struct ether_addr *ea);
+ extern int bcm_ether_atoe(char *p, u8 ea[ETH_ALEN]);

/* ip address */
struct ipv4_addr;
diff --git a/drivers/staging/brcm80211/include/proto/bcmevent.h b/drivers/staging/brcm80211/include/proto/bcmevent.h
index f61c048..5802ea0 100644
--- a/drivers/staging/brcm80211/include/proto/bcmevent.h
+++ b/drivers/staging/brcm80211/include/proto/bcmevent.h
@@ -34,7 +34,7 @@ typedef BWL_PRE_PACKED_STRUCT struct {
u32 reason;
u32 auth_type;
u32 datalen;
- struct ether_addr addr;
+ u8 addr[ETH_ALEN];
char ifname[BCM_MSG_IFNAME_MAX];
} BWL_POST_PACKED_STRUCT wl_event_msg_t;

diff --git a/drivers/staging/brcm80211/include/proto/ethernet.h b/drivers/staging/brcm80211/include/proto/ethernet.h
deleted file mode 100644
index 1176df9..0000000
--- a/drivers/staging/brcm80211/include/proto/ethernet.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _NET_ETHERNET_H_
-#define _NET_ETHERNET_H_
-
-#include <linux/if_ether.h>
-
-#include <packed_section_start.h>
-
-#define ETHER_MAX_LEN 1518
-
-#define ETHER_TYPE_BRCM 0x886c
-
-BWL_PRE_PACKED_STRUCT struct ether_addr {
- u8 octet[ETH_ALEN];
-} BWL_POST_PACKED_STRUCT;
-
-static const struct ether_addr ether_bcast = { {255, 255, 255, 255, 255, 255} };
-
-#include <packed_section_end.h>
-
-#endif /* _NET_ETHERNET_H_ */
diff --git a/drivers/staging/brcm80211/include/proto/wpa.h b/drivers/staging/brcm80211/include/proto/wpa.h
index 10c2fb6..5ffcffd 100644
--- a/drivers/staging/brcm80211/include/proto/wpa.h
+++ b/drivers/staging/brcm80211/include/proto/wpa.h
@@ -17,8 +17,6 @@
#ifndef _proto_wpa_h_
#define _proto_wpa_h_

-#include <proto/ethernet.h>
-
#define WPA2_PMKID_LEN 16
#define RSN_CAP_1_REPLAY_CNTR 0
#define RSN_CAP_2_REPLAY_CNTRS 1
diff --git a/drivers/staging/brcm80211/include/wlioctl.h b/drivers/staging/brcm80211/include/wlioctl.h
index 9be793c..523ebd0 100644
--- a/drivers/staging/brcm80211/include/wlioctl.h
+++ b/drivers/staging/brcm80211/include/wlioctl.h
@@ -17,7 +17,6 @@
#ifndef _wlioctl_h_
#define _wlioctl_h_

-#include <proto/ethernet.h>
#ifdef BRCM_FULLMAC
#include <proto/bcmeth.h>
#endif
@@ -46,7 +45,7 @@ typedef struct wl_bss_info {
u32 length; /* byte length of data in this record,
* starting at version and including IEs
*/
- struct ether_addr BSSID;
+ u8 BSSID[ETH_ALEN];
u16 beacon_period; /* units are Kusec */
u16 capability; /* Capability information */
u8 SSID_len;
@@ -128,7 +127,7 @@ typedef struct wl_extdscan_params {

typedef struct wl_scan_params {
wlc_ssid_t ssid; /* default: {0, ""} */
- struct ether_addr bssid; /* default: bcast */
+ u8 bssid[ETH_ALEN]; /* default: bcast */
s8 bss_type; /* default: any,
* DOT11_BSSTYPE_ANY/INFRASTRUCTURE/INDEPENDENT
*/
@@ -234,8 +233,8 @@ typedef struct wl_iscan_results {

typedef struct wl_probe_params {
wlc_ssid_t ssid;
- struct ether_addr bssid;
- struct ether_addr mac;
+ u8 bssid[ETH_ALEN];
+ u8 mac[ETH_ALEN];
} wl_probe_params_t;
#endif /* BRCM_FULLMAC */

@@ -262,7 +261,7 @@ typedef struct wl_u32_list {

/* used for association with a specific BSSID and chanspec list */
typedef struct wl_assoc_params {
- struct ether_addr bssid; /* 00:00:00:00:00:00: broadcast scan */
+ u8 bssid[ETH_ALEN]; /* 00:00:00:00:00:00: broadcast scan */
s32 chanspec_num; /* 0: all available channels,
* otherwise count of chanspecs in chanspec_list
*/
@@ -492,7 +491,7 @@ typedef struct wl_wsec_key {
u16 lo; /* lower 16 bits of IV */
} rxiv;
u32 pad_5[2];
- struct ether_addr ea; /* per station */
+ u8 ea[ETH_ALEN]; /* per station */
} wl_wsec_key_t;

#define WSEC_MIN_PSK_LEN 8
@@ -534,7 +533,7 @@ typedef struct {
#define MAXPMKID 16

typedef struct _pmkid {
- struct ether_addr BSSID;
+ u8 BSSID[ETH_ALEN];
u8 PMKID[WPA2_PMKID_LEN];
} pmkid_t;

@@ -544,7 +543,7 @@ typedef struct _pmkid_list {
} pmkid_list_t;

typedef struct _pmkid_cand {
- struct ether_addr BSSID;
+ u8 BSSID[ETH_ALEN];
u8 preauth;
} pmkid_cand_t;

@@ -572,7 +571,7 @@ typedef struct {
/* Used to get specific STA parameters */
typedef struct {
u32 val;
- struct ether_addr ea;
+ u8 ea[ETH_ALEN];
} scb_val_t;
#endif /* BRCM_FULLMAC */

@@ -586,7 +585,7 @@ typedef struct channel_info {
/* For ioctls that take a list of MAC addresses */
struct maclist {
uint count; /* number of MAC addresses */
- struct ether_addr ea[1]; /* variable length array of MAC addresses */
+ u8 ea[1][ETH_ALEN]; /* variable length array of MAC addresses */
};

/* get pkt count struct passed through ioctl */
@@ -1614,7 +1613,7 @@ struct ampdu_tid_control {

/* structure for identifying ea/tid for sending addba/delba */
struct ampdu_ea_tid {
- struct ether_addr ea; /* Station address */
+ u8 ea[ETH_ALEN]; /* Station address */
u8 tid; /* tid */
};
/* structure for identifying retry/tid for retry_limit_tid/rr_retry_limit_tid */
diff --git a/drivers/staging/brcm80211/sys/wl_mac80211.c b/drivers/staging/brcm80211/sys/wl_mac80211.c
index c1c9711..bc7312f 100644
--- a/drivers/staging/brcm80211/sys/wl_mac80211.c
+++ b/drivers/staging/brcm80211/sys/wl_mac80211.c
@@ -400,7 +400,7 @@ wl_ops_bss_info_changed(struct ieee80211_hw *hw,
/* BSSID changed, for whatever reason (IBSS and managed mode) */
/* FIXME: need to store bssid in bsscfg */
wlc_set_addrmatch(wl->wlc, RCM_BSSID_OFFSET,
- (struct ether_addr *)info->bssid);
+ info->bssid);
}
if (changed & BSS_CHANGED_BEACON) {
WL_ERROR("BSS_CHANGED_BEACON\n");
@@ -762,7 +762,7 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs,
goto fail;
}

- memcpy(perm, &wl->pub->cur_etheraddr, ETH_ALEN);
+ memcpy(perm, wl->pub->cur_etheraddr, ETH_ALEN);
ASSERT(is_valid_ether_addr(perm));
SET_IEEE80211_PERM_ADDR(hw, perm);

diff --git a/drivers/staging/brcm80211/sys/wlc_alloc.c b/drivers/staging/brcm80211/sys/wlc_alloc.c
index 746439e..baf30c6 100644
--- a/drivers/staging/brcm80211/sys/wlc_alloc.c
+++ b/drivers/staging/brcm80211/sys/wlc_alloc.c
@@ -86,13 +86,6 @@ static struct wlc_pub *wlc_pub_malloc(struct osl_info *osh, uint unit,
/* need to init the tunables now */
wlc_tunables_init(pub->tunables, devid);

- pub->multicast = (struct ether_addr *)wlc_calloc(osh, unit,
- (sizeof(struct ether_addr) * MAXMULTILIST));
- if (pub->multicast == NULL) {
- *err = 1003;
- goto fail;
- }
-
return pub;

fail:
@@ -105,8 +98,6 @@ static void wlc_pub_mfree(struct osl_info *osh, struct wlc_pub *pub)
if (pub == NULL)
return;

- if (pub->multicast)
- kfree(pub->multicast);
if (pub->tunables) {
kfree(pub->tunables);
pub->tunables = NULL;
@@ -140,11 +131,6 @@ void wlc_bsscfg_mfree(struct osl_info *osh, wlc_bsscfg_t *cfg)
if (cfg == NULL)
return;

- if (cfg->maclist) {
- kfree(cfg->maclist);
- cfg->maclist = NULL;
- }
-
if (cfg->current_bss != NULL) {
wlc_bss_info_t *current_bss = cfg->current_bss;
if (current_bss->bcn_prb != NULL)
diff --git a/drivers/staging/brcm80211/sys/wlc_ampdu.c b/drivers/staging/brcm80211/sys/wlc_ampdu.c
index dcc2969..cface48 100644
--- a/drivers/staging/brcm80211/sys/wlc_ampdu.c
+++ b/drivers/staging/brcm80211/sys/wlc_ampdu.c
@@ -1329,7 +1329,7 @@ void wlc_ampdu_macaddr_upd(struct wlc_info *wlc)

/* driver needs to write the ta in the template; ta is at offset 16 */
memset(template, 0, sizeof(template));
- memcpy(template, wlc->pub->cur_etheraddr.octet, ETH_ALEN);
+ memcpy(template, wlc->pub->cur_etheraddr, ETH_ALEN);
wlc_write_template_ram(wlc, (T_BA_TPL_BASE + 16), (T_RAM_ACCESS_SZ * 2),
template);
}
diff --git a/drivers/staging/brcm80211/sys/wlc_bmac.c b/drivers/staging/brcm80211/sys/wlc_bmac.c
index a74d2a1..c24fbdc 100644
--- a/drivers/staging/brcm80211/sys/wlc_bmac.c
+++ b/drivers/staging/brcm80211/sys/wlc_bmac.c
@@ -1032,9 +1032,9 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
err = 21;
goto fail;
}
- bcm_ether_atoe(macaddr, &wlc_hw->etheraddr);
- if (is_broadcast_ether_addr(wlc_hw->etheraddr.octet) ||
- is_zero_ether_addr(wlc_hw->etheraddr.octet)) {
+ bcm_ether_atoe(macaddr, wlc_hw->etheraddr);
+ if (is_broadcast_ether_addr(wlc_hw->etheraddr) ||
+ is_zero_ether_addr(wlc_hw->etheraddr)) {
WL_ERROR("wl%d: wlc_bmac_attach: bad macaddr %s\n",
unit, macaddr);
err = 22;
@@ -1348,15 +1348,15 @@ void wlc_bmac_wait_for_wake(struct wlc_hw_info *wlc_hw)
ASSERT(wlc_bmac_read_shm(wlc_hw, M_UCODE_DBGST) != DBGST_ASLEEP);
}

-void wlc_bmac_hw_etheraddr(struct wlc_hw_info *wlc_hw, struct ether_addr *ea)
+void wlc_bmac_hw_etheraddr(struct wlc_hw_info *wlc_hw, u8 ea[ETH_ALEN])
{
- memcpy(ea, &wlc_hw->etheraddr, ETH_ALEN);
+ memcpy(ea, wlc_hw->etheraddr, ETH_ALEN);
}

void wlc_bmac_set_hw_etheraddr(struct wlc_hw_info *wlc_hw,
- struct ether_addr *ea)
+ u8 ea[ETH_ALEN])
{
- memcpy(&wlc_hw->etheraddr, ea, ETH_ALEN);
+ memcpy(wlc_hw->etheraddr, ea, ETH_ALEN);
}

int wlc_bmac_bandtype(struct wlc_hw_info *wlc_hw)
@@ -1720,8 +1720,7 @@ static void wlc_ucode_mute_override_clear(struct wlc_hw_info *wlc_hw)
* Write a MAC address to the rcmta structure
*/
void
-wlc_bmac_set_rcmta(struct wlc_hw_info *wlc_hw, int idx,
- const struct ether_addr *addr)
+wlc_bmac_set_rcmta(struct wlc_hw_info *wlc_hw, int idx, const u8 addr[ETH_ALEN])
{
d11regs_t *regs = wlc_hw->regs;
volatile u16 *objdata16 = (volatile u16 *)&regs->objdata;
@@ -1733,11 +1732,8 @@ wlc_bmac_set_rcmta(struct wlc_hw_info *wlc_hw, int idx,

ASSERT(wlc_hw->corerev > 4);

- mac_hm =
- (addr->octet[3] << 24) | (addr->octet[2] << 16) | (addr->
- octet[1] << 8) |
- addr->octet[0];
- mac_l = (addr->octet[5] << 8) | addr->octet[4];
+ mac_hm = (addr[3] << 24) | (addr[2] << 16) | (addr[1] << 8) | addr[0];
+ mac_l = (addr[5] << 8) | addr[4];

osh = wlc_hw->osh;

@@ -1754,7 +1750,7 @@ wlc_bmac_set_rcmta(struct wlc_hw_info *wlc_hw, int idx,
*/
void
wlc_bmac_set_addrmatch(struct wlc_hw_info *wlc_hw, int match_reg_offset,
- const struct ether_addr *addr)
+ const u8 addr[ETH_ALEN])
{
d11regs_t *regs;
u16 mac_l;
@@ -1767,9 +1763,9 @@ wlc_bmac_set_addrmatch(struct wlc_hw_info *wlc_hw, int match_reg_offset,
ASSERT((match_reg_offset < RCM_SIZE) || (wlc_hw->corerev == 4));

regs = wlc_hw->regs;
- mac_l = addr->octet[0] | (addr->octet[1] << 8);
- mac_m = addr->octet[2] | (addr->octet[3] << 8);
- mac_h = addr->octet[4] | (addr->octet[5] << 8);
+ mac_l = addr[0] | (addr[1] << 8);
+ mac_m = addr[2] | (addr[3] << 8);
+ mac_h = addr[4] | (addr[5] << 8);

osh = wlc_hw->osh;

@@ -3042,7 +3038,7 @@ void wlc_intrsrestore(struct wlc_info *wlc, u32 macintmask)

void wlc_bmac_mute(struct wlc_hw_info *wlc_hw, bool on, mbool flags)
{
- struct ether_addr null_ether_addr = { {0, 0, 0, 0, 0, 0} };
+ u8 null_ether_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0};

if (on) {
/* suspend tx fifos */
@@ -3053,7 +3049,7 @@ void wlc_bmac_mute(struct wlc_hw_info *wlc_hw, bool on, mbool flags)

/* zero the address match register so we do not send ACKs */
wlc_bmac_set_addrmatch(wlc_hw, RCM_MAC_OFFSET,
- &null_ether_addr);
+ null_ether_addr);
} else {
/* resume tx fifos */
if (!wlc_hw->wlc->tx_suspended) {
@@ -3065,7 +3061,7 @@ void wlc_bmac_mute(struct wlc_hw_info *wlc_hw, bool on, mbool flags)

/* Restore address */
wlc_bmac_set_addrmatch(wlc_hw, RCM_MAC_OFFSET,
- &wlc_hw->etheraddr);
+ wlc_hw->etheraddr);
}

wlc_phy_mute_upd(wlc_hw->band->pi, on, flags);
diff --git a/drivers/staging/brcm80211/sys/wlc_bmac.h b/drivers/staging/brcm80211/sys/wlc_bmac.h
index 98150aa..2e93e6c 100644
--- a/drivers/staging/brcm80211/sys/wlc_bmac.h
+++ b/drivers/staging/brcm80211/sys/wlc_bmac.h
@@ -201,12 +201,10 @@ extern void wlc_bmac_write_template_ram(struct wlc_hw_info *wlc_hw, int offset,
extern void wlc_bmac_copyfrom_vars(struct wlc_hw_info *wlc_hw, char **buf,
uint *len);

-extern void wlc_bmac_process_ps_switch(struct wlc_hw_info *wlc,
- struct ether_addr *ea, s8 ps_on);
extern void wlc_bmac_hw_etheraddr(struct wlc_hw_info *wlc_hw,
- struct ether_addr *ea);
+ u8 ea[ETH_ALEN]);
extern void wlc_bmac_set_hw_etheraddr(struct wlc_hw_info *wlc_hw,
- struct ether_addr *ea);
+ u8 ea[ETH_ALEN]);
extern bool wlc_bmac_validate_chip_access(struct wlc_hw_info *wlc_hw);

extern bool wlc_bmac_radio_read_hwdisabled(struct wlc_hw_info *wlc_hw);
@@ -227,10 +225,10 @@ extern void wlc_ucode_wake_override_clear(struct wlc_hw_info *wlc_hw,
u32 override_bit);

extern void wlc_bmac_set_rcmta(struct wlc_hw_info *wlc_hw, int idx,
- const struct ether_addr *addr);
+ const u8 addr[ETH_ALEN]);
extern void wlc_bmac_set_addrmatch(struct wlc_hw_info *wlc_hw,
int match_reg_offset,
- const struct ether_addr *addr);
+ const u8 addr[ETH_ALEN]);
extern void wlc_bmac_write_hw_bcntemplates(struct wlc_hw_info *wlc_hw,
void *bcn, int len, bool both);

diff --git a/drivers/staging/brcm80211/sys/wlc_bsscfg.h b/drivers/staging/brcm80211/sys/wlc_bsscfg.h
index d6a1971..3a5b55b 100644
--- a/drivers/staging/brcm80211/sys/wlc_bsscfg.h
+++ b/drivers/staging/brcm80211/sys/wlc_bsscfg.h
@@ -68,10 +68,6 @@ struct wlc_bsscfg {
s8 _idx; /* the index of this bsscfg,
* assigned at wlc_bsscfg_alloc()
*/
- /* MAC filter */
- uint nmac; /* # of entries on maclist array */
- int macmode; /* allow/deny stations on maclist array */
- struct ether_addr *maclist; /* list of source MAC addrs to match */

/* security */
u32 wsec; /* wireless security bitvec */
@@ -93,8 +89,8 @@ struct wlc_bsscfg {
u32 tk_cm_bt_tmstmp; /* Timestamp when TKIP BT is activated */
bool tk_cm_activate; /* activate countermeasures after EAPOL-Key sent */

- struct ether_addr BSSID; /* BSSID (associated) */
- struct ether_addr cur_etheraddr; /* h/w address */
+ u8 BSSID[ETH_ALEN]; /* BSSID (associated) */
+ u8 cur_etheraddr[ETH_ALEN]; /* h/w address */
u16 bcmc_fid; /* the last BCMC FID queued to TX_BCMC_FIFO */
u16 bcmc_fid_shm; /* the last BCMC FID written to shared mem */

diff --git a/drivers/staging/brcm80211/sys/wlc_key.h b/drivers/staging/brcm80211/sys/wlc_key.h
index 6678c69..3e23d51 100644
--- a/drivers/staging/brcm80211/sys/wlc_key.h
+++ b/drivers/staging/brcm80211/sys/wlc_key.h
@@ -87,7 +87,7 @@ typedef struct wsec_iv {
#define WLC_NUMRXIVS 16 /* # rx IVs (one per 802.11e TID) */

typedef struct wsec_key {
- struct ether_addr ea; /* per station */
+ u8 ea[ETH_ALEN]; /* per station */
u8 idx; /* key index in wsec_keys array */
u8 id; /* key ID [0-3] */
u8 algo; /* CRYPTO_ALGO_AES_CCM, CRYPTO_ALGO_WEP128, etc */
diff --git a/drivers/staging/brcm80211/sys/wlc_mac80211.c b/drivers/staging/brcm80211/sys/wlc_mac80211.c
index 8083244..35c5897 100644
--- a/drivers/staging/brcm80211/sys/wlc_mac80211.c
+++ b/drivers/staging/brcm80211/sys/wlc_mac80211.c
@@ -300,7 +300,7 @@ static int _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
struct wlc_if *wlcif);

#if defined(BCMDBG)
-void wlc_get_rcmta(struct wlc_info *wlc, int idx, struct ether_addr *addr)
+void wlc_get_rcmta(struct wlc_info *wlc, int idx, u8 addr[ETH_ALEN])
{
d11regs_t *regs = wlc->regs;
u32 v32;
@@ -315,15 +315,15 @@ void wlc_get_rcmta(struct wlc_info *wlc, int idx, struct ether_addr *addr)
W_REG(osh, &regs->objaddr, (OBJADDR_RCMTA_SEL | (idx * 2)));
(void)R_REG(osh, &regs->objaddr);
v32 = R_REG(osh, &regs->objdata);
- addr->octet[0] = (u8) v32;
- addr->octet[1] = (u8) (v32 >> 8);
- addr->octet[2] = (u8) (v32 >> 16);
- addr->octet[3] = (u8) (v32 >> 24);
+ addr[0] = (u8) v32;
+ addr[1] = (u8) (v32 >> 8);
+ addr[2] = (u8) (v32 >> 16);
+ addr[3] = (u8) (v32 >> 24);
W_REG(osh, &regs->objaddr, (OBJADDR_RCMTA_SEL | ((idx * 2) + 1)));
(void)R_REG(osh, &regs->objaddr);
v32 = R_REG(osh, (volatile u16 *)&regs->objdata);
- addr->octet[4] = (u8) v32;
- addr->octet[5] = (u8) (v32 >> 8);
+ addr[4] = (u8) v32;
+ addr[5] = (u8) (v32 >> 8);
}
#endif /* defined(BCMDBG) */

@@ -679,7 +679,7 @@ int wlc_set_mac(wlc_bsscfg_t *cfg)

if (cfg == wlc->cfg) {
/* enter the MAC addr into the RXE match registers */
- wlc_set_addrmatch(wlc, RCM_MAC_OFFSET, &cfg->cur_etheraddr);
+ wlc_set_addrmatch(wlc, RCM_MAC_OFFSET, cfg->cur_etheraddr);
}

wlc_ampdu_macaddr_upd(wlc);
@@ -696,7 +696,7 @@ void wlc_set_bssid(wlc_bsscfg_t *cfg)

/* if primary config, we need to update BSSID in RXE match registers */
if (cfg == wlc->cfg) {
- wlc_set_addrmatch(wlc, RCM_BSSID_OFFSET, &cfg->BSSID);
+ wlc_set_addrmatch(wlc, RCM_BSSID_OFFSET, cfg->BSSID);
}
#ifdef SUPPORT_HWKEYS
else if (BSSCFG_STA(cfg) && cfg->BSS) {
@@ -1728,7 +1728,6 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
ASSERT(WSEC_MAX_DEFAULT_KEYS == WLC_DEFAULT_KEYS);

/* some code depends on packed structures */
- ASSERT(sizeof(struct ether_addr) == ETH_ALEN);
ASSERT(sizeof(struct ethhdr) == ETH_HLEN);
ASSERT(sizeof(d11regs_t) == SI_CORE_SIZE);
ASSERT(sizeof(ofdm_phy_hdr_t) == D11_PHY_HDR_LEN);
@@ -1838,9 +1837,9 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
wlc->core->txavail[i] = wlc->hw->txavail[i];
}

- wlc_bmac_hw_etheraddr(wlc->hw, &wlc->perm_etheraddr);
+ wlc_bmac_hw_etheraddr(wlc->hw, wlc->perm_etheraddr);

- memcpy(&pub->cur_etheraddr, &wlc->perm_etheraddr, ETH_ALEN);
+ memcpy(pub->cur_etheraddr, wlc->perm_etheraddr, ETH_ALEN);

for (j = 0; j < NBANDS(wlc); j++) {
/* Use band 1 for single band 11a */
@@ -3600,8 +3599,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
if (src_key->flags & WSEC_PRIMARY_KEY)
key.flags |= WL_PRIMARY_KEY;

- memcpy(key.ea.octet, src_key->ea.octet,
- ETH_ALEN);
+ memcpy(key.ea, src_key->ea, ETH_ALEN);
}

memcpy(arg, &key, sizeof(key));
@@ -3637,7 +3635,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
u32 hi;
/* group keys in WPA-NONE (IBSS only, AES and TKIP) use a global TXIV */
if ((bsscfg->WPA_auth & WPA_AUTH_NONE) &&
- is_zero_ether_addr(key->ea.octet)) {
+ is_zero_ether_addr(key->ea)) {
lo = bsscfg->wpa_none_txiv.lo;
hi = bsscfg->wpa_none_txiv.hi;
} else {
@@ -7655,9 +7653,9 @@ wlc_bcn_prb_template(struct wlc_info *wlc, uint type, ratespec_t bcn_rspec,
/* DUR is 0 for multicast bcn, or filled in by MAC for prb resp */
/* A1 filled in by MAC for prb resp, broadcast for bcn */
if (type == IEEE80211_STYPE_BEACON)
- memcpy(h->da, &ether_bcast, ETH_ALEN);
- memcpy(h->sa, &cfg->cur_etheraddr, ETH_ALEN);
- memcpy(h->bssid, &cfg->BSSID, ETH_ALEN);
+ memset(h->da, 255, ETH_ALEN);
+ memcpy(h->sa, cfg->cur_etheraddr, ETH_ALEN);
+ memcpy(h->bssid, cfg->BSSID, ETH_ALEN);

/* SEQ filled in by MAC */

@@ -8220,12 +8218,12 @@ void wlc_write_hw_bcntemplates(struct wlc_info *wlc, void *bcn, int len,

void
wlc_set_addrmatch(struct wlc_info *wlc, int match_reg_offset,
- const struct ether_addr *addr)
+ const u8 addr[ETH_ALEN])
{
wlc_bmac_set_addrmatch(wlc->hw, match_reg_offset, addr);
}

-void wlc_set_rcmta(struct wlc_info *wlc, int idx, const struct ether_addr *addr)
+void wlc_set_rcmta(struct wlc_info *wlc, int idx, const u8 addr[ETH_ALEN])
{
wlc_bmac_set_rcmta(wlc->hw, idx, addr);
}
diff --git a/drivers/staging/brcm80211/sys/wlc_mac80211.h b/drivers/staging/brcm80211/sys/wlc_mac80211.h
index d0c274b..cea7c33 100644
--- a/drivers/staging/brcm80211/sys/wlc_mac80211.h
+++ b/drivers/staging/brcm80211/sys/wlc_mac80211.h
@@ -470,7 +470,7 @@ struct wlc_hw_info {
uint mac_suspend_depth; /* current depth of mac_suspend levels */
u32 wake_override; /* Various conditions to force MAC to WAKE mode */
u32 mute_override; /* Prevent ucode from sending beacons */
- struct ether_addr etheraddr; /* currently configured ethernet address */
+ u8 etheraddr[ETH_ALEN]; /* currently configured ethernet address */
u32 led_gpio_mask; /* LED GPIO Mask */
bool noreset; /* true= do not reset hw, used by WLC_OUT */
bool forcefastclk; /* true if the h/w is forcing the use of fast clk */
@@ -566,7 +566,7 @@ struct wlc_info {

u32 machwcap; /* MAC capabilities, BMAC shadow */

- struct ether_addr perm_etheraddr; /* original sprom local ethernet address */
+ u8 perm_etheraddr[ETH_ALEN]; /* original sprom local ethernet address */

bool bandlocked; /* disable auto multi-band switching */
bool bandinit_pending; /* track band init in auto band */
@@ -835,13 +835,12 @@ extern void wlc_write_template_ram(struct wlc_info *wlc, int offset, int len,
extern void wlc_write_hw_bcntemplates(struct wlc_info *wlc, void *bcn, int len,
bool both);
#if defined(BCMDBG)
-extern void wlc_get_rcmta(struct wlc_info *wlc, int idx,
- struct ether_addr *addr);
+extern void wlc_get_rcmta(struct wlc_info *wlc, int idx, u8 addr[ETH_ALEN]);
#endif
extern void wlc_set_rcmta(struct wlc_info *wlc, int idx,
- const struct ether_addr *addr);
+ const u8 addr[ETH_ALEN]);
extern void wlc_set_addrmatch(struct wlc_info *wlc, int match_reg_offset,
- const struct ether_addr *addr);
+ const u8 addr[ETH_ALEN]);
extern void wlc_read_tsf(struct wlc_info *wlc, u32 *tsf_l_ptr,
u32 *tsf_h_ptr);
extern void wlc_set_cwmin(struct wlc_info *wlc, u16 newmin);
diff --git a/drivers/staging/brcm80211/sys/wlc_pub.h b/drivers/staging/brcm80211/sys/wlc_pub.h
index c304156..6b9d378 100644
--- a/drivers/staging/brcm80211/sys/wlc_pub.h
+++ b/drivers/staging/brcm80211/sys/wlc_pub.h
@@ -157,9 +157,6 @@ typedef void *wlc_pkt_t;
/* Event data type */
typedef struct wlc_event {
wl_event_msg_t event; /* encapsulated event */
- struct ether_addr *addr; /* used to keep a trace of the potential present of
- * an address in wlc_event_msg_t
- */
int bsscfgidx; /* BSS config when needed */
struct wl_if *wlif; /* pointer to wlif */
void *data; /* used to hang additional data on an event */
@@ -168,7 +165,7 @@ typedef struct wlc_event {

/* wlc internal bss_info, wl external one is in wlioctl.h */
typedef struct wlc_bss_info {
- struct ether_addr BSSID; /* network BSSID */
+ u8 BSSID[ETH_ALEN]; /* network BSSID */
u16 flags; /* flags for internal attributes */
u8 SSID_len; /* the length of SSID */
u8 SSID[32]; /* SSID string */
@@ -294,10 +291,7 @@ struct wlc_pub {
s8 _coex; /* 20/40 MHz BSS Management AUTO, ENAB, DISABLE */
bool _priofc; /* Priority-based flowcontrol */

- struct ether_addr cur_etheraddr; /* our local ethernet address */
-
- struct ether_addr *multicast; /* ptr to list of multicast addresses */
- uint nmulticast; /* # enabled multicast addresses */
+ u8 cur_etheraddr[ETH_ALEN]; /* our local ethernet address */

u32 wlfeatureflag; /* Flags to control sw features from registry */
int psq_pkts_total; /* total num of ps pkts */
@@ -527,7 +521,7 @@ extern void wlc_statsupd(struct wlc_info *wlc);
extern int wlc_get_header_len(void);
extern void wlc_mac_bcn_promisc_change(struct wlc_info *wlc, bool promisc);
extern void wlc_set_addrmatch(struct wlc_info *wlc, int match_reg_offset,
- const struct ether_addr *addr);
+ const u8 addr[ETH_ALEN]);
extern void wlc_wme_setparams(struct wlc_info *wlc, u16 aci, void *arg,
bool suspend);

@@ -566,8 +560,6 @@ extern int wlc_module_register(struct wlc_pub *pub, const bcm_iovar_t *iovars,
watchdog_fn_t watchdog_fn, down_fn_t down_fn);
extern int wlc_module_unregister(struct wlc_pub *pub, const char *name,
void *hdl);
-extern void wlc_event_if(struct wlc_info *wlc, struct wlc_bsscfg *cfg,
- wlc_event_t *e, const struct ether_addr *addr);
extern void wlc_suspend_mac_and_wait(struct wlc_info *wlc);
extern void wlc_enable_mac(struct wlc_info *wlc);
extern u16 wlc_rate_shm_offset(struct wlc_info *wlc, u8 rate);
diff --git a/drivers/staging/brcm80211/sys/wlc_scb.h b/drivers/staging/brcm80211/sys/wlc_scb.h
index fe84e99..096a6b3 100644
--- a/drivers/staging/brcm80211/sys/wlc_scb.h
+++ b/drivers/staging/brcm80211/sys/wlc_scb.h
@@ -58,7 +58,6 @@ struct scb {
u32 flags; /* various bit flags as defined below */
u32 flags2; /* various bit flags2 as defined below */
u8 state; /* current state bitfield of auth/assoc process */
- struct ether_addr ea; /* station address */
void *fragbuf[NUMPRIO]; /* defragmentation buffer per prio */
uint fragresid[NUMPRIO]; /* #bytes unused in frag buffer per prio */

diff --git a/drivers/staging/brcm80211/util/bcmsrom.c b/drivers/staging/brcm80211/util/bcmsrom.c
index 992d247..f70b26c 100644
--- a/drivers/staging/brcm80211/util/bcmsrom.c
+++ b/drivers/staging/brcm80211/util/bcmsrom.c
@@ -44,8 +44,6 @@
#include <sbsdpcmdev.h>
#endif

-#include <proto/ethernet.h> /* for sprom content groking */
-
#define BS_ERROR(args)

#define SROM_OFFSET(sih) ((sih->ccrev > 31) ? \
@@ -1725,16 +1723,16 @@ static void _initvars_srom_pci(u8 sromrev, u16 *srom, uint off, varbuf_t *b)
continue;

if (flags & SRFL_ETHADDR) {
- struct ether_addr ea;
+ u8 ea[ETH_ALEN];

- ea.octet[0] = (srom[srv->off - off] >> 8) & 0xff;
- ea.octet[1] = srom[srv->off - off] & 0xff;
- ea.octet[2] = (srom[srv->off + 1 - off] >> 8) & 0xff;
- ea.octet[3] = srom[srv->off + 1 - off] & 0xff;
- ea.octet[4] = (srom[srv->off + 2 - off] >> 8) & 0xff;
- ea.octet[5] = srom[srv->off + 2 - off] & 0xff;
+ ea[0] = (srom[srv->off - off] >> 8) & 0xff;
+ ea[1] = srom[srv->off - off] & 0xff;
+ ea[2] = (srom[srv->off + 1 - off] >> 8) & 0xff;
+ ea[3] = srom[srv->off + 1 - off] & 0xff;
+ ea[4] = (srom[srv->off + 2 - off] >> 8) & 0xff;
+ ea[5] = srom[srv->off + 2 - off] & 0xff;

- varbuf_append(b, "%s=%pM", name, ea.octet);
+ varbuf_append(b, "%s=%pM", name, ea);
} else {
ASSERT(mask_valid(srv->mask));
ASSERT(mask_width(srv->mask));
diff --git a/drivers/staging/brcm80211/util/bcmutils.c b/drivers/staging/brcm80211/util/bcmutils.c
index 43bce96..ca3ea1f 100644
--- a/drivers/staging/brcm80211/util/bcmutils.c
+++ b/drivers/staging/brcm80211/util/bcmutils.c
@@ -22,13 +22,13 @@
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/netdevice.h>
+#include <linux/if_ether.h>
#include <osl.h>
#include <bcmutils.h>
#include <siutils.h>
#include <bcmnvram.h>
#include <bcmendian.h>
#include <bcmdevs.h>
-#include <proto/ethernet.h>
#include <proto/802.1d.h>
#include <proto/802.11.h>

@@ -348,12 +348,12 @@ struct sk_buff *BCMFASTPATH pktq_mdeq(struct pktq *pq, uint prec_bmp,
}

/* parse a xx:xx:xx:xx:xx:xx format ethernet address */
-int bcm_ether_atoe(char *p, struct ether_addr *ea)
+int bcm_ether_atoe(char *p, u8 ea[ETH_ALEN])
{
int i = 0;

for (;;) {
- ea->octet[i++] = (char)simple_strtoul(p, &p, 16);
+ ea[i++] = (char)simple_strtoul(p, &p, 16);
if (!*p++ || i == 6)
break;
}
--
1.7.1


2011-02-13 14:41:05

by Stanislav Fomichev

[permalink] [raw]
Subject: [PATCH 7/8] brcm80211: replace ether_header with ethhdr

Use native linux interfaces instead of brcm80211 specific ones.

Signed-off-by: Stanislav Fomichev <[email protected]>
Signed-off-by: Stanislav Fomichev <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 2 +-
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 12 +++---
drivers/staging/brcm80211/include/proto/bcmevent.h | 4 +-
drivers/staging/brcm80211/include/proto/ethernet.h | 36 --------------------
drivers/staging/brcm80211/sys/wlc_mac80211.c | 2 +-
5 files changed, 10 insertions(+), 46 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 01943f3..077ccc7 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -868,7 +868,7 @@ wl_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
if (ifevent->action == WLC_E_IF_ADD)
dhd_add_if(dhd, ifevent->ifidx,
NULL, event->ifname,
- pvt_data->eth.ether_dhost,
+ pvt_data->eth.h_dest,
ifevent->flags,
ifevent->bssidx);
else
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index c09e9a5..a3db566 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -1030,11 +1030,11 @@ int dhd_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf)
/* Update multicast statistic */
if (pktbuf->len >= ETH_ALEN) {
u8 *pktdata = (u8 *) (pktbuf->data);
- struct ether_header *eh = (struct ether_header *)pktdata;
+ struct ethhdr *eh = (struct ethhdr *)pktdata;

- if (is_multicast_ether_addr(eh->ether_dhost))
+ if (is_multicast_ether_addr(eh->h_dest))
dhdp->tx_multicast++;
- if (ntoh16(eh->ether_type) == ETH_P_PAE)
+ if (ntoh16(eh->h_proto) == ETH_P_PAE)
atomic_inc(&dhd->pend_8021x_cnt);
}

@@ -1254,13 +1254,13 @@ void dhd_txcomplete(dhd_pub_t *dhdp, struct sk_buff *txp, bool success)
{
uint ifidx;
dhd_info_t *dhd = (dhd_info_t *) (dhdp->info);
- struct ether_header *eh;
+ struct ethhdr *eh;
u16 type;

dhd_prot_hdrpull(dhdp, &ifidx, txp);

- eh = (struct ether_header *)(txp->data);
- type = ntoh16(eh->ether_type);
+ eh = (struct ethhdr *)(txp->data);
+ type = ntoh16(eh->h_proto);

if (type == ETH_P_PAE)
atomic_dec(&dhd->pend_8021x_cnt);
diff --git a/drivers/staging/brcm80211/include/proto/bcmevent.h b/drivers/staging/brcm80211/include/proto/bcmevent.h
index 865d157..f61c048 100644
--- a/drivers/staging/brcm80211/include/proto/bcmevent.h
+++ b/drivers/staging/brcm80211/include/proto/bcmevent.h
@@ -40,13 +40,13 @@ typedef BWL_PRE_PACKED_STRUCT struct {

#ifdef BRCM_FULLMAC
typedef BWL_PRE_PACKED_STRUCT struct bcm_event {
- struct ether_header eth;
+ struct ethhdr eth;
bcmeth_hdr_t bcm_hdr;
wl_event_msg_t event;
} BWL_POST_PACKED_STRUCT bcm_event_t;
#endif
#define BCM_MSG_LEN (sizeof(bcm_event_t) - sizeof(bcmeth_hdr_t) - \
- sizeof(struct ether_header))
+ sizeof(struct ethhdr))

#define WLC_E_SET_SSID 0
#define WLC_E_JOIN 1
diff --git a/drivers/staging/brcm80211/include/proto/ethernet.h b/drivers/staging/brcm80211/include/proto/ethernet.h
index 567407d..1176df9 100644
--- a/drivers/staging/brcm80211/include/proto/ethernet.h
+++ b/drivers/staging/brcm80211/include/proto/ethernet.h
@@ -21,52 +21,16 @@

#include <packed_section_start.h>

-#define ETHER_TYPE_LEN 2
-#define ETHER_CRC_LEN 4
-#define ETHER_MIN_LEN 64
-#define ETHER_MIN_DATA 46
#define ETHER_MAX_LEN 1518
-#define ETHER_MAX_DATA 1500

#define ETHER_TYPE_BRCM 0x886c

-#define ETHER_DEST_OFFSET (0 * ETH_ALEN)
-#define ETHER_SRC_OFFSET (1 * ETH_ALEN)
-#define ETHER_TYPE_OFFSET (2 * ETH_ALEN)
-
-#define ETHER_IS_VALID_LEN(foo) \
- ((foo) >= ETHER_MIN_LEN && (foo) <= ETHER_MAX_LEN)
-
-#define ETHER_FILL_MCAST_ADDR_FROM_IP(ea, mgrp_ip) { \
- ((u8 *)ea)[0] = 0x01; \
- ((u8 *)ea)[1] = 0x00; \
- ((u8 *)ea)[2] = 0x5e; \
- ((u8 *)ea)[3] = ((mgrp_ip) >> 16) & 0x7f; \
- ((u8 *)ea)[4] = ((mgrp_ip) >> 8) & 0xff; \
- ((u8 *)ea)[5] = ((mgrp_ip) >> 0) & 0xff; \
-}
-
-BWL_PRE_PACKED_STRUCT struct ether_header {
- u8 ether_dhost[ETH_ALEN];
- u8 ether_shost[ETH_ALEN];
- u16 ether_type;
-} BWL_POST_PACKED_STRUCT;
-
BWL_PRE_PACKED_STRUCT struct ether_addr {
u8 octet[ETH_ALEN];
} BWL_POST_PACKED_STRUCT;

-#define ETHER_SET_UNICAST(ea) (((u8 *)(ea))[0] = (((u8 *)(ea))[0] & ~1))
-
static const struct ether_addr ether_bcast = { {255, 255, 255, 255, 255, 255} };

-#define ETHER_MOVE_HDR(d, s) \
-do { \
- struct ether_header t; \
- t = *(struct ether_header *)(s); \
- *(struct ether_header *)(d) = t; \
-} while (0)
-
#include <packed_section_end.h>

#endif /* _NET_ETHERNET_H_ */
diff --git a/drivers/staging/brcm80211/sys/wlc_mac80211.c b/drivers/staging/brcm80211/sys/wlc_mac80211.c
index ddca7ff..8083244 100644
--- a/drivers/staging/brcm80211/sys/wlc_mac80211.c
+++ b/drivers/staging/brcm80211/sys/wlc_mac80211.c
@@ -1729,7 +1729,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,

/* some code depends on packed structures */
ASSERT(sizeof(struct ether_addr) == ETH_ALEN);
- ASSERT(sizeof(struct ether_header) == ETH_HLEN);
+ ASSERT(sizeof(struct ethhdr) == ETH_HLEN);
ASSERT(sizeof(d11regs_t) == SI_CORE_SIZE);
ASSERT(sizeof(ofdm_phy_hdr_t) == D11_PHY_HDR_LEN);
ASSERT(sizeof(cck_phy_hdr_t) == D11_PHY_HDR_LEN);
--
1.7.1


2011-02-13 14:41:05

by Stanislav Fomichev

[permalink] [raw]
Subject: [PATCH 6/8] brcm80211: replace bcopy with memcpy

Signed-off-by: Stanislav Fomichev <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 2 +-
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 40 +++++-----
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 2 +-
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 32 ++++----
.../staging/brcm80211/brcmfmac/dhd_custom_gpio.c | 2 +-
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 2 +-
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 72 ++++++++--------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 10 +--
drivers/staging/brcm80211/brcmfmac/wl_iw.c | 55 ++++++------
drivers/staging/brcm80211/include/osl.h | 4 -
drivers/staging/brcm80211/phy/wlc_phy_cmn.c | 66 +++++++--------
drivers/staging/brcm80211/phy/wlc_phy_lcn.c | 5 +-
drivers/staging/brcm80211/sys/wl_mac80211.c | 4 +-
drivers/staging/brcm80211/sys/wlc_ampdu.c | 2 +-
drivers/staging/brcm80211/sys/wlc_bmac.c | 6 +-
drivers/staging/brcm80211/sys/wlc_mac80211.c | 90 ++++++++++----------
drivers/staging/brcm80211/sys/wlc_rate.c | 6 +-
drivers/staging/brcm80211/sys/wlc_stf.c | 2 +-
drivers/staging/brcm80211/util/bcmotp.c | 2 +-
drivers/staging/brcm80211/util/bcmsrom.c | 8 +-
drivers/staging/brcm80211/util/bcmutils.c | 2 +-
drivers/staging/brcm80211/util/hnddma.c | 8 +-
drivers/staging/brcm80211/util/nvram/nvram_ro.c | 4 +-
drivers/staging/brcm80211/util/siutils.c | 2 +-
24 files changed, 208 insertions(+), 220 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index acf43a3..df9a139 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -324,7 +324,7 @@ int bcmsdh_cis_read(void *sdh, uint func, u8 * cis, uint length)
BCMSDH_ERROR(("%s: out of memory\n", __func__));
return BCME_NOMEM;
}
- bcopy(cis, tmp_buf, length);
+ memcpy(tmp_buf, cis, length);
for (tmp_ptr = tmp_buf, ptr = cis; ptr < (cis + length - 4);
tmp_ptr++) {
ptr += sprintf((char *)ptr, "%.2x ", *tmp_ptr & 0xff);
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index d399b5c..6cde62a 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -441,7 +441,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
val_size = sizeof(int);

if (plen >= (int)sizeof(int_val))
- bcopy(params, &int_val, sizeof(int_val));
+ memcpy(&int_val, params, sizeof(int_val));

bool_val = (int_val != 0) ? true : false;

@@ -449,7 +449,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
switch (actionid) {
case IOV_GVAL(IOV_MSGLEVEL):
int_val = (s32) sd_msglevel;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_MSGLEVEL):
@@ -458,7 +458,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,

case IOV_GVAL(IOV_BLOCKMODE):
int_val = (s32) si->sd_blockmode;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_BLOCKMODE):
@@ -472,7 +472,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
break;
}
int_val = (s32) si->client_block_size[int_val];
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_BLOCKSIZE):
@@ -514,12 +514,12 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,

case IOV_GVAL(IOV_RXCHAIN):
int_val = false;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_GVAL(IOV_DMA):
int_val = (s32) si->sd_use_dma;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_DMA):
@@ -528,7 +528,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,

case IOV_GVAL(IOV_USEINTS):
int_val = (s32) si->use_client_ints;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_USEINTS):
@@ -542,7 +542,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,

case IOV_GVAL(IOV_DIVISOR):
int_val = (u32) sd_divisor;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_DIVISOR):
@@ -551,7 +551,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,

case IOV_GVAL(IOV_POWER):
int_val = (u32) sd_power;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_POWER):
@@ -560,7 +560,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,

case IOV_GVAL(IOV_CLOCK):
int_val = (u32) sd_clock;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_CLOCK):
@@ -569,7 +569,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,

case IOV_GVAL(IOV_SDMODE):
int_val = (u32) sd_sdmode;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_SDMODE):
@@ -578,7 +578,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,

case IOV_GVAL(IOV_HISPEED):
int_val = (u32) sd_hiok;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_HISPEED):
@@ -587,12 +587,12 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,

case IOV_GVAL(IOV_NUMINTS):
int_val = (s32) si->intrcount;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_GVAL(IOV_NUMLOCALINTS):
int_val = (s32) 0;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_GVAL(IOV_HOSTREG):
@@ -621,7 +621,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
int_val = 32; /* sdioh_sdmmc_rreg(si,
sd_ptr->offset); */

- bcopy(&int_val, arg, sizeof(int_val));
+ memcpy(arg, &int_val, sizeof(int_val));
break;
}

@@ -657,7 +657,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
}

int_val = (int)data;
- bcopy(&int_val, arg, sizeof(int_val));
+ memcpy(arg, &int_val, sizeof(int_val));
break;
}

@@ -1048,14 +1048,14 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,

/* For a write, copy the buffer data into the packet. */
if (write)
- bcopy(buffer, mypkt->data, buflen_u);
+ memcpy(mypkt->data, buffer, buflen_u);

Status =
sdioh_request_packet(sd, fix_inc, write, func, addr, mypkt);

/* For a read, copy the packet data back to the buffer. */
if (!write)
- bcopy(mypkt->data, buffer, buflen_u);
+ memcpy(buffer, mypkt->data, buflen_u);

pkt_buf_free_skb(sd->osh, mypkt, write ? true : false);
} else if (((u32) (pkt->data) & DMA_ALIGN_MASK) != 0) {
@@ -1075,14 +1075,14 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,

/* For a write, copy the buffer data into the packet. */
if (write)
- bcopy(pkt->data, mypkt->data, pkt->len);
+ memcpy(mypkt->data, pkt->data, pkt->len);

Status =
sdioh_request_packet(sd, fix_inc, write, func, addr, mypkt);

/* For a read, copy the packet data back to the buffer. */
if (!write)
- bcopy(mypkt->data, pkt->data, mypkt->len);
+ memcpy(pkt->data, mypkt->data, mypkt->len);

pkt_buf_free_skb(sd->osh, mypkt, write ? true : false);
} else { /* case 3: We have a packet and
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index b7b527f..9dabd67 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -286,7 +286,7 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)

slen = strlen("wme_dp") + 1;
if (len >= (int)(slen + sizeof(int)))
- bcopy(((char *)buf + slen), &val, sizeof(int));
+ memcpy(&val, (char *)buf + slen, sizeof(int));
dhd->wme_dp = (u8) ltoh32(val);
}

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 3dbf72e..01943f3 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -214,7 +214,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,
goto exit;

if (plen >= (int)sizeof(int_val))
- bcopy(params, &int_val, sizeof(int_val));
+ memcpy(&int_val, params, sizeof(int_val));

switch (actionid) {
case IOV_GVAL(IOV_VERSION):
@@ -224,7 +224,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,

case IOV_GVAL(IOV_MSGLEVEL):
int_val = (s32) dhd_msg_level;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_MSGLEVEL):
@@ -239,12 +239,12 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,

case IOV_GVAL(IOV_BCMERROR):
int_val = (s32) dhd_pub->bcmerror;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_GVAL(IOV_WDTICK):
int_val = (s32) dhd_watchdog_ms;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_WDTICK):
@@ -262,7 +262,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,
#ifdef DHD_DEBUG
case IOV_GVAL(IOV_DCONSOLE_POLL):
int_val = (s32) dhd_console_ms;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_DCONSOLE_POLL):
@@ -290,7 +290,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, u32 actionid,

case IOV_GVAL(IOV_IOCTLTIMEOUT):{
int_val = (s32) dhd_os_get_ioctl_resp_timeout();
- bcopy(&int_val, arg, sizeof(int_val));
+ memcpy(arg, &int_val, sizeof(int_val));
break;
}

@@ -913,7 +913,7 @@ wl_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
DHD_TRACE(("Converted to WLC_E_LINK type %d\n", temp));

temp = ntoh32(WLC_E_NDIS_LINK);
- memcpy((void *)(&pvt_data->event.event_type), &temp,
+ memcpy(&pvt_data->event.event_type, &temp,
sizeof(pvt_data->event.event_type));
}
break;
@@ -1031,7 +1031,7 @@ dhd_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable,
enable_parm.enable = htod32(enable);

buf_len += sizeof(enable_parm);
- memcpy((char *)pkt_filterp, &enable_parm, sizeof(enable_parm));
+ memcpy(pkt_filterp, &enable_parm, sizeof(enable_parm));

/* Enable/disable the specified filter. */
rc = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, buf, buf_len);
@@ -1174,7 +1174,7 @@ void dhd_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
** then memcpy'ed into buffer (keep_alive_pktp) since there is no
** guarantee that the buffer is properly aligned.
*/
- memcpy((char *)pkt_filterp,
+ memcpy(pkt_filterp,
&pkt_filter,
WL_PKT_FILTER_FIXED_LEN + WL_PKT_FILTER_PATTERN_FIXED_LEN);

@@ -1263,8 +1263,7 @@ int dhd_preinit_ioctls(dhd_pub_t *dhd)
DHD_ERROR(("%s: can't set MAC address , error=%d\n",
__func__, ret));
} else
- memcpy(dhd->mac.octet, (void *)&ea_addr,
- ETH_ALEN);
+ memcpy(dhd->mac.octet, &ea_addr, ETH_ALEN);
}
#endif /* GET_CUSTOM_MAC_ENABLE */

@@ -1548,8 +1547,8 @@ int dhd_iscan_delete_bss(void *dhdp, void *addr, iscan_buf_t *iscan_skip)
(bi->length));
/*
if(bi && bi_new) {
- bcopy(bi, bi_new, results->buflen -
- dtoh32(bi_new->length));
+ memcpy(bi_new, bi, results->buflen -
+ dtoh32(bi_new->length));
results->buflen -= dtoh32(bi_new->length);
}
*/
@@ -1572,9 +1571,10 @@ int dhd_iscan_delete_bss(void *dhdp, void *addr, iscan_buf_t *iscan_skip)
(wl_bss_info_t *)((unsigned long)bi +
dtoh32
(bi->length));
- bcopy(bi, bi_new,
- dtoh32
- (bi->length));
+ memcpy(bi_new,
+ bi,
+ dtoh32
+ (bi->length));
bi_new =
(wl_bss_info_t *)((unsigned long)bi_new +
dtoh32
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c b/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c
index c3f18bb..06e2e85 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c
@@ -151,7 +151,7 @@ int dhd_custom_get_mac_address(unsigned char *buf)
{
struct ether_addr ea_example = {
{0x00, 0x11, 0x22, 0x33, 0x44, 0xFF} };
- bcopy((char *)&ea_example, buf, sizeof(struct ether_addr));
+ memcpy(buf, &ea_example, sizeof(struct ether_addr));
}
#endif /* EXAMPLE_GET_MAC */

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index db45083..c09e9a5 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -2203,7 +2203,7 @@ int dhd_bus_start(dhd_pub_t *dhdp)
bcm_mkiovar("event_msgs", dhdp->eventmask, WL_EVENTING_MASK_LEN, iovbuf,
sizeof(iovbuf));
dhdcdc_query_ioctl(dhdp, 0, WLC_GET_VAR, iovbuf, sizeof(iovbuf));
- bcopy(iovbuf, dhdp->eventmask, WL_EVENTING_MASK_LEN);
+ memcpy(dhdp->eventmask, iovbuf, WL_EVENTING_MASK_LEN);

setbit(dhdp->eventmask, WLC_E_SET_SSID);
setbit(dhdp->eventmask, WLC_E_PRUNE);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 3edce44..11680ee 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -946,7 +946,7 @@ static int dhdsdio_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
}

PKTALIGN(osh, new, pkt->len, DHD_SDALIGN);
- bcopy(pkt->data, new->data, pkt->len);
+ memcpy(new->data, pkt->data, pkt->len);
if (free_pkt)
pkt_buf_free_skb(osh, pkt, true);
/* free the pkt if canned one is not used */
@@ -1396,7 +1396,7 @@ int dhd_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)

dhd_os_sdlock(bus->dhd);
rxlen = bus->rxlen;
- bcopy(bus->rxctl, msg, min(msglen, rxlen));
+ memcpy(msg, bus->rxctl, min(msglen, rxlen));
bus->rxlen = 0;
dhd_os_sdunlock(bus->dhd);

@@ -1659,7 +1659,7 @@ static int dhdsdio_pktgen_get(dhd_bus_t *bus, u8 *arg)
pktgen.mode = bus->pktgen_mode;
pktgen.stop = bus->pktgen_stop;

- bcopy(&pktgen, arg, sizeof(pktgen));
+ memcpy(arg, &pktgen, sizeof(pktgen));

return 0;
}
@@ -1669,7 +1669,7 @@ static int dhdsdio_pktgen_set(dhd_bus_t *bus, u8 *arg)
dhd_pktgen_t pktgen;
uint oldcnt, oldmode;

- bcopy(arg, &pktgen, sizeof(pktgen));
+ memcpy(&pktgen, arg, sizeof(pktgen));
if (pktgen.version != DHD_PKTGEN_VERSION)
return BCME_BADARG;

@@ -2095,7 +2095,7 @@ int dhdsdio_downloadvars(dhd_bus_t *bus, void *arg, int len)

/* Copy the passed variables, which should include the
terminating double-null */
- bcopy(arg, bus->vars, bus->varsz);
+ memcpy(bus->vars, arg, bus->varsz);
err:
return bcmerror;
}
@@ -2118,7 +2118,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
goto exit;

if (plen >= (int)sizeof(int_val))
- bcopy(params, &int_val, sizeof(int_val));
+ memcpy(&int_val, params, sizeof(int_val));

bool_val = (int_val != 0) ? true : false;

@@ -2138,7 +2138,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
bcmerror = dhdsdio_bussleep(bus, bool_val);
} else {
int_val = (s32) bus->sleeping;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
}
goto exit;
}
@@ -2152,7 +2152,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
switch (actionid) {
case IOV_GVAL(IOV_INTR):
int_val = (s32) bus->intr;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_INTR):
@@ -2173,7 +2173,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,

case IOV_GVAL(IOV_POLLRATE):
int_val = (s32) bus->pollrate;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_POLLRATE):
@@ -2183,7 +2183,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,

case IOV_GVAL(IOV_IDLETIME):
int_val = bus->idletime;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_IDLETIME):
@@ -2195,7 +2195,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,

case IOV_GVAL(IOV_IDLECLOCK):
int_val = (s32) bus->idleclock;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_IDLECLOCK):
@@ -2204,7 +2204,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,

case IOV_GVAL(IOV_SD1IDLE):
int_val = (s32) sd1idle;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_SD1IDLE):
@@ -2223,8 +2223,8 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
ASSERT(plen >= 2 * sizeof(int));

address = (u32) int_val;
- bcopy((char *)params + sizeof(int_val), &int_val,
- sizeof(int_val));
+ memcpy(&int_val, (char *)params + sizeof(int_val),
+ sizeof(int_val));
size = (uint) int_val;

/* Do some validation */
@@ -2267,12 +2267,12 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,

case IOV_GVAL(IOV_MEMSIZE):
int_val = (s32) bus->ramsize;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_GVAL(IOV_SDIOD_DRIVE):
int_val = (s32) dhd_sdiod_drive_strength;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_SDIOD_DRIVE):
@@ -2291,7 +2291,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,

case IOV_GVAL(IOV_READAHEAD):
int_val = (s32) dhd_readahead;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_READAHEAD):
@@ -2302,7 +2302,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,

case IOV_GVAL(IOV_SDRXCHAIN):
int_val = (s32) bus->use_rxchain;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_SDRXCHAIN):
@@ -2313,7 +2313,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
break;
case IOV_GVAL(IOV_ALIGNCTL):
int_val = (s32) dhd_alignctl;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_ALIGNCTL):
@@ -2322,13 +2322,13 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,

case IOV_GVAL(IOV_SDALIGN):
int_val = DHD_SDALIGN;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

#ifdef DHD_DEBUG
case IOV_GVAL(IOV_VARS):
if (bus->varsz < (uint) len)
- bcopy(bus->vars, arg, bus->varsz);
+ memcpy(arg, bus->vars, bus->varsz);
else
bcmerror = BCME_BUFTOOSHORT;
break;
@@ -2347,7 +2347,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
int_val = (s32) bcmsdh_reg_read(bus->sdh, addr, size);
if (bcmsdh_regfail(bus->sdh))
bcmerror = BCME_SDIO_ERROR;
- bcopy(&int_val, arg, sizeof(s32));
+ memcpy(arg, &int_val, sizeof(s32));
break;
}

@@ -2373,14 +2373,14 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
sdreg_t sdreg;
u32 addr, size;

- bcopy(params, &sdreg, sizeof(sdreg));
+ memcpy(&sdreg, params, sizeof(sdreg));

addr = SI_ENUM_BASE + sdreg.offset;
size = sdreg.func;
int_val = (s32) bcmsdh_reg_read(bus->sdh, addr, size);
if (bcmsdh_regfail(bus->sdh))
bcmerror = BCME_SDIO_ERROR;
- bcopy(&int_val, arg, sizeof(s32));
+ memcpy(arg, &int_val, sizeof(s32));
break;
}

@@ -2389,7 +2389,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
sdreg_t sdreg;
u32 addr, size;

- bcopy(params, &sdreg, sizeof(sdreg));
+ memcpy(&sdreg, params, sizeof(sdreg));

addr = SI_ENUM_BASE + sdreg.offset;
size = sdreg.func;
@@ -2420,7 +2420,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,

case IOV_GVAL(IOV_FORCEEVEN):
int_val = (s32) forcealign;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_FORCEEVEN):
@@ -2429,7 +2429,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,

case IOV_GVAL(IOV_TXBOUND):
int_val = (s32) dhd_txbound;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_TXBOUND):
@@ -2438,7 +2438,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,

case IOV_GVAL(IOV_RXBOUND):
int_val = (s32) dhd_rxbound;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_RXBOUND):
@@ -2447,7 +2447,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,

case IOV_GVAL(IOV_TXMINMAX):
int_val = (s32) dhd_txminmax;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_TXMINMAX):
@@ -2458,7 +2458,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,
#ifdef SDTEST
case IOV_GVAL(IOV_EXTLOOP):
int_val = (s32) bus->ext_loop;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);
break;

case IOV_SVAL(IOV_EXTLOOP):
@@ -2492,7 +2492,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, u32 actionid,

/* Get its status */
int_val = (bool) bus->dhd->dongle_reset;
- bcopy(&int_val, arg, val_size);
+ memcpy(arg, &int_val, val_size);

break;

@@ -2537,7 +2537,7 @@ static int dhdsdio_write_vars(dhd_bus_t *bus)
return BCME_NOMEM;

memset(vbuffer, 0, varsize);
- bcopy(bus->vars, vbuffer, bus->varsz);
+ memcpy(vbuffer, bus->vars, bus->varsz);

/* Write the vars list */
bcmerror =
@@ -3100,13 +3100,13 @@ dhdsdio_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff)
ASSERT(bus->rxctl >= bus->rxbuf);

/* Copy the already-read portion over */
- bcopy(hdr, bus->rxctl, firstread);
+ memcpy(bus->rxctl, hdr, firstread);
if (len <= firstread)
goto gotpkt;

/* Copy the full data pkt in gSPI case and process ioctl. */
if (bus->bus == SPI_BUS) {
- bcopy(hdr, bus->rxctl, len);
+ memcpy(bus->rxctl, hdr, len);
goto gotpkt;
}

@@ -3770,7 +3770,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
dhd_os_sdunlock_rxq(bus->dhd);

/* Now check the header */
- bcopy(rxbuf, bus->rxhdr, SDPCM_HDRLEN);
+ memcpy(bus->rxhdr, rxbuf, SDPCM_HDRLEN);

/* Extract hardware header fields */
len = ltoh16_ua(bus->rxhdr);
@@ -4136,7 +4136,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)

/* Copy the already-read portion */
skb_push(pkt, firstread);
- bcopy(bus->rxhdr, pkt->data, firstread);
+ memcpy(pkt->data, bus->rxhdr, firstread);

#ifdef DHD_DEBUG
if (DHD_BYTES_ON() && DHD_DATA_ON())
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index 991463f..6f7277d 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -1039,12 +1039,10 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
** If SSID is zero join based on BSSID only
*/
memset(&join_params, 0, sizeof(join_params));
- memcpy((void *)join_params.ssid.SSID, (void *)params->ssid,
- params->ssid_len);
+ memcpy(join_params.ssid.SSID, params->ssid, params->ssid_len);
join_params.ssid.SSID_len = htod32(params->ssid_len);
if (params->bssid)
- memcpy(&join_params.params.bssid, params->bssid,
- ETH_ALEN);
+ memcpy(&join_params.params.bssid, params->bssid, ETH_ALEN);
else
memset(&join_params.params.bssid, 0, ETH_ALEN);

@@ -1533,7 +1531,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, ETH_ALEN);
+ memcpy(&key.ea, mac_addr, ETH_ALEN);
key.len = (u32) params->key_len;
/* check for key index change */
if (key.len == 0) {
@@ -3692,7 +3690,7 @@ static s32 wl_dongle_filter(struct net_device *ndev, u32 filter_mode)
* then memcpy'ed into buffer (keep_alive_pktp) since there is no
* guarantee that the buffer is properly aligned.
*/
- memcpy((char *)pkt_filterp, &pkt_filter,
+ memcpy(pkt_filterp, &pkt_filter,
WL_PKT_FILTER_FIXED_LEN + WL_PKT_FILTER_PATTERN_FIXED_LEN);

err = wl_dev_ioctl(ndev, WLC_SET_VAR, buf, buf_len);
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_iw.c b/drivers/staging/brcm80211/brcmfmac/wl_iw.c
index db6e68e..fbee070 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_iw.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_iw.c
@@ -288,7 +288,7 @@ dev_wlc_bufvar_get(struct net_device *dev, char *name, char *buf, int buflen)
dev_wlc_ioctl(dev, WLC_GET_VAR, (void *)ioctlbuf,
MAX_WLIW_IOCTL_LEN);
if (!error)
- bcopy(ioctlbuf, buf, buflen);
+ memcpy(buf, ioctlbuf, buflen);

return error;
}
@@ -840,7 +840,7 @@ wl_iw_mlme(struct net_device *dev,
}

scbval.val = mlme->reason_code;
- bcopy(&mlme->addr.sa_data, &scbval.ea, ETH_ALEN);
+ memcpy(&scbval.ea, &mlme->addr.sa_data, ETH_ALEN);

if (mlme->cmd == IW_MLME_DISASSOC) {
scbval.val = htod32(scbval.val);
@@ -1077,7 +1077,7 @@ static void wl_iw_set_event_mask(struct net_device *dev)
char iovbuf[WL_EVENTING_MASK_LEN + 12];

dev_iw_iovar_getbuf(dev, "event_msgs", "", 0, iovbuf, sizeof(iovbuf));
- bcopy(iovbuf, eventmask, WL_EVENTING_MASK_LEN);
+ memcpy(eventmask, iovbuf, WL_EVENTING_MASK_LEN);
setbit(eventmask, WLC_E_SCAN_COMPLETE);
dev_iw_iovar_setbuf(dev, "event_msgs", eventmask, WL_EVENTING_MASK_LEN,
iovbuf, sizeof(iovbuf));
@@ -2545,8 +2545,7 @@ wl_iw_set_encodeext(struct net_device *dev,
key.len = iwe->key_len;

if (!is_multicast_ether_addr(iwe->addr.sa_data))
- bcopy((void *)&iwe->addr.sa_data, (char *)&key.ea,
- ETH_ALEN);
+ memcpy(&key.ea, &iwe->addr.sa_data, ETH_ALEN);

if (key.len == 0) {
if (iwe->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
@@ -2571,13 +2570,13 @@ wl_iw_set_encodeext(struct net_device *dev,
key.flags = WL_PRIMARY_KEY;
}

- bcopy((void *)iwe->key, key.data, iwe->key_len);
+ memcpy(key.data, iwe->key, iwe->key_len);

if (iwe->alg == IW_ENCODE_ALG_TKIP) {
u8 keybuf[8];
- bcopy(&key.data[24], keybuf, sizeof(keybuf));
- bcopy(&key.data[16], &key.data[24], sizeof(keybuf));
- bcopy(keybuf, &key.data[16], sizeof(keybuf));
+ memcpy(keybuf, &key.data[24], sizeof(keybuf));
+ memcpy(&key.data[24], &key.data[16], sizeof(keybuf));
+ memcpy(&key.data[16], keybuf, sizeof(keybuf));
}

if (iwe->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) {
@@ -2651,10 +2650,10 @@ wl_iw_set_pmksa(struct net_device *dev,
uint j;
pmkidptr = &pmkid;

- bcopy(&iwpmksa->bssid.sa_data[0],
- &pmkidptr->pmkid[0].BSSID, ETH_ALEN);
- bcopy(&iwpmksa->pmkid[0], &pmkidptr->pmkid[0].PMKID,
- WPA2_PMKID_LEN);
+ memcpy(&pmkidptr->pmkid[0].BSSID,
+ &iwpmksa->bssid.sa_data[0], ETH_ALEN);
+ memcpy(&pmkidptr->pmkid[0].PMKID,
+ &iwpmksa->pmkid[0], WPA2_PMKID_LEN);

WL_WSEC("wl_iw_set_pmksa:IW_PMKSA_REMOVE:PMKID: %pM = ",
&pmkidptr->pmkid[0].BSSID);
@@ -2673,12 +2672,12 @@ wl_iw_set_pmksa(struct net_device *dev,
&& (i < pmkid_list.pmkids.npmkid)) {
memset(&pmkid_list.pmkids.pmkid[i], 0, sizeof(pmkid_t));
for (; i < (pmkid_list.pmkids.npmkid - 1); i++) {
- bcopy(&pmkid_list.pmkids.pmkid[i + 1].BSSID,
- &pmkid_list.pmkids.pmkid[i].BSSID,
- ETH_ALEN);
- bcopy(&pmkid_list.pmkids.pmkid[i + 1].PMKID,
- &pmkid_list.pmkids.pmkid[i].PMKID,
- WPA2_PMKID_LEN);
+ memcpy(&pmkid_list.pmkids.pmkid[i].BSSID,
+ &pmkid_list.pmkids.pmkid[i + 1].BSSID,
+ ETH_ALEN);
+ memcpy(&pmkid_list.pmkids.pmkid[i].PMKID,
+ &pmkid_list.pmkids.pmkid[i + 1].PMKID,
+ WPA2_PMKID_LEN);
}
pmkid_list.pmkids.npmkid--;
} else
@@ -2692,12 +2691,12 @@ wl_iw_set_pmksa(struct net_device *dev,
&pmkid_list.pmkids.pmkid[i].BSSID, ETH_ALEN))
break;
if (i < MAXPMKID) {
- bcopy(&iwpmksa->bssid.sa_data[0],
- &pmkid_list.pmkids.pmkid[i].BSSID,
- ETH_ALEN);
- bcopy(&iwpmksa->pmkid[0],
- &pmkid_list.pmkids.pmkid[i].PMKID,
- WPA2_PMKID_LEN);
+ memcpy(&pmkid_list.pmkids.pmkid[i].BSSID,
+ &iwpmksa->bssid.sa_data[0],
+ ETH_ALEN);
+ memcpy(&pmkid_list.pmkids.pmkid[i].PMKID,
+ &iwpmksa->pmkid[0],
+ WPA2_PMKID_LEN);
if (i == pmkid_list.pmkids.npmkid)
pmkid_list.pmkids.npmkid++;
} else
@@ -3483,9 +3482,9 @@ void wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void *data)
if (pmkidcand->preauth)
iwpmkidcand->flags |=
IW_PMKID_CAND_PREAUTH;
- bcopy(&pmkidcand->BSSID,
- &iwpmkidcand->bssid.sa_data,
- ETH_ALEN);
+ memcpy(&iwpmkidcand->bssid.sa_data,
+ &pmkidcand->BSSID,
+ ETH_ALEN);
#ifndef SANDGATE2G
wireless_send_event(dev, cmd, &wrqu,
extra);
diff --git a/drivers/staging/brcm80211/include/osl.h b/drivers/staging/brcm80211/include/osl.h
index b282356..ee42450 100644
--- a/drivers/staging/brcm80211/include/osl.h
+++ b/drivers/staging/brcm80211/include/osl.h
@@ -111,8 +111,6 @@ extern void osl_dma_unmap(struct osl_info *osh, uint pa, uint size,
#include <linux/kernel.h> /* for vsn/printf's */
#include <linux/string.h> /* for mem*, str* */
#endif
-/* bcopy's: Linux kernel doesn't provide these (anymore) */
-#define bcopy(src, dst, len) memcpy((dst), (src), (len))

/* register access macros */
#ifndef IL_BIGENDIAN
@@ -205,8 +203,6 @@ extern void osl_dma_unmap(struct osl_info *osh, uint pa, uint size,
} while (0)
#endif /* IL_BIGENDIAN */

-#define bcopy(src, dst, len) memcpy((dst), (src), (len))
-
/* packet primitives */
extern struct sk_buff *pkt_buf_get_skb(struct osl_info *osh, uint len);
extern void pkt_buf_free_skb(struct osl_info *osh, struct sk_buff *skb, bool send);
diff --git a/drivers/staging/brcm80211/phy/wlc_phy_cmn.c b/drivers/staging/brcm80211/phy/wlc_phy_cmn.c
index 3bed37c..95f9511 100644
--- a/drivers/staging/brcm80211/phy/wlc_phy_cmn.c
+++ b/drivers/staging/brcm80211/phy/wlc_phy_cmn.c
@@ -779,7 +779,7 @@ wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype, char *vars

pi->vars = (char *)&pi->vars;

- bcopy(&pi->pubpi, &pi->pubpi_ro, sizeof(wlc_phy_t));
+ memcpy(&pi->pubpi_ro, &pi->pubpi, sizeof(wlc_phy_t));

return &pi->pubpi_ro;

@@ -1619,40 +1619,36 @@ void wlc_phy_txpower_target_set(wlc_phy_t *ppi, struct txpwr_limits *txpwr)
bool mac_enabled = false;
phy_info_t *pi = (phy_info_t *) ppi;

- bcopy(&txpwr->cck[0], &pi->tx_user_target[TXP_FIRST_CCK],
- WLC_NUM_RATES_CCK);
-
- bcopy(&txpwr->ofdm[0], &pi->tx_user_target[TXP_FIRST_OFDM],
- WLC_NUM_RATES_OFDM);
- bcopy(&txpwr->ofdm_cdd[0], &pi->tx_user_target[TXP_FIRST_OFDM_20_CDD],
- WLC_NUM_RATES_OFDM);
-
- bcopy(&txpwr->ofdm_40_siso[0],
- &pi->tx_user_target[TXP_FIRST_OFDM_40_SISO], WLC_NUM_RATES_OFDM);
- bcopy(&txpwr->ofdm_40_cdd[0],
- &pi->tx_user_target[TXP_FIRST_OFDM_40_CDD], WLC_NUM_RATES_OFDM);
-
- bcopy(&txpwr->mcs_20_siso[0],
- &pi->tx_user_target[TXP_FIRST_MCS_20_SISO],
- WLC_NUM_RATES_MCS_1_STREAM);
- bcopy(&txpwr->mcs_20_cdd[0], &pi->tx_user_target[TXP_FIRST_MCS_20_CDD],
- WLC_NUM_RATES_MCS_1_STREAM);
- bcopy(&txpwr->mcs_20_stbc[0],
- &pi->tx_user_target[TXP_FIRST_MCS_20_STBC],
- WLC_NUM_RATES_MCS_1_STREAM);
- bcopy(&txpwr->mcs_20_mimo[0], &pi->tx_user_target[TXP_FIRST_MCS_20_SDM],
- WLC_NUM_RATES_MCS_2_STREAM);
-
- bcopy(&txpwr->mcs_40_siso[0],
- &pi->tx_user_target[TXP_FIRST_MCS_40_SISO],
- WLC_NUM_RATES_MCS_1_STREAM);
- bcopy(&txpwr->mcs_40_cdd[0], &pi->tx_user_target[TXP_FIRST_MCS_40_CDD],
- WLC_NUM_RATES_MCS_1_STREAM);
- bcopy(&txpwr->mcs_40_stbc[0],
- &pi->tx_user_target[TXP_FIRST_MCS_40_STBC],
- WLC_NUM_RATES_MCS_1_STREAM);
- bcopy(&txpwr->mcs_40_mimo[0], &pi->tx_user_target[TXP_FIRST_MCS_40_SDM],
- WLC_NUM_RATES_MCS_2_STREAM);
+ memcpy(&pi->tx_user_target[TXP_FIRST_CCK], &txpwr->cck[0],
+ WLC_NUM_RATES_CCK);
+
+ memcpy(&pi->tx_user_target[TXP_FIRST_OFDM], &txpwr->ofdm[0],
+ WLC_NUM_RATES_OFDM);
+ memcpy(&pi->tx_user_target[TXP_FIRST_OFDM_20_CDD], &txpwr->ofdm_cdd[0],
+ WLC_NUM_RATES_OFDM);
+
+ memcpy(&pi->tx_user_target[TXP_FIRST_OFDM_40_SISO],
+ &txpwr->ofdm_40_siso[0], WLC_NUM_RATES_OFDM);
+ memcpy(&pi->tx_user_target[TXP_FIRST_OFDM_40_CDD],
+ &txpwr->ofdm_40_cdd[0], WLC_NUM_RATES_OFDM);
+
+ memcpy(&pi->tx_user_target[TXP_FIRST_MCS_20_SISO],
+ &txpwr->mcs_20_siso[0], WLC_NUM_RATES_MCS_1_STREAM);
+ memcpy(&pi->tx_user_target[TXP_FIRST_MCS_20_CDD],
+ &txpwr->mcs_20_cdd[0], WLC_NUM_RATES_MCS_1_STREAM);
+ memcpy(&pi->tx_user_target[TXP_FIRST_MCS_20_STBC],
+ &txpwr->mcs_20_stbc[0], WLC_NUM_RATES_MCS_1_STREAM);
+ memcpy(&pi->tx_user_target[TXP_FIRST_MCS_20_SDM],
+ &txpwr->mcs_20_mimo[0], WLC_NUM_RATES_MCS_2_STREAM);
+
+ memcpy(&pi->tx_user_target[TXP_FIRST_MCS_40_SISO],
+ &txpwr->mcs_40_siso[0], WLC_NUM_RATES_MCS_1_STREAM);
+ memcpy(&pi->tx_user_target[TXP_FIRST_MCS_40_CDD],
+ &txpwr->mcs_40_cdd[0], WLC_NUM_RATES_MCS_1_STREAM);
+ memcpy(&pi->tx_user_target[TXP_FIRST_MCS_40_STBC],
+ &txpwr->mcs_40_stbc[0], WLC_NUM_RATES_MCS_1_STREAM);
+ memcpy(&pi->tx_user_target[TXP_FIRST_MCS_40_SDM],
+ &txpwr->mcs_40_mimo[0], WLC_NUM_RATES_MCS_2_STREAM);

if (R_REG(pi->sh->osh, &pi->regs->maccontrol) & MCTL_EN_MAC)
mac_enabled = true;
diff --git a/drivers/staging/brcm80211/phy/wlc_phy_lcn.c b/drivers/staging/brcm80211/phy/wlc_phy_lcn.c
index 3ac2b49..1b42966 100644
--- a/drivers/staging/brcm80211/phy/wlc_phy_lcn.c
+++ b/drivers/staging/brcm80211/phy/wlc_phy_lcn.c
@@ -1965,8 +1965,9 @@ wlc_lcnphy_tx_iqlo_cal(phy_info_t *pi,
tbl_iqcal_gainparams_lcnphy[band_idx][j][2];
cal_gains.pad_gain =
tbl_iqcal_gainparams_lcnphy[band_idx][j][3];
- bcopy(&tbl_iqcal_gainparams_lcnphy[band_idx][j][3],
- ncorr_override, sizeof(ncorr_override));
+ memcpy(ncorr_override,
+ &tbl_iqcal_gainparams_lcnphy[band_idx][j][3],
+ sizeof(ncorr_override));
break;
}
}
diff --git a/drivers/staging/brcm80211/sys/wl_mac80211.c b/drivers/staging/brcm80211/sys/wl_mac80211.c
index 0c87baa..c1c9711 100644
--- a/drivers/staging/brcm80211/sys/wl_mac80211.c
+++ b/drivers/staging/brcm80211/sys/wl_mac80211.c
@@ -762,7 +762,7 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs,
goto fail;
}

- bcopy(&wl->pub->cur_etheraddr, perm, ETH_ALEN);
+ memcpy(perm, &wl->pub->cur_etheraddr, ETH_ALEN);
ASSERT(is_valid_ether_addr(perm));
SET_IEEE80211_PERM_ADDR(hw, perm);

@@ -1718,7 +1718,7 @@ int wl_ucode_init_buf(struct wl_info *wl, void **pbuf, u32 idx)
printf("fail to alloc %d bytes\n",
hdr->len);
}
- bcopy(pdata, *pbuf, hdr->len);
+ memcpy(*pbuf, pdata, hdr->len);
return 0;
}
}
diff --git a/drivers/staging/brcm80211/sys/wlc_ampdu.c b/drivers/staging/brcm80211/sys/wlc_ampdu.c
index cb98baa..dcc2969 100644
--- a/drivers/staging/brcm80211/sys/wlc_ampdu.c
+++ b/drivers/staging/brcm80211/sys/wlc_ampdu.c
@@ -1329,7 +1329,7 @@ void wlc_ampdu_macaddr_upd(struct wlc_info *wlc)

/* driver needs to write the ta in the template; ta is at offset 16 */
memset(template, 0, sizeof(template));
- bcopy((char *)wlc->pub->cur_etheraddr.octet, template, ETH_ALEN);
+ memcpy(template, wlc->pub->cur_etheraddr.octet, ETH_ALEN);
wlc_write_template_ram(wlc, (T_BA_TPL_BASE + 16), (T_RAM_ACCESS_SZ * 2),
template);
}
diff --git a/drivers/staging/brcm80211/sys/wlc_bmac.c b/drivers/staging/brcm80211/sys/wlc_bmac.c
index 69f600a..a74d2a1 100644
--- a/drivers/staging/brcm80211/sys/wlc_bmac.c
+++ b/drivers/staging/brcm80211/sys/wlc_bmac.c
@@ -1350,13 +1350,13 @@ void wlc_bmac_wait_for_wake(struct wlc_hw_info *wlc_hw)

void wlc_bmac_hw_etheraddr(struct wlc_hw_info *wlc_hw, struct ether_addr *ea)
{
- bcopy(&wlc_hw->etheraddr, ea, ETH_ALEN);
+ memcpy(ea, &wlc_hw->etheraddr, ETH_ALEN);
}

void wlc_bmac_set_hw_etheraddr(struct wlc_hw_info *wlc_hw,
struct ether_addr *ea)
{
- bcopy(ea, &wlc_hw->etheraddr, ETH_ALEN);
+ memcpy(&wlc_hw->etheraddr, ea, ETH_ALEN);
}

int wlc_bmac_bandtype(struct wlc_hw_info *wlc_hw)
@@ -1811,7 +1811,7 @@ wlc_bmac_write_template_ram(struct wlc_hw_info *wlc_hw, int offset, int len,
be_bit = (R_REG(osh, &regs->maccontrol) & MCTL_BIGEND) != 0;

while (len > 0) {
- bcopy((u8 *) buf, &word, sizeof(u32));
+ memcpy(&word, buf, sizeof(u32));

if (be_bit)
word = hton32(word);
diff --git a/drivers/staging/brcm80211/sys/wlc_mac80211.c b/drivers/staging/brcm80211/sys/wlc_mac80211.c
index aa4d01f..ddca7ff 100644
--- a/drivers/staging/brcm80211/sys/wlc_mac80211.c
+++ b/drivers/staging/brcm80211/sys/wlc_mac80211.c
@@ -990,7 +990,7 @@ static int wlc_get_current_txpwr(struct wlc_info *wlc, void *pwr, uint len)
* or convert to a tx_power_legacy_t struct
*/
if (!old_power) {
- bcopy(&power, pwr, sizeof(tx_power_t));
+ memcpy(pwr, &power, sizeof(tx_power_t));
} else {
int band_idx = CHSPEC_IS2G(power.chanspec) ? 0 : 1;

@@ -1840,8 +1840,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,

wlc_bmac_hw_etheraddr(wlc->hw, &wlc->perm_etheraddr);

- bcopy((char *)&wlc->perm_etheraddr, (char *)&pub->cur_etheraddr,
- ETH_ALEN);
+ memcpy(&pub->cur_etheraddr, &wlc->perm_etheraddr, ETH_ALEN);

for (j = 0; j < NBANDS(wlc); j++) {
/* Use band 1 for single band 11a */
@@ -2892,7 +2891,7 @@ int wlc_set_gmode(struct wlc_info *wlc, u8 gmode, bool config)

/* Set default bss rateset */
wlc->default_bss->rateset.count = rs.count;
- bcopy((char *)rs.rates, (char *)wlc->default_bss->rateset.rates,
+ memcpy(wlc->default_bss->rateset.rates, rs.rates,
sizeof(wlc->default_bss->rateset.rates));

return ret;
@@ -2986,7 +2985,7 @@ static int wlc_set_rateset(struct wlc_info *wlc, wlc_rateset_t *rs_arg)
wlc_rateset_t rs, new;
uint bandunit;

- bcopy((char *)rs_arg, (char *)&rs, sizeof(wlc_rateset_t));
+ memcpy(&rs, rs_arg, sizeof(wlc_rateset_t));

/* check for bad count value */
if ((rs.count == 0) || (rs.count > WLC_NUMRATES))
@@ -2994,7 +2993,7 @@ static int wlc_set_rateset(struct wlc_info *wlc, wlc_rateset_t *rs_arg)

/* try the current band */
bandunit = wlc->band->bandunit;
- bcopy((char *)&rs, (char *)&new, sizeof(wlc_rateset_t));
+ memcpy(&new, &rs, sizeof(wlc_rateset_t));
if (wlc_rate_hwrs_filter_sort_validate
(&new, &wlc->bandstate[bandunit]->hw_rateset, true,
wlc->stf->txstreams))
@@ -3003,7 +3002,7 @@ static int wlc_set_rateset(struct wlc_info *wlc, wlc_rateset_t *rs_arg)
/* try the other band */
if (IS_MBAND_UNLOCKED(wlc)) {
bandunit = OTHERBANDUNIT(wlc);
- bcopy((char *)&rs, (char *)&new, sizeof(wlc_rateset_t));
+ memcpy(&new, &rs, sizeof(wlc_rateset_t));
if (wlc_rate_hwrs_filter_sort_validate(&new,
&wlc->
bandstate[bandunit]->
@@ -3016,9 +3015,8 @@ static int wlc_set_rateset(struct wlc_info *wlc, wlc_rateset_t *rs_arg)

good:
/* apply new rateset */
- bcopy((char *)&new, (char *)&wlc->default_bss->rateset,
- sizeof(wlc_rateset_t));
- bcopy((char *)&new, (char *)&wlc->bandstate[bandunit]->defrateset,
+ memcpy(&wlc->default_bss->rateset, &new, sizeof(wlc_rateset_t));
+ memcpy(&wlc->bandstate[bandunit]->defrateset, &new,
sizeof(wlc_rateset_t));
return 0;
}
@@ -3099,7 +3097,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,

/* This will prevent the misaligned access */
if (pval && (u32) len >= sizeof(val))
- bcopy(pval, &val, sizeof(val));
+ memcpy(&val, pval, sizeof(val));
else
val = 0;

@@ -3595,18 +3593,18 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
if (src_key) {
key.index = src_key->id;
key.len = src_key->len;
- bcopy(src_key->data, key.data, key.len);
+ memcpy(key.data, src_key->data, key.len);
key.algo = src_key->algo;
if (WSEC_SOFTKEY(wlc, src_key, bsscfg))
key.flags |= WL_SOFT_KEY;
if (src_key->flags & WSEC_PRIMARY_KEY)
key.flags |= WL_PRIMARY_KEY;

- bcopy(src_key->ea.octet, key.ea.octet,
- ETH_ALEN);
+ memcpy(key.ea.octet, src_key->ea.octet,
+ ETH_ALEN);
}

- bcopy((char *)&key, arg, sizeof(key));
+ memcpy(arg, &key, sizeof(key));
} else
bcmerror = BCME_BADKEYIDX;
break;
@@ -3657,7 +3655,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
seq[6] = 0;
seq[7] = 0;

- bcopy((char *)seq, arg, sizeof(seq));
+ memcpy(arg, seq, sizeof(seq));
} else {
bcmerror = BCME_BADKEYIDX;
}
@@ -3680,7 +3678,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,

/* Copy only legacy rateset section */
ret_rs->count = rs->count;
- bcopy(&rs->rates, &ret_rs->rates, rs->count);
+ memcpy(&ret_rs->rates, &rs->rates, rs->count);
break;
}

@@ -3698,7 +3696,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,

/* Copy only legacy rateset section */
ret_rs->count = rs.count;
- bcopy(&rs.rates, &ret_rs->rates, rs.count);
+ memcpy(&ret_rs->rates, &rs.rates, rs.count);
break;
}

@@ -3720,16 +3718,18 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,

/* Copy only legacy rateset section */
rs.count = in_rs->count;
- bcopy(&in_rs->rates, &rs.rates, rs.count);
+ memcpy(&rs.rates, &in_rs->rates, rs.count);

/* merge rateset coming in with the current mcsset */
if (N_ENAB(wlc->pub)) {
if (bsscfg->associated)
- bcopy(&current_bss->rateset.mcs[0],
- rs.mcs, MCSSET_LEN);
+ memcpy(rs.mcs,
+ &current_bss->rateset.mcs[0],
+ MCSSET_LEN);
else
- bcopy(&wlc->default_bss->rateset.mcs[0],
- rs.mcs, MCSSET_LEN);
+ memcpy(rs.mcs,
+ &wlc->default_bss->rateset.mcs[0],
+ MCSSET_LEN);
}

bcmerror = wlc_set_rateset(wlc, &rs);
@@ -4032,7 +4032,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
bcmerror = BCME_BUFTOOSHORT;
break;
}
- bcopy((char *)arg, (char *)&rs, sizeof(wlc_rateset_t));
+ memcpy(&rs, arg, sizeof(wlc_rateset_t));

/* check for bad count value */
if (rs.count > WLC_NUMRATES) {
@@ -4068,8 +4068,8 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
}

/* apply new rateset to the override */
- bcopy((char *)&new, (char *)&wlc->sup_rates_override,
- sizeof(wlc_rateset_t));
+ memcpy(&wlc->sup_rates_override, &new,
+ sizeof(wlc_rateset_t));

/* update bcn and probe resp if needed */
if (wlc->pub->up && AP_ENAB(wlc->pub)
@@ -4092,8 +4092,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
bcmerror = BCME_BUFTOOSHORT;
break;
}
- bcopy((char *)&wlc->sup_rates_override, (char *)arg,
- sizeof(wlc_rateset_t));
+ memcpy(arg, &wlc->sup_rates_override, sizeof(wlc_rateset_t));

break;

@@ -4502,7 +4501,7 @@ wlc_iovar_check(struct wlc_pub *pub, const bcm_iovar_t *vi, void *arg, int len,
case IOVT_UINT8:
case IOVT_UINT16:
case IOVT_UINT32:
- bcopy(arg, &int_val, sizeof(int));
+ memcpy(&int_val, arg, sizeof(int));
err = wlc_iovar_rangecheck(wlc, int_val, vi);
break;
}
@@ -4546,11 +4545,12 @@ wlc_doiovar(void *hdl, const bcm_iovar_t *vi, u32 actionid,

/* convenience int and bool vals for first 8 bytes of buffer */
if (p_len >= (int)sizeof(int_val))
- bcopy(params, &int_val, sizeof(int_val));
+ memcpy(&int_val, params, sizeof(int_val));

if (p_len >= (int)sizeof(int_val) * 2)
- bcopy((void *)((unsigned long)params + sizeof(int_val)), &int_val2,
- sizeof(int_val));
+ memcpy(&int_val2,
+ (void *)((unsigned long)params + sizeof(int_val)),
+ sizeof(int_val));

/* convenience int ptr for 4-byte gets (requires int aligned arg) */
ret_int_ptr = (s32 *) arg;
@@ -5953,8 +5953,8 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
/* (3) PLCP: determine PLCP header and MAC duration, fill d11txh_t */
wlc_compute_plcp(wlc, rspec[0], phylen, plcp);
wlc_compute_plcp(wlc, rspec[1], phylen, plcp_fallback);
- bcopy(plcp_fallback, (char *)&txh->FragPLCPFallback,
- sizeof(txh->FragPLCPFallback));
+ memcpy(&txh->FragPLCPFallback, plcp_fallback,
+ sizeof(txh->FragPLCPFallback));

/* Length field now put in CCK FBR CRC field */
if (IS_CCK(rspec[1])) {
@@ -6027,14 +6027,14 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
}

/* MacFrameControl */
- bcopy((char *)&h->frame_control, (char *)&txh->MacFrameControl, sizeof(u16));
+ memcpy(&txh->MacFrameControl, &h->frame_control, sizeof(u16));

txh->TxFesTimeNormal = htol16(0);

txh->TxFesTimeFallback = htol16(0);

/* TxFrameRA */
- bcopy((char *)h->addr1, (char *)&txh->TxFrameRA, ETH_ALEN);
+ memcpy(&txh->TxFrameRA, h->addr1, ETH_ALEN);

/* TxFrameID */
txh->TxFrameID = htol16(frameid);
@@ -6102,8 +6102,8 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
/* fallback rate version of RTS PLCP header */
wlc_compute_plcp(wlc, rts_rspec[1], rts_phylen,
rts_plcp_fallback);
- bcopy(rts_plcp_fallback, (char *)&txh->RTSPLCPFallback,
- sizeof(txh->RTSPLCPFallback));
+ memcpy(&txh->RTSPLCPFallback, rts_plcp_fallback,
+ sizeof(txh->RTSPLCPFallback));

/* RTS frame fields... */
rts = (struct ieee80211_rts *)&txh->rts_frame;
@@ -6122,12 +6122,11 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
if (use_cts) {
rts->frame_control = cpu_to_le16(IEEE80211_FTYPE_CTL |
IEEE80211_STYPE_CTS);
- bcopy((char *)h->addr2, (char *)rts->ra, ETH_ALEN);
+ memcpy(rts->ra, h->addr2, ETH_ALEN);
} else {
rts->frame_control = cpu_to_le16(IEEE80211_FTYPE_CTL |
IEEE80211_STYPE_RTS);
- bcopy((char *)h->addr1, (char *)rts->ra,
- 2 * ETH_ALEN);
+ memcpy(rts->ra, h->addr1, 2 * ETH_ALEN);
}

/* mainrate
@@ -7656,10 +7655,9 @@ wlc_bcn_prb_template(struct wlc_info *wlc, uint type, ratespec_t bcn_rspec,
/* DUR is 0 for multicast bcn, or filled in by MAC for prb resp */
/* A1 filled in by MAC for prb resp, broadcast for bcn */
if (type == IEEE80211_STYPE_BEACON)
- bcopy((const char *)&ether_bcast, h->da,
- ETH_ALEN);
- bcopy((char *)&cfg->cur_etheraddr, h->sa, ETH_ALEN);
- bcopy((char *)&cfg->BSSID, h->bssid, ETH_ALEN);
+ memcpy(h->da, &ether_bcast, ETH_ALEN);
+ memcpy(h->sa, &cfg->cur_etheraddr, ETH_ALEN);
+ memcpy(h->bssid, &cfg->BSSID, ETH_ALEN);

/* SEQ filled in by MAC */

@@ -7750,7 +7748,7 @@ void wlc_shm_ssid_upd(struct wlc_info *wlc, wlc_bsscfg_t *cfg)

/* padding the ssid with zero and copy it into shm */
memset(ssidbuf, 0, DOT11_MAX_SSID_LEN);
- bcopy(ssidptr, ssidbuf, cfg->SSID_len);
+ memcpy(ssidbuf, ssidptr, cfg->SSID_len);

wlc_copyto_shm(wlc, base, ssidbuf, DOT11_MAX_SSID_LEN);

diff --git a/drivers/staging/brcm80211/sys/wlc_rate.c b/drivers/staging/brcm80211/sys/wlc_rate.c
index ab7d0be..6904f8b 100644
--- a/drivers/staging/brcm80211/sys/wlc_rate.c
+++ b/drivers/staging/brcm80211/sys/wlc_rate.c
@@ -382,7 +382,7 @@ ratespec_t BCMFASTPATH wlc_compute_rspec(d11rxhdr_t *rxh, u8 *plcp)
/* copy rateset src to dst as-is (no masking or sorting) */
void wlc_rateset_copy(const wlc_rateset_t *src, wlc_rateset_t *dst)
{
- bcopy(src, dst, sizeof(wlc_rateset_t));
+ memcpy(dst, src, sizeof(wlc_rateset_t));
}

/*
@@ -417,7 +417,7 @@ wlc_rateset_filter(wlc_rateset_t *src, wlc_rateset_t *dst, bool basic_only,
dst->htphy_membership = src->htphy_membership;

if (mcsallow && rates != WLC_RATES_CCK)
- bcopy(&src->mcs[0], &dst->mcs[0], MCSSET_LEN);
+ memcpy(&dst->mcs[0], &src->mcs[0], MCSSET_LEN);
else
wlc_rateset_mcs_clear(dst);
}
@@ -487,7 +487,7 @@ void wlc_rateset_mcs_clear(wlc_rateset_t *rateset)

void wlc_rateset_mcs_build(wlc_rateset_t *rateset, u8 txstreams)
{
- bcopy(&cck_ofdm_mimo_rates.mcs[0], &rateset->mcs[0], MCSSET_LEN);
+ memcpy(&rateset->mcs[0], &cck_ofdm_mimo_rates.mcs[0], MCSSET_LEN);
wlc_rateset_mcs_upd(rateset, txstreams);
}

diff --git a/drivers/staging/brcm80211/sys/wlc_stf.c b/drivers/staging/brcm80211/sys/wlc_stf.c
index bb56a88..c067fa4 100644
--- a/drivers/staging/brcm80211/sys/wlc_stf.c
+++ b/drivers/staging/brcm80211/sys/wlc_stf.c
@@ -558,7 +558,7 @@ void wlc_stf_phy_chain_calc(struct wlc_info *wlc)
wlc->stf->rxstreams = (u8) WLC_BITSCNT(wlc->stf->hw_rxchain);

/* initialize the txcore table */
- bcopy(txcore_default, wlc->stf->txcore, sizeof(wlc->stf->txcore));
+ memcpy(wlc->stf->txcore, txcore_default, sizeof(wlc->stf->txcore));

/* default spatial_policy */
wlc->stf->spatial_policy = MIN_SPATIAL_EXPANSION;
diff --git a/drivers/staging/brcm80211/util/bcmotp.c b/drivers/staging/brcm80211/util/bcmotp.c
index d820e7b..6fa04ed 100644
--- a/drivers/staging/brcm80211/util/bcmotp.c
+++ b/drivers/staging/brcm80211/util/bcmotp.c
@@ -818,7 +818,7 @@ static int hndotp_nvread(void *oh, char *data, uint *len)
if (offset + dsz >= *len) {
goto out;
}
- bcopy((char *)&rawotp[i + 2], &data[offset], dsz);
+ memcpy(&data[offset], &rawotp[i + 2], dsz);
offset += dsz;
/* Remove extra null characters at the end */
while (offset > 1 &&
diff --git a/drivers/staging/brcm80211/util/bcmsrom.c b/drivers/staging/brcm80211/util/bcmsrom.c
index 19d4502..992d247 100644
--- a/drivers/staging/brcm80211/util/bcmsrom.c
+++ b/drivers/staging/brcm80211/util/bcmsrom.c
@@ -1336,8 +1336,8 @@ int srom_parsecis(struct osl_info *osh, u8 *pcis[], uint ciscnt, char **vars,
u8 srev = cis[i + 1 + 70];
ASSERT(srev == 3);
/* make tuple value 16-bit aligned and parse it */
- bcopy(&cis[i + 1], srom,
- sizeof(srom));
+ memcpy(srom, &cis[i + 1],
+ sizeof(srom));
_initvars_srom_pci(srev, srom,
SROM3_SWRGN_OFF,
&b);
@@ -1518,7 +1518,7 @@ static int otp_read_pci(struct osl_info *osh, si_t *sih, u16 *buf, uint bufsz)

err = otp_read_region(sih, OTP_HW_RGN, (u16 *) otp, &sz);

- bcopy(otp, buf, bufsz);
+ memcpy(buf, otp, bufsz);

if (otp)
kfree(otp);
@@ -1562,7 +1562,7 @@ static int initvars_table(struct osl_info *osh, char *start, char *end,
ASSERT(vp != NULL);
if (!vp)
return BCME_NOMEM;
- bcopy(start, vp, c);
+ memcpy(vp, start, c);
*vars = vp;
*count = c;
} else {
diff --git a/drivers/staging/brcm80211/util/bcmutils.c b/drivers/staging/brcm80211/util/bcmutils.c
index fd30cc6..43bce96 100644
--- a/drivers/staging/brcm80211/util/bcmutils.c
+++ b/drivers/staging/brcm80211/util/bcmutils.c
@@ -51,7 +51,7 @@ uint pktfrombuf(struct osl_info *osh, struct sk_buff *p, uint offset, int len,
/* copy the data */
for (; p && len; p = p->next) {
n = min((uint) (p->len) - offset, (uint) len);
- bcopy(buf, p->data + offset, n);
+ memcpy(p->data + offset, buf, n);
buf += n;
len -= n;
ret += n;
diff --git a/drivers/staging/brcm80211/util/hnddma.c b/drivers/staging/brcm80211/util/hnddma.c
index d088692..3bfaad9 100644
--- a/drivers/staging/brcm80211/util/hnddma.c
+++ b/drivers/staging/brcm80211/util/hnddma.c
@@ -1961,8 +1961,8 @@ static void dma32_txrotate(dma_info_t *di)

/* Move the segment map as well */
if (DMASGLIST_ENAB) {
- bcopy(&di->txp_dmah[old], &di->txp_dmah[new],
- sizeof(hnddma_seg_map_t));
+ memcpy(&di->txp_dmah[new], &di->txp_dmah[old],
+ sizeof(hnddma_seg_map_t));
memset(&di->txp_dmah[old], 0, sizeof(hnddma_seg_map_t));
}

@@ -2639,8 +2639,8 @@ static void dma64_txrotate(dma_info_t *di)

/* Move the map */
if (DMASGLIST_ENAB) {
- bcopy(&di->txp_dmah[old], &di->txp_dmah[new],
- sizeof(hnddma_seg_map_t));
+ memcpy(&di->txp_dmah[new], &di->txp_dmah[old],
+ sizeof(hnddma_seg_map_t));
memset(&di->txp_dmah[old], 0, sizeof(hnddma_seg_map_t));
}

diff --git a/drivers/staging/brcm80211/util/nvram/nvram_ro.c b/drivers/staging/brcm80211/util/nvram/nvram_ro.c
index e4d41ee..b2e6c0d 100644
--- a/drivers/staging/brcm80211/util/nvram/nvram_ro.c
+++ b/drivers/staging/brcm80211/util/nvram/nvram_ro.c
@@ -70,7 +70,7 @@ static void get_flash_nvram(si_t *sih, struct nvram_header *nvh)
new->next = vars;
vars = new;

- bcopy((char *)(&nvh[1]), new->vars, nvs);
+ memcpy(new->vars, &nvh[1], nvs);

NVR_MSG(("%s: flash nvram @ %p, copied %d bytes to %p\n", __func__,
nvh, nvs, new->vars));
@@ -195,7 +195,7 @@ int nvram_getall(char *buf, int count)
len = strlen(from) + 1;
if (resid < (acc + len))
return BCME_BUFTOOSHORT;
- bcopy(from, to, len);
+ memcpy(to, from, len);
acc += len;
from += len;
to += len;
diff --git a/drivers/staging/brcm80211/util/siutils.c b/drivers/staging/brcm80211/util/siutils.c
index b66de9b..6ff331c 100644
--- a/drivers/staging/brcm80211/util/siutils.c
+++ b/drivers/staging/brcm80211/util/siutils.c
@@ -700,7 +700,7 @@ void si_detach(si_t *sih)
uint idx;

struct si_pub *si_local = NULL;
- bcopy(&sih, &si_local, sizeof(si_t **));
+ memcpy(&si_local, &sih, sizeof(si_t **));

sii = SI_INFO(sih);

--
1.7.1


2011-02-13 14:40:58

by Stanislav Fomichev

[permalink] [raw]
Subject: [PATCH 2/8] brcm80211: replace dot11_rts_frame with ieee80211_rts

Signed-off-by: Stanislav Fomichev <[email protected]>
---
drivers/staging/brcm80211/include/d11.h | 4 +++-
drivers/staging/brcm80211/include/proto/802.11.h | 7 -------
drivers/staging/brcm80211/sys/wlc_ampdu.c | 12 ++++++------
drivers/staging/brcm80211/sys/wlc_mac80211.c | 22 +++++++++++-----------
4 files changed, 20 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/brcm80211/include/d11.h b/drivers/staging/brcm80211/include/d11.h
index be2d497..604ef60 100644
--- a/drivers/staging/brcm80211/include/d11.h
+++ b/drivers/staging/brcm80211/include/d11.h
@@ -17,6 +17,8 @@
#ifndef _D11_H
#define _D11_H

+#include <linux/ieee80211.h>
+
/* This marks the start of a packed structure section. */
#include <packed_section_start.h>

@@ -739,7 +741,7 @@ BWL_PRE_PACKED_STRUCT struct d11txh {
u16 MaxABytes_FBR; /* 0x2a corerev >=16 */
u16 MinMBytes; /* 0x2b corerev >=16 */
u8 RTSPhyHeader[D11_PHY_HDR_LEN]; /* 0x2c - 0x2e */
- struct dot11_rts_frame rts_frame; /* 0x2f - 0x36 */
+ struct ieee80211_rts rts_frame; /* 0x2f - 0x36 */
u16 PAD; /* 0x37 */
} BWL_POST_PACKED_STRUCT;

diff --git a/drivers/staging/brcm80211/include/proto/802.11.h b/drivers/staging/brcm80211/include/proto/802.11.h
index 3bc066a..db4328d 100644
--- a/drivers/staging/brcm80211/include/proto/802.11.h
+++ b/drivers/staging/brcm80211/include/proto/802.11.h
@@ -45,13 +45,6 @@

#define DOT11_OUI_LEN 3

-BWL_PRE_PACKED_STRUCT struct dot11_rts_frame {
- u16 fc;
- u16 durid;
- struct ether_addr ra;
- struct ether_addr ta;
-} BWL_POST_PACKED_STRUCT;
-
#define DOT11_RTS_LEN 16
#define DOT11_CTS_LEN 10
#define DOT11_ACK_LEN 10
diff --git a/drivers/staging/brcm80211/sys/wlc_ampdu.c b/drivers/staging/brcm80211/sys/wlc_ampdu.c
index 74da502..ae051de 100644
--- a/drivers/staging/brcm80211/sys/wlc_ampdu.c
+++ b/drivers/staging/brcm80211/sys/wlc_ampdu.c
@@ -519,7 +519,7 @@ wlc_sendampdu(struct ampdu_info *ampdu, wlc_txq_info_t *qi,
ratespec_t rspec = 0, rspec_fallback = 0;
ratespec_t rts_rspec = 0, rts_rspec_fallback = 0;
u16 mimo_ctlchbw = PHY_TXC1_BW_20MHZ;
- struct dot11_rts_frame *rts;
+ struct ieee80211_rts *rts;
u8 rr_retry_limit;
wlc_fifo_info_t *f;
bool fbr_iscck;
@@ -639,8 +639,8 @@ wlc_sendampdu(struct ampdu_info *ampdu, wlc_txq_info_t *qi,
mcl |= (TXC_AMPDU_FIRST << TXC_AMPDU_SHIFT);
/* refill the bits since might be a retx mpdu */
mcl |= TXC_STARTMSDU;
- rts = (struct dot11_rts_frame *)&txh->rts_frame;
- fc = ltoh16(rts->fc);
+ rts = (struct ieee80211_rts *)&txh->rts_frame;
+ fc = le16_to_cpu(rts->frame_control);
if ((fc & FC_KIND_MASK) == FC_RTS) {
mcl |= TXC_SENDRTS;
use_rts = true;
@@ -837,7 +837,7 @@ wlc_sendampdu(struct ampdu_info *ampdu, wlc_txq_info_t *qi,
/* update RTS dur fields */
if (use_rts || use_cts) {
u16 durid;
- rts = (struct dot11_rts_frame *)&txh->rts_frame;
+ rts = (struct ieee80211_rts *)&txh->rts_frame;
if ((mch & TXC_PREAMBLE_RTS_MAIN_SHORT) ==
TXC_PREAMBLE_RTS_MAIN_SHORT)
rts_preamble_type = WLC_SHORT_PREAMBLE;
@@ -851,7 +851,7 @@ wlc_sendampdu(struct ampdu_info *ampdu, wlc_txq_info_t *qi,
rspec, rts_preamble_type,
preamble_type, ampdu_len,
true);
- rts->durid = htol16(durid);
+ rts->duration = cpu_to_le16(durid);
durid = wlc_compute_rtscts_dur(wlc, use_cts,
rts_rspec_fallback,
rspec_fallback,
@@ -860,7 +860,7 @@ wlc_sendampdu(struct ampdu_info *ampdu, wlc_txq_info_t *qi,
ampdu_len, true);
txh->RTSDurFallback = htol16(durid);
/* set TxFesTimeNormal */
- txh->TxFesTimeNormal = rts->durid;
+ txh->TxFesTimeNormal = rts->duration;
/* set fallback rate version of TxFesTimeNormal */
txh->TxFesTimeFallback = txh->RTSDurFallback;
}
diff --git a/drivers/staging/brcm80211/sys/wlc_mac80211.c b/drivers/staging/brcm80211/sys/wlc_mac80211.c
index 96ff02f..391e958 100644
--- a/drivers/staging/brcm80211/sys/wlc_mac80211.c
+++ b/drivers/staging/brcm80211/sys/wlc_mac80211.c
@@ -1736,7 +1736,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
ASSERT(sizeof(d11txh_t) == D11_TXH_LEN);
ASSERT(sizeof(d11rxhdr_t) == RXHDR_LEN);
ASSERT(sizeof(struct ieee80211_hdr) == DOT11_A4_HDR_LEN);
- ASSERT(sizeof(struct dot11_rts_frame) == DOT11_RTS_LEN);
+ ASSERT(sizeof(struct ieee80211_rts) == DOT11_RTS_LEN);
ASSERT(sizeof(struct dot11_management_header) == DOT11_MGMT_HDR_LEN);
ASSERT(sizeof(struct dot11_bcn_prb) == DOT11_BCN_PRB_LEN);
ASSERT(sizeof(tx_status_t) == TXSTATUS_LEN);
@@ -4858,7 +4858,7 @@ void wlc_print_txdesc(d11txh_t *txh)
u16 mmbyte = ltoh16(txh->MinMBytes);

u8 *rtsph = txh->RTSPhyHeader;
- struct dot11_rts_frame rts = txh->rts_frame;
+ struct ieee80211_rts rts = txh->rts_frame;
char hexbuf[256];

/* add plcp header along with txh descriptor */
@@ -5666,7 +5666,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
u8 preamble_type[2] = { WLC_LONG_PREAMBLE, WLC_LONG_PREAMBLE };
u8 rts_preamble_type[2] = { WLC_LONG_PREAMBLE, WLC_LONG_PREAMBLE };
u8 *rts_plcp, rts_plcp_fallback[D11_PHY_HDR_LEN];
- struct dot11_rts_frame *rts = NULL;
+ struct ieee80211_rts *rts = NULL;
bool qos;
uint ac;
u32 rate_val[2];
@@ -6110,12 +6110,12 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
sizeof(txh->RTSPLCPFallback));

/* RTS frame fields... */
- rts = (struct dot11_rts_frame *)&txh->rts_frame;
+ rts = (struct ieee80211_rts *)&txh->rts_frame;

durid = wlc_compute_rtscts_dur(wlc, use_cts, rts_rspec[0],
rspec[0], rts_preamble_type[0],
preamble_type[0], phylen, false);
- rts->durid = htol16(durid);
+ rts->duration = cpu_to_le16(durid);
/* fallback rate version of RTS DUR field */
durid = wlc_compute_rtscts_dur(wlc, use_cts,
rts_rspec[1], rspec[1],
@@ -6124,11 +6124,11 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
txh->RTSDurFallback = htol16(durid);

if (use_cts) {
- rts->fc = htol16(FC_CTS);
- bcopy((char *)h->addr2, (char *)&rts->ra, ETH_ALEN);
+ rts->frame_control = cpu_to_le16(FC_CTS);
+ bcopy((char *)h->addr2, (char *)rts->ra, ETH_ALEN);
} else {
- rts->fc = htol16((u16) FC_RTS);
- bcopy((char *)h->addr1, (char *)&rts->ra,
+ rts->frame_control = cpu_to_le16((u16) FC_RTS);
+ bcopy((char *)h->addr1, (char *)rts->ra,
2 * ETH_ALEN);
}

@@ -6142,7 +6142,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
} else {
memset((char *)txh->RTSPhyHeader, 0, D11_PHY_HDR_LEN);
memset((char *)&txh->rts_frame, 0,
- sizeof(struct dot11_rts_frame));
+ sizeof(struct ieee80211_rts));
memset((char *)txh->RTSPLCPFallback, 0,
sizeof(txh->RTSPLCPFallback));
txh->RTSDurFallback = 0;
@@ -6249,7 +6249,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
wlc_calc_cts_time(wlc, rts_rspec[1],
rts_preamble_type[1]);
/* (SIFS + CTS) + SIFS + frame + SIFS + ACK */
- dur += ltoh16(rts->durid);
+ dur += le16_to_cpu(rts->duration);
dur_fallback += ltoh16(txh->RTSDurFallback);
} else if (use_rifs) {
dur = frag_dur;
--
1.7.1


2011-02-13 14:41:02

by Stanislav Fomichev

[permalink] [raw]
Subject: [PATCH 5/8] brcm80211: replace FC_ defines

Signed-off-by: Stanislav Fomichev <[email protected]>
---
drivers/staging/brcm80211/include/proto/802.11.h | 33 ------------
drivers/staging/brcm80211/sys/wlc_ampdu.c | 8 ++--
drivers/staging/brcm80211/sys/wlc_mac80211.c | 59 +++++++++++-----------
3 files changed, 33 insertions(+), 67 deletions(-)

diff --git a/drivers/staging/brcm80211/include/proto/802.11.h b/drivers/staging/brcm80211/include/proto/802.11.h
index 3238dad..4e3748f 100644
--- a/drivers/staging/brcm80211/include/proto/802.11.h
+++ b/drivers/staging/brcm80211/include/proto/802.11.h
@@ -128,43 +128,10 @@ typedef struct wme_param_ie wme_param_ie_t;
#define DOT11_OPEN_SYSTEM 0
#define DOT11_SHARED_KEY 1

-#define FC_TYPE_MASK 0xC
-#define FC_TYPE_SHIFT 2
-#define FC_SUBTYPE_MASK 0xF0
-#define FC_SUBTYPE_SHIFT 4
-#define FC_MOREFRAG 0x400
-
#define SEQNUM_SHIFT 4
#define SEQNUM_MAX 0x1000
#define FRAGNUM_MASK 0xF

-#define FC_TYPE_MNG 0
-#define FC_TYPE_CTL 1
-#define FC_TYPE_DATA 2
-
-#define FC_SUBTYPE_PROBE_REQ 4
-#define FC_SUBTYPE_PROBE_RESP 5
-#define FC_SUBTYPE_BEACON 8
-#define FC_SUBTYPE_PS_POLL 10
-#define FC_SUBTYPE_RTS 11
-#define FC_SUBTYPE_CTS 12
-
-#define FC_SUBTYPE_ANY_QOS(s) (((s) & 8) != 0)
-
-#define FC_KIND_MASK (FC_TYPE_MASK | FC_SUBTYPE_MASK)
-
-#define FC_KIND(t, s) (((t) << FC_TYPE_SHIFT) | ((s) << FC_SUBTYPE_SHIFT))
-
-#define FC_SUBTYPE(fc) (((fc) & FC_SUBTYPE_MASK) >> FC_SUBTYPE_SHIFT)
-#define FC_TYPE(fc) (((fc) & FC_TYPE_MASK) >> FC_TYPE_SHIFT)
-
-#define FC_PROBE_REQ FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_PROBE_REQ)
-#define FC_PROBE_RESP FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_PROBE_RESP)
-#define FC_BEACON FC_KIND(FC_TYPE_MNG, FC_SUBTYPE_BEACON)
-#define FC_PS_POLL FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_PS_POLL)
-#define FC_RTS FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_RTS)
-#define FC_CTS FC_KIND(FC_TYPE_CTL, FC_SUBTYPE_CTS)
-
#define TLV_LEN_OFF 1
#define TLV_HDR_LEN 2
#define TLV_BODY_OFF 2
diff --git a/drivers/staging/brcm80211/sys/wlc_ampdu.c b/drivers/staging/brcm80211/sys/wlc_ampdu.c
index ae051de..cb98baa 100644
--- a/drivers/staging/brcm80211/sys/wlc_ampdu.c
+++ b/drivers/staging/brcm80211/sys/wlc_ampdu.c
@@ -635,17 +635,17 @@ wlc_sendampdu(struct ampdu_info *ampdu, wlc_txq_info_t *qi,
* test whether need to break or change the epoch
*/
if (count == 0) {
- u16 fc;
mcl |= (TXC_AMPDU_FIRST << TXC_AMPDU_SHIFT);
/* refill the bits since might be a retx mpdu */
mcl |= TXC_STARTMSDU;
rts = (struct ieee80211_rts *)&txh->rts_frame;
- fc = le16_to_cpu(rts->frame_control);
- if ((fc & FC_KIND_MASK) == FC_RTS) {
+
+ if (ieee80211_is_rts(rts->frame_control)) {
mcl |= TXC_SENDRTS;
use_rts = true;
}
- if ((fc & FC_KIND_MASK) == FC_CTS) {
+
+ if (ieee80211_is_cts(rts->frame_control)) {
mcl |= TXC_SENDCTS;
use_cts = true;
}
diff --git a/drivers/staging/brcm80211/sys/wlc_mac80211.c b/drivers/staging/brcm80211/sys/wlc_mac80211.c
index ce13e2e..aa4d01f 100644
--- a/drivers/staging/brcm80211/sys/wlc_mac80211.c
+++ b/drivers/staging/brcm80211/sys/wlc_mac80211.c
@@ -5114,15 +5114,12 @@ wlc_sendpkt_mac80211(struct wlc_info *wlc, struct sk_buff *sdu,
void *pkt;
struct scb *scb = &global_scb;
struct ieee80211_hdr *d11_header = (struct ieee80211_hdr *)(sdu->data);
- u16 type, fc;

ASSERT(sdu);

- fc = le16_to_cpu(d11_header->frame_control);
- type = FC_TYPE(fc);
-
/* 802.11 standard requires management traffic to go at highest priority */
- prio = (type == FC_TYPE_DATA ? sdu->priority : MAXPRIO);
+
+ prio = (ieee80211_is_data(d11_header->frame_control) ? sdu->priority : MAXPRIO);
fifo = prio2fifo[prio];

ASSERT((uint) skb_headroom(sdu) >= TXOFF);
@@ -5655,7 +5652,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
u8 *plcp, plcp_fallback[D11_PHY_HDR_LEN];
struct osl_info *osh;
int len, phylen, rts_phylen;
- u16 fc, type, frameid, mch, phyctl, xfts, mainrates;
+ u16 frameid, mch, phyctl, xfts, mainrates;
u16 seq = 0, mcl = 0, status = 0;
ratespec_t rspec[2] = { WLC_RATE_1M, WLC_RATE_1M }, rts_rspec[2] = {
WLC_RATE_1M, WLC_RATE_1M};
@@ -5694,10 +5691,8 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,

/* locate 802.11 MAC header */
h = (struct ieee80211_hdr *)(p->data);
- fc = le16_to_cpu(h->frame_control);
- type = FC_TYPE(fc);

- qos = (type == FC_TYPE_DATA && FC_SUBTYPE_ANY_QOS(FC_SUBTYPE(fc)));
+ qos = (ieee80211_is_data_qos(h->frame_control));

/* compute length of frame in bytes for use in PLCP computations */
len = pkttotlen(osh, p);
@@ -5749,7 +5744,8 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
frameid |= queue & TXFID_QUEUE_MASK;

/* set the ignpmq bit for all pkts tx'd in PS mode and for beacons */
- if (SCB_PS(scb) || ((fc & FC_KIND_MASK) == FC_BEACON))
+
+ if (SCB_PS(scb) || ieee80211_is_beacon(h->frame_control))
mcl |= TXC_IGNOREPMQ;

ASSERT(hw->max_rates <= IEEE80211_TX_MAX_RATES);
@@ -5972,7 +5968,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
plcp[0];

/* DUR field for main rate */
- if ((fc != FC_PS_POLL) &&
+ if (!ieee80211_is_pspoll(h->frame_control) &&
!is_multicast_ether_addr(h->addr1) && !use_rifs) {
durid =
wlc_compute_frame_dur(wlc, rspec[0], preamble_type[0],
@@ -5989,7 +5985,7 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
}

/* DUR field for fallback rate */
- if (fc == FC_PS_POLL)
+ if (ieee80211_is_pspoll(h->frame_control))
txh->FragDurFallback = h->duration_id;
else if (is_multicast_ether_addr(h->addr1) || use_rifs)
txh->FragDurFallback = 0;
@@ -6124,10 +6120,12 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
txh->RTSDurFallback = htol16(durid);

if (use_cts) {
- rts->frame_control = cpu_to_le16(FC_CTS);
+ rts->frame_control = cpu_to_le16(IEEE80211_FTYPE_CTL |
+ IEEE80211_STYPE_CTS);
bcopy((char *)h->addr2, (char *)rts->ra, ETH_ALEN);
} else {
- rts->frame_control = cpu_to_le16((u16) FC_RTS);
+ rts->frame_control = cpu_to_le16(IEEE80211_FTYPE_CTL |
+ IEEE80211_STYPE_RTS);
bcopy((char *)h->addr1, (char *)rts->ra,
2 * ETH_ALEN);
}
@@ -6620,7 +6618,7 @@ wlc_dotxstatus(struct wlc_info *wlc, tx_status_t *txs, u32 frm_tx2)
tx_rts_count =
(txs->status & TX_STATUS_RTS_RTX_MASK) >> TX_STATUS_RTS_RTX_SHIFT;

- lastframe = (fc & FC_MOREFRAG) == 0;
+ lastframe = (ieee80211_has_morefrags(h->frame_control) == 0);

if (!lastframe) {
WL_ERROR("Not last frame!\n");
@@ -7041,7 +7039,9 @@ void BCMFASTPATH wlc_recv(struct wlc_info *wlc, struct sk_buff *p)
/* explicitly test bad src address to avoid sending bad deauth */
if (!is_amsdu) {
/* CTS and ACK CTL frames are w/o a2 */
- if (FC_TYPE(fc) == FC_TYPE_DATA || FC_TYPE(fc) == FC_TYPE_MNG) {
+
+ if (ieee80211_is_data(h->frame_control) ||
+ ieee80211_is_mgmt(h->frame_control)) {
if ((is_zero_ether_addr(h->addr2) ||
is_multicast_ether_addr(h->addr2))) {
WL_ERROR("wl%d: %s: dropping a frame with invalid src mac address, a2: %pM\n",
@@ -7054,10 +7054,8 @@ void BCMFASTPATH wlc_recv(struct wlc_info *wlc, struct sk_buff *p)
}

/* due to sheer numbers, toss out probe reqs for now */
- if (FC_TYPE(fc) == FC_TYPE_MNG) {
- if ((fc & FC_KIND_MASK) == FC_PROBE_REQ)
- goto toss;
- }
+ if (ieee80211_is_probe_req(h->frame_control))
+ goto toss;

if (is_amsdu) {
WL_ERROR("%s: is_amsdu causing toss\n", __func__);
@@ -7618,9 +7616,10 @@ wlc_bcn_prb_template(struct wlc_info *wlc, uint type, ratespec_t bcn_rspec,
int hdr_len, body_len;

ASSERT(*len >= 142);
- ASSERT(type == FC_BEACON || type == FC_PROBE_RESP);
+ ASSERT(type == IEEE80211_STYPE_BEACON ||
+ type == IEEE80211_STYPE_PROBE_RESP);

- if (MBSS_BCN_ENAB(cfg) && type == FC_BEACON)
+ if (MBSS_BCN_ENAB(cfg) && type == IEEE80211_STYPE_BEACON)
hdr_len = DOT11_MAC_HDR_LEN;
else
hdr_len = D11_PHY_HDR_LEN + DOT11_MAC_HDR_LEN;
@@ -7634,7 +7633,7 @@ wlc_bcn_prb_template(struct wlc_info *wlc, uint type, ratespec_t bcn_rspec,
plcp = (cck_phy_hdr_t *) buf;

/* PLCP for Probe Response frames are filled in from core's rate table */
- if (type == FC_BEACON && !MBSS_BCN_ENAB(cfg)) {
+ if (type == IEEE80211_STYPE_BEACON && !MBSS_BCN_ENAB(cfg)) {
/* fill in PLCP */
wlc_compute_plcp(wlc, bcn_rspec,
(DOT11_MAC_HDR_LEN + body_len + DOT11_FCS_LEN),
@@ -7646,17 +7645,17 @@ wlc_bcn_prb_template(struct wlc_info *wlc, uint type, ratespec_t bcn_rspec,
if (!SOFTBCN_ENAB(cfg))
wlc_beacon_phytxctl_txant_upd(wlc, bcn_rspec);

- if (MBSS_BCN_ENAB(cfg) && type == FC_BEACON)
+ if (MBSS_BCN_ENAB(cfg) && type == IEEE80211_STYPE_BEACON)
h = (struct ieee80211_mgmt *)&plcp[0];
else
h = (struct ieee80211_mgmt *)&plcp[1];

/* fill in 802.11 header */
- h->frame_control = cpu_to_le16((u16) type);
+ h->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | type);

/* DUR is 0 for multicast bcn, or filled in by MAC for prb resp */
/* A1 filled in by MAC for prb resp, broadcast for bcn */
- if (type == FC_BEACON)
+ if (type == IEEE80211_STYPE_BEACON)
bcopy((const char *)&ether_bcast, h->da,
ETH_ALEN);
bcopy((char *)&cfg->cur_etheraddr, h->sa, ETH_ALEN);
@@ -7721,7 +7720,7 @@ void wlc_bss_update_beacon(struct wlc_info *wlc, wlc_bsscfg_t *cfg)
true));

/* update the template and ucode shm */
- wlc_bcn_prb_template(wlc, FC_BEACON, wlc->bcn_rspec, cfg, bcn,
+ wlc_bcn_prb_template(wlc, IEEE80211_STYPE_BEACON, wlc->bcn_rspec, cfg, bcn,
&len);
wlc_write_hw_bcntemplates(wlc, bcn, len, false);
}
@@ -7781,8 +7780,8 @@ wlc_bss_update_probe_resp(struct wlc_info *wlc, wlc_bsscfg_t *cfg, bool suspend)
if (!MBSS_PRB_ENAB(cfg)) {

/* create the probe response template */
- wlc_bcn_prb_template(wlc, FC_PROBE_RESP, 0, cfg, prb_resp,
- &len);
+ wlc_bcn_prb_template(wlc, IEEE80211_STYPE_PROBE_RESP, 0, cfg,
+ prb_resp, &len);

if (suspend)
wlc_suspend_mac_and_wait(wlc);
@@ -7845,7 +7844,7 @@ int wlc_prep_pdu(struct wlc_info *wlc, struct sk_buff *pdu, uint *fifop)
return BCME_BUSY;
}

- if (FC_TYPE(ltoh16(txh->MacFrameControl)) != FC_TYPE_DATA)
+ if (!ieee80211_is_data(txh->MacFrameControl))
WLCNTINCR(wlc->pub->_cnt->txctl);

return 0;
--
1.7.1


2011-02-13 16:10:05

by Arend van Spriel

[permalink] [raw]
Subject: Re: [PATCH 1/8] brcm80211: replace dot11_header with ieee80211_hdr

Stanislav Fomichev <kernel@...> writes:

>
> This is a series of patches which remove brcm specific definitions.
> Tested on MacBook 7.1.
>
Hi Stanislav,

Thanks for taking interest and initiative in this driver. These and similar
patches have already been submitted. The driver is currently in the staging
tree, which means that it is still developed in the staging-2.6 git repository
maintained by Greg KH. If you want to contribute to this driver (and you are
welcome to do so) please use that as reference. Patches are submitted to the
linuxdriverproject mailing list:

http://driverdev.linuxdriverproject.org/pipermail/devel/

> Signed-off-by: Stanislav Fomichev <kernel@...>

Gr. AvS


2011-02-19 09:26:20

by Stanislav Fomichev

[permalink] [raw]
Subject: Re: [PATCH 1/8] brcm80211: replace dot11_header with ieee80211_hdr

On Fri, Feb 18, 2011 at 12:58:15PM -0800, Greg KH wrote:
> On Sun, Feb 13, 2011 at 05:40:36PM +0300, Stanislav Fomichev wrote:
> > This is a series of patches which remove brcm specific definitions.
> > Tested on MacBook 7.1.
> >
> > Signed-off-by: Stanislav Fomichev <[email protected]>
> > ---
> > drivers/staging/brcm80211/include/proto/802.11.h | 10 ----
> > drivers/staging/brcm80211/sys/wlc_ampdu.c | 18 +++---
> > drivers/staging/brcm80211/sys/wlc_mac80211.c | 64 +++++++++++-----------
>
> You really need to do this against linux-next, as I can't apply any of
> these patches.
>
> Care to respin them and resend?
This is, again, based on the wrong tree. Pls drop. Thanks!

--
Stas