iw_runner: add parsing of max_scan_ssids

We'd like to test that WiFi hardware truly supports scanning
for the number of SSIDs that it reports to support via nl80211.

Accordingly, add code to iw_runner, to parse the bit of iw's
output that provides this information.

While there: refactor list_phys, so that the IwPhy namedtuple
is constructed after we've finished reading all the data for
a phy. This is necessary because the fields in a tuple can't
be reassigned.

BUG=chromium:338521
TEST=manual

Manual testing: ran a test which calls list_phys, verified that
it returned the same values as iw list for ath9k and mwifiex.
(The values were 4 and 10, respectively.)

Change-Id: Ief27ea4f270acea954456736d97cc1bcc206f80c
Reviewed-on: https://chromium-review.googlesource.com/184043
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
1 file changed