Commit Graph

8 Commits

Author SHA1 Message Date
Roshan Pius 4f20cdaa6a wificond: Bug fix for parsing radio chain info
The signal strength (RSSI) field is stored as a list of
uint8_t attributes in the kernel.

Bug: 68335251
Test: Ensured radio chain info is present on crosshatch scan results.
Test: ./system/connectivity/wificond/runtests.sh
Change-Id: Ic11fca82e78d066ad0bf18fabad5162b5a834b81
2018-02-02 15:03:58 -08:00
Roshan Pius 4a10da1c10 wificond: Keep a local copy of the latest nl80211.h
The libc version of nl80211.h is in sync with stable kernel version
supported by Android.  This inhibits us from using any new upstream
nl80211 APIs, until the oldest supported Android kernel includes
those APIs.  So keep a local copy of the nl80211.h inside wificond's
source tree. This header file need to be manually updated from the latest
Pixel kernel tree for new features. Since the nl80211 command set itself is
backward compatible, these new features should silently fail on devices
runnning older kernels.

The current nl80211.h file was picked from `p-dev-msm-bluecross-4.9`
kernel branch.

Bug: 72709703
Test: wificond compiles with the new headers.
Test: Device boots up and connects to wifi networks.
Test: Will send for regression tests along with the incoming DBS changes.
Change-Id: I0621c78747d4bcca8e1dd198209f86f8ebb802bb
2018-02-01 15:48:48 -08:00
Ningyuan Wang 7e8a6b0475 Add support for merging split attributes
This adds BaseNL80211Attr::Merge() and NL80211Packet::
GetAllAttributes(). These functions are useful for merging
attributes across different netlink packets.

This also adds the corresponding unit tests and fixes a existing
typo.

Bug: 36899490
Test: compile, unit tests
Change-Id: Ie53b0e088aee7aab80cf9b06b2f0e822c0062a3d
2017-10-10 12:58:03 -07:00
Manoj Gupta e0d5304beb Fix static analyzer warnings.
Fix the following warnings:
system/connectivity/wificond/net/netlink_manager.cpp:189:54: warning:
Assigned value is garbage or undefined
[clang-analyzer-core.uninitialized.Assign]

system/connectivity/wificond/tests/nl80211_attribute_unittest.cpp:280:22:
warning: The left operand of '==' is a garbage value
[clang-analyzer-core.UndefinedBinaryOperatorResult]
system/connectivity/wificond/tests/nl80211_attribute_unittest.cpp:281:22:
warning: The left operand of '==' is a garbage value
[clang-analyzer-core.UndefinedBinaryOperatorResult]
system/connectivity/wificond/tests/nl80211_attribute_unittest.cpp:282:22:
warning: The left operand of '==' is a garbage value
[clang-analyzer-core.UndefinedBinaryOperatorResult]

Bug: b/27101951
Test:Warnings are gone.
Change-Id: Ice4e7cd9954953affbd2e34d5c85b3e96a2756a1
2017-07-25 15:54:24 -07:00
Ningyuan Wang 58b77ef36d Retrieve list of attributes from a nested attribute
This adds helper functions to retrieve a list of attribute
values or nested attributes from a nested attribute.
This helps us get all sub-attributes in one pass.

BUG=30901326
TEST=compile, unit tests, manual tests

Change-Id: I3f9090b65f8e08c2a2643b35ec6db3340e1effd2
2016-09-08 16:00:39 -07:00
Ningyuan Wang 808c670699 Change include directory
This make our local headers clearly wificond prefixed.

TEST=compile
BUG=None

Change-Id: I68cc9efd2f73bec7a4cbec09a470af58420ac3e1
2016-07-18 12:39:42 -07:00
Ningyuan Wang 96f218d3f9 Support more types of nl80211 attributes
This CL includes the following changes:
1.
  Improve the interface design of NL80211Attribute classes.
  Add a function GetAttributeValue() to NL80211NestedAttr class.
2.
  Support more types of nl80211 attributes. This includes all
  size of interger types, string, flag, and raw buffer.
3.
  Guarantee payload size alignment by padding 0s.
4.
  Support FLAG attribute by adding a function AddAttribute(int id).
  We don't instanciate any flag attribute because it has no payload.
5.
  Add corresponding unit tests.

BUG=29454786
TEST=compile
TEST=run unittests

Change-Id: I3653a3babfc1df5dde42eecf4410fd636d26b956
2016-07-07 14:09:30 -07:00
Ningyuan Wang 5e4d528807 Initial commit for nl80211 attribute
This CL includes the following changes:
1. Initial design for NL80211Attribute classes.
2. Unittests verifying the functions of NL80211Attribute
   classes. This also shows how these internal interfaces
   are going to be used.

BUG=29454786
TEST=compile
TEST=run unittests

Change-Id: I52f07f9a45d5966a7787c591c5f90dc1bf55ecf8
2016-06-29 11:35:59 -07:00