On Saturday 12 April 2008, Henrique de Moraes Holschuh wrote:
No your original comment was clear enough, what I meant is that
the radio of the added switch is set to the state which is currently global
for that particular type.
So when there already is a switch of that type present, then the value
will be set to the state of the first registered switch (either ON or OFF).
When no similar switch is present then it will be set to ON.
This is already implemented, the part that is missing is that for the first
added device it doesn't listen to the state of the hardware switch/button.
That I the issue that should be addressed with this patch:
- rfkill loads, sets initial state to UNDEFINED/UNITIALIZED
- driver with key X loads
- key X is registered to rfkill, driver provides current state in rfkill->state field
- rfkill checks global state with new state
- if global state is UNDEFINED, then global state = rfkill->state
- if global state == rfkill->state happy rfkill, nothing to do
- if global state != rfkill->state change global state, toggle all radios
The state UNDEFINED/UNITIALIZED would in this case be a new state which should
be the default state during initialization.
Ok, for those devices we should set the default state to OFF _unless_
other devices of the same type are already present in which case the
default state should be set to the current global state for that type.
Agreed, but having all those module parameters gathered into a single
module isn't a sound option either.
agreed.
That and my suggestion above about state checking during rfkill registration
would indeed improve things.
If the above is too much to have it included in time for 2.6.26, I would
say the default to offline. But that is personal preference and I won't NACK
either solution. So I let you choose this one. :)
Ivo
--