-
Notifications
You must be signed in to change notification settings - Fork 32
Conversation
8965e83
to
b0b8a9e
Compare
95f0cc2
to
bd8d2c9
Compare
I don't like where this is going - reading supported channels should be done as part of |
5df65ff
to
6b4002f
Compare
6b4002f
to
547a603
Compare
547a603
to
cb65b88
Compare
common/beerocks/tlvf/yaml/beerocks/tlvf/beerocks_message_apmanager.yaml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to the comments I made: I would expect supported_channels to be removed from sNodeHostap as well. Is there any reason to keep it there?
Not marking as changes requested because I don't know if I'll still do the re-review.
common/beerocks/tlvf/yaml/beerocks/tlvf/beerocks_message_apmanager.yaml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw couple valuable comments in this PR that need to be addressed.
IMO this is what is still missing:
- in
handle_hostapd_attached()
- when there is no "acs report" need toupdate_preference_channels_from_supoorted_channels()
instead ofread_supported_channels()
- need to add controller commit that removes
set_hostap_supported_channels()
fromhandle_intel_slave_join()
since onlyadd_hostap_supported_operating_class()
will handle this from now on. - verify changes in 2 scenarios :
a. Radio configured as Auto channel
b. Radio configured as Static channel
print "supported_channels" after autoconfig_wsc_parse_radio_caps().
Check that in both scenarios prints are the same.
add the result to PR description.
cb65b88
to
2c2f23c
Compare
This is the result of the print in I checked the print two times, one with the radio channel set to auto While on auto-channel:
while on static channel:
|
83f8546
to
bfc3d86
Compare
bfc3d86
to
7264120
Compare
7264120
to
3b8bd4b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is wrong and confusing as hell. You should build a new one which does this with the following commits:
- rename supported_channels -> prefered_channels
- change prefered_channels to use std::array
- add supported_channels using nl
@@ -31,6 +31,7 @@ base_wlan_hal::base_wlan_hal(HALType type, std::string iface_name, IfaceType ifa | |||
} | |||
|
|||
// Initialize complex containers of the radio_info structure | |||
m_radio_info.preferred_channels.resize(128 /* TODO: Get real value */); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO should be accompanied with an issue URL which should fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, the commit message is really short.
Suggestion:
Preparative commit.
Currently, the supported channels used in prplMesh per radio are the channels read from ACS (Automatic channel scan) report. This is wrong, the ACS report holds the prefered channels, not the supported channels.
The supported channels should be read from the driver via NL, and a new preferred channels vector should be added to hold the ACS results. This will be done in followup commits, for now, just add empty preferred_channels to the radio info structure.
common/beerocks/tlvf/AutoGenerated/include/beerocks/tlvf/beerocks_message_common.h
Outdated
Show resolved
Hide resolved
3b8bd4b
to
14facdf
Compare
…LENGTH The SUPPORTED_CHANNELS_LENGTH is used throughout the code-base. It is used to set the maximum number of channels in the preferred and supported channel list. Since the SUPPORTED_CHANNELS_LENGTH isn't used only for the supported_channels but is used for all radio channel the current name is incorrect. Rename the SUPPORTED_CHANNELS_LENGTH to RADIO_CHANNELS_LENGTH. Increase the value to 128 to allow for the full size of the available channels. Signed-off-by: Itay Elenzweig <[email protected]>
In ap_manager_thread there are two helper functions, copy_radio_supported_channels and get_radio_supported_channels_string They only work on the ap_wlan_hal's supported_channels. Change the functions to take the supported_channels vector to make them usable for other radio channel lists. Signed-off-by: Itay Elenzweig <[email protected]>
Currently the preferred channels are used in the code-base under the wrong name "supported_channels". Change supported_channels to preferred_channels Change the container type to std::array Signed-off-by: Itay Elenzweig <[email protected]>
Currently only the preferred_channels are used throughout the codebase. They is sent as part of the ACTION_APMANAGER_JOINED_NOTIFICATION message. To support the AP Radio Basic Capabilities the supported_channels gathered from the NL80211 need to be used instead. Add supported_channels to the RadioInfo in the bwl Add supported_channels to the ACTION_APMANAGER_JOINED_NOTIFICATION message. Signed-off-by: Itay Elenzweig <[email protected]>
In handle_hostapd_attached the ACS report is used to fill the preferred_channels array. If the ACS is not enabled the supported_channels are used instead. Create a function that copies the supported_channels to the preferred_channels. Use the function when the ACS is not enabled. Read the supported channels regardless of the ACS. Signed-off-by: Itay Elenzweig <[email protected]>
The supported_channels are sent to the son_slave but are not used. The supported_channels need to be used in the AP radio capabilities during the JOIN_MASTER state. Store the supported_channels from ACTION_APMANAGER_JOINED_NOTIFICATION. Use the supported_channels for add_ap_radio_basic_capabilities. Signed-off-by: Itay Elenzweig <[email protected]>
The supported channels are sent to the son_slave from the AP manager. Then they are sent from the son_slave to the son_master as part of the. AP Radio Basic Capabilities message that is then processed in autoconfig_wsc_parse_radio_caps. Add a print in the son_master to see the AP Radio Basic Capabilities. Signed-off-by: Itay Elenzweig <[email protected]>
14facdf
to
ea6d3f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better, but still a lot of comments, some major, so asking for re-review.
@@ -43,7 +43,7 @@ enum eStructsConsts { | |||
VERSION_LENGTH = 16, | |||
NODE_NAME_LENGTH = 32, | |||
IFACE_NAME_LENGTH = 32 + 4, //need extra 1 byte for null termination + alignment | |||
SUPPORTED_CHANNELS_LENGTH = 64, //support upto # channels, every channel item is 32-bit | |||
RADIO_CHANNELS_LENGTH = 128, //support upto # channels, every channel item is 32-bit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Why change to 128 by default?
- why change at all? it should be changed to supported channels length and when you add the preferred channels length we will use a new enum.
- The name is bad - NUM_SUPPORTED_CHANNELS and NUM_PREFERRED_CHANNELS is better.
@@ -33,30 +33,28 @@ using namespace beerocks::net; | |||
/////////////////////////// Local Module Functions /////////////////////////// | |||
////////////////////////////////////////////////////////////////////////////// | |||
|
|||
static void copy_radio_supported_channels(std::shared_ptr<bwl::ap_wlan_hal> &ap_wlan_hal, | |||
beerocks::message::sWifiChannel supported_channels[]) | |||
static void copy_radio_channels(std::vector<bwl::WiFiChannel> radio_channels, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a better name now should be just copy_channels
cause thats all it does:
static void copy_channels(std::vector<bwl::WiFiChannel> &from,
beerocks::message::sWiFiChannel to[]);
(nitpick)
@@ -1569,6 +1569,9 @@ void ap_manager_thread::handle_hostapd_attached() | |||
beerocks::message::VHT_MCS_SET_SIZE, notification->params().vht_mcs_set); | |||
|
|||
// Copy the channels supported by the AP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Copy the channels supported by the AP |
@@ -1551,8 +1551,8 @@ bool ap_wlan_hal_dwpal::read_supported_channels() | |||
} | |||
} | |||
|
|||
m_radio_info.preferred_channels.insert(m_radio_info.preferred_channels.begin(), | |||
supported_channels.begin(), supported_channels.end()); | |||
m_radio_info.supported_channels.insert(m_radio_info.supported_channels.begin(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a bug - isn't it?
m_radio_info.supported_channels.insert(m_radio_info.supported_channels.begin(), | |
m_radio_info.supported_channels.insert(m_radio_info.supported_channels.begin(), | |
supported_channels.begin(), supported_channels.end()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I look at it again - this is part of a functino which shouldn't exist in this commit - bool ap_wlan_hal_dwpal::read_supported_channels()
- I'm confused, didn't the previous commit replace all occurrences of supported channels with preferred channels?
@@ -469,7 +469,7 @@ bool ap_wlan_hal_nl80211::read_supported_channels() | |||
} | |||
} | |||
|
|||
m_radio_info.preferred_channels.insert(m_radio_info.preferred_channels.begin(), | |||
m_radio_info.supported_channels.insert(m_radio_info.supported_channels.begin(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here as well - the read_supported_channels()
should not exist in this commit.
@@ -25,6 +25,9 @@ cACTION_APMANAGER_4ADDR_STA_JOINED: | |||
|
|||
cACTION_APMANAGER_JOINED_NOTIFICATION: | |||
_type: class | |||
supported_channels: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in a separate commit with the autogenerated files changes (nitpick)
@@ -1512,6 +1512,7 @@ void ap_manager_thread::handle_hostapd_attached() | |||
{ | |||
LOG(DEBUG) << "handling enabled hostapd"; | |||
|
|||
ap_wlan_hal->read_supported_channels(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we read the supported channels here? we anyway read it from NL so why every time we attach to hostapd? This should be done only once.
@@ -1527,7 +1528,7 @@ void ap_manager_thread::handle_hostapd_attached() | |||
usleep(ACS_READ_SLEEP_USC); | |||
} | |||
} else { | |||
ap_wlan_hal->read_supported_channels(); | |||
ap_wlan_hal->update_preference_channels_from_supported_channels(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No - the logic of how we choose the channel preference should be abstracted by the BWL.
So instead we should have a read_preferred_channels()
API in BWL which internally will use the radio supported channels we read at boot if ACS is disabled.
So - this whole commit should be removed, and replaced with a simple clear API to read preferred channels exactly like the API to read supported channels.
@@ -474,6 +474,12 @@ bool ap_wlan_hal_nl80211::read_supported_channels() | |||
return true; | |||
} | |||
|
|||
bool ap_wlan_hal_nl80211::update_preference_channels_from_supported_channels() | |||
{ | |||
m_radio_info.preferred_channels = m_radio_info.supported_channels; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you already do this here - so the API is very simple.. Just use m_radio_info.supported_channels
if ACS is disabled.
The supported_channels are needed to created the Radio Basic Capabilities TLV
To do so they need to be sent to the son_slave_thread, where they will be stored locally
Then the son_slave_thread needs to sent the stored hardware_supported_channels to the son_master_thread as part of the Radio Basic Capabilities TLV