Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Commit

Permalink
Agent: Add media info on front radio interfaces in Topology Response
Browse files Browse the repository at this point in the history
The controller needs to be able to add and remove the radio node from its database based on
the data that is coming from the Topology Response message.
Add dummy data on the wireless fronthaul interfaces in the tlvDeviceInformation which is in
the Topology Response message.
The reason that it is dummy values is that this is something that cannot be done at this moment
because the MediaType field must be computed with information obtained through
NL80211_CMD_GET_WIPHY command of DWPAL, which is currently not supported.
See "Send standard NL80211 commands using DWPAL #782

The filled band data is based on the information we have about the band but it is not accurate.
The fields ap_channel_bandwidth, ap_channel_center_frequency_index1 and
ap_channel_center_frequency_index2 we could get (the bw for sure, the others not so sure),
but it not worth it since it will require to create more internal messaging which will be deleted
after moving to a unified Agent (#435).

Signed-off-by: Moran Shoeg <[email protected]>
  • Loading branch information
morantr committed Mar 8, 2020
1 parent 1d61dd8 commit 4e8e8bd
Showing 1 changed file with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* over time this list is going to get very long
*/
#include <tlvf/ieee_1905_1/eMessageType.h>
#include <tlvf/ieee_1905_1/s802_11SpecificInformation.h>
#include <tlvf/ieee_1905_1/tlvAlMacAddressType.h>
#include <tlvf/ieee_1905_1/tlvAutoconfigFreqBand.h>
#include <tlvf/ieee_1905_1/tlvDeviceInformation.h>
Expand Down Expand Up @@ -1977,6 +1978,48 @@ bool backhaul_manager::handle_1905_topology_query(ieee1905_1::CmduMessageRx &cmd
// This is something that cannot be done at this moment because the MediaType field
// must be computed with information obtained through NL80211_CMD_GET_WIPHY command of DWPAL,
// which is currently not supported. See "Send standard NL80211 commands using DWPAL #782"
// For now, fill from radio data with dummy values based on information we have.
for (const auto soc : slaves_sockets) {
std::shared_ptr<ieee1905_1::cLocalInterfaceInfo> localInterfaceInfo =
tlvDeviceInformation->create_local_interface_list();
localInterfaceInfo->mac() = network_utils::mac_from_string(soc->radio_mac);

ieee1905_1::eMediaType media_type = ieee1905_1::eMediaType::UNKNONWN_MEDIA;
if (soc->freq_type == beerocks::eFreqType::FREQ_24G) {
media_type = ieee1905_1::eMediaType::IEEE_802_11N_2_4_GHZ;
} else if (soc->freq_type == beerocks::eFreqType::FREQ_5G) {
media_type = ieee1905_1::eMediaType::IEEE_802_11AC_5_GHZ;
} else {
LOG(ERROR) << "Unsupported freq_type=" << int(soc->freq_type)
<< ", iface=" << soc->hostap_iface;
return false;
}
localInterfaceInfo->media_type() = media_type;

ieee1905_1::s802_11SpecificInformation media_info = {};
localInterfaceInfo->alloc_media_info(sizeof(media_info));

// BSSID of a fronthaulradio interface is something that is not defined well.
// Put zeros for now.
media_info.network_membership = network_utils::ZERO_MAC;

media_info.role = ieee1905_1::eRole::AP;

// TODO: The Backhaul manager does not hold the information on the front radios.
// For now, put zeros and when the Agent management will be move to unified Agent thread
// this field will be filled. #435
media_info.ap_channel_bandwidth = 0;
media_info.ap_channel_center_frequency_index1 = 0;
media_info.ap_channel_center_frequency_index2 = 0;

auto *media_info_ptr = localInterfaceInfo->media_info(0);
if (media_info_ptr == nullptr) {
LOG(ERROR) << "media_info is nullptr";
return false;
}

std::copy_n(reinterpret_cast<uint8_t *>(&media_info), sizeof(media_info), media_info_ptr);
}

auto tlvSupportedService = cmdu_tx.addClass<wfa_map::tlvSupportedService>();
if (!tlvSupportedService) {
Expand Down

0 comments on commit 4e8e8bd

Please sign in to comment.