411-ath5k_allow_adhoc_and_ap.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c
  2. +++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
  3. @@ -86,13 +86,8 @@ ath5k_add_interface(struct ieee80211_hw
  4. goto end;
  5. }
  6. - /* Don't allow other interfaces if one ad-hoc is configured.
  7. - * TODO: Fix the problems with ad-hoc and multiple other interfaces.
  8. - * We would need to operate the HW in ad-hoc mode to allow TSF updates
  9. - * for the IBSS, but this breaks with additional AP or STA interfaces
  10. - * at the moment. */
  11. - if (ah->num_adhoc_vifs ||
  12. - (ah->nvifs && vif->type == NL80211_IFTYPE_ADHOC)) {
  13. + /* Don't allow more than one ad-hoc interface */
  14. + if (ah->num_adhoc_vifs && vif->type == NL80211_IFTYPE_ADHOC) {
  15. ATH5K_ERR(ah, "Only one single ad-hoc interface is allowed.\n");
  16. ret = -ELNRNG;
  17. goto end;
  18. --- a/drivers/net/wireless/ath/ath5k/base.c
  19. +++ b/drivers/net/wireless/ath/ath5k/base.c
  20. @@ -1965,7 +1965,7 @@ ath5k_beacon_send(struct ath5k_hw *ah)
  21. }
  22. if ((ah->opmode == NL80211_IFTYPE_AP && ah->num_ap_vifs +
  23. - ah->num_mesh_vifs > 1) ||
  24. + ah->num_adhoc_vifs + ah->num_mesh_vifs > 1) ||
  25. ah->opmode == NL80211_IFTYPE_MESH_POINT) {
  26. u64 tsf = ath5k_hw_get_tsf64(ah);
  27. u32 tsftu = TSF_TO_TU(tsf);
  28. @@ -2051,7 +2051,7 @@ ath5k_beacon_update_timers(struct ath5k_
  29. intval = ah->bintval & AR5K_BEACON_PERIOD;
  30. if (ah->opmode == NL80211_IFTYPE_AP && ah->num_ap_vifs
  31. - + ah->num_mesh_vifs > 1) {
  32. + + ah->num_adhoc_vifs + ah->num_mesh_vifs > 1) {
  33. intval /= ATH_BCBUF; /* staggered multi-bss beacons */
  34. if (intval < 15)
  35. ATH5K_WARN(ah, "intval %u is too low, min 15\n",
  36. @@ -2518,6 +2518,7 @@ static const struct ieee80211_iface_limi
  37. BIT(NL80211_IFTYPE_MESH_POINT) |
  38. #endif
  39. BIT(NL80211_IFTYPE_AP) },
  40. + { .max = 1, .types = BIT(NL80211_IFTYPE_ADHOC) },
  41. };
  42. static const struct ieee80211_iface_combination if_comb = {