aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtl8187_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rtl8187_dev.c')
-rw-r--r--drivers/net/wireless/rtl8187_dev.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c
index 0ef887dd2867..de61c8fe6492 100644
--- a/drivers/net/wireless/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl8187_dev.c
@@ -131,7 +131,8 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb,
131 struct rtl8187_tx_hdr *hdr; 131 struct rtl8187_tx_hdr *hdr;
132 struct rtl8187_tx_info *info; 132 struct rtl8187_tx_info *info;
133 struct urb *urb; 133 struct urb *urb;
134 u32 tmp; 134 __le16 rts_dur = 0;
135 u32 flags;
135 136
136 urb = usb_alloc_urb(0, GFP_ATOMIC); 137 urb = usb_alloc_urb(0, GFP_ATOMIC);
137 if (!urb) { 138 if (!urb) {
@@ -139,24 +140,24 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb,
139 return 0; 140 return 0;
140 } 141 }
141 142
142 hdr = (struct rtl8187_tx_hdr *)skb_push(skb, sizeof(*hdr)); 143 flags = skb->len;
143 tmp = skb->len - sizeof(*hdr); 144 flags |= RTL8187_TX_FLAG_NO_ENCRYPT;
144 tmp |= RTL8187_TX_FLAG_NO_ENCRYPT; 145 flags |= control->rts_cts_rate << 19;
145 tmp |= control->rts_cts_rate << 19; 146 flags |= control->tx_rate << 24;
146 tmp |= control->tx_rate << 24; 147 if (ieee80211_get_morefrag((struct ieee80211_hdr *)skb->data))
147 if (ieee80211_get_morefrag((struct ieee80211_hdr *)skb)) 148 flags |= RTL8187_TX_FLAG_MORE_FRAG;
148 tmp |= RTL8187_TX_FLAG_MORE_FRAG;
149 if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) { 149 if (control->flags & IEEE80211_TXCTL_USE_RTS_CTS) {
150 tmp |= RTL8187_TX_FLAG_RTS; 150 flags |= RTL8187_TX_FLAG_RTS;
151 hdr->rts_duration = 151 rts_dur = ieee80211_rts_duration(dev, priv->if_id, skb->len, control);
152 ieee80211_rts_duration(dev, priv->if_id, skb->len, control);
153 } 152 }
154 if (control->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) 153 if (control->flags & IEEE80211_TXCTL_USE_CTS_PROTECT)
155 tmp |= RTL8187_TX_FLAG_CTS; 154 flags |= RTL8187_TX_FLAG_CTS;
156 hdr->flags = cpu_to_le32(tmp); 155
156 hdr = (struct rtl8187_tx_hdr *)skb_push(skb, sizeof(*hdr));
157 hdr->flags = cpu_to_le32(flags);
157 hdr->len = 0; 158 hdr->len = 0;
158 tmp = control->retry_limit << 8; 159 hdr->rts_duration = rts_dur;
159 hdr->retry = cpu_to_le32(tmp); 160 hdr->retry = cpu_to_le32(control->retry_limit << 8);
160 161
161 info = (struct rtl8187_tx_info *)skb->cb; 162 info = (struct rtl8187_tx_info *)skb->cb;
162 info->control = kmemdup(control, sizeof(*control), GFP_ATOMIC); 163 info->control = kmemdup(control, sizeof(*control), GFP_ATOMIC);
@@ -587,8 +588,6 @@ static void rtl8187_configure_filter(struct ieee80211_hw *dev,
587 588
588 *total_flags = 0; 589 *total_flags = 0;
589 590
590 if (changed_flags & FIF_PROMISC_IN_BSS)
591 priv->rx_conf ^= RTL818X_RX_CONF_NICMAC;
592 if (changed_flags & FIF_ALLMULTI) 591 if (changed_flags & FIF_ALLMULTI)
593 priv->rx_conf ^= RTL818X_RX_CONF_MULTICAST; 592 priv->rx_conf ^= RTL818X_RX_CONF_MULTICAST;
594 if (changed_flags & FIF_FCSFAIL) 593 if (changed_flags & FIF_FCSFAIL)
@@ -601,8 +600,6 @@ static void rtl8187_configure_filter(struct ieee80211_hw *dev,
601 if (mc_count > 0) 600 if (mc_count > 0)
602 priv->rx_conf |= RTL818X_RX_CONF_MULTICAST; 601 priv->rx_conf |= RTL818X_RX_CONF_MULTICAST;
603 602
604 if (priv->rx_conf & RTL818X_RX_CONF_NICMAC)
605 *total_flags |= FIF_PROMISC_IN_BSS;
606 if (priv->rx_conf & RTL818X_RX_CONF_MULTICAST) 603 if (priv->rx_conf & RTL818X_RX_CONF_MULTICAST)
607 *total_flags |= FIF_ALLMULTI; 604 *total_flags |= FIF_ALLMULTI;
608 if (priv->rx_conf & RTL818X_RX_CONF_FCS) 605 if (priv->rx_conf & RTL818X_RX_CONF_FCS)