Search Linux Wireless

Re: [PATCH v3 4/9] wifi: cfg80211: add NL command to set 6 GHz power mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/29/23 23:21, Johannes Berg wrote:
On Wed, 2023-03-15 at 18:58 +0530, Aditya Kumar Singh wrote:

+	{
+		.cmd = NL80211_CMD_SET_6GHZ_POWER_MODE,
+		.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
+		.doit = nl80211_set_6ghz_power_mode,
+		.flags = GENL_UNS_ADMIN_PERM,
+		.internal_flags = IFLAGS(NL80211_FLAG_NEED_NETDEV |
+					 NL80211_FLAG_MLO_VALID_LINK_ID),
+	},

Why is this even a new command, rather than a parameter to start AP or
similar?

A new command was introduced because to give user space a knob to change power mode as and when required. Let's suppose AFC response has not yet arrived, AP could be started in Low Power mode. Now once AFC rules are applied (not going in detail here how that will happen) and user space
knows about it, it can send command to switch to Standard Power Mode right?


Why do we even set it in client mode from userspace?

  static struct genl_family nl80211_fam __ro_after_init = {
@@ -17409,7 +17473,7 @@ static struct genl_family nl80211_fam __ro_after_init = {
  	.n_ops = ARRAY_SIZE(nl80211_ops),
  	.small_ops = nl80211_small_ops,
  	.n_small_ops = ARRAY_SIZE(nl80211_small_ops),
-	.resv_start_op = NL80211_CMD_REMOVE_LINK_STA + 1,
+	.resv_start_op = NL80211_CMD_SET_6GHZ_POWER_MODE + 1,


Obviously, this should not be done.
If this hunk is not there, the command was not going through. Upon digging further found out that the number of commands declared in the array and the count provided here has some relation. And that too with the last element added. Since a new element was added, modified it accordingly.


But in any case, I don't think there's a lot of value in doing a
detailed review of the code if we haven't gotten a good grasp of the
semantics that you want.

johannes
Sure let me try to address all your comments and then come up with new version probably which clears the doubts. Anyways, thanks for your comments.

Aditya




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux