Commit 433f5bc1 authored by Johannes Berg's avatar Johannes Berg

mac80211: move mesh related station fields to own struct

There are now a fairly large number of mesh fields that really
aren't needed in any other modes; move those into their own
structure and allocate them separately.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent e414eea7
...@@ -1150,10 +1150,10 @@ static int sta_apply_parameters(struct ieee80211_local *local, ...@@ -1150,10 +1150,10 @@ static int sta_apply_parameters(struct ieee80211_local *local,
if (params->sta_modify_mask & STATION_PARAM_APPLY_PLINK_STATE) { if (params->sta_modify_mask & STATION_PARAM_APPLY_PLINK_STATE) {
switch (params->plink_state) { switch (params->plink_state) {
case NL80211_PLINK_ESTAB: case NL80211_PLINK_ESTAB:
if (sta->plink_state != NL80211_PLINK_ESTAB) if (sta->mesh->plink_state != NL80211_PLINK_ESTAB)
changed = mesh_plink_inc_estab_count( changed = mesh_plink_inc_estab_count(
sdata); sdata);
sta->plink_state = params->plink_state; sta->mesh->plink_state = params->plink_state;
ieee80211_mps_sta_status_update(sta); ieee80211_mps_sta_status_update(sta);
changed |= ieee80211_mps_set_sta_local_pm(sta, changed |= ieee80211_mps_set_sta_local_pm(sta,
...@@ -1165,10 +1165,10 @@ static int sta_apply_parameters(struct ieee80211_local *local, ...@@ -1165,10 +1165,10 @@ static int sta_apply_parameters(struct ieee80211_local *local,
case NL80211_PLINK_OPN_RCVD: case NL80211_PLINK_OPN_RCVD:
case NL80211_PLINK_CNF_RCVD: case NL80211_PLINK_CNF_RCVD:
case NL80211_PLINK_HOLDING: case NL80211_PLINK_HOLDING:
if (sta->plink_state == NL80211_PLINK_ESTAB) if (sta->mesh->plink_state == NL80211_PLINK_ESTAB)
changed = mesh_plink_dec_estab_count( changed = mesh_plink_dec_estab_count(
sdata); sdata);
sta->plink_state = params->plink_state; sta->mesh->plink_state = params->plink_state;
ieee80211_mps_sta_status_update(sta); ieee80211_mps_sta_status_update(sta);
changed |= ieee80211_mps_set_sta_local_pm(sta, changed |= ieee80211_mps_set_sta_local_pm(sta,
......
...@@ -158,7 +158,7 @@ void mesh_sta_cleanup(struct sta_info *sta) ...@@ -158,7 +158,7 @@ void mesh_sta_cleanup(struct sta_info *sta)
changed = mesh_accept_plinks_update(sdata); changed = mesh_accept_plinks_update(sdata);
if (!sdata->u.mesh.user_mpm) { if (!sdata->u.mesh.user_mpm) {
changed |= mesh_plink_deactivate(sta); changed |= mesh_plink_deactivate(sta);
del_timer_sync(&sta->plink_timer); del_timer_sync(&sta->mesh->plink_timer);
} }
if (changed) if (changed)
......
...@@ -862,7 +862,7 @@ void mesh_rx_path_sel_frame(struct ieee80211_sub_if_data *sdata, ...@@ -862,7 +862,7 @@ void mesh_rx_path_sel_frame(struct ieee80211_sub_if_data *sdata,
rcu_read_lock(); rcu_read_lock();
sta = sta_info_get(sdata, mgmt->sa); sta = sta_info_get(sdata, mgmt->sa);
if (!sta || sta->plink_state != NL80211_PLINK_ESTAB) { if (!sta || sta->mesh->plink_state != NL80211_PLINK_ESTAB) {
rcu_read_unlock(); rcu_read_unlock();
return; return;
} }
......
This diff is collapsed.
...@@ -92,16 +92,16 @@ u32 ieee80211_mps_local_status_update(struct ieee80211_sub_if_data *sdata) ...@@ -92,16 +92,16 @@ u32 ieee80211_mps_local_status_update(struct ieee80211_sub_if_data *sdata)
if (sdata != sta->sdata) if (sdata != sta->sdata)
continue; continue;
switch (sta->plink_state) { switch (sta->mesh->plink_state) {
case NL80211_PLINK_OPN_SNT: case NL80211_PLINK_OPN_SNT:
case NL80211_PLINK_OPN_RCVD: case NL80211_PLINK_OPN_RCVD:
case NL80211_PLINK_CNF_RCVD: case NL80211_PLINK_CNF_RCVD:
peering = true; peering = true;
break; break;
case NL80211_PLINK_ESTAB: case NL80211_PLINK_ESTAB:
if (sta->local_pm == NL80211_MESH_POWER_LIGHT_SLEEP) if (sta->mesh->local_pm == NL80211_MESH_POWER_LIGHT_SLEEP)
light_sleep_cnt++; light_sleep_cnt++;
else if (sta->local_pm == NL80211_MESH_POWER_DEEP_SLEEP) else if (sta->mesh->local_pm == NL80211_MESH_POWER_DEEP_SLEEP)
deep_sleep_cnt++; deep_sleep_cnt++;
break; break;
default: default:
...@@ -153,19 +153,19 @@ u32 ieee80211_mps_set_sta_local_pm(struct sta_info *sta, ...@@ -153,19 +153,19 @@ u32 ieee80211_mps_set_sta_local_pm(struct sta_info *sta,
{ {
struct ieee80211_sub_if_data *sdata = sta->sdata; struct ieee80211_sub_if_data *sdata = sta->sdata;
if (sta->local_pm == pm) if (sta->mesh->local_pm == pm)
return 0; return 0;
mps_dbg(sdata, "local STA operates in mode %d with %pM\n", mps_dbg(sdata, "local STA operates in mode %d with %pM\n",
pm, sta->sta.addr); pm, sta->sta.addr);
sta->local_pm = pm; sta->mesh->local_pm = pm;
/* /*
* announce peer-specific power mode transition * announce peer-specific power mode transition
* (see IEEE802.11-2012 13.14.3.2 and 13.14.3.3) * (see IEEE802.11-2012 13.14.3.2 and 13.14.3.3)
*/ */
if (sta->plink_state == NL80211_PLINK_ESTAB) if (sta->mesh->plink_state == NL80211_PLINK_ESTAB)
mps_qos_null_tx(sta); mps_qos_null_tx(sta);
return ieee80211_mps_local_status_update(sdata); return ieee80211_mps_local_status_update(sdata);
...@@ -197,8 +197,8 @@ void ieee80211_mps_set_frame_flags(struct ieee80211_sub_if_data *sdata, ...@@ -197,8 +197,8 @@ void ieee80211_mps_set_frame_flags(struct ieee80211_sub_if_data *sdata,
if (is_unicast_ether_addr(hdr->addr1) && if (is_unicast_ether_addr(hdr->addr1) &&
ieee80211_is_data_qos(hdr->frame_control) && ieee80211_is_data_qos(hdr->frame_control) &&
sta->plink_state == NL80211_PLINK_ESTAB) sta->mesh->plink_state == NL80211_PLINK_ESTAB)
pm = sta->local_pm; pm = sta->mesh->local_pm;
else else
pm = sdata->u.mesh.nonpeer_pm; pm = sdata->u.mesh.nonpeer_pm;
...@@ -241,16 +241,16 @@ void ieee80211_mps_sta_status_update(struct sta_info *sta) ...@@ -241,16 +241,16 @@ void ieee80211_mps_sta_status_update(struct sta_info *sta)
* use peer-specific power mode if peering is established and the * use peer-specific power mode if peering is established and the
* peer's power mode is known * peer's power mode is known
*/ */
if (sta->plink_state == NL80211_PLINK_ESTAB && if (sta->mesh->plink_state == NL80211_PLINK_ESTAB &&
sta->peer_pm != NL80211_MESH_POWER_UNKNOWN) sta->mesh->peer_pm != NL80211_MESH_POWER_UNKNOWN)
pm = sta->peer_pm; pm = sta->mesh->peer_pm;
else else
pm = sta->nonpeer_pm; pm = sta->mesh->nonpeer_pm;
do_buffer = (pm != NL80211_MESH_POWER_ACTIVE); do_buffer = (pm != NL80211_MESH_POWER_ACTIVE);
/* clear the MPSP flags for non-peers or active STA */ /* clear the MPSP flags for non-peers or active STA */
if (sta->plink_state != NL80211_PLINK_ESTAB) { if (sta->mesh->plink_state != NL80211_PLINK_ESTAB) {
clear_sta_flag(sta, WLAN_STA_MPSP_OWNER); clear_sta_flag(sta, WLAN_STA_MPSP_OWNER);
clear_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); clear_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT);
} else if (!do_buffer) { } else if (!do_buffer) {
...@@ -296,13 +296,13 @@ static void mps_set_sta_peer_pm(struct sta_info *sta, ...@@ -296,13 +296,13 @@ static void mps_set_sta_peer_pm(struct sta_info *sta,
pm = NL80211_MESH_POWER_ACTIVE; pm = NL80211_MESH_POWER_ACTIVE;
} }
if (sta->peer_pm == pm) if (sta->mesh->peer_pm == pm)
return; return;
mps_dbg(sta->sdata, "STA %pM enters mode %d\n", mps_dbg(sta->sdata, "STA %pM enters mode %d\n",
sta->sta.addr, pm); sta->sta.addr, pm);
sta->peer_pm = pm; sta->mesh->peer_pm = pm;
ieee80211_mps_sta_status_update(sta); ieee80211_mps_sta_status_update(sta);
} }
...@@ -317,13 +317,13 @@ static void mps_set_sta_nonpeer_pm(struct sta_info *sta, ...@@ -317,13 +317,13 @@ static void mps_set_sta_nonpeer_pm(struct sta_info *sta,
else else
pm = NL80211_MESH_POWER_ACTIVE; pm = NL80211_MESH_POWER_ACTIVE;
if (sta->nonpeer_pm == pm) if (sta->mesh->nonpeer_pm == pm)
return; return;
mps_dbg(sta->sdata, "STA %pM sets non-peer mode to %d\n", mps_dbg(sta->sdata, "STA %pM sets non-peer mode to %d\n",
sta->sta.addr, pm); sta->sta.addr, pm);
sta->nonpeer_pm = pm; sta->mesh->nonpeer_pm = pm;
ieee80211_mps_sta_status_update(sta); ieee80211_mps_sta_status_update(sta);
} }
...@@ -552,7 +552,7 @@ void ieee80211_mpsp_trigger_process(u8 *qc, struct sta_info *sta, ...@@ -552,7 +552,7 @@ void ieee80211_mpsp_trigger_process(u8 *qc, struct sta_info *sta,
} else { } else {
if (eosp) if (eosp)
clear_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); clear_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT);
else if (sta->local_pm != NL80211_MESH_POWER_ACTIVE) else if (sta->mesh->local_pm != NL80211_MESH_POWER_ACTIVE)
set_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT); set_sta_flag(sta, WLAN_STA_MPSP_RECIPIENT);
if (rspi && !test_and_set_sta_flag(sta, WLAN_STA_MPSP_OWNER)) if (rspi && !test_and_set_sta_flag(sta, WLAN_STA_MPSP_OWNER))
...@@ -577,9 +577,9 @@ void ieee80211_mps_frame_release(struct sta_info *sta, ...@@ -577,9 +577,9 @@ void ieee80211_mps_frame_release(struct sta_info *sta,
int ac, buffer_local = 0; int ac, buffer_local = 0;
bool has_buffered = false; bool has_buffered = false;
if (sta->plink_state == NL80211_PLINK_ESTAB) if (sta->mesh->plink_state == NL80211_PLINK_ESTAB)
has_buffered = ieee80211_check_tim(elems->tim, elems->tim_len, has_buffered = ieee80211_check_tim(elems->tim, elems->tim_len,
sta->llid); sta->mesh->llid);
if (has_buffered) if (has_buffered)
mps_dbg(sta->sdata, "%pM indicates buffered frames\n", mps_dbg(sta->sdata, "%pM indicates buffered frames\n",
...@@ -598,7 +598,7 @@ void ieee80211_mps_frame_release(struct sta_info *sta, ...@@ -598,7 +598,7 @@ void ieee80211_mps_frame_release(struct sta_info *sta,
if (!has_buffered && !buffer_local) if (!has_buffered && !buffer_local)
return; return;
if (sta->plink_state == NL80211_PLINK_ESTAB) if (sta->mesh->plink_state == NL80211_PLINK_ESTAB)
mpsp_trigger_send(sta, has_buffered, !buffer_local); mpsp_trigger_send(sta, has_buffered, !buffer_local);
else else
mps_frame_deliver(sta, 1); mps_frame_deliver(sta, 1);
......
...@@ -127,14 +127,14 @@ static void mesh_sync_offset_rx_bcn_presp(struct ieee80211_sub_if_data *sdata, ...@@ -127,14 +127,14 @@ static void mesh_sync_offset_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
/* Timing offset calculation (see 13.13.2.2.2) */ /* Timing offset calculation (see 13.13.2.2.2) */
t_t = le64_to_cpu(mgmt->u.beacon.timestamp); t_t = le64_to_cpu(mgmt->u.beacon.timestamp);
sta->t_offset = t_t - t_r; sta->mesh->t_offset = t_t - t_r;
if (test_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN)) { if (test_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN)) {
s64 t_clockdrift = sta->t_offset_setpoint - sta->t_offset; s64 t_clockdrift = sta->mesh->t_offset_setpoint - sta->mesh->t_offset;
msync_dbg(sdata, msync_dbg(sdata,
"STA %pM : sta->t_offset=%lld, sta->t_offset_setpoint=%lld, t_clockdrift=%lld\n", "STA %pM : t_offset=%lld, t_offset_setpoint=%lld, t_clockdrift=%lld\n",
sta->sta.addr, (long long) sta->t_offset, sta->sta.addr, (long long) sta->mesh->t_offset,
(long long) sta->t_offset_setpoint, (long long) sta->mesh->t_offset_setpoint,
(long long) t_clockdrift); (long long) t_clockdrift);
if (t_clockdrift > TOFFSET_MAXIMUM_ADJUSTMENT || if (t_clockdrift > TOFFSET_MAXIMUM_ADJUSTMENT ||
...@@ -152,12 +152,12 @@ static void mesh_sync_offset_rx_bcn_presp(struct ieee80211_sub_if_data *sdata, ...@@ -152,12 +152,12 @@ static void mesh_sync_offset_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
ifmsh->sync_offset_clockdrift_max = t_clockdrift; ifmsh->sync_offset_clockdrift_max = t_clockdrift;
spin_unlock_bh(&ifmsh->sync_offset_lock); spin_unlock_bh(&ifmsh->sync_offset_lock);
} else { } else {
sta->t_offset_setpoint = sta->t_offset - TOFFSET_SET_MARGIN; sta->mesh->t_offset_setpoint = sta->mesh->t_offset - TOFFSET_SET_MARGIN;
set_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN); set_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN);
msync_dbg(sdata, msync_dbg(sdata,
"STA %pM : offset was invalid, sta->t_offset=%lld\n", "STA %pM : offset was invalid, t_offset=%lld\n",
sta->sta.addr, sta->sta.addr,
(long long) sta->t_offset); (long long) sta->mesh->t_offset);
} }
no_sync: no_sync:
......
...@@ -249,6 +249,9 @@ void sta_info_free(struct ieee80211_local *local, struct sta_info *sta) ...@@ -249,6 +249,9 @@ void sta_info_free(struct ieee80211_local *local, struct sta_info *sta)
if (sta->sta.txq[0]) if (sta->sta.txq[0])
kfree(to_txq_info(sta->sta.txq[0])); kfree(to_txq_info(sta->sta.txq[0]));
kfree(rcu_dereference_raw(sta->sta.rates)); kfree(rcu_dereference_raw(sta->sta.rates));
#ifdef CONFIG_MAC80211_MESH
kfree(sta->mesh);
#endif
kfree(sta); kfree(sta);
} }
...@@ -313,11 +316,16 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata, ...@@ -313,11 +316,16 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
INIT_WORK(&sta->ampdu_mlme.work, ieee80211_ba_session_work); INIT_WORK(&sta->ampdu_mlme.work, ieee80211_ba_session_work);
mutex_init(&sta->ampdu_mlme.mtx); mutex_init(&sta->ampdu_mlme.mtx);
#ifdef CONFIG_MAC80211_MESH #ifdef CONFIG_MAC80211_MESH
spin_lock_init(&sta->plink_lock); if (ieee80211_vif_is_mesh(&sdata->vif)) {
if (ieee80211_vif_is_mesh(&sdata->vif) && sta->mesh = kzalloc(sizeof(*sta->mesh), gfp);
!sdata->u.mesh.user_mpm) if (!sta->mesh)
init_timer(&sta->plink_timer); goto free;
sta->nonpeer_pm = NL80211_MESH_POWER_ACTIVE; spin_lock_init(&sta->mesh->plink_lock);
if (ieee80211_vif_is_mesh(&sdata->vif) &&
!sdata->u.mesh.user_mpm)
init_timer(&sta->mesh->plink_timer);
sta->mesh->nonpeer_pm = NL80211_MESH_POWER_ACTIVE;
}
#endif #endif
memcpy(sta->addr, addr, ETH_ALEN); memcpy(sta->addr, addr, ETH_ALEN);
...@@ -406,6 +414,9 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata, ...@@ -406,6 +414,9 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
if (sta->sta.txq[0]) if (sta->sta.txq[0])
kfree(to_txq_info(sta->sta.txq[0])); kfree(to_txq_info(sta->sta.txq[0]));
free: free:
#ifdef CONFIG_MAC80211_MESH
kfree(sta->mesh);
#endif
kfree(sta); kfree(sta);
return NULL; return NULL;
} }
...@@ -637,7 +648,7 @@ static void __sta_info_recalc_tim(struct sta_info *sta, bool ignore_pending) ...@@ -637,7 +648,7 @@ static void __sta_info_recalc_tim(struct sta_info *sta, bool ignore_pending)
} else if (ieee80211_vif_is_mesh(&sta->sdata->vif)) { } else if (ieee80211_vif_is_mesh(&sta->sdata->vif)) {
ps = &sta->sdata->u.mesh.ps; ps = &sta->sdata->u.mesh.ps;
/* TIM map only for 1 <= PLID <= IEEE80211_MAX_AID */ /* TIM map only for 1 <= PLID <= IEEE80211_MAX_AID */
id = sta->plid % (IEEE80211_MAX_AID + 1); id = sta->mesh->plid % (IEEE80211_MAX_AID + 1);
#endif #endif
} else { } else {
return; return;
...@@ -1957,16 +1968,16 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo) ...@@ -1957,16 +1968,16 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
BIT(NL80211_STA_INFO_PEER_PM) | BIT(NL80211_STA_INFO_PEER_PM) |
BIT(NL80211_STA_INFO_NONPEER_PM); BIT(NL80211_STA_INFO_NONPEER_PM);
sinfo->llid = sta->llid; sinfo->llid = sta->mesh->llid;
sinfo->plid = sta->plid; sinfo->plid = sta->mesh->plid;
sinfo->plink_state = sta->plink_state; sinfo->plink_state = sta->mesh->plink_state;
if (test_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN)) { if (test_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN)) {
sinfo->filled |= BIT(NL80211_STA_INFO_T_OFFSET); sinfo->filled |= BIT(NL80211_STA_INFO_T_OFFSET);
sinfo->t_offset = sta->t_offset; sinfo->t_offset = sta->mesh->t_offset;
} }
sinfo->local_pm = sta->local_pm; sinfo->local_pm = sta->mesh->local_pm;
sinfo->peer_pm = sta->peer_pm; sinfo->peer_pm = sta->mesh->peer_pm;
sinfo->nonpeer_pm = sta->nonpeer_pm; sinfo->nonpeer_pm = sta->mesh->nonpeer_pm;
#endif #endif
} }
......
...@@ -269,6 +269,48 @@ struct ieee80211_fast_tx { ...@@ -269,6 +269,48 @@ struct ieee80211_fast_tx {
struct rcu_head rcu_head; struct rcu_head rcu_head;
}; };
/**
* struct mesh_sta - mesh STA information
* @plink_lock: serialize access to plink fields
* @llid: Local link ID
* @plid: Peer link ID
* @reason: Cancel reason on PLINK_HOLDING state
* @plink_retries: Retries in establishment
* @plink_state: peer link state
* @plink_timeout: timeout of peer link
* @plink_timer: peer link watch timer
* @t_offset: timing offset relative to this host
* @t_offset_setpoint: reference timing offset of this sta to be used when
* calculating clockdrift
* @local_pm: local link-specific power save mode
* @peer_pm: peer-specific power save mode towards local STA
* @nonpeer_pm: STA power save mode towards non-peer neighbors
* @processed_beacon: set to true after peer rates and capabilities are
* processed
*/
struct mesh_sta {
struct timer_list plink_timer;
s64 t_offset;
s64 t_offset_setpoint;
spinlock_t plink_lock;
u16 llid;
u16 plid;
u16 reason;
u8 plink_retries;
bool processed_beacon;
enum nl80211_plink_state plink_state;
u32 plink_timeout;
/* mesh power save */
enum nl80211_mesh_power_mode local_pm;
enum nl80211_mesh_power_mode peer_pm;
enum nl80211_mesh_power_mode nonpeer_pm;
};
/** /**
* struct sta_info - STA information * struct sta_info - STA information
* *
...@@ -330,20 +372,7 @@ struct ieee80211_fast_tx { ...@@ -330,20 +372,7 @@ struct ieee80211_fast_tx {
* @tid_seq: per-TID sequence numbers for sending to this STA * @tid_seq: per-TID sequence numbers for sending to this STA
* @ampdu_mlme: A-MPDU state machine state * @ampdu_mlme: A-MPDU state machine state
* @timer_to_tid: identity mapping to ID timers * @timer_to_tid: identity mapping to ID timers
* @plink_lock: serialize access to plink fields * @mesh: mesh STA information
* @llid: Local link ID
* @plid: Peer link ID
* @reason: Cancel reason on PLINK_HOLDING state
* @plink_retries: Retries in establishment
* @plink_state: peer link state
* @plink_timeout: timeout of peer link
* @plink_timer: peer link watch timer
* @t_offset: timing offset relative to this host
* @t_offset_setpoint: reference timing offset of this sta to be used when
* calculating clockdrift
* @local_pm: local link-specific power save mode
* @peer_pm: peer-specific power save mode towards local STA
* @nonpeer_pm: STA power save mode towards non-peer neighbors
* @debugfs: debug filesystem info * @debugfs: debug filesystem info
* @dead: set to true when sta is unlinked * @dead: set to true when sta is unlinked
* @uploaded: set to true when sta is uploaded to the driver * @uploaded: set to true when sta is uploaded to the driver
...@@ -371,8 +400,6 @@ struct ieee80211_fast_tx { ...@@ -371,8 +400,6 @@ struct ieee80211_fast_tx {
* @rx_msdu: MSDUs received from this station, using IEEE80211_NUM_TID * @rx_msdu: MSDUs received from this station, using IEEE80211_NUM_TID
* entry for non-QoS frames * entry for non-QoS frames
* @fast_tx: TX fastpath information * @fast_tx: TX fastpath information
* @processed_beacon: set to true after peer rates and capabilities are
* processed
*/ */
struct sta_info { struct sta_info {
/* General information, mostly static */ /* General information, mostly static */
...@@ -392,6 +419,10 @@ struct sta_info { ...@@ -392,6 +419,10 @@ struct sta_info {
struct ieee80211_fast_tx __rcu *fast_tx; struct ieee80211_fast_tx __rcu *fast_tx;
#ifdef CONFIG_MAC80211_MESH
struct mesh_sta *mesh;
#endif
struct work_struct drv_deliver_wk; struct work_struct drv_deliver_wk;
u16 listen_interval; u16 listen_interval;
...@@ -457,29 +488,6 @@ struct sta_info { ...@@ -457,29 +488,6 @@ struct sta_info {
struct sta_ampdu_mlme ampdu_mlme; struct sta_ampdu_mlme ampdu_mlme;
u8 timer_to_tid[IEEE80211_NUM_TIDS]; u8 timer_to_tid[IEEE80211_NUM_TIDS];
#ifdef CONFIG_MAC80211_MESH
/*
* Mesh peer link attributes, protected by plink_lock.
* TODO: move to a sub-structure that is referenced with pointer?
*/
spinlock_t plink_lock;
u16 llid;
u16 plid;
u16 reason;
u8 plink_retries;
enum nl80211_plink_state plink_state;
u32 plink_timeout;
struct timer_list plink_timer;
s64 t_offset;
s64 t_offset_setpoint;
/* mesh power save */
enum nl80211_mesh_power_mode local_pm;
enum nl80211_mesh_power_mode peer_pm;
enum nl80211_mesh_power_mode nonpeer_pm;
bool processed_beacon;
#endif
#ifdef CONFIG_MAC80211_DEBUGFS #ifdef CONFIG_MAC80211_DEBUGFS
struct sta_info_debugfsdentries { struct sta_info_debugfsdentries {
struct dentry *dir; struct dentry *dir;
...@@ -507,7 +515,7 @@ struct sta_info { ...@@ -507,7 +515,7 @@ struct sta_info {
static inline enum nl80211_plink_state sta_plink_state(struct sta_info *sta) static inline enum nl80211_plink_state sta_plink_state(struct sta_info *sta)
{ {
#ifdef CONFIG_MAC80211_MESH #ifdef CONFIG_MAC80211_MESH
return sta->plink_state; return sta->mesh->plink_state;
#endif #endif
return NL80211_PLINK_LISTEN; return NL80211_PLINK_LISTEN;
} }
......
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