Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- a/drivers/net/wireless/rtl818x/rtl8187/dev.c 2014-05-23 19:32:17.000000000 +0200
- +++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c 2014-11-08 00:26:09.690268026 +0100
- @@ -252,8 +252,13 @@
- flags |= ieee80211_get_tx_rate(dev, info)->hw_value << 24;
- if (ieee80211_has_morefrags(tx_hdr->frame_control))
- - flags |= RTL818X_TX_DESC_FLAG_MOREFRAG;
- -
- + {
- + // If info->control.vif is NULL it's most likely in monitor mode
- + if (likely(info->control.vif != NULL && info->control.vif->type != NL80211_IFTYPE_MONITOR)) {
- + flags |= RTL818X_TX_DESC_FLAG_MOREFRAG;
- + }
- + }
- +
- /* HW will perform RTS-CTS when only RTS flags is set.
- * HW will perform CTS-to-self when both RTS and CTS flags are set.
- * RTS rate and RTS duration will be used also for CTS-to-self.
- --- a/net/mac80211/cfg.c 2014-05-23 19:32:18.000000000 +0200
- +++ b/net/mac80211/cfg.c 2014-11-08 00:26:09.694268055 +0100
- @@ -861,7 +861,8 @@
- ret = ieee80211_vif_use_channel(sdata, chandef,
- IEEE80211_CHANCTX_EXCLUSIVE);
- }
- - } else if (local->open_count == local->monitors) {
- + // Patch: Always allow channel change, even if a normal virtual interface is present
- + } else /*if (local->open_count == local->monitors)*/ {
- local->_oper_chandef = *chandef;
- ieee80211_hw_config(local, 0);
- }
- @@ -3720,9 +3721,9 @@
- if (chanctx_conf) {
- *chandef = chanctx_conf->def;
- ret = 0;
- - } else if (local->open_count > 0 &&
- + } else /*if (local->open_count > 0 &&
- local->open_count == local->monitors &&
- - sdata->vif.type == NL80211_IFTYPE_MONITOR) {
- + sdata->vif.type == NL80211_IFTYPE_MONITOR)*/ {
- if (local->use_chanctx)
- *chandef = local->monitor_chandef;
- else
- --- a/net/mac80211/tx.c 2014-05-23 19:32:18.000000000 +0200
- +++ b/net/mac80211/tx.c 2014-11-08 00:26:09.694268055 +0100
- @@ -780,11 +780,19 @@
- /*
- * Packet injection may want to control the sequence
- - * number, if we have no matching interface then we
- - * neither assign one ourselves nor ask the driver to.
- + * number, so if an injected packet is found, skip
- + * renumbering it. Also make the packet NO_ACK to avoid
- + * excessive retries (ACKing and retrying should be
- + * handled by the injecting application).
- + * FIXME This may break hostapd and some other injectors.
- + * This should be done using a radiotap flag.
- */
- - if (unlikely(info->control.vif->type == NL80211_IFTYPE_MONITOR))
- + if (unlikely((info->flags & IEEE80211_TX_CTL_INJECTED) &&
- + !(tx->sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES))) {
- + if (!ieee80211_has_morefrags(hdr->frame_control))
- + info->flags |= IEEE80211_TX_CTL_NO_ACK;
- return TX_CONTINUE;
- + }
- if (unlikely(ieee80211_is_ctl(hdr->frame_control)))
- return TX_CONTINUE;
- @@ -1526,7 +1534,10 @@
- }
- }
- - ieee80211_set_qos_hdr(sdata, skb);
- + // Don't overwrite QoS header in monitor mode
- + if (likely(info->control.vif->type != NL80211_IFTYPE_MONITOR)) {
- + ieee80211_set_qos_hdr(sdata, skb);
- + }
- ieee80211_tx(sdata, skb, false, band);
- }
- --- a/net/wireless/chan.c 2014-05-23 19:32:18.000000000 +0200
- +++ b/net/wireless/chan.c 2014-11-08 00:26:09.694268055 +0100
- @@ -814,8 +814,10 @@
- {
- if (!rdev->ops->set_monitor_channel)
- return -EOPNOTSUPP;
- - if (!cfg80211_has_monitors_only(rdev))
- - return -EBUSY;
- + // Always allow user to change channel, even if there is another normal
- + // virtual interface using the device.
- + //if (!cfg80211_has_monitors_only(rdev))
- + // return -EBUSY;
- return rdev_set_monitor_channel(rdev, chandef);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement