On 2018-11-09 17:34, Johannes Berg wrote:
On Fri, 2018-10-19 at 14:42 +0530, Sriram R wrote:
[...]

This looks fine, but I think it would be nice to have some extended
netlink error reporting for at least some of these errors:

Sure Johannes, I'll add them in the next patch revision.
+       dfs_region = reg_get_dfs_region(wiphy);
+       if (dfs_region == NL80211_DFS_UNSET)
+               return -EINVAL;
+
+       err = nl80211_parse_chandef(rdev, info, &chandef);
+       if (err)
+               return err;
+
+       err = cfg80211_chandef_dfs_required(wiphy, &chandef, wdev->iftype);
+       if (err < 0)
+               return err;
+
+       if (err == 0)
+               return -EINVAL;
+
+       /* Do not process this notification if radar is already detected
+        * by kernel on this channel
+        */
+       if (chandef.chan->dfs_state == NL80211_DFS_UNAVAILABLE)
+               return -EINVAL;

And maybe that last one should just return 0?
You're right. I'll return success here.
Thanks,
Sriram.R


johannes

Reply via email to