[Bug 382784] New: HAL doesn't see Wireless kill switch status correctly
https://bugzilla.novell.com/show_bug.cgi?id=382784 Summary: HAL doesn't see Wireless kill switch status correctly Product: openSUSE 11.0 Version: Factory Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: P5 - None Component: Network AssignedTo: dkukawka@novell.com ReportedBy: awafaa@opensuse.org QAContact: qa@suse.de Found By: --- I am having issues with NM connecting to wireless networks. As it stands now NM see the wireless adapter but insists that the killswitch is set to off. I have tried to enable/dsable the switch and still nothing. If I run "dbus-send --system --dest=org.freedesktop.Hal $UDI --print-reply org.freedesktop.Hal.Device.KillSwitch.GetPower" I get: fveult04:~ # dbus-send --system --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/ipw_wlan_switch --print-reply org.freedesktop.Hal.Device.KillSwitch.GetPower method return sender=:1.1 -> dest=:1.28767 reply_serial=2 int32 0 This is apparently the same issue I had with Bug 379050. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382784
User dkukawka@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c1
Danny Kukawka
https://bugzilla.novell.com/show_bug.cgi?id=382784
User awafaa@opensuse.org added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c2
Andrew Wafaa
https://bugzilla.novell.com/show_bug.cgi?id=382784
User awafaa@opensuse.org added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c3
--- Comment #3 from Andrew Wafaa
https://bugzilla.novell.com/show_bug.cgi?id=382784
User dkukawka@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c4
Danny Kukawka
https://bugzilla.novell.com/show_bug.cgi?id=382784
Danny Kukawka
https://bugzilla.novell.com/show_bug.cgi?id=382784
Danny Kukawka
https://bugzilla.novell.com/show_bug.cgi?id=382784
JP Rosevear
https://bugzilla.novell.com/show_bug.cgi?id=382784
User dcbw@redhat.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c5
Dan Williams
https://bugzilla.novell.com/show_bug.cgi?id=382784
User tambet@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c6
Tambet Ingo
https://bugzilla.novell.com/show_bug.cgi?id=382784
User dkukawka@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c7
Danny Kukawka
HAL needs to harvest rfkill input events that are simply input layer buttons and create an rfkill switch object in the device list for them
I don't see why HAL should track input events to disable/enable the killswitch. HAL already provide a killswitch object if available in the sysfs. NM (or maybe a desktop application) has to listen to the input events and has to react on them. I don't see a reason why hal should start to listen and handle input events. NM already handle the real killswitch objects (via HAL interfaces), why should hal now start to handle the other input events?
NM would enforce the _policy_ such that if that rfkill object's GetPower() method returned TRUE, NM would kill radios.
Why that? if GetPower() returns TRUE WLAN (or WWAN/Bluetooth) is already disabled. NM should IMO react on the already existing input events, disable the related interface and then call SetPower() if needed.
What I really, really don't want to have is that some rfkill devices go through HAL, but other rfkill devices go through NM.
There are AFAIK _no_ rfkill devices that go through HAL and other that go through NM. HAL provides only an interface to get/set the current state (which is maybe set by the machine itself if you use the rfkill switch). HAL never set the state without someone that called the interface.
They either need to _all_ go through HAL or all go through NM, and right now HAL is the place for all rfkill state, not NM.
They have to go through NM. No, right now HAL isn't the place for the state, HAL provide only an interface to get/set the state from sysfs and other places. Btw. if you want HAL to do this, provide a patch and discuss it upstream. ATM IMO NM should do the handling of the input events and should call HAL to set it to sysfs (or the other tools). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382784
User dcbw@redhat.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c8
--- Comment #8 from Dan Williams
HAL needs to harvest rfkill input events that are simply input layer buttons and create an rfkill switch object in the device list for them
I don't see why HAL should track input events to disable/enable the killswitch. HAL already provide a killswitch object if available in the sysfs.
Because the input events _are_ killswitch events. They are the same thing as the user flipping a switch on the laptop. To the user, it does not matter whether it's an input button Fn+F5, or whether it's a toggle switch somewhere. It's the same thing.
NM (or maybe a desktop application) has to listen to the input events and has to react on them. I don't see a reason why hal should start to listen and handle input events. NM already handle the real killswitch objects (via HAL interfaces), why should hal now start to handle the other input events?
And I don't see why there should be two places to handle the same thing: rfkill. There's still different driver interfaces in the kernel to handle rfkill, because some drivers (ipw2xxx and others) have custom rfkill handling and don't hook into the kernel's rfkill framework yet. HAL is a Hardware Abstraction Layer. rfkill keys are hardware, irregardless of whether they are a toggle switch or a keyboard button. And since there are multiple methods of handling rfkill (kernel rfkill, ipw2x00, input event, vendor-specific module like tpbuttons, fujitsu-laptop, etc) there needs to be a hardware abstraction around them until they all use the same kernel interface.
NM would enforce the _policy_ such that if that rfkill object's GetPower() method returned TRUE, NM would kill radios.
Why that? if GetPower() returns TRUE WLAN (or WWAN/Bluetooth) is already disabled. NM should IMO react on the already existing input events, disable the related interface and then call SetPower() if needed.
If you create a machine-wide rfkill switch that just handles input events, then NM would already handle that killswitch automatically just like it handles toggle killswitches. No changes needed to NetworkManager at all. The cases we are talking about are _also_ machines without toggle killswitches, where the _only_ rfkill method is a keyboard key.
What I really, really don't want to have is that some rfkill devices go through HAL, but other rfkill devices go through NM.
There are AFAIK _no_ rfkill devices that go through HAL and other that go through NM. HAL provides only an interface to get/set the current state (which is maybe set by the machine itself if you use the rfkill switch). HAL never set the state without someone that called the interface.
They either need to _all_ go through HAL or all go through NM, and right now HAL is the place for all rfkill state, not NM.
They have to go through NM. No, right now HAL isn't the place for the state, HAL provide only an interface to get/set the state from sysfs and other places.
No, they WILL NOT go through NetworkManager until there's a standard kernel or HAL interface for ALL rfkill items. It's completely insane to put the hardware abstraction for rfkill stuff in to NetworkManager, when that's exactly what HAL is supposed to be doing right now. There's a standard rfkill interface in HAL: let's use it, not re-implement rfkill in two different places.
Btw. if you want HAL to do this, provide a patch and discuss it upstream. ATM IMO NM should do the handling of the input events and should call HAL to set it to sysfs (or the other tools).
Yes, that's the path forward. Until rfkill methods are standardized with a consistent interface, NetworkManager is not going to talk to them directly. We're NOT going to have 3 different codepaths to handle rfkill in NetworkManager. I see no reason why input event rfkill keys are any different than toggle rfkill keys. How the event gets delivered from the kernel is completely irrelevant; whether it's a sysfs file or an input event does not matter. What matters is having a consistent API for clients of rfkill state (ie, NetworkManager, others). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382784
User dkukawka@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c9
--- Comment #9 from Danny Kukawka
Because the input events _are_ killswitch events. They are the same thing as the user flipping a switch on the laptop. To the user, it does not matter whether it's an input button Fn+F5, or whether it's a toggle switch somewhere. It's the same thing.
No, they are not the same (from the technical view). The keyboard input events are not the same as the real kill switch buttons. In the most cases of the real killswitch buttons go through the kernel and the hardware get disabled directly. The input events are different, because they need user interactions in many cases (e.g. if the input event isn't only for WLAN but also for bluetooth or WWAN. See for example ThinkPads and Fn+F5 where a tool from Lenovo ask the user what to diable WLAN or/and bluetooth).
And I don't see why there should be two places to handle the same thing: rfkill. There's still different driver interfaces in the kernel to handle rfkill, because some drivers (ipw2xxx and others) have custom rfkill handling and don't hook into the kernel's rfkill framework yet.
There are no different places currently. HAL never set the state of the rfkill. _NEVER_ without an other tool like NM that call hal to do so!
HAL is a Hardware Abstraction Layer. rfkill keys are hardware, irregardless of whether they are a toggle switch or a keyboard button. And since there are multiple methods of handling rfkill (kernel rfkill, ipw2x00, input event, vendor-specific module like tpbuttons, fujitsu-laptop, etc) there needs to be a hardware abstraction around them until they all use the same kernel interface.
This is what HAL already do. HAL provides an interface for e.g. NM to set the state back to sysfs/kernel. This is not the job of HAL, also because you need in several cases user interaction (see above).
If you create a machine-wide rfkill switch that just handles input events, then NM would already handle that killswitch automatically just like it handles toggle killswitches. No changes needed to NetworkManager at all. The cases we are talking about are _also_ machines without toggle killswitches, where the _only_ rfkill method is a keyboard key.
Looks as if you don't full understand what happens currently. Again: 1) HAL don't change the state of the rfkill. In some cases it's the kernel, in all other cases NM has to set the state via HAL if there is a event. 2) Why should HAL provide a machine-wide rfkill? There are different types of rfkill 'devices' (WLAN/WWAN/Bluetooth) and this is why HAL has more than one (if supported by the machine) rfkill device/interface. Also because you can have more than one WLAN/WWAN/Bluetooth card. In such cases you have to ask the user which of them (maybe all, maybe only WLAN or only Bluetooth) he would like to disable.
No, they WILL NOT go through NetworkManager until there's a standard kernel or HAL interface for ALL rfkill items. It's completely insane to put the hardware abstraction for rfkill stuff in to NetworkManager, when that's exactly what HAL is supposed to be doing right now. There's a standard rfkill interface in HAL: let's use it, not re-implement rfkill in two different places.
This all has nothing to do with hardware abstraction in NM. This all is _already_ abstracted in HAL. NM needs only to listen to the events and has to act on them. There is no need to abstract anything.
Yes, that's the path forward. Until rfkill methods are standardized with a consistent interface, NetworkManager is not going to talk to them directly.
AGAIN: THIS IS WHAT WE ALREADY HAVE! THERE IS ALREADY A standardized INTERFACE. READ THE HAL SPEC. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382784
User dcbw@redhat.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c10
--- Comment #10 from Dan Williams
(In reply to comment #8 from Dan Williams)
Because the input events _are_ killswitch events. They are the same thing as the user flipping a switch on the laptop. To the user, it does not matter whether it's an input button Fn+F5, or whether it's a toggle switch somewhere. It's the same thing.
No, they are not the same (from the technical view). The keyboard input events are not the same as the real kill switch buttons. In the most cases of the real killswitch buttons go through the kernel and the hardware get disabled directly. The input events are different, because they need user interactions
Direct hardware disable only happens in _some_ cases. In some cases it's a GPIO pin that the chip reads directly and notifies the driver. In other cases, the driver reads the value and disables rf. In other cases it's a laptop specific ACPI event. In yet other cases it's a straight input button. I know this.
in many cases (e.g. if the input event isn't only for WLAN but also for bluetooth or WWAN. See for example ThinkPads and Fn+F5 where a tool from Lenovo ask the user what to diable WLAN or/and bluetooth).
That's fine; you could still have a tool to do this if there was a system-wide killswitch in HAL. When the bit flips in HAL, you ask the user what they want to do.
And I don't see why there should be two places to handle the same thing: rfkill. There's still different driver interfaces in the kernel to handle rfkill, because some drivers (ipw2xxx and others) have custom rfkill handling and don't hook into the kernel's rfkill framework yet.
There are no different places currently. HAL never set the state of the rfkill. _NEVER_ without an other tool like NM that call hal to do so!
Since the input rfkill button is obviously not tied to a wireless device, there is nothing that SetPower() could or should do. It should simply return an exception when SetPower() is called. It should only report the state of the switch with GetPower(). And yes, there are different places for the rfkill events to come from. There's the kernel's rfkill framework, there's the ipw-specific rfkill stuff in the device's sysfs directory, there's ACPI events, and there's the input-layer buttons. That's 4 different places that rfkill information comes from. NetworkManager is NOT going to abstract these 4 different places. That's HAL's job.
HAL is a Hardware Abstraction Layer. rfkill keys are hardware, irregardless of whether they are a toggle switch or a keyboard button. And since there are multiple methods of handling rfkill (kernel rfkill, ipw2x00, input event, vendor-specific module like tpbuttons, fujitsu-laptop, etc) there needs to be a hardware abstraction around them until they all use the same kernel interface.
This is what HAL already do. HAL provides an interface for e.g. NM to set the state back to sysfs/kernel. This is not the job of HAL, also because you need in several cases user interaction (see above).
But it doesn't provide an abstraction for _all_ rfkill buttons. Again, HAL would provide the state of the button, but not the policy. The "user interaction" you talk about is the Policy, and that's fine to handle with NetworkManager. But NetworkManager is not going to provide the abstraction, since that's HAL's job. NM would certainly turn off the radios if the GetPower() call on this virtual killswitch was FALSE. NM would not call SetPower() on the device, because as you state, HAL has no idea how to handle that. Again, the _state_ should be handled in HAL. The _policy_ should be handled in NM. Whether the button is on or off is state, and what to do about that state when it changes is policy.
If you create a machine-wide rfkill switch that just handles input events, then NM would already handle that killswitch automatically just like it handles toggle killswitches. No changes needed to NetworkManager at all. The cases we are talking about are _also_ machines without toggle killswitches, where the _only_ rfkill method is a keyboard key.
Looks as if you don't full understand what happens currently. Again:
I completely understand what happens.
1) HAL don't change the state of the rfkill. In some cases it's the kernel, in all other cases NM has to set the state via HAL if there is a event.
I don't expect HAL to turn the power on and off. I simply expect HAL to report the current power state of the rfkill button (either on or off).
2) Why should HAL provide a machine-wide rfkill? There are different types of rfkill 'devices' (WLAN/WWAN/Bluetooth) and this is why HAL has more than one (if supported by the machine) rfkill device/interface. Also because you can have more than one WLAN/WWAN/Bluetooth card. In such cases you have to ask the user which of them (maybe all, maybe only WLAN or only Bluetooth) he would like to disable.
Again, I don't expect HAL to handle SetPower() for virtual rfkill buttons. I only expect HAL to report the GetPower() state for the virtual buttons. Obviously something like NetworkManager will handle the policy and user interaction once the user turns the switch off. But NM has to know that the switch got turned off in the _first_ place, and that's the job of the Hardware Abstraction Layer to report. Once NM knows the power state changed, NM can ask the user just what they want to turn off, and do it. HAL would not be involved in actually turning off anything.
No, they WILL NOT go through NetworkManager until there's a standard kernel or HAL interface for ALL rfkill items. It's completely insane to put the hardware abstraction for rfkill stuff in to NetworkManager, when that's exactly what HAL is supposed to be doing right now. There's a standard rfkill interface in HAL: let's use it, not re-implement rfkill in two different places.
This all has nothing to do with hardware abstraction in NM. This all is _already_ abstracted in HAL. NM needs only to listen to the events and has to act on them. There is no need to abstract anything.
rfkill is not fully abstracted in HAL, because HAL doesn't handle all the different types of rfkill switches yet. Not all laptop-specific modules (like tpbuttons, fujitsu-laptop, toshiba-laptop, etc) have been converted to use the kernel's rfkill layer. HAL doesn't handle input-layer rfkill buttons. Some drivers like ipw2x00 don't use the in-kernel rfkill layer. Therefore it's not abstracted, since HAL doesn't completely abstract it.
Yes, that's the path forward. Until rfkill methods are standardized with a consistent interface, NetworkManager is not going to talk to them directly.
AGAIN: THIS IS WHAT WE ALREADY HAVE! THERE IS ALREADY A standardized INTERFACE. READ THE HAL SPEC.
I have read the HAL spec. I understand it. And HAL doesn't abstract input-layer rfkill buttons that are not tied to a specific hardware device. Remember, just because there's a switch on the laptop _doesn't_ mean that it disables the device in hardware when the switch is flipped. That only happens on some latops. The rfkill devices exposed in HAL are already system-wide rfkill switches, because some laptops don't tie the killswitch to a specific device. Therefore, it's exactly the same sort of thing as an input-layer rfkill switch, which is also system wide. Remember: HAL rfkill button objects are _not_ tied to a specific hardware device; some just happen to be, but that was never the intention becuase it's just not possible. Again, the path forward is to create a virtual, system-wide rfkill switch object in HAL, that responds to GetPower() but returns an exception on SetPower(), and consumes input-layer rfkill events. It should toggle the GetPower() state of the object accordingly when the switch is pressed. Things like NM can then get the events, and act on them as necessary. HAL would not have to care about what specific devices get enabled/disabled. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382784
User dcbw@redhat.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c11
--- Comment #11 from Dan Williams
https://bugzilla.novell.com/show_bug.cgi?id=382784
User dkukawka@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c12
--- Comment #12 from Danny Kukawka
I should note that NM never has may never call SetPower(), for a few reasons:
If NM don't call SetPower() also GetPower() make no sense, since the state get never set back to the card or the sysfs. HAL can't tell you the correct state then. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382784
User dcbw@redhat.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c13
--- Comment #13 from Dan Williams
HAL don't need a "system-wide rfkill switch object" since there can be more than one rfkill (for different devices) and they can't and shouldn't go through one object. This make no sense.
I never said only _one_ killswitch object. There would be one for the toggle-switch if present, and one for input buttons. For example: my T41 doesn't have a toggle switch, but does have an ipw2200 which is perfectly capable of rfkill. I therefore have an "ipw" killswitch. But I also have Fn+F5, which should be represented as a _second_ killswitch that traps all input rfkill events. With this setup, NetworkManager can do the right thing.
And since the kernel send e.g. no events if you use a "real" rfkill switch HAL don't get any info if the state change. And for the other events you get
Right; you'll only get a button press. So HAL would store the power state for that button. When the button gets pressed, HAL toggles the power state and emits a signal for the power state change.
information from HAL (as e.g. IBM ACPI events which don't go through the input layer) or the input layer. NM needs only to listen to the input layer and HAL. And since NM already listen to HAL it shouldn't be rocket science to listen also to the input layer to get the other events.
But NM shouldn't have to listen to the input layer since that button state can also be handled by HAL transparently.
If there are rfkill types not supported by GetPower() (which returns the current state) you have to provide the information to add them to the existing HAL structure/script and they get supported.
Right; we should provide an input-layer rfkill button object for hal that works as I've described.
If there are rfkill-buttons which don't have a specific hardware device, how should HAL be able to get (and provide information) about the actual state of the button? Should HAL guess it? AFAIK the keyboard buttons have no state, you can't get information about the state.
HAL tracks the button presses of the item and toggles the power state accordingly. What the default state is when HAL starts, or whether that state gets save across reboots, I'm not sure.
The keyboard button event doesn't mean neccessary that the rfkill state change. Since a event don't neccessary mean that e.g. the state for WLAN rfkill change if you e.g. disable only WWAN/Bluetooth on the event (because of the user interaction). It make IMO no sense to do this in HAL since only NM can know the correct state in this case.
Remember; HAL isn't tracking _device_ state with this killswitch, it would only be tracking _button_ state. It's up to the consumer of the killswitch state in HAL to decide whether that on/off state applies to WWAN, BT, Wifi, or whatever. Obviously HAL shouldn't be in that business. But it should be in the business of reporting the _button_ state so that NM can disable the radios of the devices that NM has associated with the button.
(In reply to comment #11 from Dan Williams)
I should note that NM never has may never call SetPower(), for a few reasons:
If NM don't call SetPower() also GetPower() make no sense, since the state get never set back to the card or the sysfs. HAL can't tell you the correct state then.
No, GetPower() reports the _switch_ state for most items, and in the other cases NM will be disabling the radios via SIOCSIWTXPOW for wifi and otherwise for BT and WWAN. If the driver doesn't update it's rfkill state accordingly, then the driver needs to be fixed. Also, remember that not all devices are directly tied to the hardware. So calling SetPower() on a device with an ACPI-reported button doesn't do anything, because it's just a button and has no interface to the wireless device anyway. It's still up to NM to proxy that state back down to the wireless device. Even if you set up scripts in HAL to handle this, how would HAL know which device to take down? There's no sysfs mapping for the device and the rfkill thing because there _is_ no rfkill button for the device since it's an independent ACPI thing. Also, who knows what type of wifi card you have and therefore how to disable it in HAL? I could put an ipw card into the machine, and then you need to write values to the /sys/class/net/eth1/device/rfkill, or I could put a bcm43xx card into the box, and then you need to do something else. HAL + callouts just can't handle SetPower() in all cases. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382784
User dkukawka@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c14
--- Comment #14 from Danny Kukawka
(In reply to comment #12 from Danny Kukawka)
If there are rfkill-buttons which don't have a specific hardware device, how should HAL be able to get (and provide information) about the actual state of the button? Should HAL guess it? AFAIK the keyboard buttons have no state, you can't get information about the state.
HAL tracks the button presses of the item and toggles the power state accordingly. What the default state is when HAL starts, or whether that state gets save across reboots, I'm not sure.
If HAL can't find out the correct state on startup, the state will we ALLWAYS wrong, if the initial state isn't correct. Guessing the current state is a no-go. And that's why the whole discussion make no sense because HAL shouldn't provide any unreliable information. And if you use SIOCSIWTXPOW to control the state of WLAN HAL also can't know the correct state. Btw. You are obviously wrong: The current rfkill interface/method don't tell the state of the button or switch, it tells you the state of the radio (from HAL SPEC: "This interface provides a mechanism for both querying whether a radio is on as well as turning it on and off.") IMO we have NM (and removed network stuff from HAL) because NM is the network abstraction layer. Because of this NM should also listen the input layer (and HAL) and handle all the network related stuff like the network related buttons. Only NM can know the correct state of the radio, HAL can't. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382784
User dcbw@redhat.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c15
--- Comment #15 from Dan Williams
(In reply to comment #13 from Dan Williams)
(In reply to comment #12 from Danny Kukawka)
If there are rfkill-buttons which don't have a specific hardware device, how should HAL be able to get (and provide information) about the actual state of the button? Should HAL guess it? AFAIK the keyboard buttons have no state, you can't get information about the state.
HAL tracks the button presses of the item and toggles the power state accordingly. What the default state is when HAL starts, or whether that state gets save across reboots, I'm not sure.
If HAL can't find out the correct state on startup, the state will we ALLWAYS wrong, if the initial state isn't correct. Guessing the current state is a no-go. And that's why the whole discussion make no sense because HAL shouldn't provide any unreliable information.
No, the state won't always be wrong. You assume a default saved state, which is exactly what NM would be doing anyway. NM isn't going to store the rfkill state, NM is going to start the radios powered up until the user or some other process tells NM to rfkill them. The _only_ way you know the state of the radio is if there is a toggle switch on the laptop that the user has switched to "off".
And if you use SIOCSIWTXPOW to control the state of WLAN HAL also can't know the correct state.
Wrong; current ipw drivers set the rfkill state to "softkill" (1) when you set txpower off. When the user flips the hardkill switch, it sets the state to "hardkill" (2). Read the rfkill sysfs file to get the current state. But HAL doesn't distinguish between soft and hard kill, which is a bug in HAL that we need to fix anyway. If the driver is softkilled via WEXT, it needs to notify userspace that it has been softkilled. There are really 3 states: RF On, RF Softkilled, RF hardkilled. Drivers need to handle all 3.
Btw. You are obviously wrong: The current rfkill interface/method don't tell the state of the button or switch, it tells you the state of the radio (from HAL SPEC: "This interface provides a mechanism for both querying whether a radio is on as well as turning it on and off.")
The spec does not reflect reality. Again, not every killswitch is directly related to a hardware radio, so how could the killswitch _possibly_ reflect the state of the radio???? It only reflects radio state for _some_ devices, those where the rfkill state is directly handled by the hardware device and driver.
IMO we have NM (and removed network stuff from HAL) because NM is the network abstraction layer. Because of this NM should also listen the input layer (and HAL) and handle all the network related stuff like the network related buttons. Only NM can know the correct state of the radio, HAL can't.
Wrong. The driver knows the correct radio state, whether it's on or off. And the kernel can/should know about hardware button state too. Sometimes that's tied to the radio state, sometimes its not tied to the radio state. If the radio state was tied to a specific device as you keep saying, why wouldn't it be a property on the actual wifi device itself instead of a property on the rfkill button object? They are rfkill _switch_ objects in the HAL GDL, _not_ radio objects. The way to clean this up is to: 1) Put radio state on the actual radio devices themselves; the WWAN/BT/WIFI/WIMAX device would have a 'rf.radio.state' parameter of 0 (on), 1 (softkill), or 2 (hardkill) 2) Fix the spec to state that the rfkill button objects don't reflect radio state, but instead the button state 3) Remove the SetPower() method on the rfkill button objects 4) Add a SetState() call to the network device to set the state to 0 (on) or 1 (softkill); since 2 is a hardkill the radio obviously cannot be taken out of state 2 except by a physical user interaction over which the software has no control -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382784
User dkukawka@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c16
--- Comment #16 from Danny Kukawka
(In reply to comment #14 from Danny Kukawka) [...] No, the state won't always be wrong.
Oh, yes it wouldn't be always wrong ... only in 50% of the cases if you assume two possible states.
You assume a default saved state, which is exactly what NM would be doing anyway.
You can't assume some random default state if the device is diabled or enabled. That would only produce unreliable and possible wrong information.
NM isn't going to store the rfkill state, NM is going to start the radios powered up until the user or some other process tells NM to rfkill them.
I don't want NM to power up any device only to set it to a default state. If I disable WLAN under windows or an other Linux session I want to have it disabled also if I boot my actual Linux. The state should not change and it should be also the same over a reboot or shutdown/boot cycle. One example: I sit in a plane and disabled the WLAN in the airport, then I reboot in the airplane: I don't want NM or HAL to enable the WLAN again only to get a default state. Thats wrong behavior.
The _only_ way you know the state of the radio is if there is a toggle switch on the laptop that the user has switched to "off".
Then the state is possibly wrong until the user toggle the switch. Thats no option.
Btw. You are obviously wrong: The current rfkill interface/method don't tell the state of the button or switch, it tells you the state of the radio (from HAL SPEC: "This interface provides a mechanism for both querying whether a radio is on as well as turning it on and off.")
The spec does not reflect reality. Again, not every killswitch is directly related to a hardware radio, so how could the killswitch _possibly_ reflect the state of the radio???? It only reflects radio state for _some_ devices, those where the rfkill state is directly handled by the hardware device and driver.
It does not matter if the spec reflect the reality. It reflects what is described in the spec. And the description is clear. Also because this is for the already existing devices in HAL which all work the same AFAIK. GetPower() returns the state that is set in sysfs or the bios (in the case of the Dell machines) for the currently supported devices. There is nothing wrong in the specification of HAL. The SPEC is not wrong only because you want something different than the current situation.
IMO we have NM (and removed network stuff from HAL) because NM is the network abstraction layer. Because of this NM should also listen the input layer (and HAL) and handle all the network related stuff like the network related buttons. Only NM can know the correct state of the radio, HAL can't.
Wrong. The driver knows the correct radio state, whether it's on or off. And the kernel can/should know about hardware button state too. Sometimes that's tied to the radio state, sometimes its not tied to the radio state.
But this don't change the fact that NM is the abstraction layer for network.
If the radio state was tied to a specific device as you keep saying, why wouldn't it be a property on the actual wifi device itself instead of a property on the rfkill button object?
Because there is currently no state property for such devices! There is only a DBus method to get the current state of the radio.
They are rfkill _switch_ objects in the HAL GDL, _not_ radio objects.
Doesn't matter. What matters is actually what is written in the spec.
The way to clean this up is to:
1) Put radio state on the actual radio devices themselves; the WWAN/BT/WIFI/WIMAX device would have a 'rf.radio.state' parameter of 0 (on), 1 (softkill), or 2 (hardkill)
That's not possible for all keyboard buttons, because HAL don't know if the keyboard button has to handle WLAN or/and other radio devices. And adding a device to any radio make also no sense because you can have more than the internal radio devices (and you can detect if a internal UMTS USB card is internal or external) and keyboard button don't need to affect neccessarly the external (USB/PCMCIA/IR) devices (or the user want to differ between internal and external devices). What's if the system has more than one WLAN or bluetooth device? Adding the same keyboard botton to both? What if both devices are in different states? ...
2) Fix the spec to state that the rfkill button objects don't reflect radio state, but instead the button state
That would break the current behavior.
3) Remove the SetPower() method on the rfkill button objects
Why? Maybe an other application than NM wants to set the sysfs attributes also!
4) Add a SetState() call to the network device to set the state to 0 (on) or 1 (softkill); since 2 is a hardkill the radio obviously cannot be taken out of state 2 except by a physical user interaction over which the software has no control
Btw. It make no sense to continue the discussion. The current HAL is maybe not perfect, but what HAL currently do, as in the spec described, is correct. NM could simply listen to the input layer (this is no rocket science!) for now to fix the problem for the current product. If HAL get ever changed it would not be for the current product (openSUSE 11.0). Discuss this in the upstream bugzilla. The discussion ends for me here. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382784
User dkukawka@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c17
--- Comment #17 from Danny Kukawka
https://bugzilla.novell.com/show_bug.cgi?id=382784
User dcbw@redhat.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c18
--- Comment #18 from Dan Williams
And btw. it's not the job of HAL to do network device specific handling like WEXT or SIOCSIWTXPOW or anything other that's not the sysfs (or e.g. the Dell handling) since we have NM for it. That's why we removed network related stuff from HAL: it's the job of NM. There is no reason to move it back. This all should IMO be done in NM and not HAL.
Nowhere in this discussion have I ever said that HAL should touch the wireless devices themselves with WEXT. That is, and has always been, the job of NetworkManager. I simply want HAL to consistently report the state of rfkill buttons so that _NM_ can do the WEXT poking. HAL should abstract the vendor/device specific rfkill button states, not the device stuff. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382784
User trenn@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c19
Thomas Renninger
https://bugzilla.novell.com/show_bug.cgi?id=382784
User awafaa@opensuse.org added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c20
--- Comment #20 from Andrew Wafaa
https://bugzilla.novell.com/show_bug.cgi?id=382784
User dfabian@quick.cz added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c21
David Fabian
https://bugzilla.novell.com/show_bug.cgi?id=382784
User awafaa@opensuse.org added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c22
--- Comment #22 from Andrew Wafaa
https://bugzilla.novell.com/show_bug.cgi?id=382784
User dfabian@quick.cz added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c23
--- Comment #23 from David Fabian
https://bugzilla.novell.com/show_bug.cgi?id=382784
User jnelson-suse@jamponi.net added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c24
Jon Nelson
https://bugzilla.novell.com/show_bug.cgi?id=382784
User bidossessi.sodonon@yahoo.fr added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c25
Bidossessi SODONON
https://bugzilla.novell.com/show_bug.cgi?id=382784
User trenn@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c26
--- Comment #26 from Thomas Renninger
https://bugzilla.novell.com/show_bug.cgi?id=382784
User dcbw@redhat.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c27
--- Comment #27 from Dan Williams
https://bugzilla.novell.com/show_bug.cgi?id=382784
User jnelson-suse@jamponi.net added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c28
--- Comment #28 from Jon Nelson
https://bugzilla.novell.com/show_bug.cgi?id=382784
User dkukawka@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=382784#c29
Danny Kukawka
participants (1)
-
bugzilla_noreply@novell.com