1. 22 7月, 2009 1 次提交
  2. 09 7月, 2009 1 次提交
  3. 19 6月, 2009 2 次提交
    • A
      rfkill: export persistent attribute in sysfs · 464902e8
      Alan Jenkins 提交于
      This information allows userspace to implement a hybrid policy where
      it can store the rfkill soft-blocked state in platform non-volatile
      storage if available, and if not then file-based storage can be used.
      
      Some users prefer platform non-volatile storage because of the behaviour
      when dual-booting multiple versions of Linux, or if the rfkill setting
      is changed in the BIOS setting screens, or if the BIOS responds to
      wireless-toggle hotkeys itself before the relevant platform driver has
      been loaded.
      Signed-off-by: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      Acked-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      464902e8
    • A
      rfkill: don't restore software blocked state on persistent devices · 06d5caf4
      Alan Jenkins 提交于
      The setting of the "persistent" flag is also made more explicit using
      a new rfkill_init_sw_state() function, instead of special-casing
      rfkill_set_sw_state() when it is called before registration.
      
      Suspend is a bit of a corner case so we try to get away without adding
      another hack to rfkill-input - it's going to be removed soon.
      If the state does change over suspend, users will simply have to prod
      rfkill-input twice in order to toggle the state.
      
      Userspace policy agents will be able to implement a more consistent user
      experience.  For example, they can avoid the above problem if they
      toggle devices individually.  Then there would be no "global state"
      to get out of sync.
      
      Currently there are only two rfkill drivers with persistent soft-blocked
      state.  thinkpad-acpi already checks the software state on resume.
      eeepc-laptop will require modification.
      Signed-off-by: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      CC: Marcel Holtmann <marcel@holtmann.org>
      Acked-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      06d5caf4
  4. 11 6月, 2009 2 次提交
    • A
      rfkill: don't impose global states on resume (just restore the previous states) · 908209c1
      Alan Jenkins 提交于
      Once rfkill-input is disabled, the "global" states will only be used as
      default initial states.
      
      Since the states will always be the same after resume, we shouldn't
      generate events on resume.
      Signed-off-by: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      908209c1
    • A
      rfkill: remove set_global_sw_state · b3fa1329
      Alan Jenkins 提交于
      rfkill_set_global_sw_state() (previously rfkill_set_default()) will no
      longer be exported by the rewritten rfkill core.
      
      Instead, platform drivers which can provide persistent soft-rfkill state
      across power-down/reboot should indicate their initial state by calling
      rfkill_set_sw_state() before registration.  Otherwise, they will be
      initialized to a default value during registration by a set_block call.
      
      We remove existing calls to rfkill_set_sw_state() which happen before
      registration, since these had no effect in the old model.  If these
      drivers do have persistent state, the calls can be put back (subject
      to testing :-).  This affects hp-wmi and acer-wmi.
      
      Drivers with persistent state will affect the global state only if
      rfkill-input is enabled.  This is required, otherwise booting with
      wireless soft-blocked and pressing the wireless-toggle key once would
      have no apparent effect.  This special case will be removed in future
      along with rfkill-input, in favour of a more flexible userspace daemon
      (see Documentation/feature-removal-schedule.txt).
      
      Now rfkill_global_states[n].def is only used to preserve global states
      over EPO, it is renamed to ".sav".
      Signed-off-by: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      Acked-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      b3fa1329
  5. 10 6月, 2009 1 次提交
  6. 04 6月, 2009 3 次提交
    • J
      rfkill: add function to query state · 6081162e
      Johannes Berg 提交于
      Sometimes it is necessary to know how the state is,
      and it is easier to query rfkill than keep track of
      it somewhere else, so add a function for that. This
      could later be expanded to return hard/soft block,
      but so far that isn't necessary.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      6081162e
    • J
      rfkill: create useful userspace interface · c64fb016
      Johannes Berg 提交于
      The new code added by this patch will make rfkill create
      a misc character device /dev/rfkill that userspace can use
      to control rfkill soft blocks and get status of devices as
      well as events when the status changes.
      
      Using it is very simple -- when you open it you can read
      a number of times to get the initial state, and every
      further read blocks (you can poll) on getting the next
      event from the kernel. The same structure you read is
      also used when writing to it to change the soft block of
      a given device, all devices of a given type, or all
      devices.
      
      This also makes CONFIG_RFKILL_INPUT selectable again in
      order to be able to test without it present since its
      functionality can now be replaced by userspace entirely
      and distros and users may not want the input part of
      rfkill interfering with their userspace code. We will
      also write a userspace daemon to handle all that and
      consequently add the input code to the feature removal
      schedule.
      
      In order to have rfkilld support both kernels with and
      without CONFIG_RFKILL_INPUT (or new kernels after its
      eventual removal) we also add an ioctl (that only exists
      if rfkill-input is present) to disable rfkill-input.
      It is not very efficient, but at least gives the correct
      behaviour in all cases.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Acked-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      c64fb016
    • J
      rfkill: rewrite · 19d337df
      Johannes Berg 提交于
      This patch completely rewrites the rfkill core to address
      the following deficiencies:
      
       * all rfkill drivers need to implement polling where necessary
         rather than having one central implementation
      
       * updating the rfkill state cannot be done from arbitrary
         contexts, forcing drivers to use schedule_work and requiring
         lots of code
      
       * rfkill drivers need to keep track of soft/hard blocked
         internally -- the core should do this
      
       * the rfkill API has many unexpected quirks, for example being
         asymmetric wrt. alloc/free and register/unregister
      
       * rfkill can call back into a driver from within a function the
         driver called -- this is prone to deadlocks and generally
         should be avoided
      
       * rfkill-input pointlessly is a separate module
      
       * drivers need to #ifdef rfkill functions (unless they want to
         depend on or select RFKILL) -- rfkill should provide inlines
         that do nothing if it isn't compiled in
      
       * the rfkill structure is not opaque -- drivers need to initialise
         it correctly (lots of sanity checking code required) -- instead
         force drivers to pass the right variables to rfkill_alloc()
      
       * the documentation is hard to read because it always assumes the
         reader is completely clueless and contains way TOO MANY CAPS
      
       * the rfkill code needlessly uses a lot of locks and atomic
         operations in locked sections
      
       * fix LED trigger to actually change the LED when the radio state
         changes -- this wasn't done before
      Tested-by: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
      Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> [thinkpad]
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      19d337df
  7. 23 4月, 2009 2 次提交
  8. 13 12月, 2008 1 次提交
  9. 26 11月, 2008 1 次提交
    • H
      rfkill: preserve state across suspend · f80b5e99
      Henrique de Moraes Holschuh 提交于
      The rfkill class API requires that the driver connected to a class
      call rfkill_force_state() on resume to update the real state of the
      rfkill controller, OR that it provides a get_state() hook.
      
      This means there is potentially a hidden call in the resume code flow
      that changes rfkill->state (i.e. rfkill_force_state()), so the
      previous state of the transmitter was being lost.
      
      The simplest and most future-proof way to fix this is to explicitly
      store the pre-sleep state on the rfkill structure, and restore from
      that on resume.
      Signed-off-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br>
      Acked-by: NIvo van Doorn <IvDoorn@gmail.com>
      Cc: Matthew Garrett <mjg59@srcf.ucam.org>
      Cc: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      f80b5e99
  10. 23 8月, 2008 3 次提交
  11. 30 7月, 2008 1 次提交
  12. 27 6月, 2008 5 次提交
    • H
      rfkill: rename the rfkill_state states and add block-locked state · 5005657c
      Henrique de Moraes Holschuh 提交于
      The current naming of rfkill_state causes a lot of confusion: not only the
      "kill" in rfkill suggests negative logic, but also the fact that rfkill cannot
      turn anything on (it can just force something off or stop forcing something
      off) is often forgotten.
      
      Rename RFKILL_STATE_OFF to RFKILL_STATE_SOFT_BLOCKED (transmitter is blocked
      and will not operate; state can be changed by a toggle_radio request), and
      RFKILL_STATE_ON to RFKILL_STATE_UNBLOCKED (transmitter is not blocked, and may
      operate).
      
      Also, add a new third state, RFKILL_STATE_HARD_BLOCKED (transmitter is blocked
      and will not operate; state cannot be changed through a toggle_radio request),
      which is used by drivers to indicate a wireless transmiter was blocked by a
      hardware rfkill line that accepts no overrides.
      
      Keep the old names as #defines, but document them as deprecated.  This way,
      drivers can be converted to the new names *and* verified to actually use rfkill
      correctly one by one.
      Signed-off-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br>
      Acked-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      5005657c
    • H
      rfkill: add notifier chains support · 79399a8d
      Henrique de Moraes Holschuh 提交于
      Add a notifier chain for use by the rfkill class.  This notifier chain
      signals the following events (more to be added when needed):
      
        1. rfkill: rfkill device state has changed
      
      A pointer to the rfkill struct will be passed as a parameter.
      
      The notifier message types have been added to include/linux/rfkill.h
      instead of to include/linux/notifier.h in order to avoid the madness of
      modifying a header used globally (and that triggers an almost full tree
      rebuild every time it is touched) with information that is of interest only
      to code that includes the rfkill.h header.
      Signed-off-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br>
      Acked-by: NIvo van Doorn <IvDoorn@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      79399a8d
    • H
      rfkill: add the WWAN radio type · 477576a0
      Henrique de Moraes Holschuh 提交于
      Unfortunately, instead of adding a generic Wireless WAN type, a technology-
      specific type (WiMAX) was added.  That's useless for other WWAN devices,
      such as EDGE, UMTS, X-RTT and other such radios.
      
      Add a WWAN rfkill type for generic wireless WAN devices.  No keys are added
      as most devices really want to use KEY_WLAN for WWAN control (in a cycle of
      none, WLAN, WWAN, WLAN+WWAN) and need no specific keycode added.
      Signed-off-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br>
      Acked-by: NIvo van Doorn <IvDoorn@gmail.com>
      Cc: Iñaky Pérez-González <inaky.perez-gonzalez@intel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      477576a0
    • H
      rfkill: add read-write rfkill switch support · 801e49af
      Henrique de Moraes Holschuh 提交于
      Currently, rfkill support for read/write rfkill switches is hacked through
      a round-trip over the input layer and rfkill-input to let a driver sync
      rfkill->state to hardware changes.
      
      This is buggy and sub-optimal.  It causes real problems.  It is best to
      think of the rfkill class as supporting only write-only switches at the
      moment.
      
      In order to implement the read/write functionality properly:
      
      Add a get_state() hook that is called by the class every time it needs to
      fetch the current state of the switch.  Add a call to this hook every time
      the *current* state of the radio plays a role in a decision.
      
      Also add a force_state() method that can be used to forcefully syncronize
      the class' idea of the current state of the switch.  This allows for a
      faster implementation of the read/write functionality, as a driver which
      get events on switch changes can avoid the need for a get_state() hook.
      
      If the get_state() hook is left as NULL, current behaviour is maintained,
      so this change is fully backwards compatible with the current rfkill
      drivers.
      
      For hardware that issues events when the rfkill state changes, leave
      get_state() NULL in the rfkill struct, set the initial state properly
      before registering with the rfkill class, and use the force_state() method
      in the driver to keep the rfkill interface up-to-date.
      
      get_state() can be called by the class from atomic context. It must not
      sleep.
      Signed-off-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br>
      Acked-by: NIvo van Doorn <IvDoorn@gmail.com>
      Cc: Dmitry Torokhov <dtor@mail.ru>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      801e49af
    • H
      rfkill: clarify meaning of rfkill states · f3146aff
      Henrique de Moraes Holschuh 提交于
      rfkill really should have been named rfswitch.  As it is, one can get
      confused whether RFKILL_STATE_ON means the KILL switch is on (and
      therefore, the radio is being *blocked* from operating), or whether it
      means the RADIO rf output is on.
      
      Clearly state that RFKILL_STATE_ON means the radio is *unblocked* from
      operating (i.e. there is no rf killing going on).
      Signed-off-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br>
      Acked-by: NIvo van Doorn <IvDoorn@gmail.com>
      Cc: Dmitry Torokhov <dtor@mail.ru>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      f3146aff
  13. 01 2月, 2008 1 次提交
  14. 11 10月, 2007 6 次提交
  15. 08 6月, 2007 1 次提交
  16. 07 5月, 2007 1 次提交