Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4e99465 authored by Abhishek Ambure's avatar Abhishek Ambure Committed by nshrivas
Browse files

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
parent 362a0868
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -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;

}

/**