Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement WifiAccessPointSetPhyType #139

Merged
merged 18 commits into from
Jan 31, 2024
Merged

Conversation

corbin-phipps
Copy link
Contributor

@corbin-phipps corbin-phipps commented Jan 27, 2024

Type

  • Bug fix
  • Feature addition
  • Feature update
  • Documentation
  • Build Infrastructure

Side Effects

  • Breaking change
  • Non-functional change

Goals

This PR adds a new netremote API, WifiAccessPointSetPhyType, to allow clients to update the PHY type in the configuration of an AP.

Technical Details

  • Added WifiAccessPointSetPhyType to NetRemoteService.proto and related types to NetRemoteWifi.proto.
  • Implemented API in NetRemoteService.*.
  • Added SetProtocol function to IAccessPointController interface and in its implementations (e.g. AccessPointControllerLinux.
  • Added unit test.

Test Results

Unit tests pass.

Reviewer Focus

  • SetProtocol sets the hw_mode hostapd property, as well as wmm_enabled and ieee80211* properties where applicable. Are others needed, such as ht_capab for ieee80211n?

  • In IeeeProtocolToHostapdHwMode, the conversion from ieee80211n to hostapd hw_mode can be either a or g depending on the band, currently it's set to a. How should we handle this? Is there a way to check the bands that are currently set in hostapd somewhere and choose the best option, or should we always set this to a and update it later if a client wants to set a specific frequency band?

Future Work

None.

Checklist

  • Build target all compiles cleanly.
  • clang-format and clang-tidy deltas produced no new output.
  • Newly added functions include doxygen-style comment block.

src/linux/wpa-controller/include/Wpa/ProtocolHostapd.hxx Outdated Show resolved Hide resolved
src/linux/wifi/core/AccessPointControllerLinux.cxx Outdated Show resolved Hide resolved
src/linux/wifi/core/AccessPointControllerLinux.cxx Outdated Show resolved Hide resolved
src/common/wifi/core/CMakeLists.txt Outdated Show resolved Hide resolved
src/common/service/NetRemoteService.cxx Outdated Show resolved Hide resolved
src/linux/wifi/core/CMakeLists.txt Outdated Show resolved Hide resolved
src/common/service/NetRemoteService.cxx Outdated Show resolved Hide resolved
src/linux/wifi/core/AccessPointControllerLinux.cxx Outdated Show resolved Hide resolved
src/common/service/NetRemoteService.cxx Outdated Show resolved Hide resolved
src/common/service/NetRemoteService.cxx Outdated Show resolved Hide resolved
@abeltrano abeltrano changed the base branch from develop to user/corbinphipps/add-update-config-apis January 30, 2024 03:01
@abeltrano
Copy link
Contributor

I re-targeted this to user/corbinphipps/add-update-config-apis so it's easier to see the changes compared to there since it seems this is a child branch of that.

@abeltrano abeltrano force-pushed the user/corbinphipps/add-update-config-apis branch from 4ce5e7b to b1292b9 Compare January 30, 2024 03:09
@abeltrano abeltrano force-pushed the user/corbinphipps/phy-api-impl branch from b1c10a1 to a1914bd Compare January 30, 2024 03:09
@abeltrano abeltrano force-pushed the user/corbinphipps/phy-api-impl branch from a1914bd to 02882d7 Compare January 30, 2024 03:18
@abeltrano abeltrano changed the base branch from user/corbinphipps/add-update-config-apis to develop January 30, 2024 03:18
@abeltrano
Copy link
Contributor

I re-targeted this to user/corbinphipps/add-update-config-apis so it's easier to see the changes compared to there since it seems this is a child branch of that.

Nevermind, I now re-targeted it such that it can be applied directly to develop without the changes in user/corbinphipps/add-update-config-apis. Limiting the scope should make it easier to review and test. Overall, it probably makes sense to complete this PR first.

@corbin-phipps corbin-phipps marked this pull request as ready for review January 30, 2024 18:12
@corbin-phipps corbin-phipps requested a review from a team as a code owner January 30, 2024 18:12
src/linux/wifi/core/AccessPointControllerLinux.cxx Outdated Show resolved Hide resolved
src/linux/wifi/core/AccessPointControllerLinux.cxx Outdated Show resolved Hide resolved
src/common/service/NetRemoteService.cxx Outdated Show resolved Hide resolved
src/common/service/NetRemoteService.cxx Outdated Show resolved Hide resolved
src/common/service/NetRemoteService.cxx Outdated Show resolved Hide resolved
tests/unit/TestNetRemoteServiceClient.cxx Outdated Show resolved Hide resolved
tests/unit/wifi/helpers/AccessPointControllerTest.cxx Outdated Show resolved Hide resolved
…ant; fix dangling reference; fix return logic; fix style nits
@abeltrano
Copy link
Contributor

abeltrano commented Jan 30, 2024

  • SetProtocol sets the hw_mode hostapd property, as well as wmm_enabled and ieee80211* properties where applicable. Are others needed, such as ht_capab for ieee80211n?

We'll need to figure this out eventually, but we can defer that and do it later on an as-needed, case-by-case basis. I'll create some issues to track that work. The only thing to verify now is whether or not hostapd will refuse to apply the hw_mode setting if the associated settings like ht_capab, vht_capab, are not specified. As long as it doesn't,

  • AccessPointControllerTest::SetProtocol currently just returns true. Is this okay to leave unimplemented since this is for a mocked AP?

This one is handled now right, so we can remove this part from the PR description?

  • In IeeeProtocolToHostapdHwMode, the conversion from ieee80211n to hostapd hw_mode can be either a or g depending on the band, currently it's set to a. How should we handle this? Is there a way to check the bands that are currently set in hostapd somewhere and choose the best option, or should we always set this to a and update it later if a client wants to set a specific frequency band?

This one is difficult because of the hostapd config file implementation. I think what you've done here is good for now, and we can plan to sort out the nuisances nuances later.

Copy link
Contributor

@abeltrano abeltrano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ship it!

@abeltrano abeltrano merged commit e407c45 into develop Jan 31, 2024
5 checks passed
@abeltrano abeltrano deleted the user/corbinphipps/phy-api-impl branch January 31, 2024 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants