staging: rtl8192e: Remove dead code associated with USB_USE_ALIGNMENT
authorLarry Finger <Larry.Finger@lwfinger.net>
Wed, 13 Jul 2011 03:16:06 +0000 (22:16 -0500)
committerLarry Finger <Larry.Finger@lwfinger.net>
Wed, 24 Aug 2011 01:23:59 +0000 (20:23 -0500)
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
drivers/staging/rtl8192e/rtl819x_BAProc.c
drivers/staging/rtl8192e/rtllib_softmac.c
drivers/staging/rtl8192e/rtllib_tx.c

index 08b9067..3d9f760 100644 (file)
@@ -91,13 +91,7 @@ static struct sk_buff* rtllib_ADDBA(struct rtllib_device* ieee, u8* Dst, PBA_REC
                RTLLIB_DEBUG(RTLLIB_DL_ERR, "pBA(%p) is NULL or ieee(%p) is NULL\n", pBA, ieee);
                return NULL;
        }
-#ifdef USB_USE_ALIGNMENT
-        u32 Tmpaddr=0;
-        int alignment=0;
-        skb = dev_alloc_skb(len + sizeof( struct rtllib_hdr_3addr) + USB_512B_ALIGNMENT_SIZE);
-#else
        skb = dev_alloc_skb(len + sizeof( struct rtllib_hdr_3addr));
