On Tue, Aug 25, 2009 at 10:27 AM, Johannes Berg<johannes@xxxxxxxxxxxxxxxx> wrote: > On Tue, 2009-08-25 at 06:51 +0000, Hin-Tak Leung wrote: > >> dmesg and rfkill/state corresponds exactly to what the sliding switch >> does (in the on position, dmesg says it is on, states says 2, in the >> off position, dmesg says it is off, state says 1). NM basically >> ignores rfkill/state, and just if'up the device whenever it notices >> the device has gone down. > > NM can't ignore the state since cfg80211 enforces it. > > Can you please use rfkill (http://git.sipsolutions.net/rfkill.git) to > see what's going on? Like print out events while you slide the button > and use NM etc. > > One thing that would be possible -- does your poll callback work while > the interface is down? Try to tell NM to turn off the wireless network, > and see whether the state ever changes with your slider. -------------------- [root@localhost rfkill]# ./rfkill list 0: (null): Wireless LAN Soft blocked: no Hard blocked: no [root@localhost rfkill]# ./rfkill event RFKILL event: idx 0 type 1 op 0 soft 0 hard 0 RFKILL event: idx 0 type 1 op 2 soft 0 hard 1 RFKILL event: idx 0 type 1 op 2 soft 0 hard 0 RFKILL event: idx 0 type 1 op 2 soft 0 hard 1 RFKILL event: idx 0 type 1 op 2 soft 0 hard 0 RFKILL event: idx 0 type 1 op 2 soft 0 hard 1 RFKILL event: idx 0 type 1 op 2 soft 0 hard 0 RFKILL event: idx 0 type 1 op 2 soft 0 hard 1 RFKILL event: idx 0 type 1 op 2 soft 0 hard 0 RFKILL event: idx 0 type 1 op 2 soft 0 hard 1 RFKILL event: idx 0 type 1 op 2 soft 0 hard 0 RFKILL event: idx 0 type 1 op 2 soft 0 hard 1 RFKILL event: idx 0 type 1 op 2 soft 0 hard 0 RFKILL event: idx 0 type 1 op 2 soft 0 hard 1 RFKILL event: idx 0 type 1 op 2 soft 0 hard 0 RFKILL event: idx 0 type 1 op 2 soft 0 hard 1 RFKILL event: idx 0 type 1 op 2 soft 0 hard 0 RFKILL event: idx 0 type 1 op 2 soft 0 hard 1 ^C [root@localhost rfkill]# ./rfkill list 0: (null): Wireless LAN Soft blocked: no Hard blocked: yes [root@localhost rfkill]# ./rfkill list 0: (null): Wireless LAN Soft blocked: no Hard blocked: no -------------- The rfkill event hard just goes 1 and 0 whenever I slide the switch, regardless of what NM does . e.g. NM set to disable networking has no effect on the 1/0 switch (it happens just depending on the slide switch and nothing else), and nothing changes when NM noticed rfkill'ed if down & decided to if'up and reassociate. Basically the rfkill event state just depends on the slide switch, regardless of NM (if it is set to enable wireless networking, it just if up the device again; if it is set to disable, it just stayed disable & the device stay down, but the event state continues to respond to the slide switch). -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html