Commit da473b61 authored by Chun-Yeow Yeoh's avatar Chun-Yeow Yeoh Committed by John W. Linville

ath5k: allow AP and mesh mode to operate simultaneously

This patch allows the possibility of having the mesh point and AP to be operated
simultaneously in one single radio. Previously, mesh point fails to generate the
mesh beacon if virtual AP is created for the same radio.
Signed-off-by: default avatarChun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 804483e9
...@@ -1320,6 +1320,7 @@ struct ath5k_hw { ...@@ -1320,6 +1320,7 @@ struct ath5k_hw {
struct ieee80211_vif *bslot[ATH_BCBUF]; struct ieee80211_vif *bslot[ATH_BCBUF];
u16 num_ap_vifs; u16 num_ap_vifs;
u16 num_adhoc_vifs; u16 num_adhoc_vifs;
u16 num_mesh_vifs;
unsigned int bhalq, /* SW q for outgoing beacons */ unsigned int bhalq, /* SW q for outgoing beacons */
bmisscount, /* missed beacon transmits */ bmisscount, /* missed beacon transmits */
bintval, /* beacon interval in TU */ bintval, /* beacon interval in TU */
......
...@@ -1867,7 +1867,8 @@ ath5k_beacon_send(struct ath5k_hw *ah) ...@@ -1867,7 +1867,8 @@ ath5k_beacon_send(struct ath5k_hw *ah)
ah->bmisscount = 0; ah->bmisscount = 0;
} }
if ((ah->opmode == NL80211_IFTYPE_AP && ah->num_ap_vifs > 1) || if ((ah->opmode == NL80211_IFTYPE_AP && ah->num_ap_vifs +
ah->num_mesh_vifs > 1) ||
ah->opmode == NL80211_IFTYPE_MESH_POINT) { ah->opmode == NL80211_IFTYPE_MESH_POINT) {
u64 tsf = ath5k_hw_get_tsf64(ah); u64 tsf = ath5k_hw_get_tsf64(ah);
u32 tsftu = TSF_TO_TU(tsf); u32 tsftu = TSF_TO_TU(tsf);
...@@ -1952,7 +1953,8 @@ ath5k_beacon_update_timers(struct ath5k_hw *ah, u64 bc_tsf) ...@@ -1952,7 +1953,8 @@ ath5k_beacon_update_timers(struct ath5k_hw *ah, u64 bc_tsf)
u64 hw_tsf; u64 hw_tsf;
intval = ah->bintval & AR5K_BEACON_PERIOD; intval = ah->bintval & AR5K_BEACON_PERIOD;
if (ah->opmode == NL80211_IFTYPE_AP && ah->num_ap_vifs > 1) { if (ah->opmode == NL80211_IFTYPE_AP && ah->num_ap_vifs
+ ah->num_mesh_vifs > 1) {
intval /= ATH_BCBUF; /* staggered multi-bss beacons */ intval /= ATH_BCBUF; /* staggered multi-bss beacons */
if (intval < 15) if (intval < 15)
ATH5K_WARN(ah, "intval %u is too low, min 15\n", ATH5K_WARN(ah, "intval %u is too low, min 15\n",
......
...@@ -134,6 +134,8 @@ ath5k_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) ...@@ -134,6 +134,8 @@ ath5k_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
ah->num_ap_vifs++; ah->num_ap_vifs++;
else if (avf->opmode == NL80211_IFTYPE_ADHOC) else if (avf->opmode == NL80211_IFTYPE_ADHOC)
ah->num_adhoc_vifs++; ah->num_adhoc_vifs++;
else if (avf->opmode == NL80211_IFTYPE_MESH_POINT)
ah->num_mesh_vifs++;
} }
/* Any MAC address is fine, all others are included through the /* Any MAC address is fine, all others are included through the
...@@ -175,6 +177,8 @@ ath5k_remove_interface(struct ieee80211_hw *hw, ...@@ -175,6 +177,8 @@ ath5k_remove_interface(struct ieee80211_hw *hw,
ah->num_ap_vifs--; ah->num_ap_vifs--;
else if (avf->opmode == NL80211_IFTYPE_ADHOC) else if (avf->opmode == NL80211_IFTYPE_ADHOC)
ah->num_adhoc_vifs--; ah->num_adhoc_vifs--;
else if (avf->opmode == NL80211_IFTYPE_MESH_POINT)
ah->num_mesh_vifs--;
ath5k_update_bssid_mask_and_opmode(ah, NULL); ath5k_update_bssid_mask_and_opmode(ah, NULL);
mutex_unlock(&ah->lock); mutex_unlock(&ah->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment