1. 15 6月, 2018 1 次提交
  2. 18 5月, 2018 1 次提交
  3. 08 5月, 2018 1 次提交
  4. 29 3月, 2018 3 次提交
  5. 23 3月, 2018 1 次提交
  6. 27 2月, 2018 1 次提交
  7. 19 2月, 2018 1 次提交
    • A
      cfg80211: fix cfg80211_beacon_dup · bee92d06
      Arnd Bergmann 提交于
      gcc-8 warns about some obviously incorrect code:
      
      net/mac80211/cfg.c: In function 'cfg80211_beacon_dup':
      net/mac80211/cfg.c:2896:3: error: 'memcpy' source argument is the same as destination [-Werror=restrict]
      
      From the context, I conclude that we want to copy from beacon into
      new_beacon, as we do in the rest of the function.
      
      Cc: stable@vger.kernel.org
      Fixes: 73da7d5b ("mac80211: add channel switch command and beacon callbacks")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      bee92d06
  8. 04 1月, 2018 1 次提交
    • P
      mac80211: Fix setting TX power on monitor interfaces · 3a3713ec
      Peter Große 提交于
      Instead of calling ieee80211_recalc_txpower on monitor interfaces
      directly, call it using the virtual monitor interface, if one exists.
      
      In case of a single monitor interface given, reject setting TX power,
      if no virtual monitor interface exists.
      
      That being checked, don't warn in ieee80211_bss_info_change_notify,
      after setting TX power on a monitor interface.
      
      Fixes warning:
      ------------[ cut here ]------------
       WARNING: CPU: 0 PID: 2193 at net/mac80211/driver-ops.h:167
       ieee80211_bss_info_change_notify+0x111/0x190 Modules linked in: uvcvideo
       videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_core
      rndis_host cdc_ether usbnet mii tp_smapi(O) thinkpad_ec(O) ohci_hcd vboxpci(O)
       vboxnetadp(O) vboxnetflt(O) v boxdrv(O) x86_pkg_temp_thermal kvm_intel kvm
       irqbypass iwldvm iwlwifi ehci_pci ehci_hcd tpm_tis tpm_tis_core tpm CPU: 0
       PID: 2193 Comm: iw Tainted: G           O    4.12.12-gentoo #2 task:
       ffff880186fd5cc0 task.stack: ffffc90001b54000 RIP:
       0010:ieee80211_bss_info_change_notify+0x111/0x190 RSP: 0018:ffffc90001b57a10
       EFLAGS: 00010246 RAX: 0000000000000006 RBX: ffff8801052ce840 RCX:
       0000000000000064 RDX: 00000000fffffffc RSI: 0000000000040000 RDI:
       ffff8801052ce840 RBP: ffffc90001b57a38 R08: 0000000000000062 R09:
       0000000000000000 R10: ffff8802144b5000 R11: ffff880049dc4614 R12:
       0000000000040000 R13: 0000000000000064 R14: ffff8802105f0760 R15:
       ffffc90001b57b48 FS:  00007f92644b4580(0000) GS:ffff88021e200000(0000)
       knlGS:0000000000000000 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: 00007f9263c109f0 CR3: 00000001df850000 CR4: 00000000000406f0
       Call Trace:
        ieee80211_recalc_txpower+0x33/0x40
        ieee80211_set_tx_power+0x40/0x180
        nl80211_set_wiphy+0x32e/0x950
      Reported-by: NPeter Große <pegro@friiks.de>
      Signed-off-by: NPeter Große <pegro@friiks.de>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      3a3713ec
  9. 11 12月, 2017 1 次提交
  10. 18 10月, 2017 1 次提交
  11. 16 6月, 2017 1 次提交
    • J
      networking: make skb_put & friends return void pointers · 4df864c1
      Johannes Berg 提交于
      It seems like a historic accident that these return unsigned char *,
      and in many places that means casts are required, more often than not.
      
      Make these functions (skb_put, __skb_put and pskb_put) return void *
      and remove all the casts across the tree, adding a (u8 *) cast only
      where the unsigned char pointer was used directly, all done with the
      following spatch:
      
          @@
          expression SKB, LEN;
          typedef u8;
          identifier fn = { skb_put, __skb_put };
          @@
          - *(fn(SKB, LEN))
          + *(u8 *)fn(SKB, LEN)
      
          @@
          expression E, SKB, LEN;
          identifier fn = { skb_put, __skb_put };
          type T;
          @@
          - E = ((T *)(fn(SKB, LEN)))
          + E = fn(SKB, LEN)
      
      which actually doesn't cover pskb_put since there are only three
      users overall.
      
      A handful of stragglers were converted manually, notably a macro in
      drivers/isdn/i4l/isdn_bsdcomp.c and, oddly enough, one of the many
      instances in net/bluetooth/hci_sock.c. In the former file, I also
      had to fix one whitespace problem spatch introduced.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4df864c1
  12. 13 6月, 2017 1 次提交
    • E
      mac80211: don't send SMPS action frame in AP mode when not needed · b3dd8279
      Emmanuel Grumbach 提交于
      mac80211 allows to modify the SMPS state of an AP both,
      when it is started, and after it has been started. Such a
      change will trigger an action frame to all the peers that
      are currently connected, and will be remembered so that
      new peers will get notified as soon as they connect (since
      the SMPS setting in the beacon may not be the right one).
      
      This means that we need to remember the SMPS state
      currently requested as well as the SMPS state that was
      configured initially (and advertised in the beacon).
      The former is bss->req_smps and the latter is
      sdata->smps_mode.
      
      Initially, the AP interface could only be started with
      SMPS_OFF, which means that sdata->smps_mode was SMPS_OFF
      always. Later, a nl80211 API was added to be able to start
      an AP with a different AP mode. That code forgot to update
      bss->req_smps and because of that, if the AP interface was
      started with SMPS_DYNAMIC, we had:
         sdata->smps_mode = SMPS_DYNAMIC
         bss->req_smps = SMPS_OFF
      
      That configuration made mac80211 think it needs to fire off
      an action frame to any new station connecting to the AP in
      order to let it know that the actual SMPS configuration is
      SMPS_OFF.
      
      Fix that by properly setting bss->req_smps in
      ieee80211_start_ap.
      
      Fixes: f6993174 ("mac80211: set smps_mode according to ap params")
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      b3dd8279
  13. 19 5月, 2017 1 次提交
  14. 28 4月, 2017 1 次提交
    • M
      mac80211: Fix possible sband related NULL pointer de-reference · 21a8e9dd
      Mohammed Shafi Shajakhan 提交于
      Existing API 'ieee80211_get_sdata_band' returns default 2 GHz band even
      if the channel context configuration is NULL. This crashes for chipsets
      which support 5 Ghz alone when it tries to access members of 'sband'.
      Channel context configuration can be NULL in multivif case and when
      channel switch is in progress (or) when it fails. Fix this by replacing
      the API 'ieee80211_get_sdata_band' with  'ieee80211_get_sband' which
      returns a NULL pointer for sband when the channel configuration is NULL.
      
      An example scenario is as below:
      
      In multivif mode (AP + STA) with drivers like ath10k, when we do a
      channel switch in the AP vif (which has a number of clients connected)
      and a STA vif which is connected to some other AP, when the channel
      switch in AP vif fails, while the STA vifs tries to connect to the
      other AP, there is a window where the channel context is NULL/invalid
      and this results in a crash  while the clients connected to the AP vif
      tries to reconnect and this race is very similar to the one investigated
      by Michal in https://patchwork.kernel.org/patch/3788161/ and this does
      happens with hardware that supports 5Ghz alone after long hours of
      testing with continuous channel switch on the AP vif
      
      ieee80211 phy0: channel context reservation cannot be finalized because
      some interfaces aren't switching
      wlan0: failed to finalize CSA, disconnecting
      wlan0-1: deauthenticating from 8c:fd:f0:01:54:9c by local choice
      	(Reason: 3=DEAUTH_LEAVING)
      
      	WARNING: CPU: 1 PID: 19032 at net/mac80211/ieee80211_i.h:1013 sta_info_alloc+0x374/0x3fc [mac80211]
      	[<bf77272c>] (sta_info_alloc [mac80211])
      	[<bf78776c>] (ieee80211_add_station [mac80211]))
      	[<bf73cc50>] (nl80211_new_station [cfg80211])
      
      	Unable to handle kernel NULL pointer dereference at virtual
      	address 00000014
      	pgd = d5f4c000
      	Internal error: Oops: 17 [#1] PREEMPT SMP ARM
      	PC is at sta_info_alloc+0x380/0x3fc [mac80211]
      	LR is at sta_info_alloc+0x37c/0x3fc [mac80211]
      	[<bf772738>] (sta_info_alloc [mac80211])
      	[<bf78776c>] (ieee80211_add_station [mac80211])
      	[<bf73cc50>] (nl80211_new_station [cfg80211]))
      
      Cc: Michal Kazior <michal.kazior@tieto.com>
      Signed-off-by: NMohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      21a8e9dd
  15. 27 4月, 2017 2 次提交
  16. 13 4月, 2017 4 次提交
  17. 08 3月, 2017 1 次提交
    • J
      mac80211: reject/clear user rate mask if not usable · e8e4f528
      Johannes Berg 提交于
      If the user rate mask results in no (basic) rates being usable,
      clear it. Also, if we're already operating when it's set, reject
      it instead.
      
      Technically, selecting basic rates as the criterion is a bit too
      restrictive, but calculating the usable rates over all stations
      (e.g. in AP mode) is harder, and all stations must support the
      basic rates. Similarly, in client mode, the basic rates will be
      used anyway for control frames.
      
      This fixes the "no supported rates (...) in rate_mask ..." warning
      that occurs on TX when you've selected a rate mask that's not
      compatible with the connection (e.g. an AP that enables only the
      rates 36, 48, 54 and you've selected only 6, 9, 12.)
      Reported-by: NKirtika Ruchandani <kirtika@google.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      e8e4f528
  18. 06 3月, 2017 1 次提交
  19. 09 2月, 2017 1 次提交
    • L
      cfg80211: fix NAN bands definition · 8585989d
      Luca Coelho 提交于
      The nl80211_nan_dual_band_conf enumeration doesn't make much sense.
      The default value is assigned to a bit, which makes it weird if the
      default bit and other bits are set at the same time.
      
      To improve this, get rid of NL80211_NAN_BAND_DEFAULT and add a wiphy
      configuration to let the drivers define which bands are supported.
      This is exposed to the userspace, which then can make a decision on
      which band(s) to use.  Additionally, rename all "dual_band" elements
      to "bands", to make things clearer.
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      8585989d
  20. 13 12月, 2016 1 次提交
    • M
      mac80211: multicast to unicast conversion · ebceec86
      Michael Braun 提交于
      Add the ability for an AP (and associated VLANs) to perform
      multicast-to-unicast conversion for ARP, IPv4 and IPv6 frames
      (possibly within 802.1Q). If enabled, such frames are to be sent
      to each station separately, with the DA replaced by their own
      MAC address rather than the group address.
      
      Note that this may break certain expectations of the receiver,
      such as the ability to drop unicast IP packets received within
      multicast L2 frames, or the ability to not send ICMP destination
      unreachable messages for packets received in L2 multicast (which
      is required, but the receiver can't tell the difference if this
      new option is enabled.)
      
      This also doesn't implement the 802.11 DMS (directed multicast
      service).
      Signed-off-by: NMichael Braun <michael-dev@fami-braun.de>
      [use true/false, rename label to the correct "multicast",
       use __be16 for ethertype and network order for constants]
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      ebceec86
  21. 27 10月, 2016 1 次提交
  22. 12 10月, 2016 3 次提交
    • M
      mac80211: filter multicast data packets on AP / AP_VLAN · 72f15d53
      Michael Braun 提交于
      This patch adds filtering for multicast data packets on AP_VLAN
      interfaces that have no authorized station connected and changes
      filtering on AP interfaces to not count stations assigned to
      AP_VLAN interfaces.
      
      This saves airtime and avoids waking up other stations currently
      authorized in this BSS. When using WPA, the packets dropped could
      not be decrypted by any station.
      
      The behaviour when there are no AP_VLAN interfaces is left unchanged.
      
      When there are AP_VLAN interfaces, this patch
      1. adds filtering multicast data packets sent on AP_VLAN interfaces
         that have no authorized station connected.
         No filtering happens on 4addr AP_VLAN interfaces.
      2. makes filtering of multicast data packets sent on AP interfaces
         depend on the number of authorized stations in this bss not
         assigned to an AP_VLAN interface.
      
      Therefore, a new num_mcast_sta counter is added for AP_VLAN interfaces.
      The existing one for AP interfaces is altered to not track stations
      assigned to an AP_VLAN interface.
      
      The new counter is exposed in debugfs.
      Signed-off-by: NMichael Braun <michael-dev@fami-braun.de>
      [reformat commit message a bit, unline ieee80211_vif_{inc,dec}_num_mcast]
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      72f15d53
    • M
      mac80211: remove unnecessary num_mcast_sta check · 5f9994bd
      Michael Braun 提交于
      Checking for num_mcast_sta in __ieee80211_request_smps_ap() is
      unnecessary as sta list will be empty in this case anyway, so
      the list iteration will just exit immediately. Since this isn't
      a "hot" code path, it doesn't really matter, and the next patch
      will redefine num_mcast_sta to make this check invalid.
      Signed-off-by: NMichael Braun <michael-dev@fami-braun.de>
      [change commit message]
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      5f9994bd
    • J
      mac80211: remove unnecessary mesh check · 850092db
      Johannes Berg 提交于
      sta_info_get_bss() is equivalent to sta_info_get() in the
      mesh case, since sta->sdata->bss will be NULL (it's only
      set for AP/AP_VLAN interfaces.) Thus, the mesh check here
      isn't actually needed - remove it.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      850092db
  23. 30 9月, 2016 5 次提交
  24. 15 9月, 2016 1 次提交
  25. 12 9月, 2016 2 次提交
  26. 05 8月, 2016 1 次提交
  27. 06 7月, 2016 1 次提交