Advertisement
Guest User

Untitled

a guest
Mar 4th, 2016
126
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --- a/drivers/net/wireless/rt2x00/rt2400pci.c
  2. +++ b/drivers/net/wireless/rt2x00/rt2400pci.c
  3. @@ -273,8 +273,10 @@ static void rt2400pci_config_filter(struct rt2x00_dev *rt2x00dev,
  4. !(filter_flags & FIF_PLCPFAIL));
  5. rt2x00_set_field32(&reg, RXCSR0_DROP_CONTROL,
  6. !(filter_flags & FIF_CONTROL));
  7. - rt2x00_set_field32(&reg, RXCSR0_DROP_NOT_TO_ME, 1);
  8. + rt2x00_set_field32(&reg, RXCSR0_DROP_NOT_TO_ME,
  9. + !test_bit(CONFIG_MONITORING, &rt2x00dev->flags));
  10. rt2x00_set_field32(&reg, RXCSR0_DROP_TODS,
  11. + !test_bit(CONFIG_MONITORING, &rt2x00dev->flags) &&
  12. !rt2x00dev->intf_ap_count);
  13. rt2x00_set_field32(&reg, RXCSR0_DROP_VERSION_ERROR, 1);
  14. rt2x00mmio_register_write(rt2x00dev, RXCSR0, reg);
  15. --- a/drivers/net/wireless/rt2x00/rt2500pci.c
  16. +++ b/drivers/net/wireless/rt2x00/rt2500pci.c
  17. @@ -274,8 +274,10 @@ static void rt2500pci_config_filter(struct rt2x00_dev *rt2x00dev,
  18. !(filter_flags & FIF_PLCPFAIL));
  19. rt2x00_set_field32(&reg, RXCSR0_DROP_CONTROL,
  20. !(filter_flags & FIF_CONTROL));
  21. - rt2x00_set_field32(&reg, RXCSR0_DROP_NOT_TO_ME, 1);
  22. + rt2x00_set_field32(&reg, RXCSR0_DROP_NOT_TO_ME,
  23. + !test_bit(CONFIG_MONITORING, &rt2x00dev->flags));
  24. rt2x00_set_field32(&reg, RXCSR0_DROP_TODS,
  25. + !test_bit(CONFIG_MONITORING, &rt2x00dev->flags) &&
  26. !rt2x00dev->intf_ap_count);
  27. rt2x00_set_field32(&reg, RXCSR0_DROP_VERSION_ERROR, 1);
  28. rt2x00_set_field32(&reg, RXCSR0_DROP_MCAST,
  29. --- a/drivers/net/wireless/rt2x00/rt2500usb.c
  30. +++ b/drivers/net/wireless/rt2x00/rt2500usb.c
  31. @@ -437,8 +437,10 @@ static void rt2500usb_config_filter(struct rt2x00_dev *rt2x00dev,
  32. !(filter_flags & FIF_PLCPFAIL));
  33. rt2x00_set_field16(&reg, TXRX_CSR2_DROP_CONTROL,
  34. !(filter_flags & FIF_CONTROL));
  35. - rt2x00_set_field16(&reg, TXRX_CSR2_DROP_NOT_TO_ME, 1);
  36. + rt2x00_set_field16(&reg, TXRX_CSR2_DROP_NOT_TO_ME,
  37. + !test_bit(CONFIG_MONITORING, &rt2x00dev->flags));
  38. rt2x00_set_field16(&reg, TXRX_CSR2_DROP_TODS,
  39. + !test_bit(CONFIG_MONITORING, &rt2x00dev->flags) &&
  40. !rt2x00dev->intf_ap_count);
  41. rt2x00_set_field16(&reg, TXRX_CSR2_DROP_VERSION_ERROR, 1);
  42. rt2x00_set_field16(&reg, TXRX_CSR2_DROP_MULTICAST,
  43. --- a/drivers/net/wireless/rt2x00/rt2800lib.c
  44. +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
  45. @@ -1490,7 +1490,8 @@ void rt2800_config_filter(struct rt2x00_dev *rt2x00dev,
  46. !(filter_flags & FIF_FCSFAIL));
  47. rt2x00_set_field32(&reg, RX_FILTER_CFG_DROP_PHY_ERROR,
  48. !(filter_flags & FIF_PLCPFAIL));
  49. - rt2x00_set_field32(&reg, RX_FILTER_CFG_DROP_NOT_TO_ME, 1);
  50. + rt2x00_set_field32(&reg, RX_FILTER_CFG_DROP_NOT_TO_ME,
  51. + !test_bit(CONFIG_MONITORING, &rt2x00dev->flags));
  52. rt2x00_set_field32(&reg, RX_FILTER_CFG_DROP_NOT_MY_BSSD, 0);
  53. rt2x00_set_field32(&reg, RX_FILTER_CFG_DROP_VER_ERROR, 1);
  54. rt2x00_set_field32(&reg, RX_FILTER_CFG_DROP_MULTICAST,
  55. --- a/drivers/net/wireless/rt2x00/rt2x00.h
  56. +++ b/drivers/net/wireless/rt2x00/rt2x00.h
  57. @@ -669,6 +669,7 @@ enum rt2x00_state_flags {
  58. CONFIG_POWERSAVING,
  59. CONFIG_HT_DISABLED,
  60. CONFIG_QOS_DISABLED,
  61. + CONFIG_MONITORING,
  62.  
  63. /*
  64. * Mark we currently are sequentially reading TX_STA_FIFO register
  65. --- a/drivers/net/wireless/rt2x00/rt2x00config.c
  66. +++ b/drivers/net/wireless/rt2x00/rt2x00config.c
  67. @@ -277,6 +277,11 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
  68. else
  69. clear_bit(CONFIG_POWERSAVING, &rt2x00dev->flags);
  70.  
  71. + if (conf->flags & IEEE80211_CONF_MONITOR)
  72. + set_bit(CONFIG_MONITORING, &rt2x00dev->flags);
  73. + else
  74. + clear_bit(CONFIG_MONITORING, &rt2x00dev->flags);
  75. +
  76. rt2x00dev->curr_band = conf->chandef.chan->band;
  77. rt2x00dev->curr_freq = conf->chandef.chan->center_freq;
  78. rt2x00dev->tx_power = conf->power_level;
  79. --- a/drivers/net/wireless/rt2x00/rt2x00mac.c
  80. +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
  81. @@ -385,11 +385,6 @@ void rt2x00mac_configure_filter(struct ieee80211_hw *hw,
  82. *total_flags |= FIF_PSPOLL;
  83. }
  84.  
  85. - /*
  86. - * Check if there is any work left for us.
  87. - */
  88. - if (rt2x00dev->packet_filter == *total_flags)
  89. - return;
  90. rt2x00dev->packet_filter = *total_flags;
  91.  
  92. rt2x00dev->ops->lib->config_filter(rt2x00dev, *total_flags);
  93. --- a/drivers/net/wireless/rt2x00/rt61pci.c
  94. +++ b/drivers/net/wireless/rt2x00/rt61pci.c
  95. @@ -530,8 +530,10 @@ static void rt61pci_config_filter(struct rt2x00_dev *rt2x00dev,
  96. !(filter_flags & FIF_PLCPFAIL));
  97. rt2x00_set_field32(&reg, TXRX_CSR0_DROP_CONTROL,
  98. !(filter_flags & (FIF_CONTROL | FIF_PSPOLL)));
  99. - rt2x00_set_field32(&reg, TXRX_CSR0_DROP_NOT_TO_ME, 1);
  100. + rt2x00_set_field32(&reg, TXRX_CSR0_DROP_NOT_TO_ME,
  101. + !test_bit(CONFIG_MONITORING, &rt2x00dev->flags));
  102. rt2x00_set_field32(&reg, TXRX_CSR0_DROP_TO_DS,
  103. + !test_bit(CONFIG_MONITORING, &rt2x00dev->flags) &&
  104. !rt2x00dev->intf_ap_count);
  105. rt2x00_set_field32(&reg, TXRX_CSR0_DROP_VERSION_ERROR, 1);
  106. rt2x00_set_field32(&reg, TXRX_CSR0_DROP_MULTICAST,
  107. --- a/drivers/net/wireless/rt2x00/rt73usb.c
  108. +++ b/drivers/net/wireless/rt2x00/rt73usb.c
  109. @@ -480,8 +480,10 @@ static void rt73usb_config_filter(struct rt2x00_dev *rt2x00dev,
  110. !(filter_flags & FIF_PLCPFAIL));
  111. rt2x00_set_field32(&reg, TXRX_CSR0_DROP_CONTROL,
  112. !(filter_flags & (FIF_CONTROL | FIF_PSPOLL)));
  113. - rt2x00_set_field32(&reg, TXRX_CSR0_DROP_NOT_TO_ME, 1);
  114. + rt2x00_set_field32(&reg, TXRX_CSR0_DROP_NOT_TO_ME,
  115. + !test_bit(CONFIG_MONITORING, &rt2x00dev->flags));
  116. rt2x00_set_field32(&reg, TXRX_CSR0_DROP_TO_DS,
  117. + !test_bit(CONFIG_MONITORING, &rt2x00dev->flags) &&
  118. !rt2x00dev->intf_ap_count);
  119. rt2x00_set_field32(&reg, TXRX_CSR0_DROP_VERSION_ERROR, 1);
  120. rt2x00_set_field32(&reg, TXRX_CSR0_DROP_MULTICAST,
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement