SHARE
TWEET

006-chan_qos_frag_ack_negative_one.patch

a guest Nov 12th, 2014 1,496 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --- a/drivers/net/wireless/rtl818x/rtl8187/dev.c        2014-05-23 19:32:17.000000000 +0200
  2. +++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c        2014-11-08 00:26:09.690268026 +0100
  3. @@ -252,8 +252,13 @@
  4.  
  5.         flags |= ieee80211_get_tx_rate(dev, info)->hw_value << 24;
  6.         if (ieee80211_has_morefrags(tx_hdr->frame_control))
  7. -               flags |= RTL818X_TX_DESC_FLAG_MOREFRAG;
  8. -
  9. +       {
  10. +               // If info->control.vif is NULL it's most likely in monitor mode
  11. +               if (likely(info->control.vif != NULL && info->control.vif->type != NL80211_IFTYPE_MONITOR)) {
  12. +                       flags |= RTL818X_TX_DESC_FLAG_MOREFRAG;
  13. +               }
  14. +       }
  15. +                                      
  16.         /* HW will perform RTS-CTS when only RTS flags is set.
  17.          * HW will perform CTS-to-self when both RTS and CTS flags are set.
  18.          * RTS rate and RTS duration will be used also for CTS-to-self.
  19. --- a/net/mac80211/cfg.c        2014-05-23 19:32:18.000000000 +0200
  20. +++ b/net/mac80211/cfg.c        2014-11-08 00:26:09.694268055 +0100
  21. @@ -861,7 +861,8 @@
  22.                         ret = ieee80211_vif_use_channel(sdata, chandef,
  23.                                         IEEE80211_CHANCTX_EXCLUSIVE);
  24.                 }
  25. -       } else if (local->open_count == local->monitors) {
  26. +       // Patch: Always allow channel change, even if a normal virtual interface is present
  27. +       } else /*if (local->open_count == local->monitors)*/ {
  28.                 local->_oper_chandef = *chandef;
  29.                 ieee80211_hw_config(local, 0);
  30.         }
  31. @@ -3720,9 +3721,9 @@
  32.         if (chanctx_conf) {
  33.                 *chandef = chanctx_conf->def;
  34.                 ret = 0;
  35. -       } else if (local->open_count > 0 &&
  36. +       } else /*if (local->open_count > 0 &&
  37.                    local->open_count == local->monitors &&
  38. -                  sdata->vif.type == NL80211_IFTYPE_MONITOR) {
  39. +                  sdata->vif.type == NL80211_IFTYPE_MONITOR)*/ {
  40.                 if (local->use_chanctx)
  41.                         *chandef = local->monitor_chandef;
  42.                 else
  43. --- a/net/mac80211/tx.c 2014-05-23 19:32:18.000000000 +0200
  44. +++ b/net/mac80211/tx.c 2014-11-08 00:26:09.694268055 +0100
  45. @@ -780,11 +780,19 @@
  46.  
  47.         /*
  48.          * Packet injection may want to control the sequence
  49. -        * number, if we have no matching interface then we
  50. -        * neither assign one ourselves nor ask the driver to.
  51. +        * number, so if an injected packet is found, skip
  52. +        * renumbering it. Also make the packet NO_ACK to avoid
  53. +        * excessive retries (ACKing and retrying should be
  54. +        * handled by the injecting application).
  55. +        * FIXME This may break hostapd and some other injectors.
  56. +        * This should be done using a radiotap flag.
  57.          */
  58. -       if (unlikely(info->control.vif->type == NL80211_IFTYPE_MONITOR))
  59. +       if (unlikely((info->flags & IEEE80211_TX_CTL_INJECTED) &&
  60. +          !(tx->sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES))) {
  61. +               if (!ieee80211_has_morefrags(hdr->frame_control))
  62. +                       info->flags |= IEEE80211_TX_CTL_NO_ACK;
  63.                 return TX_CONTINUE;
  64. +       }
  65.  
  66.         if (unlikely(ieee80211_is_ctl(hdr->frame_control)))
  67.                 return TX_CONTINUE;
  68. @@ -1526,7 +1534,10 @@
  69.                 }
  70.         }
  71.  
  72. -       ieee80211_set_qos_hdr(sdata, skb);
  73. +       // Don't overwrite QoS header in monitor mode
  74. +       if (likely(info->control.vif->type != NL80211_IFTYPE_MONITOR)) {
  75. +               ieee80211_set_qos_hdr(sdata, skb);
  76. +       }
  77.         ieee80211_tx(sdata, skb, false, band);
  78.  }
  79.  
  80. --- a/net/wireless/chan.c       2014-05-23 19:32:18.000000000 +0200
  81. +++ b/net/wireless/chan.c       2014-11-08 00:26:09.694268055 +0100
  82. @@ -814,8 +814,10 @@
  83.  {
  84.         if (!rdev->ops->set_monitor_channel)
  85.                 return -EOPNOTSUPP;
  86. -       if (!cfg80211_has_monitors_only(rdev))
  87. -               return -EBUSY;
  88. +       // Always allow user to change channel, even if there is another normal
  89. +       // virtual interface using the device.
  90. +       //if (!cfg80211_has_monitors_only(rdev))
  91. +       //      return -EBUSY;
  92.  
  93.         return rdev_set_monitor_channel(rdev, chandef);
  94.  }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top