[SK_BUFF]: Introduce ip_hdr(), remove skb->nh.iph
[powerpc.git] / net / ieee80211 / ieee80211_tx.c
index 854fc13..62a8a2b 100644 (file)
@@ -54,7 +54,7 @@ Desc. | ctrl | dura |  DA/RA  |   TA    |    SA   | Sequ |  Frame  |  fcs |
       |      | tion | (BSSID) |         |         | ence |  data   |      |
       `--------------------------------------------------|         |------'
 Total: 28 non-data bytes                                 `----.----'
-                                                              |
+                                                             |
        .- 'Frame data' expands, if WEP enabled, to <----------'
        |
        V
@@ -64,8 +64,8 @@ Bytes |  4  |   0-2296  |  4  |
 Desc. | IV  | Encrypted | ICV |
       |     | Packet    |     |
       `-----|           |-----'
-            `-----.-----'
-                  |
+           `-----.-----'
+                 |
        .- 'Encrypted Packet' expands to
        |
        V
@@ -225,10 +225,10 @@ static int ieee80211_classify(struct sk_buff *skb)
        struct iphdr *ip;
 
        eth = (struct ethhdr *)skb->data;
-       if (eth->h_proto != __constant_htons(ETH_P_IP))
+       if (eth->h_proto != htons(ETH_P_IP))
                return 0;
 
-       ip = skb->nh.iph;
+       ip = ip_hdr(skb);
        switch (ip->tos & 0xfc) {
        case 0x20:
                return 2;
@@ -502,9 +502,6 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
                if (host_encrypt)
                        ieee80211_encrypt_fragment(ieee, skb_frag, hdr_len);
                else if (host_build_iv) {
-                       struct ieee80211_crypt_data *crypt;
-
-                       crypt = ieee->crypt[ieee->tx_keyidx];
                        atomic_inc(&crypt->refcnt);
                        if (crypt->ops->build_iv)
                                crypt->ops->build_iv(skb_frag, hdr_len,