Update to 5.8.7.1

This commit is contained in:
Rin Cat
2020-08-02 05:12:24 -04:00
parent 314b662331
commit e3b09b28f7
449 changed files with 106089 additions and 83748 deletions

View File

@@ -354,7 +354,6 @@ static bool rtw_mesh_acnode_candidate_exist(_adapter *adapter)
_exit_critical_bh(&(mlme->scanned_queue.lock), &irqL);
exit:
return need;
}
@@ -456,7 +455,7 @@ static void rtw_mesh_acnode_rsvd_chk(_adapter *adapter)
if (plink_ctl->acnode_rsvd != acnode_rsvd) {
plink_ctl->acnode_rsvd = acnode_rsvd;
RTW_INFO(FUNC_ADPT_FMT" acnode_rsvd = %d\n", FUNC_ADPT_ARG(adapter), plink_ctl->acnode_rsvd);
update_beacon(adapter, WLAN_EID_MESH_CONFIG, NULL, 1);
update_beacon(adapter, WLAN_EID_MESH_CONFIG, NULL, 1, 0);
}
}
@@ -707,6 +706,7 @@ void rtw_chk_candidate_peer_notify(_adapter *adapter, struct wlan_network *scann
, scanned->network.MacAddress
, BSS_EX_TLV_IES(&scanned->network)
, BSS_EX_TLV_IES_LEN(&scanned->network)
, scanned->network.Rssi
, GFP_ATOMIC
);
#endif
@@ -999,6 +999,7 @@ u8 rtw_mesh_select_operating_ch(_adapter *adapter)
int ch_set_idx = rtw_chset_search_ch(rfctl->channel_set, scanned->network.Configuration.DSConfig);
if (ch_set_idx >= 0
&& rfctl->channel_set[ch_set_idx].ScanType != SCAN_PASSIVE
&& !CH_IS_NON_OCP(&rfctl->channel_set[ch_set_idx])
) {
u8 nop, accept;
@@ -1791,7 +1792,6 @@ static int rtw_mesh_check_frames(_adapter *adapter, const u8 **buf, size_t *len,
};
}
exit:
return is_mesh_frame;
}
@@ -2028,7 +2028,6 @@ struct mesh_plink_ent *_rtw_mesh_plink_get(_adapter *adapter, const u8 *hwaddr)
}
}
exit:
return ent;
}
@@ -2043,7 +2042,6 @@ struct mesh_plink_ent *rtw_mesh_plink_get(_adapter *adapter, const u8 *hwaddr)
ent = _rtw_mesh_plink_get(adapter, hwaddr);
_exit_critical_bh(&(plink_ctl->lock), &irqL);
exit:
return ent;
}
@@ -2117,7 +2115,6 @@ int _rtw_mesh_plink_add(_adapter *adapter, const u8 *hwaddr)
plink_ctl->num++;
}
exit:
return exist == _TRUE ? RTW_ALREADY : (ent ? _SUCCESS : _FAIL);
}
@@ -2148,7 +2145,6 @@ int rtw_mesh_plink_set_state(_adapter *adapter, const u8 *hwaddr, u8 state)
ent->plink_state = state;
_exit_critical_bh(&(plink_ctl->lock), &irqL);
exit:
return ent ? _SUCCESS : _FAIL;
}
@@ -2168,7 +2164,6 @@ int rtw_mesh_plink_set_aek(_adapter *adapter, const u8 *hwaddr, const u8 *aek)
}
_exit_critical_bh(&(plink_ctl->lock), &irqL);
exit:
return ent ? _SUCCESS : _FAIL;
}
#endif
@@ -2190,7 +2185,6 @@ int rtw_mesh_plink_set_peer_conf_timeout(_adapter *adapter, const u8 *hwaddr)
}
_exit_critical_bh(&(plink_ctl->lock), &irqL);
exit:
return ent ? _SUCCESS : _FAIL;
}
#endif
@@ -2241,7 +2235,6 @@ int rtw_mesh_plink_del(_adapter *adapter, const u8 *hwaddr)
_exit_critical_bh(&(plink_ctl->lock), &irqL);
exit:
return exist == _TRUE ? _SUCCESS : RTW_ALREADY;
}
@@ -2465,6 +2458,7 @@ int rtw_mesh_peer_establish(_adapter *adapter, struct mesh_plink_ent *plink, str
rtw_ewma_err_rate_add(&sta->metrics.err_rate, 1);
/* init data_rate to 1M */
sta->metrics.data_rate = 10;
sta->alive = _TRUE;
_enter_critical_bh(&stapriv->asoc_list_lock, &irqL);
if (rtw_is_list_empty(&sta->asoc_list)) {
@@ -2495,11 +2489,11 @@ void rtw_mesh_expire_peer_notify(_adapter *adapter, const u8 *peer_addr)
, peer_addr
, null_ssid
, 2
, 0
, GFP_ATOMIC
);
#endif
exit:
return;
}
@@ -3208,6 +3202,9 @@ int rtw_mesh_nexthop_lookup(_adapter *adapter,
struct sta_info *next_hop;
const u8 *target_addr = mda;
int err = -ENOENT;
struct registry_priv *registry_par = &adapter->registrypriv;
u8 peer_alive_based_preq = registry_par->peer_alive_based_preq;
BOOLEAN nexthop_alive = _TRUE;
rtw_rcu_read_lock();
mpath = rtw_mesh_path_lookup(adapter, target_addr);
@@ -3215,21 +3212,41 @@ int rtw_mesh_nexthop_lookup(_adapter *adapter,
if (!mpath || !(mpath->flags & RTW_MESH_PATH_ACTIVE))
goto endlookup;
if (rtw_time_after(rtw_get_current_time(),
mpath->exp_time -
rtw_ms_to_systime(adapter->mesh_cfg.path_refresh_time)) &&
_rtw_memcmp(adapter_mac_addr(adapter), msa, ETH_ALEN) == _TRUE &&
!(mpath->flags & RTW_MESH_PATH_RESOLVING) &&
!(mpath->flags & RTW_MESH_PATH_FIXED)) {
rtw_mesh_queue_preq(mpath, RTW_PREQ_Q_F_START | RTW_PREQ_Q_F_REFRESH);
}
next_hop = rtw_rcu_dereference(mpath->next_hop);
if (next_hop) {
_rtw_memcpy(ra, next_hop->cmn.mac_addr, ETH_ALEN);
err = 0;
}
if (peer_alive_based_preq && next_hop)
nexthop_alive = next_hop->alive;
if (_rtw_memcmp(adapter_mac_addr(adapter), msa, ETH_ALEN) == _TRUE &&
!(mpath->flags & RTW_MESH_PATH_RESOLVING) &&
!(mpath->flags & RTW_MESH_PATH_FIXED)) {
u8 flags = RTW_PREQ_Q_F_START | RTW_PREQ_Q_F_REFRESH;
if (peer_alive_based_preq && nexthop_alive == _FALSE) {
flags |= RTW_PREQ_Q_F_BCAST_PREQ;
rtw_mesh_queue_preq(mpath, flags);
} else if (rtw_time_after(rtw_get_current_time(),
mpath->exp_time -
rtw_ms_to_systime(adapter->mesh_cfg.path_refresh_time))) {
rtw_mesh_queue_preq(mpath, flags);
}
/* Avoid keeping trying unicast PREQ toward root,
when next_hop leaves */
} else if (peer_alive_based_preq &&
_rtw_memcmp(adapter_mac_addr(adapter), msa, ETH_ALEN) == _TRUE &&
(mpath->flags & RTW_MESH_PATH_RESOLVING) &&
!(mpath->flags & RTW_MESH_PATH_FIXED) &&
!(mpath->flags & RTW_MESH_PATH_BCAST_PREQ) &&
mpath->is_root && nexthop_alive == _FALSE) {
enter_critical_bh(&mpath->state_lock);
mpath->flags |= RTW_MESH_PATH_BCAST_PREQ;
exit_critical_bh(&mpath->state_lock);
}
endlookup:
rtw_rcu_read_unlock();
return err;

View File

@@ -106,6 +106,7 @@ extern const char *_rtw_mesh_ps_str[];
#define RTW_PREQ_Q_F_REFRESH 0x2
#define RTW_PREQ_Q_F_CHK 0x4
#define RTW_PREQ_Q_F_PEER_AKA 0x8
#define RTW_PREQ_Q_F_BCAST_PREQ 0x10 /* force path_dicover using broadcast */
struct rtw_mesh_preq_queue {
_list list;
u8 dst[ETH_ALEN];
@@ -391,7 +392,7 @@ struct rtw_mesh_info {
_queue mpath_tx_queue;
u32 mpath_tx_queue_len;
struct tasklet_struct mpath_tx_tasklet;
_tasklet mpath_tx_tasklet;
struct rtw_mrc *mrc;

View File

@@ -1319,6 +1319,8 @@ void rtw_mesh_queue_preq(struct rtw_mesh_path *path, u8 flags)
#endif
if (flags & RTW_PREQ_Q_F_PEER_AKA)
path->flags |= RTW_MESH_PATH_PEER_AKA;
if (flags & RTW_PREQ_Q_F_BCAST_PREQ)
path->flags |= RTW_MESH_PATH_BCAST_PREQ;
_rtw_spinunlock(&path->state_lock);
rtw_list_insert_tail(&preq_node->list, &minfo->preq_queue.list);
@@ -1338,12 +1340,15 @@ void rtw_mesh_queue_preq(struct rtw_mesh_path *path, u8 flags)
}
static const u8 *rtw_hwmp_preq_da(struct rtw_mesh_path *path,
BOOLEAN is_root_add_chk, BOOLEAN da_is_peer)
BOOLEAN is_root_add_chk, BOOLEAN da_is_peer,
BOOLEAN force_preq_bcast)
{
const u8 *da;
if (da_is_peer)
da = path->dst;
else if (force_preq_bcast)
da = bcast_addr;
else if (path->is_root)
#ifdef CONFIG_RTW_MESH_ADD_ROOT_CHK
da = is_root_add_chk ? path->add_chk_rann_snd_addr:
@@ -1368,7 +1373,7 @@ void rtw_mesh_path_start_discovery(_adapter *adapter)
u32 lifetime;
u8 flags = 0;
BOOLEAN is_root_add_chk = _FALSE;
BOOLEAN da_is_peer;
BOOLEAN da_is_peer, force_preq_bcast;
enter_critical_bh(&minfo->mesh_preq_queue_lock);
if (!minfo->preq_queue_len ||
@@ -1437,9 +1442,11 @@ void rtw_mesh_path_start_discovery(_adapter *adapter)
is_root_add_chk = !!(path->flags & RTW_MESH_PATH_ROOT_ADD_CHK);
#endif
da_is_peer = !!(path->flags & RTW_MESH_PATH_PEER_AKA);
force_preq_bcast = !!(path->flags & RTW_MESH_PATH_BCAST_PREQ);
exit_critical_bh(&path->state_lock);
da = rtw_hwmp_preq_da(path, is_root_add_chk, da_is_peer);
da = rtw_hwmp_preq_da(path, is_root_add_chk,
da_is_peer, force_preq_bcast);
#ifdef CONFIG_RTW_MESH_ON_DMD_GANN
flags = (mshcfg->dot11MeshGateAnnouncementProtocol)
@@ -1475,7 +1482,8 @@ void rtw_mesh_path_timer(void *ctx)
path->flags &= ~(RTW_MESH_PATH_RESOLVING |
RTW_MESH_PATH_RESOLVED |
RTW_MESH_PATH_ROOT_ADD_CHK |
RTW_MESH_PATH_PEER_AKA);
RTW_MESH_PATH_PEER_AKA |
RTW_MESH_PATH_BCAST_PREQ);
exit_critical_bh(&path->state_lock);
} else if (path->discovery_retries < rtw_max_preq_retries(adapter)) {
++path->discovery_retries;
@@ -1495,7 +1503,8 @@ void rtw_mesh_path_timer(void *ctx)
RTW_MESH_PATH_RESOLVED |
RTW_MESH_PATH_REQ_QUEUED |
RTW_MESH_PATH_ROOT_ADD_CHK |
RTW_MESH_PATH_PEER_AKA);
RTW_MESH_PATH_PEER_AKA |
RTW_MESH_PATH_BCAST_PREQ);
path->exp_time = rtw_get_current_time();
exit_critical_bh(&path->state_lock);
if (!path->is_gate && rtw_mesh_gate_num(adapter) > 0) {

View File

@@ -324,6 +324,63 @@ rtw_mesh_path_lookup_by_idx(_adapter *adapter, int idx)
return __rtw_mesh_path_lookup_by_idx(adapter->mesh_info.mesh_paths, idx);
}
void dump_mpath(void *sel, _adapter *adapter)
{
struct rtw_mesh_path *mpath;
int idx = 0;
char dst[ETH_ALEN];
char next_hop[ETH_ALEN];
u32 sn, metric, qlen;
u32 exp_ms = 0, dto_ms;
u8 drty;
enum rtw_mesh_path_flags flags;
RTW_PRINT_SEL(sel, "%-17s %-17s %-10s %-10s %-4s %-6s %-6s %-4s flags\n"
, "dst", "next_hop", "sn", "metric", "qlen", "exp_ms", "dto_ms", "drty"
);
do {
rtw_rcu_read_lock();
mpath = rtw_mesh_path_lookup_by_idx(adapter, idx);
if (mpath) {
_rtw_memcpy(dst, mpath->dst, ETH_ALEN);
_rtw_memcpy(next_hop, mpath->next_hop->cmn.mac_addr, ETH_ALEN);
sn = mpath->sn;
metric = mpath->metric;
qlen = mpath->frame_queue_len;
if (rtw_time_after(mpath->exp_time, rtw_get_current_time()))
exp_ms = rtw_get_remaining_time_ms(mpath->exp_time);
dto_ms = rtw_systime_to_ms(mpath->discovery_timeout);
drty = mpath->discovery_retries;
flags = mpath->flags;
}
rtw_rcu_read_unlock();
if (mpath) {
RTW_PRINT_SEL(sel, MAC_FMT" "MAC_FMT" %10u %10u %4u %6u %6u %4u%s%s%s%s%s%s%s%s%s%s\n"
, MAC_ARG(dst), MAC_ARG(next_hop), sn, metric, qlen
, exp_ms < 999999 ? exp_ms : 999999
, dto_ms < 999999 ? dto_ms : 999999
, drty
, (flags & RTW_MESH_PATH_ACTIVE) ? " ACT" : ""
, (flags & RTW_MESH_PATH_RESOLVING) ? " RSVING" : ""
, (flags & RTW_MESH_PATH_SN_VALID) ? " SN_VALID" : ""
, (flags & RTW_MESH_PATH_FIXED) ? " FIXED" : ""
, (flags & RTW_MESH_PATH_RESOLVED) ? " RSVED" : ""
, (flags & RTW_MESH_PATH_REQ_QUEUED) ? " REQ_IN_Q" : ""
, (flags & RTW_MESH_PATH_DELETED) ? " DELETED" : ""
, (flags & RTW_MESH_PATH_ROOT_ADD_CHK) ? " R_ADD_CHK" : ""
, (flags & RTW_MESH_PATH_PEER_AKA) ? " PEER_AKA" : ""
, (flags & RTW_MESH_PATH_BCAST_PREQ) ? " BC_PREQ" : ""
);
}
idx++;
} while (mpath);
}
/**
* rtw_mpp_path_lookup_by_idx - look up a path in the proxy path table by its index
* @idx: index
@@ -387,8 +444,13 @@ int rtw_mesh_path_add_gate(struct rtw_mesh_path *mpath)
exit_critical_bh(&mpath->state_lock);
if (ori_num_gates == 0)
update_beacon(mpath->adapter, WLAN_EID_MESH_CONFIG, NULL, _TRUE);
if (ori_num_gates == 0) {
update_beacon(mpath->adapter, WLAN_EID_MESH_CONFIG, NULL, _TRUE, 0);
#if CONFIG_RTW_MESH_CTO_MGATE_CARRIER
if (!rtw_mesh_cto_mgate_required(mpath->adapter))
rtw_netif_carrier_on(mpath->adapter->pnetdev);
#endif
}
RTW_MPATH_DBG(
FUNC_ADPT_FMT" Mesh path: Recorded new gate: %pM. %d known gates\n",
@@ -442,8 +504,13 @@ void rtw_mesh_gate_del(struct rtw_mesh_table *tbl, struct rtw_mesh_path *mpath)
exit_critical_bh(&tbl->gates_lock);
if (ori_num_gates == 1)
update_beacon(mpath->adapter, WLAN_EID_MESH_CONFIG, NULL, _TRUE);
if (ori_num_gates == 1) {
update_beacon(mpath->adapter, WLAN_EID_MESH_CONFIG, NULL, _TRUE, 0);
#if CONFIG_RTW_MESH_CTO_MGATE_CARRIER
if (rtw_mesh_cto_mgate_required(mpath->adapter))
rtw_netif_carrier_off(mpath->adapter->pnetdev);
#endif
}
RTW_MPATH_DBG(
FUNC_ADPT_FMT" Mesh path: Deleted gate: %pM. %d known gates\n",

View File

@@ -42,20 +42,23 @@
* With this flag, It will try the last used rann_snd_addr
* @RTW_MESH_PATH_PEER_AKA: only used toward a peer, only used in active keep
* alive mechanism. PREQ's da = path dst
* @RTW_MESH_PATH_BCAST_PREQ: for re-checking next hop resolve toward root.
* Use it to force path_discover sending broadcast PREQ for root.
*
* RTW_MESH_PATH_RESOLVED is used by the mesh path timer to
* decide when to stop or cancel the mesh path discovery.
*/
enum rtw_mesh_path_flags {
RTW_MESH_PATH_ACTIVE = BIT(0),
RTW_MESH_PATH_ACTIVE = BIT(0),
RTW_MESH_PATH_RESOLVING = BIT(1),
RTW_MESH_PATH_SN_VALID = BIT(2),
RTW_MESH_PATH_FIXED = BIT(3),
RTW_MESH_PATH_RESOLVED = BIT(4),
RTW_MESH_PATH_REQ_QUEUED = BIT(5),
RTW_MESH_PATH_DELETED = BIT(6),
RTW_MESH_PATH_DELETED = BIT(6),
RTW_MESH_PATH_ROOT_ADD_CHK = BIT(7),
RTW_MESH_PATH_PEER_AKA = BIT(8),
RTW_MESH_PATH_BCAST_PREQ = BIT(9),
};
/**
@@ -166,6 +169,8 @@ void dump_mpp(void *sel, _adapter *adapter);
struct rtw_mesh_path *
rtw_mesh_path_lookup_by_idx(_adapter *adapter, int idx);
void dump_mpath(void *sel, _adapter *adapter);
struct rtw_mesh_path *
rtw_mpp_path_lookup_by_idx(_adapter *adapter, int idx);
void rtw_mesh_path_fix_nexthop(struct rtw_mesh_path *mpath, struct sta_info *next_hop);