mac80211: mesh: clean up rx_bcn_presp API
commit a5b983c6073140b624f64e79fea6d33c3e4315a0 upstream. We currently pass the entire elements to the rx_bcn_presp() method, but only need mesh_config. Additionally, we use the length of the elements to calculate back the entire frame's length, but that's confusing - just pass the length of the frame instead. Link: https://lore.kernel.org/r/20210920154009.a18ed3d2da6c.I1824b773a0fbae4453e1433c184678ca14e8df45@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com> Cc: Felix Fietkau <nbd@nbd.name> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e5ebcbb4f9
commit
864f2d3482
@@ -631,10 +631,9 @@ struct ieee80211_if_ocb {
|
|||||||
*/
|
*/
|
||||||
struct ieee802_11_elems;
|
struct ieee802_11_elems;
|
||||||
struct ieee80211_mesh_sync_ops {
|
struct ieee80211_mesh_sync_ops {
|
||||||
void (*rx_bcn_presp)(struct ieee80211_sub_if_data *sdata,
|
void (*rx_bcn_presp)(struct ieee80211_sub_if_data *sdata, u16 stype,
|
||||||
u16 stype,
|
struct ieee80211_mgmt *mgmt, unsigned int len,
|
||||||
struct ieee80211_mgmt *mgmt,
|
const struct ieee80211_meshconf_ie *mesh_cfg,
|
||||||
struct ieee802_11_elems *elems,
|
|
||||||
struct ieee80211_rx_status *rx_status);
|
struct ieee80211_rx_status *rx_status);
|
||||||
|
|
||||||
/* should be called with beacon_data under RCU read lock */
|
/* should be called with beacon_data under RCU read lock */
|
||||||
|
|||||||
@@ -1354,8 +1354,8 @@ static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ifmsh->sync_ops)
|
if (ifmsh->sync_ops)
|
||||||
ifmsh->sync_ops->rx_bcn_presp(sdata,
|
ifmsh->sync_ops->rx_bcn_presp(sdata, stype, mgmt, len,
|
||||||
stype, mgmt, &elems, rx_status);
|
elems.mesh_config, rx_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ieee80211_mesh_finish_csa(struct ieee80211_sub_if_data *sdata)
|
int ieee80211_mesh_finish_csa(struct ieee80211_sub_if_data *sdata)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
* Copyright 2011-2012, Pavel Zubarev <pavel.zubarev@gmail.com>
|
* Copyright 2011-2012, Pavel Zubarev <pavel.zubarev@gmail.com>
|
||||||
* Copyright 2011-2012, Marco Porsch <marco.porsch@s2005.tu-chemnitz.de>
|
* Copyright 2011-2012, Marco Porsch <marco.porsch@s2005.tu-chemnitz.de>
|
||||||
* Copyright 2011-2012, cozybit Inc.
|
* Copyright 2011-2012, cozybit Inc.
|
||||||
|
* Copyright (C) 2021 Intel Corporation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ieee80211_i.h"
|
#include "ieee80211_i.h"
|
||||||
@@ -35,12 +36,12 @@ struct sync_method {
|
|||||||
/**
|
/**
|
||||||
* mesh_peer_tbtt_adjusting - check if an mp is currently adjusting its TBTT
|
* mesh_peer_tbtt_adjusting - check if an mp is currently adjusting its TBTT
|
||||||
*
|
*
|
||||||
* @ie: information elements of a management frame from the mesh peer
|
* @cfg: mesh config element from the mesh peer (or %NULL)
|
||||||
*/
|
*/
|
||||||
static bool mesh_peer_tbtt_adjusting(struct ieee802_11_elems *ie)
|
static bool mesh_peer_tbtt_adjusting(const struct ieee80211_meshconf_ie *cfg)
|
||||||
{
|
{
|
||||||
return (ie->mesh_config->meshconf_cap &
|
return cfg &&
|
||||||
IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING) != 0;
|
(cfg->meshconf_cap & IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mesh_sync_adjust_tsf(struct ieee80211_sub_if_data *sdata)
|
void mesh_sync_adjust_tsf(struct ieee80211_sub_if_data *sdata)
|
||||||
@@ -76,11 +77,11 @@ void mesh_sync_adjust_tsf(struct ieee80211_sub_if_data *sdata)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mesh_sync_offset_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
|
static void
|
||||||
u16 stype,
|
mesh_sync_offset_rx_bcn_presp(struct ieee80211_sub_if_data *sdata, u16 stype,
|
||||||
struct ieee80211_mgmt *mgmt,
|
struct ieee80211_mgmt *mgmt, unsigned int len,
|
||||||
struct ieee802_11_elems *elems,
|
const struct ieee80211_meshconf_ie *mesh_cfg,
|
||||||
struct ieee80211_rx_status *rx_status)
|
struct ieee80211_rx_status *rx_status)
|
||||||
{
|
{
|
||||||
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
|
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
|
||||||
struct ieee80211_local *local = sdata->local;
|
struct ieee80211_local *local = sdata->local;
|
||||||
@@ -101,10 +102,7 @@ static void mesh_sync_offset_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
|
|||||||
*/
|
*/
|
||||||
if (ieee80211_have_rx_timestamp(rx_status))
|
if (ieee80211_have_rx_timestamp(rx_status))
|
||||||
t_r = ieee80211_calculate_rx_timestamp(local, rx_status,
|
t_r = ieee80211_calculate_rx_timestamp(local, rx_status,
|
||||||
24 + 12 +
|
len + FCS_LEN, 24);
|
||||||
elems->total_len +
|
|
||||||
FCS_LEN,
|
|
||||||
24);
|
|
||||||
else
|
else
|
||||||
t_r = drv_get_tsf(local, sdata);
|
t_r = drv_get_tsf(local, sdata);
|
||||||
|
|
||||||
@@ -119,7 +117,7 @@ static void mesh_sync_offset_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
|
|||||||
* dot11MeshNbrOffsetMaxNeighbor non-peer non-MBSS neighbors
|
* dot11MeshNbrOffsetMaxNeighbor non-peer non-MBSS neighbors
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (elems->mesh_config && mesh_peer_tbtt_adjusting(elems)) {
|
if (mesh_peer_tbtt_adjusting(mesh_cfg)) {
|
||||||
msync_dbg(sdata, "STA %pM : is adjusting TBTT\n",
|
msync_dbg(sdata, "STA %pM : is adjusting TBTT\n",
|
||||||
sta->sta.addr);
|
sta->sta.addr);
|
||||||
goto no_sync;
|
goto no_sync;
|
||||||
|
|||||||
Reference in New Issue
Block a user