Search Linux Wireless

Re: [PATCH] mac80211: support FTM responder configuration/statistics

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

 




I just realized that this is broken in nl80211_channel_switch() and
ieee80211_set_csa_beacon(), doing a CSA will always disable FTM unless
it was actually included in the new configuration.
Hi Johannes

oops..Yes, there is a bug in the patch. The code below, I think, must fix this issue.
Please let me know your comments..

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 51622333d460..70d6de29425b 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2934,19 +2934,20 @@ static int ieee80211_start_radar_detection(struct wiphy *wiphy,
                memcpy(pos, beacon->probe_resp, beacon->probe_resp_len);
                pos += beacon->probe_resp_len;
        }
-       if (beacon->ftm_responder)
+       if (beacon->ftm_responder != -1) {
                new_beacon->ftm_responder = beacon->ftm_responder;
-       if (beacon->lci) {
-               new_beacon->lci_len = beacon->lci_len;
-               new_beacon->lci = pos;
-               memcpy(pos, beacon->lci, beacon->lci_len);
-               pos += beacon->lci_len;
-       }
-       if (beacon->civicloc) {
-               new_beacon->civicloc_len = beacon->civicloc_len;
-               new_beacon->civicloc = pos;
-               memcpy(pos, beacon->civicloc, beacon->civicloc_len);
-               pos += beacon->civicloc_len;
+               if (beacon->lci) {
+                       new_beacon->lci_len = beacon->lci_len;
+                       new_beacon->lci = pos;
+                       memcpy(pos, beacon->lci, beacon->lci_len);
+                       pos += beacon->lci_len;
+               }
+               if (beacon->civicloc) {
+                       new_beacon->civicloc_len = beacon->civicloc_len;
+                       new_beacon->civicloc = pos;
+ memcpy(pos, beacon->civicloc, beacon->civicloc_len);
+                       pos += beacon->civicloc_len;
+               }
        }

        return new_beacon;



Doing the trivial thing:

 	memset(&params, 0, sizeof(params));
+	params.beacon_after.ftm_responder = -1;
This would not be needed then.

in nl80211_channel_switch() will not help because then mac80211 will
lose all the extra configuration, and will actually store -1 into its
enabled value which is really strange.

I'd appreciate if you could take a look at this.

Thanks,
johannes



[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