Hello,
On 8/23/24 12:42, Johannes Berg wrote:
On Fri, 2024-08-16 at 16:24 +0200, Issam Hamdi wrote:
@@ -10143,7 +10143,23 @@ static int nl80211_start_radar_detection(struct sk_buff *skb,
err = rdev_start_radar_detection(rdev, dev, &chandef, cac_time_ms);
if (!err) {
- wdev->links[0].ap.chandef = chandef;
+ switch (wdev->iftype) {
+ case NL80211_IFTYPE_MESH_POINT:
+ wdev->u.mesh.chandef = chandef;
+ break;
+ case NL80211_IFTYPE_ADHOC:
+ wdev->u.ibss.chandef = chandef;
+ break;
+ case NL80211_IFTYPE_OCB:
+ wdev->u.ocb.chandef = chandef;
+ break;
OCB cannot even get to this code given earlier conditions, why are you
adding it here?
Actually I didn't test it with OCB mode, I added the check on the
different modes to make sure that the function "wdev_chandef" return a
no NULL chandef for the different modes.
I will remove the check on the OCB mode, if it will impact other
implementation.
I guess this should conflict:
https://lore.kernel.org/linux-wireless/20240711035147.1896538-1-quic_adisi@xxxxxxxxxxx/
but it's probably not too hard to resolve that.
johannes
Issam