Commit 453e66f2 authored by Marco Porsch's avatar Marco Porsch Committed by Johannes Berg

mac80211: remove mesh config macros from mesh_plink.c

Use shortcut pointer instead where it is appropriate.
Signed-off-by: default avatarMarco Porsch <marco.porsch@etit.tu-chemnitz.de>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 40aefedc
...@@ -19,12 +19,6 @@ ...@@ -19,12 +19,6 @@
#define mod_plink_timer(s, t) (mod_timer(&s->plink_timer, \ #define mod_plink_timer(s, t) (mod_timer(&s->plink_timer, \
jiffies + HZ * t / 1000)) jiffies + HZ * t / 1000))
#define dot11MeshMaxRetries(s) (s->u.mesh.mshcfg.dot11MeshMaxRetries)
#define dot11MeshRetryTimeout(s) (s->u.mesh.mshcfg.dot11MeshRetryTimeout)
#define dot11MeshConfirmTimeout(s) (s->u.mesh.mshcfg.dot11MeshConfirmTimeout)
#define dot11MeshHoldingTimeout(s) (s->u.mesh.mshcfg.dot11MeshHoldingTimeout)
#define dot11MeshMaxPeerLinks(s) (s->u.mesh.mshcfg.dot11MeshMaxPeerLinks)
/* We only need a valid sta if user configured a minimum rssi_threshold. */ /* We only need a valid sta if user configured a minimum rssi_threshold. */
#define rssi_threshold_check(sta, sdata) \ #define rssi_threshold_check(sta, sdata) \
(sdata->u.mesh.mshcfg.rssi_threshold == 0 ||\ (sdata->u.mesh.mshcfg.rssi_threshold == 0 ||\
...@@ -430,6 +424,7 @@ static void mesh_plink_timer(unsigned long data) ...@@ -430,6 +424,7 @@ static void mesh_plink_timer(unsigned long data)
struct sta_info *sta; struct sta_info *sta;
__le16 llid, plid, reason; __le16 llid, plid, reason;
struct ieee80211_sub_if_data *sdata; struct ieee80211_sub_if_data *sdata;
struct mesh_config *mshcfg;
/* /*
* This STA is valid because sta_info_destroy() will * This STA is valid because sta_info_destroy() will
...@@ -456,12 +451,13 @@ static void mesh_plink_timer(unsigned long data) ...@@ -456,12 +451,13 @@ static void mesh_plink_timer(unsigned long data)
llid = sta->llid; llid = sta->llid;
plid = sta->plid; plid = sta->plid;
sdata = sta->sdata; sdata = sta->sdata;
mshcfg = &sdata->u.mesh.mshcfg;
switch (sta->plink_state) { switch (sta->plink_state) {
case NL80211_PLINK_OPN_RCVD: case NL80211_PLINK_OPN_RCVD:
case NL80211_PLINK_OPN_SNT: case NL80211_PLINK_OPN_SNT:
/* retry timer */ /* retry timer */
if (sta->plink_retries < dot11MeshMaxRetries(sdata)) { if (sta->plink_retries < mshcfg->dot11MeshMaxRetries) {
u32 rand; u32 rand;
mpl_dbg(sta->sdata, mpl_dbg(sta->sdata,
"Mesh plink for %pM (retry, timeout): %d %d\n", "Mesh plink for %pM (retry, timeout): %d %d\n",
...@@ -484,7 +480,7 @@ static void mesh_plink_timer(unsigned long data) ...@@ -484,7 +480,7 @@ static void mesh_plink_timer(unsigned long data)
if (!reason) if (!reason)
reason = cpu_to_le16(WLAN_REASON_MESH_CONFIRM_TIMEOUT); reason = cpu_to_le16(WLAN_REASON_MESH_CONFIRM_TIMEOUT);
sta->plink_state = NL80211_PLINK_HOLDING; sta->plink_state = NL80211_PLINK_HOLDING;
mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata)); mod_plink_timer(sta, mshcfg->dot11MeshHoldingTimeout);
spin_unlock_bh(&sta->lock); spin_unlock_bh(&sta->lock);
mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_CLOSE, mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_CLOSE,
sta->sta.addr, llid, plid, reason); sta->sta.addr, llid, plid, reason);
...@@ -543,7 +539,7 @@ int mesh_plink_open(struct sta_info *sta) ...@@ -543,7 +539,7 @@ int mesh_plink_open(struct sta_info *sta)
return -EBUSY; return -EBUSY;
} }
sta->plink_state = NL80211_PLINK_OPN_SNT; sta->plink_state = NL80211_PLINK_OPN_SNT;
mesh_plink_timer_set(sta, dot11MeshRetryTimeout(sdata)); mesh_plink_timer_set(sta, sdata->u.mesh.mshcfg.dot11MeshRetryTimeout);
spin_unlock_bh(&sta->lock); spin_unlock_bh(&sta->lock);
mpl_dbg(sdata, mpl_dbg(sdata,
"Mesh plink: starting establishment with %pM\n", "Mesh plink: starting establishment with %pM\n",
...@@ -570,6 +566,7 @@ void mesh_plink_block(struct sta_info *sta) ...@@ -570,6 +566,7 @@ void mesh_plink_block(struct sta_info *sta)
void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_mgmt *mgmt, void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_mgmt *mgmt,
size_t len, struct ieee80211_rx_status *rx_status) size_t len, struct ieee80211_rx_status *rx_status)
{ {
struct mesh_config *mshcfg = &sdata->u.mesh.mshcfg;
struct ieee802_11_elems elems; struct ieee802_11_elems elems;
struct sta_info *sta; struct sta_info *sta;
enum plink_event event; enum plink_event event;
...@@ -777,7 +774,8 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m ...@@ -777,7 +774,8 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
sta->plid = plid; sta->plid = plid;
get_random_bytes(&llid, 2); get_random_bytes(&llid, 2);
sta->llid = llid; sta->llid = llid;
mesh_plink_timer_set(sta, dot11MeshRetryTimeout(sdata)); mesh_plink_timer_set(sta,
mshcfg->dot11MeshRetryTimeout);
spin_unlock_bh(&sta->lock); spin_unlock_bh(&sta->lock);
mesh_plink_frame_tx(sdata, mesh_plink_frame_tx(sdata,
WLAN_SP_MESH_PEERING_OPEN, WLAN_SP_MESH_PEERING_OPEN,
...@@ -803,7 +801,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m ...@@ -803,7 +801,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
sta->reason = reason; sta->reason = reason;
sta->plink_state = NL80211_PLINK_HOLDING; sta->plink_state = NL80211_PLINK_HOLDING;
if (!mod_plink_timer(sta, if (!mod_plink_timer(sta,
dot11MeshHoldingTimeout(sdata))) mshcfg->dot11MeshHoldingTimeout))
sta->ignore_plink_timer = true; sta->ignore_plink_timer = true;
llid = sta->llid; llid = sta->llid;
...@@ -825,7 +823,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m ...@@ -825,7 +823,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
case CNF_ACPT: case CNF_ACPT:
sta->plink_state = NL80211_PLINK_CNF_RCVD; sta->plink_state = NL80211_PLINK_CNF_RCVD;
if (!mod_plink_timer(sta, if (!mod_plink_timer(sta,
dot11MeshConfirmTimeout(sdata))) mshcfg->dot11MeshConfirmTimeout))
sta->ignore_plink_timer = true; sta->ignore_plink_timer = true;
spin_unlock_bh(&sta->lock); spin_unlock_bh(&sta->lock);
...@@ -847,7 +845,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m ...@@ -847,7 +845,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
sta->reason = reason; sta->reason = reason;
sta->plink_state = NL80211_PLINK_HOLDING; sta->plink_state = NL80211_PLINK_HOLDING;
if (!mod_plink_timer(sta, if (!mod_plink_timer(sta,
dot11MeshHoldingTimeout(sdata))) mshcfg->dot11MeshHoldingTimeout))
sta->ignore_plink_timer = true; sta->ignore_plink_timer = true;
llid = sta->llid; llid = sta->llid;
...@@ -888,7 +886,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m ...@@ -888,7 +886,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
sta->reason = reason; sta->reason = reason;
sta->plink_state = NL80211_PLINK_HOLDING; sta->plink_state = NL80211_PLINK_HOLDING;
if (!mod_plink_timer(sta, if (!mod_plink_timer(sta,
dot11MeshHoldingTimeout(sdata))) mshcfg->dot11MeshHoldingTimeout))
sta->ignore_plink_timer = true; sta->ignore_plink_timer = true;
llid = sta->llid; llid = sta->llid;
...@@ -923,7 +921,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m ...@@ -923,7 +921,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
changed |= __mesh_plink_deactivate(sta); changed |= __mesh_plink_deactivate(sta);
sta->plink_state = NL80211_PLINK_HOLDING; sta->plink_state = NL80211_PLINK_HOLDING;
llid = sta->llid; llid = sta->llid;
mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata)); mod_plink_timer(sta, mshcfg->dot11MeshHoldingTimeout);
spin_unlock_bh(&sta->lock); spin_unlock_bh(&sta->lock);
changed |= mesh_set_ht_prot_mode(sdata); changed |= mesh_set_ht_prot_mode(sdata);
mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_CLOSE, mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_CLOSE,
......
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