1. 09 8月, 2018 1 次提交
  2. 31 7月, 2018 1 次提交
    • R
      brcmfmac: specify some features per firmware version · 1e591c56
      Rafał Miłecki 提交于
      Some features supported by firmware aren't advertised and there is no
      way for a driver to query them. This includes e.g. monitor mode details.
      
      Most firmwares support monitor interface but only the latest ones
      /announce/ it with a "monitor" flag in the "cap" iovar. There isn't any
      reliable detection method for older firmwares (BRCMF_C_MONITOR was tried
      but "it only indicates the core part of the stack supports").
      
      Similarly support for tagging monitor frames and building radiotap
      headers can't be reliably detected for all firmwares.
      
      This commit adds table that allows mapping features to firmware version.
      It adds mappings for 43602a1 and 4366b1 firmwares from
      linux-firmware.git. Both were confirmed to be passing monitor frames.
      Signed-off-by: NRafał Miłecki <rafal@milecki.pl>
      Reviewed-by: NArend van Spriel <arend.vanspriel@broadcom.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      1e591c56
  3. 25 7月, 2018 1 次提交
  4. 04 7月, 2018 5 次提交
  5. 28 6月, 2018 1 次提交
    • O
      wireless-drivers: use BIT_ULL for NL80211_STA_INFO_ attribute types · 22d0d2fa
      Omer Efrat 提交于
      The BIT macro uses unsigned long which some architectures handle as 32 bit
      and therefore might cause macro's shift to overflow when used on a value
      equals or larger than 32 (NL80211_STA_INFO_RX_DURATION and afterwards).
      
      Since 'filled' member in station_info changed to u64, BIT_ULL macro
      should be used with all NL80211_STA_INFO_* attribute types instead of BIT
      to prevent future possible bugs when one will use BIT macro for higher
      attributes by mistake.
      
      This commit cleans up all usages of BIT macro with the above field
      in wireless-drivers by changing it to BIT_ULL instead. In addition, there are
      some places which don't use BIT nor BIT_ULL macros so align those as well.
      Signed-off-by: NOmer Efrat <omer.efrat@tandemg.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      22d0d2fa
  6. 25 6月, 2018 1 次提交
    • M
      brcmfmac: stop watchdog before detach and free everything · 373c83a8
      Michael Trimarchi 提交于
      Using built-in in kernel image without a firmware in filesystem
      or in the kernel image can lead to a kernel NULL pointer deference.
      Watchdog need to be stopped in brcmf_sdio_remove
      
      The system is going down NOW!
      [ 1348.110759] Unable to handle kernel NULL pointer dereference at virtual address 000002f8
      Sent SIGTERM to all processes
      [ 1348.121412] Mem abort info:
      [ 1348.126962]   ESR = 0x96000004
      [ 1348.130023]   Exception class = DABT (current EL), IL = 32 bits
      [ 1348.135948]   SET = 0, FnV = 0
      [ 1348.138997]   EA = 0, S1PTW = 0
      [ 1348.142154] Data abort info:
      [ 1348.145045]   ISV = 0, ISS = 0x00000004
      [ 1348.148884]   CM = 0, WnR = 0
      [ 1348.151861] user pgtable: 4k pages, 48-bit VAs, pgdp = (____ptrval____)
      [ 1348.158475] [00000000000002f8] pgd=0000000000000000
      [ 1348.163364] Internal error: Oops: 96000004 [#1] PREEMPT SMP
      [ 1348.168927] Modules linked in: ipv6
      [ 1348.172421] CPU: 3 PID: 1421 Comm: brcmf_wdog/mmc0 Not tainted 4.17.0-rc5-next-20180517 #18
      [ 1348.180757] Hardware name: Amarula A64-Relic (DT)
      [ 1348.185455] pstate: 60000005 (nZCv daif -PAN -UAO)
      [ 1348.190251] pc : brcmf_sdiod_freezer_count+0x0/0x20
      [ 1348.195124] lr : brcmf_sdio_watchdog_thread+0x64/0x290
      [ 1348.200253] sp : ffff00000b85be30
      [ 1348.203561] x29: ffff00000b85be30 x28: 0000000000000000
      [ 1348.208868] x27: ffff00000b6cb918 x26: ffff80003b990638
      [ 1348.214176] x25: ffff0000087b1a20 x24: ffff80003b94f800
      [ 1348.219483] x23: ffff000008e620c8 x22: ffff000008f0b660
      [ 1348.224790] x21: ffff000008c6a858 x20: 00000000fffffe00
      [ 1348.230097] x19: ffff80003b94f800 x18: 0000000000000001
      [ 1348.235404] x17: 0000ffffab2e8a74 x16: ffff0000080d7de8
      [ 1348.240711] x15: 0000000000000000 x14: 0000000000000400
      [ 1348.246018] x13: 0000000000000400 x12: 0000000000000001
      [ 1348.251324] x11: 00000000000002c4 x10: 0000000000000a10
      [ 1348.256631] x9 : ffff00000b85bc40 x8 : ffff80003be11870
      [ 1348.261937] x7 : ffff80003dfc7308 x6 : 000000078ff08b55
      [ 1348.267243] x5 : 00000139e1058400 x4 : 0000000000000000
      [ 1348.272550] x3 : dead000000000100 x2 : 958f2788d6618100
      [ 1348.277856] x1 : 00000000fffffe00 x0 : 0000000000000000
      Signed-off-by: NMichael Trimarchi <michael@amarulasolutions.com>
      Acked-by: NArend van Spriel <arend.vanspriel@broadcom.com>
      Tested-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      373c83a8
  7. 13 6月, 2018 1 次提交
    • K
      treewide: kzalloc() -> kcalloc() · 6396bb22
      Kees Cook 提交于
      The kzalloc() function has a 2-factor argument form, kcalloc(). This
      patch replaces cases of:
      
              kzalloc(a * b, gfp)
      
      with:
              kcalloc(a * b, gfp)
      
      as well as handling cases of:
      
              kzalloc(a * b * c, gfp)
      
      with:
      
              kzalloc(array3_size(a, b, c), gfp)
      
      as it's slightly less ugly than:
      
              kzalloc_array(array_size(a, b), c, gfp)
      
      This does, however, attempt to ignore constant size factors like:
      
              kzalloc(4 * 1024, gfp)
      
      though any constants defined via macros get caught up in the conversion.
      
      Any factors with a sizeof() of "unsigned char", "char", and "u8" were
      dropped, since they're redundant.
      
      The Coccinelle script used for this was:
      
      // Fix redundant parens around sizeof().
      @@
      type TYPE;
      expression THING, E;
      @@
      
      (
        kzalloc(
      -	(sizeof(TYPE)) * E
      +	sizeof(TYPE) * E
        , ...)
      |
        kzalloc(
      -	(sizeof(THING)) * E
      +	sizeof(THING) * E
        , ...)
      )
      
      // Drop single-byte sizes and redundant parens.
      @@
      expression COUNT;
      typedef u8;
      typedef __u8;
      @@
      
      (
        kzalloc(
      -	sizeof(u8) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(__u8) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(char) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(unsigned char) * (COUNT)
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(u8) * COUNT
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(__u8) * COUNT
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(char) * COUNT
      +	COUNT
        , ...)
      |
        kzalloc(
      -	sizeof(unsigned char) * COUNT
      +	COUNT
        , ...)
      )
      
      // 2-factor product with sizeof(type/expression) and identifier or constant.
      @@
      type TYPE;
      expression THING;
      identifier COUNT_ID;
      constant COUNT_CONST;
      @@
      
      (
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * (COUNT_ID)
      +	COUNT_ID, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * COUNT_ID
      +	COUNT_ID, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * (COUNT_CONST)
      +	COUNT_CONST, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * COUNT_CONST
      +	COUNT_CONST, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * (COUNT_ID)
      +	COUNT_ID, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * COUNT_ID
      +	COUNT_ID, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * (COUNT_CONST)
      +	COUNT_CONST, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * COUNT_CONST
      +	COUNT_CONST, sizeof(THING)
        , ...)
      )
      
      // 2-factor product, only identifiers.
      @@
      identifier SIZE, COUNT;
      @@
      
      - kzalloc
      + kcalloc
        (
      -	SIZE * COUNT
      +	COUNT, SIZE
        , ...)
      
      // 3-factor product with 1 sizeof(type) or sizeof(expression), with
      // redundant parens removed.
      @@
      expression THING;
      identifier STRIDE, COUNT;
      type TYPE;
      @@
      
      (
        kzalloc(
      -	sizeof(TYPE) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kzalloc(
      -	sizeof(THING) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      )
      
      // 3-factor product with 2 sizeof(variable), with redundant parens removed.
      @@
      expression THING1, THING2;
      identifier COUNT;
      type TYPE1, TYPE2;
      @@
      
      (
        kzalloc(
      -	sizeof(TYPE1) * sizeof(TYPE2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        kzalloc(
      -	sizeof(THING1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        kzalloc(
      -	sizeof(THING1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      |
        kzalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      )
      
      // 3-factor product, only identifiers, with redundant parens removed.
      @@
      identifier STRIDE, SIZE, COUNT;
      @@
      
      (
        kzalloc(
      -	(COUNT) * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	(COUNT) * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	(COUNT) * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	(COUNT) * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kzalloc(
      -	COUNT * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      )
      
      // Any remaining multi-factor products, first at least 3-factor products,
      // when they're not all constants...
      @@
      expression E1, E2, E3;
      constant C1, C2, C3;
      @@
      
      (
        kzalloc(C1 * C2 * C3, ...)
      |
        kzalloc(
      -	(E1) * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kzalloc(
      -	(E1) * (E2) * E3
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kzalloc(
      -	(E1) * (E2) * (E3)
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kzalloc(
      -	E1 * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      )
      
      // And then all remaining 2 factors products when they're not all constants,
      // keeping sizeof() as the second factor argument.
      @@
      expression THING, E1, E2;
      type TYPE;
      constant C1, C2, C3;
      @@
      
      (
        kzalloc(sizeof(THING) * C2, ...)
      |
        kzalloc(sizeof(TYPE) * C2, ...)
      |
        kzalloc(C1 * C2 * C3, ...)
      |
        kzalloc(C1 * C2, ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * (E2)
      +	E2, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(TYPE) * E2
      +	E2, sizeof(TYPE)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * (E2)
      +	E2, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	sizeof(THING) * E2
      +	E2, sizeof(THING)
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	(E1) * E2
      +	E1, E2
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	(E1) * (E2)
      +	E1, E2
        , ...)
      |
      - kzalloc
      + kcalloc
        (
      -	E1 * E2
      +	E1, E2
        , ...)
      )
      Signed-off-by: NKees Cook <keescook@chromium.org>
      6396bb22
  8. 31 5月, 2018 1 次提交
  9. 23 5月, 2018 6 次提交
  10. 15 5月, 2018 2 次提交
  11. 12 5月, 2018 1 次提交
  12. 09 5月, 2018 1 次提交
    • S
      brcmfmac: Add support for bcm43364 wireless chipset · 9c4a121e
      Sean Lanigan 提交于
      Add support for the BCM43364 chipset via an SDIO interface, as used in
      e.g. the Murata 1FX module.
      
      The BCM43364 uses the same firmware as the BCM43430 (which is already
      included), the only difference is the omission of Bluetooth.
      
      However, the SDIO_ID for the BCM43364 is 02D0:A9A4, giving it a MODALIAS
      of sdio:c00v02D0dA9A4, which doesn't get recognised and hence doesn't
      load the brcmfmac module. Adding the 'A9A4' ID in the appropriate place
      triggers the brcmfmac driver to load, and then correctly use the
      firmware file 'brcmfmac43430-sdio.bin'.
      Signed-off-by: NSean Lanigan <sean@lano.id.au>
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      9c4a121e
  13. 30 4月, 2018 6 次提交
  14. 25 4月, 2018 1 次提交
  15. 09 4月, 2018 1 次提交
  16. 27 3月, 2018 10 次提交