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

Add synchronization and switching between WhdSoftAPInterface and WhdSTAInterfaces #11578

Merged
merged 1 commit into from
Oct 25, 2019

Conversation

cydriftcloud
Copy link
Contributor

@cydriftcloud cydriftcloud commented Sep 26, 2019

Description

Currently, there is no synchronization between STA and SoftAP interfaces which shares the same underlying WHD device. Synchronization mechanism using lock_guard is added to serialize operations including

  • SoftAP: start, stop
  • STA: scan, connect, disconnect

Also resolved switching issue between SoftAP and STA mode for primary interface

  • Avoid reinit primary interface by getting mapping the current interface to the other one which is already on
  • In concurrent mode, STA is the default if it is up, otherwise SoftAP is set as default.
  • For non-concurrent mode, the most recent started interface is set as default.

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

Release Notes

@cydriftcloud cydriftcloud changed the title Add synchronization between SoftAP/STA interfaces Add synchronization between WhdSoftAPInterface and WhdSTAInterfaces Sep 27, 2019
@ciarmcom ciarmcom requested review from maclobdell and a team September 27, 2019 01:00
@ciarmcom
Copy link
Member

@cydriftcloud, thank you for your changes.
@maclobdell @ARMmbed/mbed-os-ipcore @ARMmbed/mbed-os-maintainers please review.

@adbridge
Copy link
Contributor

adbridge commented Oct 7, 2019

@cydriftcloud please can you remove the merge commit against this PR and use a rebase instead. Ty.

@cydriftcloud cydriftcloud force-pushed the pr-dev/ap-sta-op-sync branch from 6d6cb95 to e286b2e Compare October 10, 2019 00:47
@cydriftcloud cydriftcloud changed the title Add synchronization between WhdSoftAPInterface and WhdSTAInterfaces Add synchronization and switching between WhdSoftAPInterface and WhdSTAInterfaces Oct 10, 2019
@cydriftcloud cydriftcloud force-pushed the pr-dev/ap-sta-op-sync branch from e286b2e to a3ee443 Compare October 11, 2019 03:40
@cydriftcloud
Copy link
Contributor Author

@adbridge I have updated the PR with recommended changes. Also I have added a few additional changes that dealing with synchronization and switching that should go along with this PR. Please help review and provide feedbacks.

@cydriftcloud
Copy link
Contributor Author

@adbridge Can you please remove the need work label as the work has been done and PR has been updated. @bulislaw and @maclobdell can you help to review the new change?

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 18, 2019

Restarted travis, should be green

@ARMmbed/mbed-os-ipcore Please review

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 21, 2019

Travis green, now time for review

- A shared mutex is added for synchronization
- ScopedMutexLock is used to to protect
  - SoftAP: start, stop
  - STA: scan, join, disconnect
- Fix switching issue between SoftAP and STA mode for primary interface
  - Avoid reinit primary interface by getting mapping the current interface to the other one which is already on
  - In concurrent mode, STA is the default if it is up, otherwise SoftAP is default.
  - For non-concurrent mode, the most recent started interface is set as default.
@cydriftcloud cydriftcloud force-pushed the pr-dev/ap-sta-op-sync branch from a3ee443 to 28884b5 Compare October 24, 2019 01:32
@0xc0170
Copy link
Contributor

0xc0170 commented Oct 24, 2019

CI started while we get requested reviews

@mbed-ci
Copy link

mbed-ci commented Oct 24, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 25, 2019

@ARMmbed/mbed-os-ipcore Please review, if approved we could integrate it today

@0xc0170 0xc0170 merged commit a44fd82 into ARMmbed:master Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants