#include "mesh_mpm.h"
#include "mesh_rsn.h"
-/* TODO make configurable */
-#define dot11MeshMaxRetries 10
-#define dot11MeshRetryTimeout 1
-#define dot11MeshConfirmTimeout 1
-#define dot11MeshHoldingTimeout 1
-
struct mesh_peer_mgmt_ie {
const u8 *proto_id;
const u8 *llid;
struct wpa_supplicant *wpa_s = eloop_ctx;
struct sta_info *sta = user_data;
u16 reason = 0;
+ struct mesh_conf *conf = wpa_s->ifmsh->mconf;
switch (sta->plink_state) {
case PLINK_OPEN_RCVD:
case PLINK_OPEN_SENT:
/* retry timer */
- if (sta->mpm_retries < dot11MeshMaxRetries) {
- eloop_register_timeout(dot11MeshRetryTimeout, 0,
- plink_timer, wpa_s, sta);
+ if (sta->mpm_retries < conf->dot11MeshMaxRetries) {
+ eloop_register_timeout(
+ conf->dot11MeshRetryTimeout / 1000,
+ (conf->dot11MeshRetryTimeout % 1000) * 1000,
+ plink_timer, wpa_s, sta);
mesh_mpm_send_plink_action(wpa_s, sta, PLINK_OPEN, 0);
sta->mpm_retries++;
break;
if (!reason)
reason = WLAN_REASON_MESH_CONFIRM_TIMEOUT;
sta->plink_state = PLINK_HOLDING;
- eloop_register_timeout(dot11MeshHoldingTimeout, 0,
- plink_timer, wpa_s, sta);
+ eloop_register_timeout(conf->dot11MeshHoldingTimeout / 1000,
+ (conf->dot11MeshHoldingTimeout % 1000) * 1000,
+ plink_timer, wpa_s, sta);
mesh_mpm_send_plink_action(wpa_s, sta, PLINK_CLOSE, reason);
break;
case PLINK_HOLDING:
mesh_mpm_plink_open(struct wpa_supplicant *wpa_s, struct sta_info *sta,
enum mesh_plink_state next_state)
{
+ struct mesh_conf *conf = wpa_s->ifmsh->mconf;
+
eloop_cancel_timeout(plink_timer, wpa_s, sta);
- eloop_register_timeout(dot11MeshRetryTimeout, 0, plink_timer,
- wpa_s, sta);
+ eloop_register_timeout(conf->dot11MeshRetryTimeout / 1000,
+ (conf->dot11MeshRetryTimeout % 1000) * 1000,
+ plink_timer, wpa_s, sta);
mesh_mpm_send_plink_action(wpa_s, sta, PLINK_OPEN, 0);
wpa_mesh_set_plink_state(wpa_s, sta, next_state);
}
wpa_mesh_set_plink_state(wpa_s, sta, PLINK_HOLDING);
if (!reason)
reason = WLAN_REASON_MESH_CLOSE_RCVD;
- eloop_register_timeout(dot11MeshHoldingTimeout, 0,
- plink_timer, wpa_s, sta);
+ eloop_register_timeout(
+ conf->dot11MeshHoldingTimeout / 1000,
+ (conf->dot11MeshHoldingTimeout % 1000) * 1000,
+ plink_timer, wpa_s, sta);
mesh_mpm_send_plink_action(wpa_s, sta,
PLINK_CLOSE, reason);
break;
break;
case CNF_ACPT:
wpa_mesh_set_plink_state(wpa_s, sta, PLINK_CNF_RCVD);
- eloop_register_timeout(dot11MeshConfirmTimeout, 0,
- plink_timer, wpa_s, sta);
+ eloop_register_timeout(
+ conf->dot11MeshConfirmTimeout / 1000,
+ (conf->dot11MeshConfirmTimeout % 1000) * 1000,
+ plink_timer, wpa_s, sta);
break;
default:
break;
wpa_mesh_set_plink_state(wpa_s, sta, PLINK_HOLDING);
if (!reason)
reason = WLAN_REASON_MESH_CLOSE_RCVD;
- eloop_register_timeout(dot11MeshHoldingTimeout, 0,
- plink_timer, wpa_s, sta);
+ eloop_register_timeout(
+ conf->dot11MeshHoldingTimeout / 1000,
+ (conf->dot11MeshHoldingTimeout % 1000) * 1000,
+ plink_timer, wpa_s, sta);
sta->mpm_close_reason = reason;
mesh_mpm_send_plink_action(wpa_s, sta,
PLINK_CLOSE, reason);
wpa_mesh_set_plink_state(wpa_s, sta, PLINK_HOLDING);
if (!reason)
reason = WLAN_REASON_MESH_CLOSE_RCVD;
- eloop_register_timeout(dot11MeshHoldingTimeout, 0,
- plink_timer, wpa_s, sta);
+ eloop_register_timeout(
+ conf->dot11MeshHoldingTimeout / 1000,
+ (conf->dot11MeshHoldingTimeout % 1000) * 1000,
+ plink_timer, wpa_s, sta);
sta->mpm_close_reason = reason;
mesh_mpm_send_plink_action(wpa_s, sta,
PLINK_CLOSE, reason);
wpa_mesh_set_plink_state(wpa_s, sta, PLINK_HOLDING);
reason = WLAN_REASON_MESH_CLOSE_RCVD;
- eloop_register_timeout(dot11MeshHoldingTimeout, 0,
- plink_timer, wpa_s, sta);
+ eloop_register_timeout(
+ conf->dot11MeshHoldingTimeout / 1000,
+ (conf->dot11MeshHoldingTimeout % 1000) * 1000,
+ plink_timer, wpa_s, sta);
sta->mpm_close_reason = reason;
wpa_msg(wpa_s, MSG_INFO, "mesh plink with " MACSTR