351-ath9k-fix-regression-in-bssidmask-calculation.patch 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. From: Ben Greear <[email protected]>
  2. Date: Tue, 4 Nov 2014 15:22:50 -0800
  3. Subject: [PATCH] ath9k: fix regression in bssidmask calculation
  4. The commit that went into 3.17:
  5. ath9k: Summarize hw state per channel context
  6. Group and set hw state (opmode, primary_sta, beacon conf) per
  7. channel context instead of whole list of vifs. This would allow
  8. each channel context to run in different mode (STA/AP).
  9. Signed-off-by: Felix Fietkau <[email protected]>
  10. Signed-off-by: Rajkumar Manoharan <[email protected]>
  11. Signed-off-by: John W. Linville <[email protected]>
  12. broke multi-vif configuration due to not properly calculating
  13. the bssid mask.
  14. The test case that caught this was:
  15. create wlan0 and sta0-4 (6 total), not sure how much that matters.
  16. associate all 6 (works fine)
  17. disconnect 5 of them, leaving sta0 up
  18. Start trying to bring up the other 5 one at a time. It will
  19. fail, with iw events looking like this (in these logs, several
  20. sta are trying to come up, but symptom is the same with just one)
  21. The patch causing the regression made quite a few changes, but
  22. the part I think caused this particular problem was not
  23. recalculating the bssid mask when adding and removing interfaces.
  24. Re-adding those calls fixes my test case. Fix bad comment
  25. as well.
  26. Signed-off-by: Ben Greear <[email protected]>
  27. ---
  28. --- a/drivers/net/wireless/ath/ath9k/main.c
  29. +++ b/drivers/net/wireless/ath/ath9k/main.c
  30. @@ -994,9 +994,8 @@ void ath9k_calculate_iter_data(struct at
  31. struct ath_vif *avp;
  32. /*
  33. - * Pick the MAC address of the first interface as the new hardware
  34. - * MAC address. The hardware will use it together with the BSSID mask
  35. - * when matching addresses.
  36. + * The hardware will use primary station addr together with the
  37. + * BSSID mask when matching addresses.
  38. */
  39. memset(iter_data, 0, sizeof(*iter_data));
  40. memset(&iter_data->mask, 0xff, ETH_ALEN);
  41. @@ -1225,6 +1224,8 @@ static int ath9k_add_interface(struct ie
  42. list_add_tail(&avp->list, &avp->chanctx->vifs);
  43. }
  44. + ath9k_calculate_summary_state(sc, avp->chanctx);
  45. +
  46. ath9k_assign_hw_queues(hw, vif);
  47. an->sc = sc;
  48. @@ -1294,6 +1295,8 @@ static void ath9k_remove_interface(struc
  49. ath_tx_node_cleanup(sc, &avp->mcast_node);
  50. + ath9k_calculate_summary_state(sc, avp->chanctx);
  51. +
  52. mutex_unlock(&sc->mutex);
  53. }