mirror of
https://gitlab.com/prpl-foundation/prplmesh/prplMesh.git
synced 2025-12-20 01:21:22 +08:00
agent: replace bssid_multi_ap_profile with bBSS_multi_ap_profile and base TS/SP on effective profile
The field bssid_multi_ap_profile in AgentDB was ambiguous: it mixed our own capability with the upstream AP’s advertised profile. Replace it with a clearly named backhaul_bss_multi_ap_profile, which is populated from the association response via pwhm (EndPoint.MultiAPProfile) and treated as read-only from prplMesh. Update Traffic Separation and Service Prioritization decisions to no longer check only backhaul_bss_multi_ap_profile > 1. Instead, compute an effective profile. This ensures that features like TS and SP are only enabled when supported by all participants (local Agent, upstream AP, and controller). PPM-3434. Signed-off-by: Dmytro Puz <d.puz@inango-systems.com>
This commit is contained in:
@@ -205,7 +205,12 @@ public:
|
||||
enum class eConnectionType { Invalid = 0, Wired, Wireless } connection_type;
|
||||
std::string selected_iface_name;
|
||||
sMacAddr preferred_bssid;
|
||||
uint8_t bssid_multi_ap_profile;
|
||||
|
||||
// Multi-AP Profile advertised by the upstream AP in its association response.
|
||||
// Read-only from prplMesh perspective (populated by pwhm via EndPoint.MultiAPProfile).
|
||||
// Used together with our own device_conf.multi_ap_profile and controller profile
|
||||
// to determine the effective profile for this backhaul link.
|
||||
uint8_t backhaul_bss_multi_ap_profile;
|
||||
sMacAddr backhaul_bssid;
|
||||
|
||||
struct sBackhaulLink {
|
||||
|
||||
@@ -721,10 +721,11 @@ bool BackhaulManager::backhaul_fsm_main(bool &skip_select)
|
||||
case EState::INIT: {
|
||||
state_time_stamp_timeout = std::chrono::steady_clock::now() +
|
||||
std::chrono::seconds(STATE_WAIT_ENABLE_TIMEOUT_SECONDS);
|
||||
auto db = AgentDB::get();
|
||||
db->backhaul.connection_type = AgentDB::sBackhaul::eConnectionType::Invalid;
|
||||
db->backhaul.bssid_multi_ap_profile = 0;
|
||||
db->controller_info.bridge_mac = beerocks::net::network_utils::ZERO_MAC;
|
||||
auto db = AgentDB::get();
|
||||
db->backhaul.connection_type = AgentDB::sBackhaul::eConnectionType::Invalid;
|
||||
db->controller_info.bridge_mac = beerocks::net::network_utils::ZERO_MAC;
|
||||
db->backhaul.backhaul_bss_multi_ap_profile =
|
||||
wfa_map::tlvProfile2MultiApProfile::eMultiApProfile::MULTIAP_PROFILE_1;
|
||||
|
||||
FSM_MOVE_STATE(WAIT_ENABLE);
|
||||
break;
|
||||
@@ -2150,8 +2151,8 @@ bool BackhaulManager::hal_event_handler(bwl::base_wlan_hal::hal_event_ptr_t even
|
||||
db->bsta_mld_configuration->ap_mld_mac = msg->mac_address;
|
||||
}
|
||||
|
||||
db->traffic_separation.primary_vlan_id = msg->multi_ap_primary_vlan_id;
|
||||
db->backhaul.bssid_multi_ap_profile = msg->multi_ap_profile;
|
||||
db->traffic_separation.primary_vlan_id = msg->multi_ap_primary_vlan_id;
|
||||
db->backhaul.backhaul_bss_multi_ap_profile = msg->multi_ap_profile;
|
||||
|
||||
auto request = message_com::create_vs_message<
|
||||
beerocks_message::cACTION_BACKHAUL_APPLY_VLAN_POLICY_REQUEST>(cmdu_tx);
|
||||
|
||||
@@ -222,8 +222,18 @@ void ServicePrioritizationTask::gather_iface_details(
|
||||
return;
|
||||
}
|
||||
iface.iface_name = radio->back.iface_name;
|
||||
|
||||
// Effective Multi-AP Profile = minimum of local capability, and bBSS
|
||||
// (upstream AP) profile. This ensures the link never advertises or enables
|
||||
// features (TS, SP, R3/4) that are unsupported by any participant in the path.
|
||||
auto profile_min = std::min({int(db->backhaul.backhaul_bss_multi_ap_profile),
|
||||
int(db->device_conf.multi_ap_profile)});
|
||||
LOG(INFO) << "Service Prioritization decision: local ="
|
||||
<< int(db->device_conf.multi_ap_profile)
|
||||
<< " peer =" << db->backhaul.backhaul_bss_multi_ap_profile
|
||||
<< " -> effective=" << profile_min;
|
||||
iface.tag_info =
|
||||
db->backhaul.bssid_multi_ap_profile > 1
|
||||
profile_min > wfa_map::tlvProfile2MultiApProfile::eMultiApProfile::MULTIAP_PROFILE_1
|
||||
? bpl::ServicePrioritizationUtils::ePortMode::TAGGED_PORT_PRIMARY_TAGGED
|
||||
: bpl::ServicePrioritizationUtils::ePortMode::UNTAGGED_PORT;
|
||||
iface_tag_info_list->push_back(iface);
|
||||
|
||||
@@ -128,7 +128,16 @@ void TrafficSeparation::apply_policy(const std::string &radio_iface)
|
||||
return;
|
||||
}
|
||||
|
||||
if (db->backhaul.bssid_multi_ap_profile > 1) {
|
||||
// Effective Multi-AP Profile = minimum of local capability, and bBSS
|
||||
// (upstream AP) profile. This ensures the link never advertises or enables
|
||||
// features (TS, SP, R3/4) that are unsupported by any participant in the path.
|
||||
auto profile_min = std::min({int(db->backhaul.backhaul_bss_multi_ap_profile),
|
||||
int(db->device_conf.multi_ap_profile)});
|
||||
LOG(INFO) << "TS decision: local =" << int(db->device_conf.multi_ap_profile)
|
||||
<< " peer =" << db->backhaul.backhaul_bss_multi_ap_profile
|
||||
<< " -> effective=" << profile_min;
|
||||
|
||||
if (profile_min > wfa_map::tlvProfile2MultiApProfile::eMultiApProfile::MULTIAP_PROFILE_1) {
|
||||
set_vlan_policy(radio->back.iface_name, ePortMode::TAGGED_PORT_PRIMARY_TAGGED,
|
||||
is_bridge);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user