/* Minimal header; can be used for passing 802.11 frames with sufficient
  * information to determine what type of underlying data type is actually
  * stored in the data. */
-struct ieee80211_hdr {
+struct rtl_80211_hdr {
        __le16 frame_ctl;
        __le16 duration_id;
        u8 payload[0];
 } __packed;
 
-struct ieee80211_hdr_1addr {
+struct rtl_80211_hdr_1addr {
        __le16 frame_ctl;
        __le16 duration_id;
        u8 addr1[ETH_ALEN];
        u8 payload[0];
 } __packed;
 
-struct ieee80211_hdr_2addr {
+struct rtl_80211_hdr_2addr {
        __le16 frame_ctl;
        __le16 duration_id;
        u8 addr1[ETH_ALEN];
        u8 payload[0];
 } __packed;
 
-struct ieee80211_hdr_3addr {
+struct rtl_80211_hdr_3addr {
        __le16 frame_ctl;
        __le16 duration_id;
        u8 addr1[ETH_ALEN];
        u8 payload[0];
 } __packed;
 
-struct ieee80211_hdr_4addr {
+struct rtl_80211_hdr_4addr {
        __le16 frame_ctl;
        __le16 duration_id;
        u8 addr1[ETH_ALEN];
        u8 payload[0];
 } __packed;
 
-struct ieee80211_hdr_3addrqos {
+struct rtl_80211_hdr_3addrqos {
        __le16 frame_ctl;
        __le16 duration_id;
        u8 addr1[ETH_ALEN];
        __le16 qos_ctl;
 } __packed;
 
-struct ieee80211_hdr_4addrqos {
+struct rtl_80211_hdr_4addrqos {
        __le16 frame_ctl;
        __le16 duration_id;
        u8 addr1[ETH_ALEN];
 } __packed;
 
 struct ieee80211_authentication {
-       struct ieee80211_hdr_3addr header;
+       struct rtl_80211_hdr_3addr header;
        __le16 algorithm;
        __le16 transaction;
        __le16 status;
 } __packed;
 
 struct ieee80211_disassoc {
-       struct ieee80211_hdr_3addr header;
+       struct rtl_80211_hdr_3addr header;
        __le16 reason;
 } __packed;
 
 struct ieee80211_probe_request {
-       struct ieee80211_hdr_3addr header;
+       struct rtl_80211_hdr_3addr header;
        /* SSID, supported rates */
        struct ieee80211_info_element info_element[0];
 } __packed;
 
 struct ieee80211_probe_response {
-       struct ieee80211_hdr_3addr header;
+       struct rtl_80211_hdr_3addr header;
        __le32 time_stamp[2];
        __le16 beacon_interval;
        __le16 capability;
 #define ieee80211_beacon ieee80211_probe_response
 
 struct ieee80211_assoc_request_frame {
-       struct ieee80211_hdr_3addr header;
+       struct rtl_80211_hdr_3addr header;
        __le16 capability;
        __le16 listen_interval;
        /* SSID, supported rates, RSN */
 } __packed;
 
 struct ieee80211_reassoc_request_frame {
-       struct ieee80211_hdr_3addr header;
+       struct rtl_80211_hdr_3addr header;
        __le16 capability;
        __le16 listen_interval;
        u8 current_ap[ETH_ALEN];
 } __packed;
 
 struct ieee80211_assoc_response_frame {
-       struct ieee80211_hdr_3addr header;
+       struct rtl_80211_hdr_3addr header;
        __le16 capability;
        __le16 status;
        __le16 aid;
 //added by amy for reorder
 static inline u8 Frame_QoSTID(u8 *buf)
 {
-       struct ieee80211_hdr_3addr *hdr;
+       struct rtl_80211_hdr_3addr *hdr;
        u16 fc;
-       hdr = (struct ieee80211_hdr_3addr *)buf;
+       hdr = (struct rtl_80211_hdr_3addr *)buf;
        fc = le16_to_cpu(hdr->frame_ctl);
        return (u8)((frameqos *)(buf + (((fc & IEEE80211_FCTL_TODS)&&(fc & IEEE80211_FCTL_FROMDS))? 30 : 24)))->field.tid;
 }
        return hdrlen;
 }
 
-static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr)
+static inline u8 *ieee80211_get_payload(struct rtl_80211_hdr *hdr)
 {
        switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl))) {
        case IEEE80211_1ADDR_LEN:
-               return ((struct ieee80211_hdr_1addr *)hdr)->payload;
+               return ((struct rtl_80211_hdr_1addr *)hdr)->payload;
        case IEEE80211_2ADDR_LEN:
-               return ((struct ieee80211_hdr_2addr *)hdr)->payload;
+               return ((struct rtl_80211_hdr_2addr *)hdr)->payload;
        case IEEE80211_3ADDR_LEN:
-               return ((struct ieee80211_hdr_3addr *)hdr)->payload;
+               return ((struct rtl_80211_hdr_3addr *)hdr)->payload;
        case IEEE80211_4ADDR_LEN:
-               return ((struct ieee80211_hdr_4addr *)hdr)->payload;
+               return ((struct rtl_80211_hdr_4addr *)hdr)->payload;
        }
        return NULL;
 }
 extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
                        struct ieee80211_rx_stats *rx_stats);
 extern void ieee80211_rx_mgt(struct ieee80211_device *ieee,
-                            struct ieee80211_hdr_4addr *header,
+                            struct rtl_80211_hdr_4addr *header,
                             struct ieee80211_rx_stats *stats);
 
 /* ieee80211_wx.c */
 
 
 
 static void ccmp_init_blocks(struct crypto_tfm *tfm,
-                            struct ieee80211_hdr_4addr *hdr,
+                            struct rtl_80211_hdr_4addr *hdr,
                             u8 *pn, size_t dlen, u8 *b0, u8 *auth,
                             u8 *s0)
 {
        struct ieee80211_ccmp_data *key = priv;
        int data_len, i;
        u8 *pos;
-       struct ieee80211_hdr_4addr *hdr;
+       struct rtl_80211_hdr_4addr *hdr;
        cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
 
        if (skb_headroom(skb) < CCMP_HDR_LEN ||
        *pos++ = key->tx_pn[0];
 
 
-       hdr = (struct ieee80211_hdr_4addr *) skb->data;
+       hdr = (struct rtl_80211_hdr_4addr *) skb->data;
        if (!tcb_desc->bHwSec)
        {
                int blocks, last, len;
 {
        struct ieee80211_ccmp_data *key = priv;
        u8 keyidx, *pos;
-       struct ieee80211_hdr_4addr *hdr;
+       struct rtl_80211_hdr_4addr *hdr;
        cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
        u8 pn[6];
 
                return -1;
        }
 
-       hdr = (struct ieee80211_hdr_4addr *) skb->data;
+       hdr = (struct rtl_80211_hdr_4addr *) skb->data;
        pos = skb->data + hdr_len;
        keyidx = pos[3];
        if (!(keyidx & (1 << 5))) {
 
        struct ieee80211_tkip_data *tkey = priv;
                int len;
        u8 *pos;
-       struct ieee80211_hdr_4addr *hdr;
+       struct rtl_80211_hdr_4addr *hdr;
        cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
        struct blkcipher_desc desc = {.tfm = tkey->tx_tfm_arc4};
        int ret = 0;
            skb->len < hdr_len)
                return -1;
 
-       hdr = (struct ieee80211_hdr_4addr *) skb->data;
+       hdr = (struct rtl_80211_hdr_4addr *) skb->data;
 
        if (!tcb_desc->bHwSec)
        {
        u8 keyidx, *pos;
        u32 iv32;
        u16 iv16;
-       struct ieee80211_hdr_4addr *hdr;
+       struct rtl_80211_hdr_4addr *hdr;
        cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
        struct blkcipher_desc desc = {.tfm = tkey->rx_tfm_arc4};
        u8 rc4key[16];
        if (skb->len < hdr_len + 8 + 4)
                return -1;
 
-       hdr = (struct ieee80211_hdr_4addr *) skb->data;
+       hdr = (struct rtl_80211_hdr_4addr *) skb->data;
        pos = skb->data + hdr_len;
        keyidx = pos[3];
        if (!(keyidx & (1 << 5))) {
 
 static void michael_mic_hdr(struct sk_buff *skb, u8 *hdr)
 {
-       struct ieee80211_hdr_4addr *hdr11;
+       struct rtl_80211_hdr_4addr *hdr11;
 
-       hdr11 = (struct ieee80211_hdr_4addr *) skb->data;
+       hdr11 = (struct rtl_80211_hdr_4addr *) skb->data;
        switch (le16_to_cpu(hdr11->frame_ctl) &
                (IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS)) {
        case IEEE80211_FCTL_TODS:
 {
        struct ieee80211_tkip_data *tkey = priv;
        u8 *pos;
-       struct ieee80211_hdr_4addr *hdr;
+       struct rtl_80211_hdr_4addr *hdr;
 
-       hdr = (struct ieee80211_hdr_4addr *) skb->data;
+       hdr = (struct rtl_80211_hdr_4addr *) skb->data;
 
        if (skb_tailroom(skb) < 8 || skb->len < hdr_len) {
                printk(KERN_DEBUG "Invalid packet for Michael MIC add "
 }
 
 static void ieee80211_michael_mic_failure(struct net_device *dev,
-                                      struct ieee80211_hdr_4addr *hdr,
+                                      struct rtl_80211_hdr_4addr *hdr,
                                       int keyidx)
 {
        union iwreq_data wrqu;
 {
        struct ieee80211_tkip_data *tkey = priv;
        u8 mic[8];
-       struct ieee80211_hdr_4addr *hdr;
+       struct rtl_80211_hdr_4addr *hdr;
 
-       hdr = (struct ieee80211_hdr_4addr *) skb->data;
+       hdr = (struct rtl_80211_hdr_4addr *) skb->data;
 
        if (!tkey->key_set)
                return -1;
                                skb->data + hdr_len, skb->len - 8 - hdr_len, mic))
                return -1;
        if (memcmp(mic, skb->data + skb->len - 8, 8) != 0) {
-               struct ieee80211_hdr_4addr *hdr;
-               hdr = (struct ieee80211_hdr_4addr *) skb->data;
+               struct rtl_80211_hdr_4addr *hdr;
+               hdr = (struct rtl_80211_hdr_4addr *) skb->data;
                printk(KERN_DEBUG "%s: Michael MIC verification failed for "
                       "MSDU from %pM keyidx=%d\n",
                       skb->dev ? skb->dev->name : "N/A", hdr->addr2,
 
                                        struct sk_buff *skb,
                                        struct ieee80211_rx_stats *rx_stats)
 {
-       struct ieee80211_hdr_4addr *hdr = (struct ieee80211_hdr_4addr *)skb->data;
+       struct rtl_80211_hdr_4addr *hdr = (struct rtl_80211_hdr_4addr *)skb->data;
        u16 fc = le16_to_cpu(hdr->frame_ctl);
 
        skb->dev = ieee->dev;
 /* Called only as a tasklet (software IRQ) */
 static struct sk_buff *
 ieee80211_frag_cache_get(struct ieee80211_device *ieee,
-                        struct ieee80211_hdr_4addr *hdr)
+                        struct rtl_80211_hdr_4addr *hdr)
 {
        struct sk_buff *skb = NULL;
        u16 fc = le16_to_cpu(hdr->frame_ctl);
        unsigned int frag = WLAN_GET_SEQ_FRAG(sc);
        unsigned int seq = WLAN_GET_SEQ_SEQ(sc);
        struct ieee80211_frag_entry *entry;
-       struct ieee80211_hdr_3addrqos *hdr_3addrqos;
-       struct ieee80211_hdr_4addrqos *hdr_4addrqos;
+       struct rtl_80211_hdr_3addrqos *hdr_3addrqos;
+       struct rtl_80211_hdr_4addrqos *hdr_4addrqos;
        u8 tid;
 
        if (((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) {
-         hdr_4addrqos = (struct ieee80211_hdr_4addrqos *)hdr;
+         hdr_4addrqos = (struct rtl_80211_hdr_4addrqos *)hdr;
          tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QCTL_TID;
          tid = UP2AC(tid);
          tid ++;
        } else if (IEEE80211_QOS_HAS_SEQ(fc)) {
-         hdr_3addrqos = (struct ieee80211_hdr_3addrqos *)hdr;
+         hdr_3addrqos = (struct rtl_80211_hdr_3addrqos *)hdr;
          tid = le16_to_cpu(hdr_3addrqos->qos_ctl) & IEEE80211_QCTL_TID;
          tid = UP2AC(tid);
          tid ++;
        if (frag == 0) {
                /* Reserve enough space to fit maximum frame length */
                skb = dev_alloc_skb(ieee->dev->mtu +
-                                   sizeof(struct ieee80211_hdr_4addr) +
+                                   sizeof(struct rtl_80211_hdr_4addr) +
                                    8 /* LLC */ +
                                    2 /* alignment */ +
                                    8 /* WEP */ +
 
 /* Called only as a tasklet (software IRQ) */
 static int ieee80211_frag_cache_invalidate(struct ieee80211_device *ieee,
-                                          struct ieee80211_hdr_4addr *hdr)
+                                          struct rtl_80211_hdr_4addr *hdr)
 {
        u16 fc = le16_to_cpu(hdr->frame_ctl);
        u16 sc = le16_to_cpu(hdr->seq_ctl);
        unsigned int seq = WLAN_GET_SEQ_SEQ(sc);
        struct ieee80211_frag_entry *entry;
-       struct ieee80211_hdr_3addrqos *hdr_3addrqos;
-       struct ieee80211_hdr_4addrqos *hdr_4addrqos;
+       struct rtl_80211_hdr_3addrqos *hdr_3addrqos;
+       struct rtl_80211_hdr_4addrqos *hdr_4addrqos;
        u8 tid;
 
        if(((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) {
-         hdr_4addrqos = (struct ieee80211_hdr_4addrqos *)hdr;
+         hdr_4addrqos = (struct rtl_80211_hdr_4addrqos *)hdr;
          tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QCTL_TID;
          tid = UP2AC(tid);
          tid ++;
        } else if (IEEE80211_QOS_HAS_SEQ(fc)) {
-         hdr_3addrqos = (struct ieee80211_hdr_3addrqos *)hdr;
+         hdr_3addrqos = (struct rtl_80211_hdr_3addrqos *)hdr;
          tid = le16_to_cpu(hdr_3addrqos->qos_ctl) & IEEE80211_QCTL_TID;
          tid = UP2AC(tid);
          tid ++;
         * this is not mandatory.... but seems that the probe
         * response parser uses it
         */
-       struct ieee80211_hdr_3addr *hdr = (struct ieee80211_hdr_3addr *)skb->data;
+       struct rtl_80211_hdr_3addr *hdr = (struct rtl_80211_hdr_3addr *)skb->data;
 
        rx_stats->len = skb->len;
-       ieee80211_rx_mgt(ieee,(struct ieee80211_hdr_4addr *)skb->data,rx_stats);
+       ieee80211_rx_mgt(ieee,(struct rtl_80211_hdr_4addr *)skb->data,rx_stats);
        /* if ((ieee->state == IEEE80211_LINKED) && (memcmp(hdr->addr3, ieee->current_network.bssid, ETH_ALEN))) */
        if ((memcmp(hdr->addr1, ieee->dev->dev_addr, ETH_ALEN)))/* use ADDR1 to perform address matching for Management frames */
        {
 {
        struct net_device *dev = ieee->dev;
        u16 fc, ethertype;
-       struct ieee80211_hdr_4addr *hdr;
+       struct rtl_80211_hdr_4addr *hdr;
        u8 *pos;
 
        if (skb->len < 24)
                return 0;
 
-       hdr = (struct ieee80211_hdr_4addr *) skb->data;
+       hdr = (struct rtl_80211_hdr_4addr *) skb->data;
        fc = le16_to_cpu(hdr->frame_ctl);
 
        /* check that the frame is unicast frame to us */
 ieee80211_rx_frame_decrypt(struct ieee80211_device *ieee, struct sk_buff *skb,
                           struct ieee80211_crypt_data *crypt)
 {
-       struct ieee80211_hdr_4addr *hdr;
+       struct rtl_80211_hdr_4addr *hdr;
        int res, hdrlen;
 
        if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL)
                cb_desc *tcb_desc = (cb_desc *)(skb->cb+ MAX_DEV_ADDR_SIZE);
                tcb_desc->bHwSec = 1;
        }
-       hdr = (struct ieee80211_hdr_4addr *) skb->data;
+       hdr = (struct rtl_80211_hdr_4addr *) skb->data;
        hdrlen = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
 
        if (ieee->tkip_countermeasures &&
 ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device *ieee, struct sk_buff *skb,
                             int keyidx, struct ieee80211_crypt_data *crypt)
 {
-       struct ieee80211_hdr_4addr *hdr;
+       struct rtl_80211_hdr_4addr *hdr;
        int res, hdrlen;
 
        if (crypt == NULL || crypt->ops->decrypt_msdu == NULL)
                tcb_desc->bHwSec = 1;
        }
 
-       hdr = (struct ieee80211_hdr_4addr *) skb->data;
+       hdr = (struct rtl_80211_hdr_4addr *) skb->data;
        hdrlen = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
 
        atomic_inc(&crypt->refcnt);
 /* this function is stolen from ipw2200 driver*/
 #define IEEE_PACKET_RETRY_TIME (5*HZ)
 static int is_duplicate_packet(struct ieee80211_device *ieee,
-                                     struct ieee80211_hdr_4addr *header)
+                                     struct rtl_80211_hdr_4addr *header)
 {
        u16 fc = le16_to_cpu(header->frame_ctl);
        u16 sc = le16_to_cpu(header->seq_ctl);
        u16 frag = WLAN_GET_SEQ_FRAG(sc);
        u16 *last_seq, *last_frag;
        unsigned long *last_time;
-       struct ieee80211_hdr_3addrqos *hdr_3addrqos;
-       struct ieee80211_hdr_4addrqos *hdr_4addrqos;
+       struct rtl_80211_hdr_3addrqos *hdr_3addrqos;
+       struct rtl_80211_hdr_4addrqos *hdr_4addrqos;
        u8 tid;
 
 
        //TO2DS and QoS
        if(((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) {
-         hdr_4addrqos = (struct ieee80211_hdr_4addrqos *)header;
+         hdr_4addrqos = (struct rtl_80211_hdr_4addrqos *)header;
          tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QCTL_TID;
          tid = UP2AC(tid);
          tid ++;
        } else if(IEEE80211_QOS_HAS_SEQ(fc)) { //QoS
-         hdr_3addrqos = (struct ieee80211_hdr_3addrqos *)header;
+         hdr_3addrqos = (struct rtl_80211_hdr_3addrqos *)header;
          tid = le16_to_cpu(hdr_3addrqos->qos_ctl) & IEEE80211_QCTL_TID;
          tid = UP2AC(tid);
          tid ++;
                         struct ieee80211_rx_stats *rx_stats,
                         struct ieee80211_rxb *rxb, u8 *src, u8 *dst)
 {
-       struct ieee80211_hdr_3addr  *hdr = (struct ieee80211_hdr_3addr *)skb->data;
+       struct rtl_80211_hdr_3addr  *hdr = (struct rtl_80211_hdr_3addr *)skb->data;
        u16             fc = le16_to_cpu(hdr->frame_ctl);
 
-       u16             LLCOffset= sizeof(struct ieee80211_hdr_3addr);
+       u16             LLCOffset= sizeof(struct rtl_80211_hdr_3addr);
        u16             ChkLength;
        bool            bIsAggregateFrame = false;
        u16             nSubframe_Length;
                 struct ieee80211_rx_stats *rx_stats)
 {
        struct net_device *dev = ieee->dev;
-       struct ieee80211_hdr_4addr *hdr;
-       //struct ieee80211_hdr_3addrqos *hdr;
+       struct rtl_80211_hdr_4addr *hdr;
+       //struct rtl_80211_hdr_3addrqos *hdr;
 
        size_t hdrlen;
        u16 fc, type, stype, sc;
        int i;
        struct ieee80211_rxb *rxb = NULL;
        // cheat the the hdr type
-       hdr = (struct ieee80211_hdr_4addr *)skb->data;
+       hdr = (struct rtl_80211_hdr_4addr *)skb->data;
        stats = &ieee->stats;
 
        if (skb->len < 10) {
        }
 
 
-       hdr = (struct ieee80211_hdr_4addr *) skb->data;
+       hdr = (struct rtl_80211_hdr_4addr *) skb->data;
 
        /* skb: hdr + (possibly fragmented) plaintext payload */
        // PR: FIXME: hostap has additional conditions in the "if" below:
                /* this was the last fragment and the frame will be
                 * delivered, so remove skb from fragment cache */
                skb = frag_skb;
-               hdr = (struct ieee80211_hdr_4addr *) skb->data;
+               hdr = (struct rtl_80211_hdr_4addr *) skb->data;
                ieee80211_frag_cache_invalidate(ieee, hdr);
        }
 
        ieee->LinkDetectInfo.NumRecvDataInPeriod++;
        ieee->LinkDetectInfo.NumRxOkInPeriod++;
 
-       hdr = (struct ieee80211_hdr_4addr *) skb->data;
+       hdr = (struct rtl_80211_hdr_4addr *) skb->data;
        if (crypt && !(fc & IEEE80211_FCTL_WEP) && !ieee->open_wep) {
                if (/*ieee->ieee802_1x &&*/
                    ieee80211_is_eapol_frame(ieee, skb, hdrlen)) {
 }
 
 void ieee80211_rx_mgt(struct ieee80211_device *ieee,
-                     struct ieee80211_hdr_4addr *header,
+                     struct rtl_80211_hdr_4addr *header,
                      struct ieee80211_rx_stats *stats)
 {
        switch (WLAN_FC_GET_STYPE(header->frame_ctl)) {
 
 {
        unsigned long flags;
        short single = ieee->softmac_features & IEEE_SOFTMAC_SINGLE_QUEUE;
-       struct ieee80211_hdr_3addr  *header=
-               (struct ieee80211_hdr_3addr  *) skb->data;
+       struct rtl_80211_hdr_3addr  *header=
+               (struct rtl_80211_hdr_3addr  *) skb->data;
 
        cb_desc *tcb_desc = (cb_desc *)(skb->cb + 8);
        spin_lock_irqsave(&ieee->lock, flags);
 {
 
        short single = ieee->softmac_features & IEEE_SOFTMAC_SINGLE_QUEUE;
-       struct ieee80211_hdr_3addr  *header =
-               (struct ieee80211_hdr_3addr  *) skb->data;
+       struct rtl_80211_hdr_3addr  *header =
+               (struct rtl_80211_hdr_3addr  *) skb->data;
 
 
        if(single){
                                           short pwr)
 {
        struct sk_buff *skb;
-       struct ieee80211_hdr_3addr *hdr;
+       struct rtl_80211_hdr_3addr *hdr;
 
-       skb = dev_alloc_skb(sizeof(struct ieee80211_hdr_3addr));
+       skb = dev_alloc_skb(sizeof(struct rtl_80211_hdr_3addr));
 
        if (!skb)
                return NULL;
 
-       hdr = (struct ieee80211_hdr_3addr *)skb_put(skb,sizeof(struct ieee80211_hdr_3addr));
+       hdr = (struct rtl_80211_hdr_3addr *)skb_put(skb,sizeof(struct rtl_80211_hdr_3addr));
 
        memcpy(hdr->addr1, ieee->current_network.bssid, ETH_ALEN);
        memcpy(hdr->addr2, ieee->dev->dev_addr, ETH_ALEN);
 
                IEEE80211_DEBUG_MGMT("Sending authentication challenge response\n");
 
-               ieee80211_encrypt_fragment(ieee, skb, sizeof(struct ieee80211_hdr_3addr  ));
+               ieee80211_encrypt_fragment(ieee, skb, sizeof(struct rtl_80211_hdr_3addr  ));
 
                softmac_mgmt_xmit(skb, ieee);
                mod_timer(&ieee->associate_timer, jiffies + (HZ/2));
        u8 *ssid=NULL;
        u8 ssidlen = 0;
 
-       struct ieee80211_hdr_3addr   *header =
-               (struct ieee80211_hdr_3addr   *) skb->data;
+       struct rtl_80211_hdr_3addr   *header =
+               (struct rtl_80211_hdr_3addr   *) skb->data;
 
-       if (skb->len < sizeof (struct ieee80211_hdr_3addr  ))
+       if (skb->len < sizeof (struct rtl_80211_hdr_3addr  ))
                return -1; /* corrupted */
 
        memcpy(src,header->addr2, ETH_ALEN);
 
        skbend = (u8 *)skb->data + skb->len;
 
-       tag = skb->data + sizeof (struct ieee80211_hdr_3addr  );
+       tag = skb->data + sizeof (struct rtl_80211_hdr_3addr  );
 
        while (tag+1 < skbend){
                if (*tag == 0) {
 static void ieee80211_process_action(struct ieee80211_device *ieee,
                                     struct sk_buff *skb)
 {
-       struct ieee80211_hdr *header = (struct ieee80211_hdr *)skb->data;
+       struct rtl_80211_hdr *header = (struct rtl_80211_hdr *)skb->data;
        u8 *act = ieee80211_get_payload(header);
        u8 tmp = 0;
 //     IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, skb->len);
                        struct ieee80211_rx_stats *rx_stats, u16 type,
                        u16 stype)
 {
-       struct ieee80211_hdr_3addr *header = (struct ieee80211_hdr_3addr *) skb->data;
+       struct rtl_80211_hdr_3addr *header = (struct rtl_80211_hdr_3addr *) skb->data;
        u16 errcode;
        int aid;
        struct ieee80211_assoc_response_frame *assoc_resp;
 
        unsigned long flags;
        struct sk_buff *skb;
-       struct ieee80211_hdr_3addr  *header;
+       struct rtl_80211_hdr_3addr  *header;
 
        spin_lock_irqsave(&ieee->lock, flags);
        if (! ieee->queue_stop) goto exit;
        if (ieee->softmac_features & IEEE_SOFTMAC_SINGLE_QUEUE) {
                while (!ieee->queue_stop && (skb = dequeue_mgmt(ieee))){
 
-                       header = (struct ieee80211_hdr_3addr  *) skb->data;
+                       header = (struct rtl_80211_hdr_3addr  *) skb->data;
 
                        header->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0] << 4);
 
 
        if (ieee->tkip_countermeasures &&
            crypt && crypt->ops && strcmp(crypt->ops->name, "TKIP") == 0) {
                if (net_ratelimit()) {
-                       struct ieee80211_hdr_3addrqos *header;
+                       struct rtl_80211_hdr_3addrqos *header;
 
-                       header = (struct ieee80211_hdr_3addrqos *)frag->data;
+                       header = (struct rtl_80211_hdr_3addrqos *)frag->data;
                        printk(KERN_DEBUG "%s: TKIP countermeasures: dropped "
                               "TX packet to %pM\n",
                               ieee->dev->name, header->addr1);
 {
        PRT_HIGH_THROUGHPUT     pHTInfo = ieee->pHTInfo;
        PTX_TS_RECORD                   pTxTs = NULL;
-       struct ieee80211_hdr_1addr *hdr = (struct ieee80211_hdr_1addr *)skb->data;
+       struct rtl_80211_hdr_1addr *hdr = (struct rtl_80211_hdr_1addr *)skb->data;
 
        if (!pHTInfo->bCurrentHTSupport||!pHTInfo->bEnableHT)
                return;
 {
        struct ieee80211_device *ieee = netdev_priv(dev);
        struct ieee80211_txb *txb = NULL;
-       struct ieee80211_hdr_3addrqos *frag_hdr;
+       struct rtl_80211_hdr_3addrqos *frag_hdr;
        int i, bytes_per_frag, nr_frags, bytes_last_frag, frag_size;
        unsigned long flags;
        struct net_device_stats *stats = &ieee->stats;
        int ether_type = 0, encrypt;
        int bytes, fc, qos_ctl = 0, hdr_len;
        struct sk_buff *skb_frag;
-       struct ieee80211_hdr_3addrqos header = { /* Ensure zero initialized */
+       struct rtl_80211_hdr_3addrqos header = { /* Ensure zero initialized */
                .duration_id = 0,
                .seq_ctl = 0,
                .qos_ctl = 0
                        {
                                tcb_desc->bHwSec = 0;
                        }
-                       frag_hdr = (struct ieee80211_hdr_3addrqos *)skb_put(skb_frag, hdr_len);
+                       frag_hdr = (struct rtl_80211_hdr_3addrqos *)skb_put(skb_frag, hdr_len);
                        memcpy(frag_hdr, &header, hdr_len);
 
                        /* If this is not the last fragment, then add the MOREFRAGS
                        ieee->seq_ctrl[0]++;
                }
        }else{
-               if (unlikely(skb->len < sizeof(struct ieee80211_hdr_3addr))) {
+               if (unlikely(skb->len < sizeof(struct rtl_80211_hdr_3addr))) {
                        printk(KERN_WARNING "%s: skb too small (%d).\n",
                        ieee->dev->name, skb->len);
                        goto success;
 
 static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, PBA_RECORD pBA, u16 StatusCode, u8 type)
 {
        struct sk_buff *skb = NULL;
-        struct ieee80211_hdr_3addr *BAReq = NULL;
+        struct rtl_80211_hdr_3addr *BAReq = NULL;
        u8 *tag = NULL;
        u16 len = ieee->tx_headroom + 9;
        //category(1) + action field(1) + Dialog Token(1) + BA Parameter Set(2) +  BA Timeout Value(2) +  BA Start SeqCtrl(2)(or StatusCode(2))
                IEEE80211_DEBUG(IEEE80211_DL_ERR, "pBA is NULL\n");
                return NULL;
        }
-       skb = dev_alloc_skb(len + sizeof( struct ieee80211_hdr_3addr)); //need to add something others? FIXME
+       skb = dev_alloc_skb(len + sizeof( struct rtl_80211_hdr_3addr)); //need to add something others? FIXME
        if (skb == NULL)
        {
                IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc skb for ADDBA_REQ\n");
                return NULL;
        }
 
-       memset(skb->data, 0, sizeof( struct ieee80211_hdr_3addr));      //I wonder whether it's necessary. Apparently kernel will not do it when alloc a skb.
+       memset(skb->data, 0, sizeof( struct rtl_80211_hdr_3addr));      //I wonder whether it's necessary. Apparently kernel will not do it when alloc a skb.
        skb_reserve(skb, ieee->tx_headroom);
 
-       BAReq = ( struct ieee80211_hdr_3addr *) skb_put(skb,sizeof( struct ieee80211_hdr_3addr));
+       BAReq = ( struct rtl_80211_hdr_3addr *) skb_put(skb,sizeof( struct rtl_80211_hdr_3addr));
 
        memcpy(BAReq->addr1, Dst, ETH_ALEN);
        memcpy(BAReq->addr2, ieee->dev->dev_addr, ETH_ALEN);
 
        BAReq->frame_ctl = cpu_to_le16(IEEE80211_STYPE_MANAGE_ACT); //action frame
 
-       //tag += sizeof( struct ieee80211_hdr_3addr); //move to action field
+       //tag += sizeof( struct rtl_80211_hdr_3addr); //move to action field
        tag = (u8 *)skb_put(skb, 9);
        *tag ++= ACT_CAT_BA;
        *tag ++= type;
 {
        DELBA_PARAM_SET DelbaParamSet;
        struct sk_buff *skb = NULL;
-        struct ieee80211_hdr_3addr *Delba = NULL;
+        struct rtl_80211_hdr_3addr *Delba = NULL;
        u8 *tag = NULL;
        //len = head len + DELBA Parameter Set(2) + Reason Code(2)
        u16 len = 6 + ieee->tx_headroom;
        DelbaParamSet.field.Initiator   = (TxRxSelect==TX_DIR)?1:0;
        DelbaParamSet.field.TID = pBA->BaParamSet.field.TID;
 
-       skb = dev_alloc_skb(len + sizeof( struct ieee80211_hdr_3addr)); //need to add something others? FIXME
+       skb = dev_alloc_skb(len + sizeof( struct rtl_80211_hdr_3addr)); //need to add something others? FIXME
        if (skb == NULL)
        {
                IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc skb for ADDBA_REQ\n");
                return NULL;
        }
-//     memset(skb->data, 0, len+sizeof( struct ieee80211_hdr_3addr));
+//     memset(skb->data, 0, len+sizeof( struct rtl_80211_hdr_3addr));
        skb_reserve(skb, ieee->tx_headroom);
 
-       Delba = ( struct ieee80211_hdr_3addr *) skb_put(skb,sizeof( struct ieee80211_hdr_3addr));
+       Delba = ( struct rtl_80211_hdr_3addr *) skb_put(skb,sizeof( struct rtl_80211_hdr_3addr));
 
        memcpy(Delba->addr1, dst, ETH_ALEN);
        memcpy(Delba->addr2, ieee->dev->dev_addr, ETH_ALEN);
 ********************************************************************************************************************/
 int ieee80211_rx_ADDBAReq(struct ieee80211_device *ieee, struct sk_buff *skb)
 {
-        struct ieee80211_hdr_3addr *req = NULL;
+        struct rtl_80211_hdr_3addr *req = NULL;
        u16 rc = 0;
        u8 *dst = NULL, *pDialogToken = NULL, *tag = NULL;
        PBA_RECORD pBA = NULL;
        PSEQUENCE_CONTROL pBaStartSeqCtrl = NULL;
        PRX_TS_RECORD   pTS = NULL;
 
-       if (skb->len < sizeof(struct ieee80211_hdr_3addr) + 9) {
+       if (skb->len < sizeof(struct rtl_80211_hdr_3addr) + 9) {
                IEEE80211_DEBUG(IEEE80211_DL_ERR,
                                " Invalid skb len in BAREQ(%d / %zu)\n",
                                skb->len,
-                               (sizeof(struct ieee80211_hdr_3addr) + 9));
+                               (sizeof(struct rtl_80211_hdr_3addr) + 9));
                return -1;
        }
 
        IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, skb->len);
 
-       req = (struct ieee80211_hdr_3addr *) skb->data;
+       req = (struct rtl_80211_hdr_3addr *) skb->data;
        tag = (u8 *)req;
        dst = (u8 *)(&req->addr2[0]);
-       tag += sizeof(struct ieee80211_hdr_3addr);
+       tag += sizeof(struct rtl_80211_hdr_3addr);
        pDialogToken = tag + 2;  //category+action
        pBaParamSet = (PBA_PARAM_SET)(tag + 3);   //+DialogToken
        pBaTimeoutVal = (u16 *)(tag + 5);
 ********************************************************************************************************************/
 int ieee80211_rx_ADDBARsp(struct ieee80211_device *ieee, struct sk_buff *skb)
 {
-        struct ieee80211_hdr_3addr *rsp = NULL;
+        struct rtl_80211_hdr_3addr *rsp = NULL;
        PBA_RECORD              pPendingBA, pAdmittedBA;
        PTX_TS_RECORD           pTS = NULL;
        u8 *dst = NULL, *pDialogToken = NULL, *tag = NULL;
        PBA_PARAM_SET           pBaParamSet = NULL;
        u16                     ReasonCode;
 
-       if (skb->len < sizeof(struct ieee80211_hdr_3addr) + 9) {
+       if (skb->len < sizeof(struct rtl_80211_hdr_3addr) + 9) {
                IEEE80211_DEBUG(IEEE80211_DL_ERR,
                                " Invalid skb len in BARSP(%d / %zu)\n",
                                skb->len,
-                               (sizeof(struct ieee80211_hdr_3addr) + 9));
+                               (sizeof(struct rtl_80211_hdr_3addr) + 9));
                return -1;
        }
-       rsp = (struct ieee80211_hdr_3addr *)skb->data;
+       rsp = (struct rtl_80211_hdr_3addr *)skb->data;
        tag = (u8 *)rsp;
        dst = (u8 *)(&rsp->addr2[0]);
-       tag += sizeof(struct ieee80211_hdr_3addr);
+       tag += sizeof(struct rtl_80211_hdr_3addr);
        pDialogToken = tag + 2;
        pStatusCode = (u16 *)(tag + 3);
        pBaParamSet = (PBA_PARAM_SET)(tag + 5);
 ********************************************************************************************************************/
 int ieee80211_rx_DELBA(struct ieee80211_device *ieee, struct sk_buff *skb)
 {
-        struct ieee80211_hdr_3addr *delba = NULL;
+        struct rtl_80211_hdr_3addr *delba = NULL;
        PDELBA_PARAM_SET        pDelBaParamSet = NULL;
        u16                     *pReasonCode = NULL;
        u8                      *dst = NULL;
 
-       if (skb->len < sizeof(struct ieee80211_hdr_3addr) + 6) {
+       if (skb->len < sizeof(struct rtl_80211_hdr_3addr) + 6) {
                IEEE80211_DEBUG(IEEE80211_DL_ERR,
                                " Invalid skb len in DELBA(%d / %zu)\n",
                                skb->len,
-                               (sizeof(struct ieee80211_hdr_3addr) + 6));
+                               (sizeof(struct rtl_80211_hdr_3addr) + 6));
                return -1;
        }
 
        }
 
        IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, skb->len);
-       delba = (struct ieee80211_hdr_3addr *)skb->data;
+       delba = (struct rtl_80211_hdr_3addr *)skb->data;
        dst = (u8 *)(&delba->addr2[0]);
-       delba += sizeof(struct ieee80211_hdr_3addr);
+       delba += sizeof(struct rtl_80211_hdr_3addr);
        pDelBaParamSet = (PDELBA_PARAM_SET)(delba+2);
        pReasonCode = (u16 *)(delba+4);
 
 
        static u32 slide_beacon_adc_pwdb_index, slide_beacon_adc_pwdb_statistics;
        static u32 last_beacon_adc_pwdb;
 
-       struct ieee80211_hdr_3addr *hdr;
+       struct rtl_80211_hdr_3addr *hdr;
        u16 sc;
        unsigned int frag, seq;
-       hdr = (struct ieee80211_hdr_3addr *)buffer;
+       hdr = (struct rtl_80211_hdr_3addr *)buffer;
        sc = le16_to_cpu(hdr->seq_ctl);
        frag = WLAN_GET_SEQ_FRAG(sc);
        seq = WLAN_GET_SEQ_SEQ(sc);
        bool bpacket_match_bssid, bpacket_toself;
        bool bPacketBeacon = false, bToSelfBA = false;
        static struct ieee80211_rx_stats  previous_stats;
-       struct ieee80211_hdr_3addr *hdr;//by amy
+       struct rtl_80211_hdr_3addr *hdr;//by amy
        u16 fc, type;
 
        // Get Signal Quality for only RX data queue (but not command queue)
        /* Get MAC frame start address. */
        tmp_buf = (u8 *)skb->data;
 
-       hdr = (struct ieee80211_hdr_3addr *)tmp_buf;
+       hdr = (struct rtl_80211_hdr_3addr *)tmp_buf;
        fc = le16_to_cpu(hdr->frame_ctl);
        type = WLAN_FC_GET_TYPE(fc);
        praddr = hdr->addr1;
                .freq = IEEE80211_24GHZ_BAND,
        };
        u32 rx_pkt_len = 0;
-       struct ieee80211_hdr_1addr *ieee80211_hdr = NULL;
+       struct rtl_80211_hdr_1addr *ieee80211_hdr = NULL;
        bool unicast_packet = false;
 
        /* 20 is for ps-poll */
                skb_trim(skb, skb->len - 4/*sCrcLng*/);
 
                rx_pkt_len = skb->len;
-               ieee80211_hdr = (struct ieee80211_hdr_1addr *)skb->data;
+               ieee80211_hdr = (struct rtl_80211_hdr_1addr *)skb->data;
                unicast_packet = false;
                if (is_broadcast_ether_addr(ieee80211_hdr->addr1)) {
                        //TODO