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 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 ARMmbed/mbed-os-maintainers Sep 27, 2019
@ciarmcom

This comment has been minimized.

Copy link
Member

ciarmcom commented Sep 27, 2019

@adbridge

This comment has been minimized.

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.

@adbridge adbridge added needs: work and removed needs: review labels Oct 7, 2019
@cydriftcloud cydriftcloud force-pushed the cydriftcloud:pr-dev/ap-sta-op-sync branch from 6d6cb95 to e286b2e Oct 10, 2019
@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 cydriftcloud:pr-dev/ap-sta-op-sync branch from e286b2e to a3ee443 Oct 11, 2019
@cydriftcloud

This comment has been minimized.

Copy link
Contributor Author

cydriftcloud commented Oct 15, 2019

@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

This comment has been minimized.

Copy link
Contributor Author

cydriftcloud commented Oct 18, 2019

@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 0xc0170 added needs: review and removed needs: work labels Oct 18, 2019
@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Oct 18, 2019

Restarted travis, should be green

@ARMmbed/mbed-os-ipcore Please review

@0xc0170

This comment has been minimized.

Copy link
Member

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 cydriftcloud:pr-dev/ap-sta-op-sync branch from a3ee443 to 28884b5 Oct 24, 2019
@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Oct 24, 2019

CI started while we get requested reviews

@mbed-ci

This comment has been minimized.

Copy link

mbed-ci commented Oct 24, 2019

Test run: SUCCESS

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

@0xc0170

This comment has been minimized.

Copy link
Member

0xc0170 commented Oct 25, 2019

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

@0xc0170 0xc0170 removed the needs: review label Oct 25, 2019
@0xc0170 0xc0170 added needs: CI and removed needs: CI labels Oct 25, 2019
@0xc0170 0xc0170 merged commit a44fd82 into ARMmbed:master Oct 25, 2019
26 checks passed
26 checks passed
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/build-ARM Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR Success
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/dynamic-memory-usage RTOS ROM(+0 bytes) RAM(+0 bytes)
Details
jenkins-ci/exporter Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/mbed2-build-ARM Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Success!
Details
travis-ci/docs Success!
Details
travis-ci/doxy-spellcheck Success!
Details
travis-ci/events Success! Runtime is 8675 cycles.
Details
travis-ci/gitattributestest Success!
Details
travis-ci/include_check Success!
Details
travis-ci/licence_check Success!
Details
travis-ci/littlefs Success! Code size is 8420B.
Details
travis-ci/psa-autogen Success!
Details
travis-ci/tools-py2.7 Success!
Details
travis-ci/tools-py3.5 Success!
Details
travis-ci/tools-py3.6 Success!
Details
travis-ci/tools-py3.7 Success!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.