1. 04 6月, 2009 15 次提交
    • J
      cfg80211: add rfkill support · 1f87f7d3
      Johannes Berg 提交于
      To be easier on drivers and users, have cfg80211 register an
      rfkill structure that drivers can access. When soft-killed,
      simply take down all interfaces; when hard-killed the driver
      needs to notify us and we will take down the interfaces
      after the fact. While rfkilled, interfaces cannot be set UP.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      1f87f7d3
    • 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
      cfg80211: move txpower wext from mac80211 · 7643a2c3
      Johannes Berg 提交于
      This patch introduces new cfg80211 API to set the TX power
      via cfg80211, puts the wext code into cfg80211 and updates
      mac80211 to use all that. The -ENETDOWN bits are a hack but
      will go away soon.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      7643a2c3
    • 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
    • B
      nl80211: use GFP_ATOMIC for michael mic failure message · 0f6399c4
      Bob Copeland 提交于
      nl80211_michael_mic_failure can be called in atomic context but
      does a GFP_KERNEL allocation.  Fixes the error below:
      
      [  126.793225] BUG: sleeping function called from invalid context at mm/slab.c:3055
      [  126.793234] in_atomic(): 1, irqs_disabled(): 0, pid: 0, name: swapper
      [  126.793241] 2 locks held by swapper/0:
      [  126.793246]  #0:  (&sc->rxbuflock){+.-.+.}, at: [<f94e1b46>] ath5k_tasklet_rx+0x34/0x55e [ath5k]
      [  126.793294]  #1:  (rcu_read_lock){.+.+.+}, at: [<f92872f3>] __ieee80211_rx+0x7e/0x563 [mac80211]
      [  126.793342] Pid: 0, comm: swapper Not tainted 2.6.30-rc7-wl #124
      [  126.793347] Call Trace:
      [  126.793361]  [<c014499d>] ? __debug_show_held_locks+0x1e/0x20
      [  126.793380]  [<c011e9a3>] __might_sleep+0x100/0x107
      [  126.793386]  [<c018ea99>] kmem_cache_alloc+0x35/0x170
      [  126.793393]  [<c02e8bb1>] ? __alloc_skb+0x2e/0x117
      [  126.793397]  [<c014517d>] ? mark_held_locks+0x43/0x5b
      [  126.793402]  [<c02e8bb1>] __alloc_skb+0x2e/0x117
      [  126.793419]  [<f851a836>] nl80211_michael_mic_failure+0x2a/0x1fa [cfg80211]
      [  126.793425]  [<c01453b8>] ? trace_hardirqs_on_caller+0xf6/0x130
      [  126.793430]  [<c01453fd>] ? trace_hardirqs_on+0xb/0xd
      [  126.793444]  [<f851b2b8>] cfg80211_michael_mic_failure+0x30/0x38 [cfg80211]
      [  126.793463]  [<f928bf69>] mac80211_ev_michael_mic_failure+0xfd/0x108 [mac80211]
      [  126.793480]  [<f9279fbd>] ieee80211_rx_h_michael_mic_verify+0xd4/0x117 [mac80211]
      [  126.793499]  [<f9285ef3>] ieee80211_invoke_rx_handlers+0xdde/0x1963 [mac80211]
      [  126.793505]  [<c0107152>] ? sched_clock+0x3f/0x64
      [  126.793511]  [<c0107152>] ? sched_clock+0x3f/0x64
      [  126.793516]  [<c01445d7>] ? trace_hardirqs_off+0xb/0xd
      [  126.793521]  [<c0107152>] ? sched_clock+0x3f/0x64
      [  126.793526]  [<c0146454>] ? __lock_acquire+0x62c/0x1271
      [  126.793545]  [<f9286fbb>] __ieee80211_rx_handle_packet+0x543/0x564 [mac80211]
      [  126.793564]  [<f9287757>] __ieee80211_rx+0x4e2/0x563 [mac80211]
      [  126.793577]  [<f94e1ff6>] ath5k_tasklet_rx+0x4e4/0x55e [ath5k]
      [  126.793583]  [<c0102b54>] ? restore_nocheck_notrace+0x0/0xe
      [  126.793589]  [<c0129aa2>] tasklet_action+0x92/0xe5
      [  126.793594]  [<c0129f22>] __do_softirq+0xb1/0x182
      [  126.793599]  [<c012a023>] do_softirq+0x30/0x48
      [  126.793603]  [<c012a19b>] irq_exit+0x3d/0x74
      [  126.793609]  [<c0358016>] do_IRQ+0x76/0x8c
      [  126.793613]  [<c010312e>] common_interrupt+0x2e/0x34
      [  126.793618]  [<c014007b>] ? timer_list_show+0x277/0x939
      [  126.793630]  [<f88eb321>] ? acpi_idle_enter_bm+0x266/0x291 [processor]
      [  126.793636]  [<c02d00f6>] cpuidle_idle_call+0x6a/0x9c
      [  126.793640]  [<c0101cc8>] cpu_idle+0x53/0x87
      [  126.793645]  [<c0344510>] rest_init+0x6c/0x6e
      [  126.793651]  [<c04dd74d>] start_kernel+0x286/0x28b
      [  126.793656]  [<c04dd037>] __init_begin+0x37/0x3c
      Signed-off-by: NBob Copeland <me@bobcopeland.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      0f6399c4
    • L
      cfg80211: fix for duplicate userspace replies · 729e9c76
      Luis R. Rodriguez 提交于
      This fixes an incorrect assumption (BUG_ON) made in
      cfg80211 when handling country IE regulatory requests.
      The assumption was that we won't try to call_crda()
      twice for the same event and therefore we will not
      recieve two replies through nl80211 for the regulatory
      request. As it turns out it is true we don't call_crda()
      twice for the same event, however, kobject_uevent_env()
      *might* send the udev event twice and/or userspace can
      simply process the udev event twice. We remove the BUG_ON()
      and simply ignore the duplicate request.
      
      For details refer to this thread:
      
      http://marc.info/?l=linux-wireless&m=124149987921337&w=2
      
      Cc: stable@kernel.org
      Reported-by: NMaxim Levitsky <maximlevitsky@gmail.com>
      Signed-off-by: NLuis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      729e9c76
    • J
      net: introduce pre-up netdev notifier · 3b8bcfd5
      Johannes Berg 提交于
      NETDEV_UP is called after the device is set UP, but sometimes
      it is useful to be able to veto the device UP. Introduce a
      new NETDEV_PRE_UP notifier that can be used for exactly this.
      The first use case will be cfg80211 denying interfaces to be
      set UP if the device is known to be rfkill'ed.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      3b8bcfd5
    • L
      mac80211: handle -EALREADY on cfg80211 op assoc req · 86ab04c8
      Luis R. Rodriguez 提交于
      When the SME requests to associate to an open AP
      ieee80211_sta_set_extra_ie() can be called with zero IE
      length. When this happens or when the extra IE has already
      been set -EALREADY is passed down and the supplicant will
      complain that the operation is already in progress and it will
      not let us associate. We correct this by treating -EALREADY
      from ieee80211_sta_set_extra_ie() as a success just as we do
      for wext.
      
      Cc: Shan.Palanisamy@Atheros.com
      Signed-off-by: NLuis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      86ab04c8
    • J
      cfg80211: disallow interfering with stations on non-AP (part 2) · 034d655e
      Johannes Berg 提交于
      On non-AP interfaces userspace has no business interfering with
      the station management, this can confuse mac80211 (and other
      drivers probably wouldn't support it anyway). Allow adding and
      removing stations only on AP interfaces.
      
      (Reconcile this w/ previous version of patch posted with same
      subject... -- JWL)
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      034d655e
    • J
      mac80211: fix transposed min/max CW values · 7ba10a8e
      Johannes Berg 提交于
      I accidentally transposed these in the patch that "fixed" the defaults,
      leading to extremely low throughput because of the huge min CW.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      7ba10a8e
    • J
      cfg80211: use key size constants · 8fc0fee0
      Johannes Berg 提交于
      Instead of hardcoding the key length for validation, use the
      constants Zhu Yi recently added and add one for AES_CMAC too.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      8fc0fee0
    • J
      nl80211: bounce scan request back to userspace · 362a415d
      Johannes Berg 提交于
      When a scan finishes only the program that asked for it
      knows what kind of scan it was; let's tell everybody else
      about the scan parameters as well so they can evaluate
      the result of the scan better. Also helps with debugging.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      362a415d
    • J
      cfg80211: validate AID of stations being added · 51b50fbe
      Johannes Berg 提交于
      We have some validation code in mac80211 but said code will
      force an invalid AID to 0 which isn't a valid AID either;
      instead require a valid AID (1-2007) to be passed in from
      userspace in cfg80211 already. Also move the code before
      the race comment since it can only be executed during STA
      addition and thus is not racy.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      51b50fbe
    • J
      mac80211: deprecate conf.beacon_int properly · e535c756
      Johannes Berg 提交于
      Ivo has updated the driver to no longer use the change flag,
      so we can remove that, but rt2x00 and ath5k still use the
      actual value so let's mark it as deprecated too.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      e535c756
  2. 03 6月, 2009 2 次提交
  3. 02 6月, 2009 5 次提交
  4. 01 6月, 2009 1 次提交
  5. 30 5月, 2009 2 次提交
    • J
      net: convert unicast addr list · ccffad25
      Jiri Pirko 提交于
      This patch converts unicast address list to standard list_head using
      previously introduced struct netdev_hw_addr. It also relaxes the
      locking. Original spinlock (still used for multicast addresses) is not
      needed and is no longer used for a protection of this list. All
      reading and writing takes place under rtnl (with no changes).
      
      I also removed a possibility to specify the length of the address
      while adding or deleting unicast address. It's always dev->addr_len.
      
      The convertion touched especially e1000 and ixgbe codes when the
      change is not so trivial.
      Signed-off-by: NJiri Pirko <jpirko@redhat.com>
      
       drivers/net/bnx2.c               |   13 +--
       drivers/net/e1000/e1000_main.c   |   24 +++--
       drivers/net/ixgbe/ixgbe_common.c |   14 ++--
       drivers/net/ixgbe/ixgbe_common.h |    4 +-
       drivers/net/ixgbe/ixgbe_main.c   |    6 +-
       drivers/net/ixgbe/ixgbe_type.h   |    4 +-
       drivers/net/macvlan.c            |   11 +-
       drivers/net/mv643xx_eth.c        |   11 +-
       drivers/net/niu.c                |    7 +-
       drivers/net/virtio_net.c         |    7 +-
       drivers/s390/net/qeth_l2_main.c  |    6 +-
       drivers/scsi/fcoe/fcoe.c         |   16 ++--
       include/linux/netdevice.h        |   18 ++--
       net/8021q/vlan.c                 |    4 +-
       net/8021q/vlan_dev.c             |   10 +-
       net/core/dev.c                   |  195 +++++++++++++++++++++++++++-----------
       net/dsa/slave.c                  |   10 +-
       net/packet/af_packet.c           |    4 +-
       18 files changed, 227 insertions(+), 137 deletions(-)
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ccffad25
    • I
      tcp: fix loop in ofo handling code and reduce its complexity · 2df9001e
      Ilpo Järvinen 提交于
      Somewhat luckily, I was looking into these parts with very fine
      comb because I've made somewhat similar changes on the same
      area (conflicts that arose weren't that lucky though). The loop
      was very much overengineered recently in commit 91521944
      (tcp: Use SKB queue and list helpers instead of doing it
      by-hand), while it basically just wants to know if there are
      skbs after 'skb'.
      
      Also it got broken because skb1 = skb->next got translated into
      skb1 = skb1->next (though abstracted) improperly. Note that
      'skb1' is pointing to previous sk_buff than skb or NULL if at
      head. Two things went wrong:
      - We'll kfree 'skb' on the first iteration instead of the
        skbuff following 'skb' (it would require required SACK reneging
        to recover I think).
      - The list head case where 'skb1' is NULL is checked too early
        and the loop won't execute whereas it previously did.
      
      Conclusion, mostly revert the recent changes which makes the
      cset very messy looking but using proper accessor in the
      previous-like version.
      
      The effective changes against the original can be viewed with:
        git-diff 91521944^ \
      		net/ipv4/tcp_input.c | sed -n -e '57,70 p'
      Signed-off-by: NIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2df9001e
  6. 29 5月, 2009 11 次提交
  7. 28 5月, 2009 3 次提交
  8. 27 5月, 2009 1 次提交