staging: brcm80211: replaced struct dot11_rts_frame by struct ieee80211_rts
authorRoland Vossen <rvossen@broadcom.com>
Fri, 24 Dec 2010 14:17:42 +0000 (15:17 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 20 Jan 2011 23:20:34 +0000 (15:20 -0800)
Code cleanup. Replacing Broadcom specific definitions with Linux counterpart.
Not tested yet.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/include/d11.h
drivers/staging/brcm80211/include/proto/802.11.h
drivers/staging/brcm80211/sys/wlc_ampdu.c
drivers/staging/brcm80211/sys/wlc_mac80211.c

index 631bfe7d366b756ee0f4e787eced46861e83e7d6..50883af62496344a08635f158f3574e416e7c3ac 100644 (file)
@@ -736,7 +736,7 @@ 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 */
 } __attribute__((packed));
 
index 7595bc7a1a7abb822c974117295d5421a1f9c043..0fc12d1844e45ee7a68158756c939d11632b67e8 100644 (file)
@@ -54,13 +54,6 @@ struct dot11_header {
        u8 a4[ETH_ALEN];
 } __attribute__((packed));
 
-struct dot11_rts_frame {
-       u16 fc;
-       u16 durid;
-       u8 ra[ETH_ALEN];
-       u8 ta[ETH_ALEN];
-} __attribute__((packed));
-
 #define        DOT11_RTS_LEN           16
 #define        DOT11_CTS_LEN           10
 #define        DOT11_ACK_LEN           10
index 3d7119536583e799af04e4df6b81955f53a27e7b..3ce2b2f83fc2e1f8994acfebec957058aac109b7 100644 (file)
@@ -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 = ltoh16(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 = htol16(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;
                }
index 49894b6fdbfae21942d4dfa33492d9cc0ff270e9..1c68f4a1fff57056af61649cd49f91ed92a01805 100644 (file)
@@ -1743,7 +1743,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 dot11_header) == 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);
@@ -4865,7 +4865,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 */
@@ -5674,7 +5674,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];
@@ -6118,12 +6118,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 = htol16(durid);
                /* fallback rate version of RTS DUR field */
                durid = wlc_compute_rtscts_dur(wlc, use_cts,
                                               rts_rspec[1], rspec[1],
@@ -6132,10 +6132,10 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
                txh->RTSDurFallback = htol16(durid);
 
                if (use_cts) {
-                       rts->fc = htol16(FC_CTS);
+                       rts->frame_control = htol16(FC_CTS);
                        bcopy((char *)&h->a2, (char *)&rts->ra, ETH_ALEN);
                } else {
-                       rts->fc = htol16((u16) FC_RTS);
+                       rts->frame_control = htol16((u16) FC_RTS);
                        bcopy((char *)&h->a1, (char *)&rts->ra,
                              2 * ETH_ALEN);
                }
@@ -6150,7 +6150,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;
@@ -6257,7 +6257,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 += ltoh16(rts->duration);
                                dur_fallback += ltoh16(txh->RTSDurFallback);
                        } else if (use_rifs) {
                                dur = frag_dur;