brcm80211: replace dot11_header with ieee80211_hdr
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.
--- 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(-)
drivers/staging/brcm80211/include/proto/802.11.h +0 -10
@@ -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;
drivers/staging/brcm80211/sys/wlc_ampdu.c +9 -9
@@ -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 ;
drivers/staging/brcm80211/sys/wlc_mac80211.c +32 -32
205 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 2/8 brcm80211: replace dot11_rts_frame with ieee80211_rts
--- 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(-)
drivers/staging/brcm80211/include/d11.h +3 -1
@@ -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 ;
drivers/staging/brcm80211/include/proto/802.11.h +0 -7
@@ -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
drivers/staging/brcm80211/sys/wlc_ampdu.c +6 -6
@@ -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; }
drivers/staging/brcm80211/sys/wlc_mac80211.c +11 -11
@@ -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;
Signature · 1 line
1.7.1
PATCH 3/8 brcm80211: replace dot11_management_header with ieee80211_mgmt
In reply to Stanislav Fomichev--- drivers/staging/brcm80211/include/proto/802.11.h | 8 -------- drivers/staging/brcm80211/sys/wlc_mac80211.c | 16 ++++++++-------- 2 files changed, 8 insertions(+), 16 deletions(-)
drivers/staging/brcm80211/include/proto/802.11.h +0 -8
@@ -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 {
drivers/staging/brcm80211/sys/wlc_mac80211.c +8 -8
@@ -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 *)ðer_bcast, (char *)&h->da, +bcopy ((const char *)ðer_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 */
Signature · 1 line
1.7.1
PATCH 4/8 brcm80211: replace ht_cap_ie with ieee80211_ht_cap
In reply to Stanislav Fomichev--- 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(-)
drivers/staging/brcm80211/include/proto/802.11.h +0 -26
@@ -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
drivers/staging/brcm80211/sys/wlc_mac80211.c +11 -11
@@ -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);
drivers/staging/brcm80211/sys/wlc_mac80211.h +1 -1
@@ -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 */
drivers/staging/brcm80211/sys/wlc_pub.h +5 -2
@@ -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 ;
drivers/staging/brcm80211/sys/wlc_stf.c +7 -7
@@ -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,
Signature · 1 line
1.7.1
PATCH 5/8 brcm80211: replace FC_ defines
In reply to Stanislav Fomichev--- 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(-)
drivers/staging/brcm80211/include/proto/802.11.h +0 -33
@@ -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
drivers/staging/brcm80211/sys/wlc_ampdu.c +4 -4
@@ -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; }
drivers/staging/brcm80211/sys/wlc_mac80211.c +29 -30
171 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 6/8 brcm80211: replace bcopy with memcpy
In reply to Stanislav Fomichev--- 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(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +1 -1
@@ -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 );
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +20 -20
@@ -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
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +1 -1
@@ -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); }
drivers/staging/brcm80211/brcmfmac/dhd_common.c +16 -16
@@ -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
drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c +1 -1
@@ -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 */
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +1 -1
@@ -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 );
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +36 -36
278 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +4 -6
@@ -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);
drivers/staging/brcm80211/brcmfmac/wl_iw.c +27 -28
112 lines not on this page · raw message
drivers/staging/brcm80211/include/osl.h +0 -4
@@ -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);
drivers/staging/brcm80211/phy/wlc_phy_cmn.c +31 -35
78 lines not on this page · raw message
drivers/staging/brcm80211/phy/wlc_phy_lcn.c +3 -2
@@ -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 ; } }
drivers/staging/brcm80211/sys/wl_mac80211.c +2 -2
@@ -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 ; } }
drivers/staging/brcm80211/sys/wlc_ampdu.c +1 -1
@@ -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); }
drivers/staging/brcm80211/sys/wlc_bmac.c +3 -3
@@ -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, ®s->maccontrol) &MCTL_BIGEND ) !=0 ;while (len >0 ) { -bcopy ((u8 *) buf, &word,sizeof (u32)); +memcpy (&word, buf,sizeof (u32));if (be_bit) word =hton32 (word);
drivers/staging/brcm80211/sys/wlc_mac80211.c +44 -46
258 lines not on this page · raw message
drivers/staging/brcm80211/sys/wlc_rate.c +3 -3
@@ -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); }
drivers/staging/brcm80211/sys/wlc_stf.c +1 -1
@@ -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 ;
drivers/staging/brcm80211/util/bcmotp.c +1 -1
@@ -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 &&
drivers/staging/brcm80211/util/bcmsrom.c +4 -4
@@ -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 {
drivers/staging/brcm80211/util/bcmutils.c +1 -1
@@ -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;
drivers/staging/brcm80211/util/hnddma.c +4 -4
@@ -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)); }
drivers/staging/brcm80211/util/nvram/nvram_ro.c +2 -2
@@ -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;
drivers/staging/brcm80211/util/siutils.c +1 -1
@@ -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);
Signature · 1 line
1.7.1
PATCH 7/8 brcm80211: replace ether_header with ethhdr
In reply to Stanislav FomichevUse native linux interfaces instead of brcm80211 specific ones.
--- 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(-)
drivers/staging/brcm80211/brcmfmac/dhd_common.c +1 -1
@@ -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
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +6 -6
@@ -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);
drivers/staging/brcm80211/include/proto/bcmevent.h +2 -2
@@ -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
drivers/staging/brcm80211/include/proto/ethernet.h +0 -36
@@ -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_ */
drivers/staging/brcm80211/sys/wlc_mac80211.c +1 -1
@@ -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 );
Signature · 1 line
1.7.1
PATCH 8/8 brcm80211: replace ether_addr with u8[ETH_ALEN]
In reply to Stanislav FomichevRemoved proto/ethernet.h as a side effect.
--- 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
drivers/staging/brcm80211/brcmfmac/dhd.h +1 -1
@@ -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 */
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +1 -1
@@ -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);
drivers/staging/brcm80211/brcmfmac/dhd_common.c +25 -25
108 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c +2 -3
@@ -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 */
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +8 -8
@@ -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 ); }
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +0 -1
@@ -44,7 +44,6 @@#include <sbsdpcmdev.h> #include <bcmsdpcm.h> -#include <proto/ethernet.h> #include <proto/802.1d.h> #include <proto/802.11.h>
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +27 -29
200 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +1 -2
@@ -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 */
drivers/staging/brcm80211/brcmfmac/wl_iw.c +23 -26
177 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/wl_iw.h +1 -2
@@ -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;
drivers/staging/brcm80211/include/bcmcdc.h +2 -2
@@ -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
drivers/staging/brcm80211/include/bcmutils.h +3 -3
@@ -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 ;
drivers/staging/brcm80211/include/proto/bcmevent.h +1 -1
@@ -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;
drivers/staging/brcm80211/include/proto/ethernet.h deleted +0 -36
@@ -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_ */
drivers/staging/brcm80211/include/proto/wpa.h +0 -2
@@ -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
drivers/staging/brcm80211/include/wlioctl.h +11 -12
@@ -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 16typedef 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 */
drivers/staging/brcm80211/sys/wl_mac80211.c +2 -2
@@ -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);
drivers/staging/brcm80211/sys/wlc_alloc.c +0 -14
@@ -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 )
drivers/staging/brcm80211/sys/wlc_ampdu.c +1 -1
@@ -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); }
drivers/staging/brcm80211/sys/wlc_bmac.c +17 -21
@@ -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 *)®s->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);
drivers/staging/brcm80211/sys/wlc_bmac.h +4 -6
@@ -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);
drivers/staging/brcm80211/sys/wlc_bsscfg.h +2 -6
@@ -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 */
drivers/staging/brcm80211/sys/wlc_key.h +1 -1
@@ -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 */
drivers/staging/brcm80211/sys/wlc_mac80211.c +18 -20
@@ -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, ®s->objaddr, (OBJADDR_RCMTA_SEL | (idx *2 ))); (void )R_REG (osh, ®s->objaddr); v32 =R_REG (osh, ®s->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, ®s->objaddr, (OBJADDR_RCMTA_SEL | ((idx *2 ) +1 ))); (void )R_REG (osh, ®s->objaddr); v32 =R_REG (osh, (volatile u16 *)®s->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, ðer_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); }
drivers/staging/brcm80211/sys/wlc_mac80211.h +5 -6
@@ -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);
drivers/staging/brcm80211/sys/wlc_pub.h +3 -11
@@ -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);
drivers/staging/brcm80211/sys/wlc_scb.h +0 -1
@@ -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 */
drivers/staging/brcm80211/util/bcmsrom.c +8 -10
@@ -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));
drivers/staging/brcm80211/util/bcmutils.c +3 -3
@@ -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 ; }
Signature · 1 line
1.7.1
Quoted 4 lines · Stanislav Fomichev
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/
Quoted 1 line
Signed-off-by Stanislav Fomichev <kernel@...>
Gr. AvS
Quoted 8 lines · Stanislav Fomichev
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
Quoted 10 lines · Greg KH
Quoted 8 lines · Stanislav Fomichev
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 +++++++++++-----------
Quoted 4 lines
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!
Signature · 1 line
Stas