-#endif
        if (skb == NULL)
        {
                RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't alloc skb for ADDBA_REQ\n");
@@ -106,12 +100,6 @@ static struct sk_buff* rtllib_ADDBA(struct rtllib_device* ieee, u8* Dst, PBA_REC
 
        memset(skb->data, 0, sizeof( struct rtllib_hdr_3addr));
 
-#ifdef USB_USE_ALIGNMENT
-        Tmpaddr = (u32)skb->data;
-        alignment = Tmpaddr & 0x1ff;
-        skb_reserve(skb,(USB_512B_ALIGNMENT_SIZE - alignment));
-#endif
-
        skb_reserve(skb, ieee->tx_headroom);
 
        BAReq = ( struct rtllib_hdr_3addr *) skb_put(skb,sizeof( struct rtllib_hdr_3addr));
@@ -174,24 +162,13 @@ static struct sk_buff* rtllib_DELBA(
        DelbaParamSet.field.Initiator   = (TxRxSelect==TX_DIR)?1:0;
        DelbaParamSet.field.TID = pBA->BaParamSet.field.TID;
 
-#ifdef USB_USE_ALIGNMENT
-        u32 Tmpaddr=0;
-        int alignment=0;
-       skb = dev_alloc_skb(len + sizeof( struct rtllib_hdr_3addr) + USB_512B_ALIGNMENT_SIZE);
-#else
        skb = dev_alloc_skb(len + sizeof( struct rtllib_hdr_3addr));
-#endif
        if (skb == NULL)
        {
                RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't alloc skb for ADDBA_REQ\n");
                return NULL;
        }
 
-#ifdef USB_USE_ALIGNMENT
-        Tmpaddr = (u32)skb->data;
-        alignment = Tmpaddr & 0x1ff;
-        skb_reserve(skb,(USB_512B_ALIGNMENT_SIZE - alignment));
-#endif
        skb_reserve(skb, ieee->tx_headroom);
 
        Delba = ( struct rtllib_hdr_3addr *) skb_put(skb,sizeof( struct rtllib_hdr_3addr));
index b224468..a3a0397 100644 (file)
@@ -382,25 +382,12 @@ inline struct sk_buff *rtllib_probe_req(struct rtllib_device *ieee)
 
        rate_len = rtllib_MFIE_rate_len(ieee);
 
-#ifdef USB_USE_ALIGNMENT
-        u32 Tmpaddr;
-        int alignment;
-        skb = dev_alloc_skb(sizeof(struct rtllib_probe_request) +
-                            2 + len + rate_len + ieee->tx_headroom + USB_512B_ALIGNMENT_SIZE);
-#else
        skb = dev_alloc_skb(sizeof(struct rtllib_probe_request) +
                            2 + len + rate_len + ieee->tx_headroom);
-#endif
 
        if (!skb)
                return NULL;
 
-#ifdef USB_USE_ALIGNMENT
-        Tmpaddr = (u32)skb->data;
-        alignment = Tmpaddr & 0x1ff;
-        skb_reserve(skb,(USB_512B_ALIGNMENT_SIZE - alignment));
-#endif
-
        skb_reserve(skb, ieee->tx_headroom);
 
        req = (struct rtllib_probe_request *) skb_put(skb,sizeof(struct rtllib_probe_request));
@@ -858,22 +845,10 @@ inline struct sk_buff *rtllib_authentication_req(struct rtllib_network *beacon,
        struct rtllib_authentication *auth;
        int  len = 0;
        len = sizeof(struct rtllib_authentication) + challengelen + ieee->tx_headroom + 4;
-#ifdef USB_USE_ALIGNMENT
-        u32 Tmpaddr;
-        int alignment;
-        skb = dev_alloc_skb(len + USB_512B_ALIGNMENT_SIZE);
-#else
        skb = dev_alloc_skb(len);
-#endif
 
        if (!skb) return NULL;
 
-#ifdef USB_USE_ALIGNMENT
-        Tmpaddr = (u32)skb->data;
-        alignment = Tmpaddr & 0x1ff;
-        skb_reserve(skb,(USB_512B_ALIGNMENT_SIZE - alignment));
-#endif
-
        skb_reserve(skb, ieee->tx_headroom);
 
        auth = (struct rtllib_authentication *)
@@ -994,22 +969,10 @@ static struct sk_buff* rtllib_probe_resp(struct rtllib_device *ieee, u8 *dest)
                +erp_len
                +wpa_ie_len
                +ieee->tx_headroom;
-#ifdef USB_USE_ALIGNMENT
-        u32 Tmpaddr=0;
-        int alignment=0;
-        skb = dev_alloc_skb(beacon_size + USB_512B_ALIGNMENT_SIZE);
-#else
        skb = dev_alloc_skb(beacon_size);
-#endif
        if (!skb)
                return NULL;
 
-#ifdef USB_USE_ALIGNMENT
-        Tmpaddr = (u32)skb->data;
-        alignment = Tmpaddr & 0x1ff;
-        skb_reserve(skb,(USB_512B_ALIGNMENT_SIZE - alignment));
-#endif
-
        skb_reserve(skb, ieee->tx_headroom);
 
        beacon_buf = (struct rtllib_probe_response*) skb_put(skb, (beacon_size - ieee->tx_headroom));
@@ -1098,23 +1061,11 @@ struct sk_buff* rtllib_assoc_resp(struct rtllib_device *ieee, u8 *dest)
        unsigned int rate_len = rtllib_MFIE_rate_len(ieee);
        int len = sizeof(struct rtllib_assoc_response_frame) + rate_len + ieee->tx_headroom;
 
-#ifdef USB_USE_ALIGNMENT
-        u32 Tmpaddr=0;
-        int alignment=0;
-        skb = dev_alloc_skb(len + USB_512B_ALIGNMENT_SIZE);
-#else
        skb = dev_alloc_skb(len);
-#endif
 
        if (!skb)
                return NULL;
 
-#ifdef USB_USE_ALIGNMENT
-        Tmpaddr = (u32)skb->data;
-        alignment = Tmpaddr & 0x1ff;
-        skb_reserve(skb,(USB_512B_ALIGNMENT_SIZE - alignment));
-#endif
-
        skb_reserve(skb, ieee->tx_headroom);
 
        assoc = (struct rtllib_assoc_response_frame *)
@@ -1160,24 +1111,12 @@ struct sk_buff* rtllib_auth_resp(struct rtllib_device *ieee,int status, u8 *dest
        struct sk_buff *skb = NULL;
        struct rtllib_authentication *auth;
        int len = ieee->tx_headroom + sizeof(struct rtllib_authentication)+1;
-#ifdef USB_USE_ALIGNMENT
-        u32 Tmpaddr=0;
-        int alignment=0;
-        skb = dev_alloc_skb(len + USB_512B_ALIGNMENT_SIZE);
-#else
        skb = dev_alloc_skb(len);
-#endif
        if (!skb)
                return NULL;
 
        skb->len = sizeof(struct rtllib_authentication);
 
-#ifdef USB_USE_ALIGNMENT
-        Tmpaddr = (u32)skb->data;
-        alignment = Tmpaddr & 0x1ff;
-        skb_reserve(skb,(USB_512B_ALIGNMENT_SIZE - alignment));
-#endif
-
        skb_reserve(skb, ieee->tx_headroom);
 
        auth = (struct rtllib_authentication *)
@@ -1201,21 +1140,10 @@ struct sk_buff* rtllib_null_func(struct rtllib_device *ieee,short pwr)
        struct sk_buff *skb;
        struct rtllib_hdr_3addr* hdr;
 
-#ifdef USB_USE_ALIGNMENT
-        u32 Tmpaddr=0;
-        int alignment=0;
-        skb = dev_alloc_skb(sizeof(struct rtllib_hdr_3addr) + ieee->tx_headroom + USB_512B_ALIGNMENT_SIZE);
-#else
        skb = dev_alloc_skb(sizeof(struct rtllib_hdr_3addr)+ieee->tx_headroom);
-#endif
        if (!skb)
                return NULL;
 
-#ifdef USB_USE_ALIGNMENT
-        Tmpaddr = (u32)skb->data;
-        alignment = Tmpaddr & 0x1ff;
-        skb_reserve(skb,(USB_512B_ALIGNMENT_SIZE - alignment));
-#endif
        skb_reserve(skb, ieee->tx_headroom);
 
        hdr = (struct rtllib_hdr_3addr*)skb_put(skb,sizeof(struct rtllib_hdr_3addr));
@@ -1238,21 +1166,10 @@ struct sk_buff* rtllib_pspoll_func(struct rtllib_device *ieee)
        struct sk_buff *skb;
        struct rtllib_pspoll_hdr* hdr;
 
-#ifdef USB_USE_ALIGNMENT
-        u32 Tmpaddr=0;
-        int alignment=0;
-        skb = dev_alloc_skb(sizeof(struct rtllib_pspoll_hdr) + ieee->tx_headroom + USB_512B_ALIGNMENT_SIZE);
-#else
        skb = dev_alloc_skb(sizeof(struct rtllib_pspoll_hdr)+ieee->tx_headroom);
-#endif
        if (!skb)
                return NULL;
 
-#ifdef USB_USE_ALIGNMENT
-        Tmpaddr = (u32)skb->data;
-        alignment = Tmpaddr & 0x1ff;
-        skb_reserve(skb,(USB_512B_ALIGNMENT_SIZE - alignment));
-#endif
        skb_reserve(skb, ieee->tx_headroom);
 
        hdr = (struct rtllib_pspoll_hdr*)skb_put(skb,sizeof(struct rtllib_pspoll_hdr));
@@ -1412,23 +1329,11 @@ inline struct sk_buff *rtllib_association_req(struct rtllib_network *beacon,stru
                + cxvernum_ie_len
                + ieee->tx_headroom;
 
-#ifdef USB_USE_ALIGNMENT
-       u32 Tmpaddr=0;
-       int alignment=0;
-       skb = dev_alloc_skb(len + USB_512B_ALIGNMENT_SIZE);
-#else
        skb = dev_alloc_skb(len);
-#endif
 
        if (!skb)
                return NULL;
 
-#ifdef USB_USE_ALIGNMENT
-        Tmpaddr = (u32)skb->data;
-        alignment = Tmpaddr & 0x1ff;
-        skb_reserve(skb,(USB_512B_ALIGNMENT_SIZE - alignment));
-#endif
-
        skb_reserve(skb, ieee->tx_headroom);
 
        hdr = (struct rtllib_assoc_request_frame *)
@@ -3743,24 +3648,13 @@ inline struct sk_buff *rtllib_disauth_skb( struct rtllib_network *beacon,
 {
        struct sk_buff *skb;
        struct rtllib_disauth *disauth;
-#ifdef USB_USE_ALIGNMENT
-        u32 Tmpaddr=0;
-        int alignment=0;
-       int len = sizeof(struct rtllib_disauth) + ieee->tx_headroom + USB_512B_ALIGNMENT_SIZE;
-#else
        int len = sizeof(struct rtllib_disauth) + ieee->tx_headroom;
 
-#endif
        skb = dev_alloc_skb(len);
        if (!skb) {
                return NULL;
        }
 
-#ifdef USB_USE_ALIGNMENT
-        Tmpaddr = (u32)skb->data;
-        alignment = Tmpaddr & 0x1ff;
-        skb_reserve(skb,(USB_512B_ALIGNMENT_SIZE - alignment));
-#endif
        skb_reserve(skb, ieee->tx_headroom);
 
        disauth = (struct rtllib_disauth *) skb_put(skb,sizeof(struct rtllib_disauth));
@@ -3780,24 +3674,13 @@ inline struct sk_buff *rtllib_disassociate_skb( struct rtllib_network *beacon,
 {
        struct sk_buff *skb;
        struct rtllib_disassoc *disass;
-#ifdef USB_USE_ALIGNMENT
-        u32 Tmpaddr=0;
-        int alignment=0;
-       int len = sizeof(struct rtllib_disassoc) + ieee->tx_headroom + USB_512B_ALIGNMENT_SIZE;
-#else
        int len = sizeof(struct rtllib_disassoc) + ieee->tx_headroom;
-#endif
        skb = dev_alloc_skb(len);
 
        if (!skb) {
                return NULL;
        }
 
-#ifdef USB_USE_ALIGNMENT
-        Tmpaddr = (u32)skb->data;
-        alignment = Tmpaddr & 0x1ff;
-        skb_reserve(skb,(USB_512B_ALIGNMENT_SIZE - alignment));
-#endif
        skb_reserve(skb, ieee->tx_headroom);
 
        disass = (struct rtllib_disassoc *) skb_put(skb,sizeof(struct rtllib_disassoc));
index 3aa6756..f93530e 100644 (file)
@@ -243,10 +243,6 @@ void rtllib_txb_free(struct rtllib_txb *txb) {
 struct rtllib_txb *rtllib_alloc_txb(int nr_frags, int txb_size,
                                          int gfp_mask)
 {
-#ifdef USB_USE_ALIGNMENT
-       u32 Tmpaddr=0;
-       int alignment=0;
-#endif
        struct rtllib_txb *txb;
        int i;
        txb = kmalloc(
@@ -260,20 +256,11 @@ struct rtllib_txb *rtllib_alloc_txb(int nr_frags, int txb_size,
        txb->frag_size = txb_size;
 
        for (i = 0; i < nr_frags; i++) {
-#ifdef USB_USE_ALIGNMENT
-               txb->fragments[i] = dev_alloc_skb(txb_size+USB_512B_ALIGNMENT_SIZE);
-#else
                txb->fragments[i] = dev_alloc_skb(txb_size);
-#endif
                if (unlikely(!txb->fragments[i])) {
                        i--;
                        break;
                }
-#ifdef USB_USE_ALIGNMENT
-               Tmpaddr = (u32)(txb->fragments[i]->data);
-               alignment = Tmpaddr & 0x1ff;
-               skb_reserve(txb->fragments[i],(USB_512B_ALIGNMENT_SIZE - alignment));
-#endif
                memset(txb->fragments[i]->cb, 0, sizeof(txb->fragments[i]->cb));
        }
        if (unlikely(i != nr_frags)) {