diff options
author | John W. Linville <linville@tuxdriver.com> | 2010-12-13 15:20:45 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-12-13 15:20:45 -0500 |
commit | 1d212aa96e1b63459486f729af9a3fa38768b801 (patch) | |
tree | e91e74db57a5bb7884b4681cdb788d405ec8f10f /net/mac80211/tx.c | |
parent | 8c4877a4128e7931077b024a891a4b284d8756a3 (diff) | |
parent | b7613370db5ba66ad81e41cd3a5417fde4d5e03c (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r-- | net/mac80211/tx.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 2ba742656825..0ee56bb0ea7e 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -666,10 +666,11 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx) | |||
666 | if (unlikely(info->control.rates[0].idx < 0)) | 666 | if (unlikely(info->control.rates[0].idx < 0)) |
667 | return TX_DROP; | 667 | return TX_DROP; |
668 | 668 | ||
669 | if (txrc.reported_rate.idx < 0) | 669 | if (txrc.reported_rate.idx < 0) { |
670 | txrc.reported_rate = info->control.rates[0]; | 670 | txrc.reported_rate = info->control.rates[0]; |
671 | 671 | if (tx->sta && ieee80211_is_data(hdr->frame_control)) | |
672 | if (tx->sta) | 672 | tx->sta->last_tx_rate = txrc.reported_rate; |
673 | } else if (tx->sta) | ||
673 | tx->sta->last_tx_rate = txrc.reported_rate; | 674 | tx->sta->last_tx_rate = txrc.reported_rate; |
674 | 675 | ||
675 | if (unlikely(!info->control.rates[0].count)) | 676 | if (unlikely(!info->control.rates[0].count)) |
@@ -1745,15 +1746,13 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1745 | int nh_pos, h_pos; | 1746 | int nh_pos, h_pos; |
1746 | struct sta_info *sta = NULL; | 1747 | struct sta_info *sta = NULL; |
1747 | u32 sta_flags = 0; | 1748 | u32 sta_flags = 0; |
1749 | struct sk_buff *tmp_skb; | ||
1748 | 1750 | ||
1749 | if (unlikely(skb->len < ETH_HLEN)) { | 1751 | if (unlikely(skb->len < ETH_HLEN)) { |
1750 | ret = NETDEV_TX_OK; | 1752 | ret = NETDEV_TX_OK; |
1751 | goto fail; | 1753 | goto fail; |
1752 | } | 1754 | } |
1753 | 1755 | ||
1754 | nh_pos = skb_network_header(skb) - skb->data; | ||
1755 | h_pos = skb_transport_header(skb) - skb->data; | ||
1756 | |||
1757 | /* convert Ethernet header to proper 802.11 header (based on | 1756 | /* convert Ethernet header to proper 802.11 header (based on |
1758 | * operation mode) */ | 1757 | * operation mode) */ |
1759 | ethertype = (skb->data[12] << 8) | skb->data[13]; | 1758 | ethertype = (skb->data[12] << 8) | skb->data[13]; |
@@ -1926,6 +1925,20 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1926 | goto fail; | 1925 | goto fail; |
1927 | } | 1926 | } |
1928 | 1927 | ||
1928 | /* | ||
1929 | * If the skb is shared we need to obtain our own copy. | ||
1930 | */ | ||
1931 | if (skb_shared(skb)) { | ||
1932 | tmp_skb = skb; | ||
1933 | skb = skb_copy(skb, GFP_ATOMIC); | ||
1934 | kfree_skb(tmp_skb); | ||
1935 | |||
1936 | if (!skb) { | ||
1937 | ret = NETDEV_TX_OK; | ||
1938 | goto fail; | ||
1939 | } | ||
1940 | } | ||
1941 | |||
1929 | hdr.frame_control = fc; | 1942 | hdr.frame_control = fc; |
1930 | hdr.duration_id = 0; | 1943 | hdr.duration_id = 0; |
1931 | hdr.seq_ctrl = 0; | 1944 | hdr.seq_ctrl = 0; |
@@ -1944,6 +1957,9 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1944 | encaps_len = 0; | 1957 | encaps_len = 0; |
1945 | } | 1958 | } |
1946 | 1959 | ||
1960 | nh_pos = skb_network_header(skb) - skb->data; | ||
1961 | h_pos = skb_transport_header(skb) - skb->data; | ||
1962 | |||
1947 | skb_pull(skb, skip_header_bytes); | 1963 | skb_pull(skb, skip_header_bytes); |
1948 | nh_pos -= skip_header_bytes; | 1964 | nh_pos -= skip_header_bytes; |
1949 | h_pos -= skip_header_bytes; | 1965 | h_pos -= skip_header_bytes; |