mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 00:24:41 -04:00
qcacld-3.0: Handle ch cnt and number of channels for SETROAMSCANCHANNELS
To set specific channels, user give SETROAMSCANCHANNELS command with channel count followed by number of channels. Ex. SETROAMSCANCHANNELS 2 1 11, here 2 is count and 1 & 11 are the channels. If channel count is more than the number of channels, driver rejects SETROAMSCANCHANNELS command and if number of channels are more than the channel count, driver ignores excess channels in the list. Change-Id: I276b84b4994bdf25abf36298dc212dcd54ce0dbb CRs-Fixed: 2609788
This commit is contained in:
parent
362a08680e
commit
f4e994656f
1 changed files with 12 additions and 10 deletions
|
|
@ -1880,12 +1880,10 @@ hdd_parse_channellist(struct hdd_context *hdd_ctx,
|
|||
in_ptr = strpbrk(in_ptr, " ");
|
||||
/* no channel list after the number of channels argument */
|
||||
if (!in_ptr) {
|
||||
if (0 != j) {
|
||||
*num_channels = j;
|
||||
if ((j != 0) && (*num_channels == j))
|
||||
return 0;
|
||||
} else {
|
||||
return -EINVAL;
|
||||
}
|
||||
else
|
||||
goto cnt_mismatch;
|
||||
}
|
||||
|
||||
/* remove empty space */
|
||||
|
|
@ -1897,12 +1895,10 @@ hdd_parse_channellist(struct hdd_context *hdd_ctx,
|
|||
* argument and spaces
|
||||
*/
|
||||
if ('\0' == *in_ptr) {
|
||||
if (0 != j) {
|
||||
*num_channels = j;
|
||||
if ((j != 0) && (*num_channels == j))
|
||||
return 0;
|
||||
} else {
|
||||
return -EINVAL;
|
||||
}
|
||||
else
|
||||
goto cnt_mismatch;
|
||||
}
|
||||
|
||||
v = sscanf(in_ptr, "%31s ", buf);
|
||||
|
|
@ -1923,6 +1919,12 @@ hdd_parse_channellist(struct hdd_context *hdd_ctx,
|
|||
}
|
||||
|
||||
return 0;
|
||||
|
||||
cnt_mismatch:
|
||||
hdd_debug("Mismatch in ch cnt: %d and num of ch: %d", *num_channels, j);
|
||||
*num_channels = 0;
|
||||
return -EINVAL;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue