1. 09 9月, 2016 1 次提交
  2. 04 9月, 2016 2 次提交
    • N
      brcmfmac: fix pmksa->bssid usage · 7703773e
      Nicolas Iooss 提交于
      The struct cfg80211_pmksa defines its bssid field as:
      
          const u8 *bssid;
      
      contrary to struct brcmf_pmksa, which uses:
      
          u8 bssid[ETH_ALEN];
      
      Therefore in brcmf_cfg80211_del_pmksa(), &pmksa->bssid takes the address
      of this field (of type u8**), not the one of its content (which would be
      u8*).  Remove the & operator to make brcmf_dbg("%pM") and memcmp()
      behave as expected.
      
      This bug have been found using a custom static checker (which checks the
      usage of %p... attributes at build time).  It has been introduced in
      commit 6c404f34 ("brcmfmac: Cleanup pmksa cache handling code"),
      which replaced pmksa->bssid by &pmksa->bssid while refactoring the code,
      without modifying struct cfg80211_pmksa definition.
      
      Replace &pmk[i].bssid with pmk[i].bssid too to make the code clearer,
      this change does not affect the semantic.
      
      Fixes: 6c404f34 ("brcmfmac: Cleanup pmksa cache handling code")
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicolas Iooss <nicolas.iooss_linux@m4x.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      7703773e
    • I
      brcmfmac: Add USB ID for Cisco Linksys AE1200 · bccf3ffc
      Ismael Luceno 提交于
      The AE1200 comes with different revisions of the BCM43235 chipset,
      but all have the same USB ID. Only revision 3 can be supported.
      Signed-off-by: NIsmael Luceno <ismael@iodev.co.uk>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      bccf3ffc
  3. 03 9月, 2016 1 次提交
  4. 14 8月, 2016 1 次提交
  5. 20 7月, 2016 3 次提交
  6. 19 7月, 2016 3 次提交
  7. 08 7月, 2016 2 次提交
    • R
      brcmfmac: support removing AP interfaces with "interface_remove" · dba8fbc6
      Rafał Miłecki 提交于
      New firmwares (e.g. 10.10.69.36 for BCM4366) support "interface_remove"
      for removing interfaces. Try to use this method on cfg80211 request. In
      case of older firmwares (e.g. 7.35.177.56 for BCM43602 as I tested) this
      will just result in firmware rejecting command and this won't change any
      behavior.
      Signed-off-by: NRafał Miłecki <zajec5@gmail.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      dba8fbc6
    • R
      brcmfmac: delete interface directly in code that sent fw request · a63b0987
      Rafał Miłecki 提交于
      So far when receiving event about in-firmware-interface removal our
      event worker was notifying listener and afterwards it was removing Linux
      interface.
      
      First of all it was resulting in slightly unexpected order. The listener
      (del_virtual_intf callback) was (usually) returning with success before
      we even called unregister_netdev(ice).
      
      Please note this couldn't be simply fixed by changing order of calls in
      brcmf_fweh_handle_if_event as unregistering interface earlier could free
      struct brcmf_if.
      
      Another problem of current implementation are possible lockups. Focus on
      the time slot between calling event handler and removing Linux
      interface. During that time original caller may leave (unlocking rtnl
      semaphore) *and* another call to the same code may be done (locking it
      again). If that happens our event handler will stuck at removing Linux
      interface, it won't handle another event and will block process holding
      rtnl lock.
      
      This can be simply solved by unregistering interface in a proper
      callback, right after receiving confirmation event from firmware. This
      only required modifying worker to don't unregister on its own if there
      is someone waiting for the event.
      Signed-off-by: NRafał Miłecki <zajec5@gmail.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      a63b0987
  8. 06 7月, 2016 1 次提交
    • A
      nl80211: support beacon report scanning · 1d76250b
      Avraham Stern 提交于
      Beacon report radio measurement requires reporting observed BSSs
      on the channels specified in the beacon request. If the measurement
      mode is set to passive or active, it requires actually performing a
      scan (passive or active, accordingly), and reporting the time that
      the scan was started and the time each beacon/probe was received
      (both in terms of TSF of the BSS of the requesting AP). If the
      request mode is table, this information is optional.
      In addition, the radio measurement request specifies the channel
      dwell time for the measurement.
      
      In order to use scan for beacon report when the mode is active or
      passive, add a parameter to scan request that specifies the
      channel dwell time, and add scan start time and beacon received time
      to scan results information.
      
      Supporting beacon report is required for Multi Band Operation (MBO).
      Signed-off-by: NAssaf Krauss <assaf.krauss@intel.com>
      Signed-off-by: NDavid Spinadel <david.spinadel@intel.com>
      Signed-off-by: NAvraham Stern <avraham.stern@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      1d76250b
  9. 30 6月, 2016 2 次提交
  10. 29 6月, 2016 4 次提交
  11. 16 6月, 2016 10 次提交
  12. 14 6月, 2016 4 次提交
  13. 10 6月, 2016 1 次提交
    • R
      brcmfmac: rework function picking free BSS index · d02fb8f1
      Rafał Miłecki 提交于
      The old implementation was overcomplicated and slightly bugged in some
      corner cases.
      
      Consider following state of BSS-es (limited to 6 for simplification):
      drvr->iflist[0]: { bsscfgidx:0, ndev->name:wlan1, }
      drvr->iflist[1]:  (null)
      drvr->iflist[2]: { bsscfgidx:2, ndev->name:wlan1-1, }
      drvr->iflist[3]: { bsscfgidx:3, ndev->name:wlan1-2, }
      drvr->iflist[4]:  (null)
      drvr->iflist[5]:  (null)
      In such case the next AP interface should bsscfgidx 4 (we don't use 1 as
      it's reserved for P2P).
      
      With old code the loop iterations were following:
      [ifidx = 0] [bsscfgidx = 2] [highest = 2]
      [ifidx = 1] [bsscfgidx = 2] [highest = 2] available = true
      [ifidx = 2] [bsscfgidx = 2] [highest = 2] bsscfgidx = highest + 1
      [ifidx = 3] [bsscfgidx = 3] [highest = 2] bsscfgidx = highest + 1
      [ifidx = 4] [bsscfgidx = 3] [highest = 2] available = true
      [ifidx = 5] [bsscfgidx = 3] [highest = 2] available = true
      There were 2 obvious problems:
      1) Having empty BSS at index 1 was resulting in available being always
         set to true, even if we would run out of BSS-es.
      2) Calculated bsscfgidx was invalid (3 instead of 4) resulting in driver
         not being able to create the 4th AP interface.
      
      New code is simpler, placed in file where it's really used, handles
      running out of free BSS-es and allows using 4 interfaces at the same
      time. It also looks for the first free BSS instead of one after the last
      in use. It works well with current driver (which doesn't allow deleting
      interfaces) and should be future proof (if we ever allow deleting).
      Signed-off-by: NRafał Miłecki <zajec5@gmail.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      d02fb8f1
  14. 04 6月, 2016 2 次提交
    • C
      brcmfmac: Fix 'did not remove int handler' warning · b7467401
      Christian Daudt 提交于
      brcmf_sdiod_intr_unregister call that removes both func1 and
      func2 interrupt handlers only called when brcmf_ops_sdio_remove
      is called for func 1 (which is the 2nd call) but sdio is expecting
      it to be removed at the end of each sdio_remove call.
      This is causing 'rmmod bcmrfmac' on a 4356-sdio chip to complain
      with:
      WARNING: driver brcmfmac did not remove its interrupt handler!
      
      The modification makes calling brcmf_sdiod_intr_unregister multiple
      times harmless by clearing the variables that track if interrupt
      handlers have been installed, and then calls it on every
      brcmf_ops_sdio_remove call instead of just remove for func 1.
      Signed-off-by: NChristian Daudt <csd@broadcom.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      b7467401
    • C
      brcmfmac: Fix kernel oops in failed chip_attach · b88a2e80
      Christian Daudt 提交于
      When chip attach fails, brcmf_sdiod_intr_unregister is being called
      but that is too early as sdiodev->settings has not been set yet
      nor has brcmf_sdiod_intr_register been called.
      Change to use oob_irq_requested + newly created sd_irq_requested
      to decide on what to unregister at intr_unregister time.
      
      Steps to reproduce problem:
      - modprobe brcmfmac using buggy FW
      - rmmod brcmfmac
      - modprobe brcmfmac again.
      
      If done with a buggy firmware, brcm_chip_attach will fail on the
      2nd modprobe triggering the call to intr_unregister and the
      kernel oops when attempting to de-reference sdiodev->settings->bus.sdio
      which has not yet been set.
      Signed-off-by: NChristian Daudt <csd@broadcom.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      b88a2e80
  15. 03 6月, 2016 1 次提交
    • F
      brcmfmac: add eth_type_trans back for PCIe full dongle · 31143e29
      Franky Lin 提交于
      A regression was introduced in commit 9c349892 ("brcmfmac: revise
      handling events in receive path") which moves eth_type_trans() call
      to brcmf_rx_frame(). Msgbuf layer doesn't use brcmf_rx_frame() but invokes
      brcmf_netif_rx() directly. In such case the Ethernet header was not
      stripped out resulting in null pointer dereference in the networking
      stack.
      
      BUG: unable to handle kernel NULL pointer dereference at 0000000000000048
      IP: [<ffffffff814c3ce6>] enqueue_to_backlog+0x56/0x260
      PGD 0
      Oops: 0000 [#1] PREEMPT SMP
      Modules linked in: fuse ipt_MASQUERADE nf_nat_masquerade_ipv4
      iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 xt_addrtype
      [...]
      rtsx_pci scsi_mod usbcore usb_common i8042 serio nvme nvme_core
      CPU: 7 PID: 1340 Comm: irq/136-brcmf_p Not tainted 4.7.0-rc1-mainline #1
      Hardware name: Dell Inc. XPS 15 9550/0N7TVV, BIOS 01.02.00 04/07/2016
      task: ffff8804a0c5bd00 ti: ffff88049e124000 task.ti: ffff88049e124000
      RIP: 0010:[<ffffffff814c3ce6>] [<ffffffff814c3ce6>]
      enqueue_to_backlog+0x56/0x260
      RSP: 0018:ffff88049e127ca0 EFLAGS: 00010046
      RAX: 0000000000000000 RBX: ffff8804bddd7c40 RCX: 000000000000002f
      RDX: 0000000000000000 RSI: 0000000000000007 RDI: ffff8804bddd7d4c
      RBP: ffff88049e127ce8 R08: 0000000000000000 R09: 0000000000000000
      R10: ffff8804bddd12c0 R11: 000000000000149e R12: 0000000000017c40
      R13: ffff88049e127d08 R14: ffff8804a9bd6d00 R15: ffff8804bddd7d4c
      FS: 0000000000000000(0000) GS:ffff8804bddc0000(0000) knlGS:0000000000000000
      CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000048 CR3: 0000000001806000 CR4: 00000000003406e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Stack:
      ffff8804bdddad00 ffff8804ad089e00 0000000000000000 0000000000000282
      0000000000000000 ffff8804a9bd6d00 ffff8804a1b27e00 ffff8804a9bd6d00
      ffff88002ee88000 ffff88049e127d28 ffffffff814c3f3b ffffffff81311fc3
      Call Trace:
      [<ffffffff814c3f3b>] netif_rx_internal+0x4b/0x170
      [<ffffffff81311fc3>] ? swiotlb_tbl_unmap_single+0xf3/0x120
      [<ffffffff814c5467>] netif_rx_ni+0x27/0xc0
      [<ffffffffa08519e9>] brcmf_netif_rx+0x49/0x70 [brcmfmac]
      [<ffffffffa08564d4>] brcmf_msgbuf_process_rx+0x2b4/0x570 [brcmfmac]
      [<ffffffff81020017>] ? __xen_set_pgd_hyper+0x57/0xd0
      [<ffffffff810d60b0>] ? irq_forced_thread_fn+0x70/0x70
      [<ffffffffa0857381>] brcmf_proto_msgbuf_rx_trigger+0x31/0xe0 [brcmfmac]
      [<ffffffffa0861e8f>] brcmf_pcie_isr_thread+0x7f/0x110 [brcmfmac]
      [<ffffffff810d60d0>] irq_thread_fn+0x20/0x50
      [<ffffffff810d63ad>] irq_thread+0x12d/0x1c0
      [<ffffffff815d07d5>] ? __schedule+0x2f5/0x7a0
      [<ffffffff810d61d0>] ? wake_threads_waitq+0x30/0x30
      [<ffffffff810d6280>] ? irq_thread_dtor+0xb0/0xb0
      [<ffffffff81098ea8>] kthread+0xd8/0xf0
      [<ffffffff815d4b7f>] ret_from_fork+0x1f/0x40
      [<ffffffff81098dd0>] ? kthread_worker_fn+0x170/0x170
      Code: 1c f5 60 9a 8e 81 9c 58 0f 1f 44 00 00 48 89 45 d0 fa 66 0f 1f
      44 00 00 4c 8d bb 0c 01 00 00 4c 89 ff e8 5e 08 11 00 49 8b 56 20 <48>
      8b 52 48 83 e2 01 74 10 8b 8b 08 01 00 00 8b 15 59 c5 42 00
      RIP [<ffffffff814c3ce6>] enqueue_to_backlog+0x56/0x260
      RSP <ffff88049e127ca0>
      CR2: 0000000000000048
      
      Fixes: 9c349892 ("brcmfmac: revise handling events in receive path")
      Reported-by: NRafal Milecki <zajec5@gmail.com>
      Reported-by: NGrey Christoforo <grey@christoforo.net>
      Reviewed-by: NPieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
      Reviewed-by: NArend Van Spriel <arend@broadcom.com>
      Reviewed-by: NHante Meuleman <hante.meuleman@broadcom.com>
      Signed-off-by: NFranky Lin <franky.lin@broadcom.com>
      [arend@broadcom.com: rephrased the commit message]
      Signed-off-by: NArend van Spriel <arend@broadcom.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      31143e29
  16. 28 5月, 2016 1 次提交
  17. 12 5月, 2016 1 次提交