-2

I can't understand one thing in net/wireless/nl80211.c file starting from kernel 3.13. Why there is following if statement in nl80211_start_radar_detection():

if (netif_carrier_ok(dev)) {
    return -EBUSY;
}

From what I understand this means that we cannot start radar detection if our driver carrier is ready. Why? Shouldn't that be

if (!netif_carrier_ok(dev)) {
    return -EBUSY;
}

Thanks

Miza
  • 1
  • Many functions in the Unix and POSIX world return zero on success, and a negative number on failure. Maybe if you check what `netif_carrier_ok` does and what it returns you will find out better (and faster!) than just posting here? – Some programmer dude Oct 20 '16 at 13:22
  • I already did that, thats exactly why I ask the question – Miza Oct 20 '16 at 13:25
  • @Someprogrammerdude, netif_carier_ok returns `bool`. Would be really strange if 0 meant success. –  Oct 20 '16 at 13:55
  • 1
    My guess would be that the function you look at can only be called when the WiFi interface is not in use for actual networking –  Oct 20 '16 at 13:57

1 Answers1

0

nl80211_start_radar_detection() :- this will start radar detection and will move from channel if radar is detected .

but here netif_carrier_ok(dev) , checking that device support that carrier or not or can my device operate on that channel and if not return with error.

no need to proceed future and check for radar.

SHASHI BHUSAN
  • 612
  • 6
  • 12