1. 20 Oct, 2015 31 commits
    • Alexander Aring's avatar
      6lowpan: nhc: move iphc manipulation out of nhc · 607b0bd3
      Alexander Aring authored
      This patch moves the iphc setting of next header commpression bit inside
      iphc functionality. Setting of IPHC bits should be happen at iphc.c file
      only.
      Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      607b0bd3
    • Alexander Aring's avatar
      6lowpan: remove lowpan_fetch_skb_u8 · 478208e3
      Alexander Aring authored
      This patch removes the lowpan_fetch_skb_u8 function for getting the iphc
      bytes. Instead we using the generic which has a len parameter to tell
      the amount of bytes to fetch.
      Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
      Acked-by: default avatarJukka Rissanen <jukka.rissanen@linux.intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      478208e3
    • Alexander Aring's avatar
      6lowpan: cleanup lowpan_header_decompress · 8911d774
      Alexander Aring authored
      This patch changes the lowpan_header_decompress function by removing
      inklayer related information from parameters. This is currently for
      supporting short and extended address for iphc handling in 802154.
      We don't support short address handling anyway right now, but there
      exists already code for handling short addresses in
      lowpan_header_decompress.
      
      The address parameters are also changed to a void pointer, so 6LoWPAN
      linklayer specific code can put complex structures as these parameters
      and cast it again inside the generic code by evaluating linklayer type
      before. The order is also changed by destination address at first and
      then source address, which is the same like all others functions where
      destination is always the first, memcpy, dev_hard_header,
      lowpan_header_compress, etc.
      
      This patch also moves the fetching of iphc values from 6LoWPAN linklayer
      specific code into the generic branch.
      Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
      Acked-by: default avatarJukka Rissanen <jukka.rissanen@linux.intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      8911d774
    • Alexander Aring's avatar
      6lowpan: cleanup lowpan_header_compress · a6f77389
      Alexander Aring authored
      This patch changes the lowpan_header_compress function by removing
      unused parameters like "len" and drop static value parameters of
      protocol type. Instead we really check the protocol type inside inside
      the skb structure. Also we drop the use of IEEE802154_ADDR_LEN which is
      link-layer specific. Instead we using EUI64_ADDR_LEN which should always
      the default case for now.
      Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
      Acked-by: default avatarJukka Rissanen <jukka.rissanen@linux.intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      a6f77389
    • Alexander Aring's avatar
      6lowpan: introduce LOWPAN_IPHC_MAX_HC_BUF_LEN · bf513fd6
      Alexander Aring authored
      This patch introduces the LOWPAN_IPHC_MAX_HC_BUF_LEN define which
      represent the worst-case supported IPHC buffer length. It's used to
      allocate the stack buffer space for creating the IPHC header.
      Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
      Acked-by: default avatarJukka Rissanen <jukka.rissanen@linux.intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      bf513fd6
    • Alexander Aring's avatar
      bluetooth: 6lowpan: use lowpan dispatch helpers · cefdb801
      Alexander Aring authored
      This patch adds a check if the dataroom of skb contains a dispatch value
      by checking if skb->len != 0. This patch also change the dispatch
      evaluation by the recently introduced helpers for checking the common
      6LoWPAN dispatch values for IPv6 and IPHC header.
      
      There was also a forgotten else branch which should drop the packet if
      no matching dispatch is available.
      Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
      Acked-by: default avatarJukka Rissanen <jukka.rissanen@linux.intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      cefdb801
    • Alexander Aring's avatar
      mac802154: llsec: use kzfree · 71cd2aa5
      Alexander Aring authored
      This patch will use kzfree instead kfree for security related
      information which can be offered by acccident.
      Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      71cd2aa5
    • Johan Hedberg's avatar
      Bluetooth: Fix removing connection parameters when unpairing · a6ad2a6b
      Johan Hedberg authored
      The commit 89cbb063 introduced support for deferred connection
      parameter removal when unpairing by removing them only once an
      existing connection gets disconnected. However, it failed to address
      the scenario when we're *not* connected and do an unpair operation.
      
      What makes things worse is that most user space BlueZ versions will
      first issue a disconnect request and only then unpair, meaning the
      buggy code will be triggered every time. This effectively causes the
      kernel to resume scanning and reconnect to a device for which we've
      removed all keys and GATT database information.
      
      This patch fixes the issue by adding the missing call to the
      hci_conn_params_del() function to a branch which handles the case of
      no existing connection.
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Cc: stable@vger.kernel.org # 3.19+
      a6ad2a6b
    • Marcel Holtmann's avatar
      Bluetooth: btusb: Add support for latest Apple controllers · 22f8e9db
      Marcel Holtmann authored
      The latest Apple Bluetooth controllers with Broadcom chip in it have
      a small design change. Instead of including a USB hub with mouse and
      keyboard devices, they are now HID interfaces on the same device.
      
      T:  Bus=04 Lev=02 Prnt=02 Port=04 Cnt=01 Dev#= 39 Spd=12   MxCh= 0
      D:  Ver= 2.01 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=05ac ProdID=8290 Rev= 0.79
      S:  Manufacturer=Broadcom Corp.
      S:  Product=Bluetooth USB Host Controller
      C:* #Ifs= 6 Cfg#= 1 Atr=e0 MxPwr=  0mA
      A:  FirstIf#= 2 IfCount= 4 Cls=ff(vend.) Sub=01 Prot=01
      I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=01 Driver=usbhid
      E:  Ad=85(I) Atr=03(Int.) MxPS=   8 Ivl=10ms
      I:* If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid
      E:  Ad=86(I) Atr=03(Int.) MxPS=   8 Ivl=10ms
      I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
      E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      I:* If#= 3 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      I:  If#= 3 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      I:  If#= 3 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      I:  If#= 3 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      I:  If#= 3 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      I:  If#= 3 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=btusb
      E:  Ad=84(I) Atr=02(Bulk) MxPS=  32 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS=  32 Ivl=0ms
      I:* If#= 5 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)
      
      The general layout of Bluetooth devices is that interface 0 is the main
      interface and interface 1 is for audio data. This design obviously moves
      it to main interface 2 and audio data on interface 3.
      
      Starting with the MacBookPro12,1 (early 2015 models) the new Broadcom
      BCM943602CS cards are used which show this interface layout.
      
      usb 4-1.5: New USB device found, idVendor=05ac, idProduct=8290
      usb 4-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
      usb 4-1.5: Product: Bluetooth USB Host Controller
      usb 4-1.5: Manufacturer: Broadcom Corp.
      Bluetooth: hci0: BCM: chip id 102 build 0243
      Bluetooth: hci0: BCM: product 05ac:8290
      Bluetooth: hci0: BCM20703A1 Generic USB UHE Apple 20Mhz fcbga_X87
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      22f8e9db
    • Marcel Holtmann's avatar
      Bluetooth: btusb: Set early vendor info for Intel and Broadcom · 49a5f782
      Marcel Holtmann authored
      For the controllers from Intel and Broadcom (including Apple), it is
      helpful to have the information about the manufacturer send out early.
      
      This patch sets the hdev->manufacturer information which will be send
      out before actually calling the vendor specific hdev->setup driver
      callback.
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      49a5f782
    • Marcel Holtmann's avatar
      Bluetooth: Add support setup stage internal notification event · e131d74a
      Marcel Holtmann authored
      Before the vendor specific setup stage is triggered call back into the
      core to trigger an internal notification event. That event is used to
      send an index update to the monitor interface. With that specific event
      it is possible to update userspace with manufacturer information before
      any HCI command has been executed. This is useful for early stage
      debugging of vendor specific initialization sequences.
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      e131d74a
    • Dmitry Tunin's avatar
      Bluetooth: ath3k: Add support of AR3012 0cf3:817b device · 18e0afab
      Dmitry Tunin authored
      T: Bus=04 Lev=02 Prnt=02 Port=04 Cnt=01 Dev#= 3 Spd=12 MxCh= 0
      D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
      P: Vendor=0cf3 ProdID=817b Rev=00.02
      C: #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
      I: If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      
      BugLink: https://bugs.launchpad.net/bugs/1506615Signed-off-by: default avatarDmitry Tunin <hanipouspilot@gmail.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Cc: stable@vger.kernel.org
      18e0afab
    • Dmitry Tunin's avatar
      Bluetooth: ath3k: Add new AR3012 0930:021c id · cd355ff0
      Dmitry Tunin authored
      This adapter works with the existing linux-firmware.
      
      T:  Bus=01 Lev=01 Prnt=01 Port=03 Cnt=02 Dev#=  3 Spd=12  MxCh= 0
      D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=0930 ProdID=021c Rev=00.01
      C:  #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
      I:  If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      I:  If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      
      BugLink: https://bugs.launchpad.net/bugs/1502781Signed-off-by: default avatarDmitry Tunin <hanipouspilot@gmail.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Cc: stable@vger.kernel.org
      cd355ff0
    • Santtu Rekilä's avatar
      Bluetooth: btusb: Add support for Foxconn/Lenovo BCM43142A0 (105b:e065) · 2faf71ce
      Santtu Rekilä authored
      Recently salvaged this 'BCM43142A0' WiFi/Bluetooth module from a Lenovo laptop
      and noticed it doesn't work automatically, because the USB IDs are missing
      from btusb.c.
      
      Plugging in the adapter on Linux 4.1 (dmesg):
      usb 3-3.3.3: new full-speed USB device number 90 using xhci_hcd
      usb 3-3.3.3: New USB device found, idVendor=105b, idProduct=e065
      usb 3-3.3.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
      usb 3-3.3.3: Product: BCM43142A0
      usb 3-3.3.3: Manufacturer: Broadcom Corp
      usb 3-3.3.3: SerialNumber: 0090A286559E
      
      /sys/kernel/debug/usb/devices:
      T:  Bus=03 Lev=03 Prnt=22 Port=02 Cnt=02 Dev#= 90 Spd=12   MxCh= 0
      D:  Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=105b ProdID=e065 Rev= 1.12
      S:  Manufacturer=Broadcom Corp
      S:  Product=BCM43142A0
      S:  SerialNumber=0090A286559E
      C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=  0mA
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
      E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
      E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      I:  If#= 1 Alt= 2 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      I:  If#= 1 Alt= 3 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      I:  If#= 1 Alt= 4 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      I:  If#= 1 Alt= 5 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
      E:  Ad=84(I) Atr=02(Bulk) MxPS=  32 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS=  32 Ivl=0ms
      I:* If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)
      
      Support for the chipset was added in commit 88f9b65d and a similar BCM43142
      based device was added in commit 8f0c304c.
      
      To work around the issue, I got the firmware
      (BCM43142A0_001.001.011.0122.0153) off a Windows installation of Broadcom
      bluetooth driver and converted it to a .hcd -file via. hex2hcd and placed it
      in /lib/firmware/brcm/BCM.hcd. After that:
      
      $ echo "105b e065 0 19ff 0239" > /sys/bus/usb/drivers/btusb/new_id
      ...(plug in the adapter)
      usb 3-3.3.3: new full-speed USB device number 91 using xhci_hcd
      usb 3-3.3.3: New USB device found, idVendor=105b, idProduct=e065
      usb 3-3.3.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
      usb 3-3.3.3: Product: BCM43142A0
      usb 3-3.3.3: Manufacturer: Broadcom Corp
      usb 3-3.3.3: SerialNumber: 0090A286559E
      Bluetooth: hci0: BCM: chip id 70
      Bluetooth: hci0: BCM (001.001.011) build 0000
      bluetooth hci0: firmware: direct-loading firmware brcm/BCM.hcd
      Bluetooth: hci0: BCM (001.001.011) build 0154
      
      Bam, now it works for me!
      
      /sys/kernel/debug/usb/devices:
      T:  Bus=03 Lev=03 Prnt=22 Port=02 Cnt=02 Dev#= 92 Spd=12   MxCh= 0
      D:  Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=105b ProdID=e065 Rev= 1.12
      S:  Manufacturer=Broadcom Corp
      S:  Product=BCM43142A0
      S:  SerialNumber=0090A286559E
      C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=  0mA
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
      E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      I:  If#= 1 Alt= 2 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      I:  If#= 1 Alt= 3 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      I:  If#= 1 Alt= 4 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      I:  If#= 1 Alt= 5 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
      E:  Ad=84(I) Atr=02(Bulk) MxPS=  32 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS=  32 Ivl=0ms
      I:* If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)
      Signed-off-by: default avatarSanttu Rekilä <sare@r00t3d.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      2faf71ce
    • David Herrmann's avatar
      Bluetooth: hidp: fix device disconnect on idle timeout · 660f0fc0
      David Herrmann authored
      The HIDP specs define an idle-timeout which automatically disconnects a
      device. This has always been implemented in the HIDP layer and forced a
      synchronous shutdown of the hidp-scheduler. This works just fine, but
      lacks a forced disconnect on the underlying l2cap channels. This has been
      broken since:
      
          commit 5205185d
          Author: David Herrmann <dh.herrmann@gmail.com>
          Date:   Sat Apr 6 20:28:47 2013 +0200
      
              Bluetooth: hidp: remove old session-management
      
      The old session-management always forced an l2cap error on the ctrl/intr
      channels when shutting down. The new session-management skips this, as we
      don't want to enforce channel policy on the caller. In other words, if
      user-space removes an HIDP device, the underlying channels (which are
      *owned* and *referenced* by user-space) are still left active. User-space
      needs to call shutdown(2) or close(2) to release them.
      
      Unfortunately, this does not work with idle-timeouts. There is no way to
      signal user-space that the HIDP layer has been stopped. The API simply
      does not support any event-passing except for poll(2). Hence, we restore
      old behavior and force EUNATCH on the sockets if the HIDP layer is
      disconnected due to idle-timeouts (behavior of explicit disconnects
      remains unmodified). User-space can still call
      
          getsockopt(..., SO_ERROR, ...)
      
      ..to retrieve the EUNATCH error and clear sk_err. Hence, the channels can
      still be re-used (which nobody does so far, though). Therefore, the API
      still supports the new behavior, but with this patch it's also compatible
      to the old implicit channel shutdown.
      
      Cc: <stable@vger.kernel.org> # 3.10+
      Reported-by: default avatarMark Haun <haunma@keteu.org>
      Reported-by: default avatarLuiz Augusto von Dentz <luiz.dentz@gmail.com>
      Signed-off-by: default avatarDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      660f0fc0
    • Marcel Holtmann's avatar
      Bluetooth: btbcm: Read USB product information for Apple devices · 34cea41e
      Marcel Holtmann authored
      For the Apple Bluetooth devices, read the USB product information and
      print them. This allows for easy mapping of chip and USB details.
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      34cea41e
    • Marcel Holtmann's avatar
      Bluetooth: btbcm: Fix firmware version number calculation · 8045ce21
      Marcel Holtmann authored
      The calculation for the firmware version number is off by one bit.
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      8045ce21
    • Marcel Holtmann's avatar
      Bluetooth: btusb: Mark BCM2045 devices to have broken link key commands · 6c9d435d
      Marcel Holtmann authored
      The BCM2045 seems to have a problem with the stored link key commands
      and thus just mark them as broken.
      
        HCI Event: Command Complete (0x0e) plen 12
           Read Local Supported Features (0x04|0x0003) ncmd 1
           status 0x00
           Features: 0xff 0xff 0x8d 0xfe 0x8f 0xf9 0x00 0x80
        HCI Event: Command Complete (0x0e) plen 12
           Read Local Version Information (0x04|0x0001) ncmd 1
           status 0x00
           HCI Version: 2.0 (0x3) HCI Revision: 0x2000
           LMP Version: 2.0 (0x3) LMP Subversion: 0x410d
           Manufacturer: Broadcom Corporation (15)
        HCI Event: Command Complete (0x0e) plen 11
           Read Buffer Size (0x04|0x0005) ncmd 1
           status 0x00
           ACL MTU 1017:8 SCO MTU 64:0
        HCI Event: Command Complete (0x0e) plen 68
           Read Local Supported Commands (0x04|0x0002) ncmd 1
           status 0x00
           Commands: ffffff03feffcfffffffffff0300f8ff07
        HCI Event: Command Complete (0x0e) plen 4
           Delete Stored Link Key (0x03|0x0012) ncmd 1
           status 0x11 deleted 2048
           Error: Unsupported Feature or Parameter Value
      
      From the looks of it, this device seems genuine and not one of the
      devices that are neither Broadcom nor CSR devices in reality.
      
      T: Bus=04 Lev=02 Prnt=02 Port=02 Cnt=02 Dev#= 3 Spd=12 MxCh= 0
      D: Ver= 2.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
      P: Vendor=0a5c ProdID=2045 Rev= 1.12
      S: Manufacturer=Broadcom Corp
      S: Product=BCM2045A
      S: SerialNumber=000000000000
      C:* #Ifs= 4 Cfg#= 1 Atr=a0 MxPwr=100mA
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms
      E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
      E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms
      E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms
      I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms
      E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms
      I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms
      E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms
      I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms
      E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms
      I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms
      E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms
      I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
      E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms
      E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms
      I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
      E: Ad=84(I) Atr=02(Bulk) MxPS= 32 Ivl=0ms
      E: Ad=04(O) Atr=02(Bulk) MxPS= 32 Ivl=0ms
      I:* If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=00 Driver=(none)
      Reported-and-tested-by: default avatarJulio González Mejías <juliolokooo@gmail.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      6c9d435d
    • Marcel Holtmann's avatar
      Bluetooth: btintel: Add diagnostic support for older controllers · 3e24767b
      Marcel Holtmann authored
      For the older controllers like Wilkens Peak and Stone Peak, enabling the
      traces requires to switch into manufacturer mode first. This patch does
      exactly that, but only for these older controllers.
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      3e24767b
    • Marcel Holtmann's avatar
      Bluetooth: btintel: Set quirk for non-persistent diagnostic settings · d8270fbb
      Marcel Holtmann authored
      For Intel controllers the diagnostics settings are not persistent over
      HCI Reset. So set the quirk to programm them again on every power up.
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      d8270fbb
    • Marcel Holtmann's avatar
      Bluetooth: Add new quirk for non-persistent diagnostic settings · 7e995b9e
      Marcel Holtmann authored
      If the diagnostic settings are not persistent over HCI Reset, then this
      quirk can be used to tell the Bluetoth core about it. This will ensure
      that the settings are programmed correctly when the controller is
      powered up.
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      7e995b9e
    • Arnd Bergmann's avatar
      Bluetooth: bpa10x: fix BT_HCIUART dependency · 7841d06e
      Arnd Bergmann authored
      The change to bpa10x to use the h4_recv_buf helper added a dependency
      on BT_HCIUART. This was incorrectly added to Kconfig by adding a
      'select' statement, which now in turn causes build failures
      when CONFIG_TTY is not set:
      
      warning: (BT_HCIBPA10X) selects BT_HCIUART which has unmet direct dependencies (NET && BT && TTY)
      vers/built-in.o: In function `hci_uart_tty_receive':
      fpga-mgr.c:(.text+0x282824): undefined reference to `tty_unthrottle'
      drivers/built-in.o: In function `hci_uart_tty_ioctl':
      fpga-mgr.c:(.text+0x282aa0): undefined reference to `n_tty_ioctl_helper'
      drivers/built-in.o: In function `hci_uart_flush':
      
      This replaces the 'select BT_HCIUART' dependency with 'depends on', which
      does not have this kind of problem. Alternatively, one could add 'depends
      on TTY', but avoiding 'select' on user-visible options is generally the
      preferred choice as that does not introduce the potential for dependency
      loops or incomplete dependency chains.
      
      Fixes: 91489919 ("Bluetooth: bpa10x: Fix missing BT_HCIUART dependency")
      Fixes: 943cc592 ("Bluetooth: bpa10x: Use h4_recv_buf helper for frame reassembly")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      7841d06e
    • Marcel Holtmann's avatar
      Bluetooth: btusb: Print information of Intel SfP lock states · 2220994e
      Marcel Holtmann authored
      The lock states from Intel SfP controllers can only be read once before
      loading the firmware. So for debugging purposes, print them out.
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      2220994e
    • Johan Hedberg's avatar
      Bluetooth: Don't use remote address type to decide IRK persistency · cad20c27
      Johan Hedberg authored
      There are LE devices on the market that start off by announcing their
      public address and then once paired switch to using private address.
      To be interoperable with such devices we should simply trust the fact
      that we're receiving an IRK from them to indicate that they may use
      private addresses in the future. Instead, simply tie the persistency
      to the bonding/no-bonding information the same way as for LTKs and
      CSRKs.
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      cad20c27
    • Marcel Holtmann's avatar
      Bluetooth: Queue diagnostic messages together with HCI packets · 581d6fd6
      Marcel Holtmann authored
      Sending diagnostic messages directly to the monitor socket might cause
      issues for devices processing their messages in interrupt context. So
      instead of trying to directly forward them, queue them up with the other
      HCI packets and lets them be processed by the sockets at the same time.
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      581d6fd6
    • Marcel Holtmann's avatar
      Bluetooth: Restrict valid packet types via HCI_CHANNEL_RAW · bb77543e
      Marcel Holtmann authored
      When using the HCI_CHANNEL_RAW, restrict the packet types to valid ones
      from the Bluetooth specification.
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      bb77543e
    • Marcel Holtmann's avatar
      Bluetooth: Remove quirk for HCI_VENDOR_PKT filter handling · 8cd4f581
      Marcel Holtmann authored
      The HCI_VENDOR_PKT quirk was needed for BPA-100/105 devices that send
      these messages. Now that there is support for proper diagnostic channel
      this quirk is no longer needed.
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      8cd4f581
    • Marcel Holtmann's avatar
      Bluetooth: btintel: Add support for enabling tracing functionality · 6d2e50d2
      Marcel Holtmann authored
      For Intel controllers with firmware that allows tracing of baseband
      functionality this allows enabling it via set_diag driver callback.
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      6d2e50d2
    • Marcel Holtmann's avatar
      Bluetooth: btusb: Add support for Broadcom LM_DIAG interface · 9d08f504
      Marcel Holtmann authored
      The Broadcom Bluetooth USB devices have a third interface that is
      dedicated for LM_DIAG messages. The If#= 2 describes this interface
      and it consists of one bulk in and one bulk endpoint.
      
      T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#= 38 Spd=12   MxCh= 0
      D:  Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
      P:  Vendor=19ff ProdID=0239 Rev= 1.12
      S:  Manufacturer=Broadcom Corp
      S:  Product=BCM20702A0
      C:* #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=  0mA
      I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
      E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
      I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
      I:  If#= 1 Alt= 1 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
      I:  If#= 1 Alt= 2 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
      I:  If#= 1 Alt= 3 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
      I:  If#= 1 Alt= 4 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
      I:  If#= 1 Alt= 5 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
      E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
      I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=btusb
      E:  Ad=84(I) Atr=02(Bulk) MxPS=  32 Ivl=0ms
      E:  Ad=04(O) Atr=02(Bulk) MxPS=  32 Ivl=0ms
      I:* If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)
      
      For all Broadcom based devices with this interface, the driver now
      claims it and schedules URBs for it. This allows to capture the
      LM_DIAG messages and allows forwarding them via hci_recv_diag into
      the diagnostic channel of the Bluetooth subsystem.
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      9d08f504
    • Marcel Holtmann's avatar
      Bluetooth: bpa10x: Fix missing BT_HCIUART dependency · 91489919
      Marcel Holtmann authored
      Selecting just BT_HCIUART_H4 is not enough and it also needs to select
      BT_HCIUART to avoid this warning:
      
      warning: (BT_HCIBPA10X) selects BT_HCIUART_H4 which has unmet direct
      dependencies (NET && BT && BT_HCIUART)
      Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
      91489919
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 26440c83
      David S. Miller authored
      Conflicts:
      	drivers/net/usb/asix_common.c
      	net/ipv4/inet_connection_sock.c
      	net/switchdev/switchdev.c
      
      In the inet_connection_sock.c case the request socket hashing scheme
      is completely different in net-next.
      
      The other two conflicts were overlapping changes.
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      26440c83
  2. 19 Oct, 2015 9 commits
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 1099f860
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Account for extra headroom in ath9k driver, from Felix Fietkau.
      
       2) Fix OOPS in pppoe driver due to incorrect socket state transition,
          from Guillaume Nault.
      
       3) Kill memory leak in amd-xgbe debugfx, from Geliang Tang.
      
       4) Power management fixes for iwlwifi, from Johannes Berg.
      
       5) Fix races in reqsk_queue_unlink(), from Eric Dumazet.
      
       6) Fix dst_entry usage in ARP replies, from Jiri Benc.
      
       7) Cure OOPSes with SO_GET_FILTER, from Daniel Borkmann.
      
       8) Missing allocation failure check in amd-xgbe, from Tom Lendacky.
      
       9) Various resource allocation/freeing cures in DSA< from Neil
          Armstrong.
      
      10) A series of bug fixes in the openvswitch conntrack support, from
          Joe Stringer.
      
      11) Fix two cases (BPF and act_mirred) where we have to clean the sender
          cpu stored in the SKB before transmitting.  From WANG Cong and
          Alexei Starovoitov.
      
      12) Disable VLAN filtering in promiscuous mode in mlx5 driver, from
          Achiad Shochat.
      
      13) Older bnx2x chips cannot do 4-tuple UDP hashing, so prevent this
          configuration via ethtool.  From Yuval Mintz.
      
      14) Don't call rt6_uncached_list_flush_dev() from rt6_ifdown() when
          'dev' is NULL, from Eric Biederman.
      
      15) Prevent stalled link synchronization in tipc, from Jon Paul Maloy.
      
      16) kcalloc() gstrings ethtool buffer before having driver fill it in,
          in order to prevent kernel memory leaking.  From Joe Perches.
      
      17) Fix mixxing rt6_info initialization for blackhole routes, from
          Martin KaFai Lau.
      
      18) Kill VLAN regression in via-rhine, from Andrej Ota.
      
      19) Missing pfmemalloc check in sk_add_backlog(), from Eric Dumazet.
      
      20) Fix spurious MSG_TRUNC signalling in netlink dumps, from Ronen Arad.
      
      21) Scrube SKBs when pushing them between namespaces in openvswitch,
          from Joe Stringer.
      
      22) bcmgenet enables link interrupts too early, fix from Florian
          Fainelli.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (92 commits)
        net: bcmgenet: Fix early link interrupt enabling
        tunnels: Don't require remote endpoint or ID during creation.
        openvswitch: Scrub skb between namespaces
        xen-netback: correctly check failed allocation
        net: asix: add support for the Billionton GUSB2AM-1G-B USB adapter
        netlink: Trim skb to alloc size to avoid MSG_TRUNC
        net: add pfmemalloc check in sk_add_backlog()
        via-rhine: fix VLAN receive handling regression.
        ipv6: Initialize rt6_info properly in ip6_blackhole_route()
        ipv6: Move common init code for rt6_info to a new function rt6_info_init()
        Bluetooth: Fix initializing conn_params in scan phase
        Bluetooth: Fix conn_params list update in hci_connect_le_scan_cleanup
        Bluetooth: Fix remove_device behavior for explicit connects
        Bluetooth: Fix LE reconnection logic
        Bluetooth: Fix reference counting for LE-scan based connections
        Bluetooth: Fix double scan updates
        mlxsw: core: Fix race condition in __mlxsw_emad_transmit
        tipc: move fragment importance field to new header position
        ethtool: Use kcalloc instead of kmalloc for ethtool_get_strings
        tipc: eliminate risk of stalled link synchronization
        ...
      1099f860
    • Florian Fainelli's avatar
      net: bcmgenet: Fix early link interrupt enabling · 37850e37
      Florian Fainelli authored
      Link interrupts are enabled in init_umac(), which is too early for us to
      process them since we do not yet have a valid PHY device pointer. On
      BCM7425 chips for instance, we will crash calling phy_mac_interrupt()
      because phydev is NULL.
      
      Fix this by moving the link interrupts enabling in
      bcmgenet_netif_start(), under a specific function:
      bcmgenet_link_intr_enable() and while at it, update the comments
      surrounding the code.
      
      Fixes: 6cc8e6d4 ("net: bcmgenet: Delay PHY initialization to bcmgenet_open()")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      37850e37
    • David S. Miller's avatar
      Merge tag 'wireless-drivers-for-davem-2015-10-17' of... · afc050dd
      David S. Miller authored
      Merge tag 'wireless-drivers-for-davem-2015-10-17' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers
      
      Kalle Valo says:
      
      ====================
      iwlwifi:
      
      * mvm: flush fw_dump_wk when mvm fails to start
      * mvm: init card correctly on ctkill exit check
      * pci: add a few more PCI subvendor IDs for the 7265 series
      * fix firmware filename for 3160
      * mvm: clear csa countdown when AP is stopped
      * mvm: fix D3 firmware PN programming
      * dvm: fix D3 firmware PN programming
      * mvm: fix D3 CCMP TX PN assignment
      
      rtlwifi:
      
      * rtl8821ae: Fix system lockups on boot
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      afc050dd
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next · 371f1c7e
      David S. Miller authored
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter/IPVS updates for net-next
      
      The following patchset contains Netfilter/IPVS updates for your net-next
      tree. Most relevantly, updates for the nfnetlink_log to integrate with
      conntrack, fixes for cttimeout and improvements for nf_queue core, they are:
      
      1) Remove useless ifdef around static inline function in IPVS, from
         Eric W. Biederman.
      
      2) Simplify the conntrack support for nfnetlink_queue: Merge
         nfnetlink_queue_ct.c file into nfnetlink_queue_core.c, then rename it back
         to nfnetlink_queue.c
      
      3) Use y2038 safe timestamp from nfnetlink_queue.
      
      4) Get rid of dead function definition in nf_conntrack, from Flavio
         Leitner.
      
      5) Attach conntrack support for nfnetlink_log.c, from Ken-ichirou MATSUZAWA.
         This adds a new NETFILTER_NETLINK_GLUE_CT Kconfig switch that
         controls enabling both nfqueue and nflog integration with conntrack.
         The userspace application can request this via NFULNL_CFG_F_CONNTRACK
         configuration flag.
      
      6) Remove unused netns variables in IPVS, from Eric W. Biederman and
         Simon Horman.
      
      7) Don't put back the refcount on the cttimeout object from xt_CT on success.
      
      8) Fix crash on cttimeout policy object removal. We have to flush out
         the cttimeout extension area of the conntrack not to refer to an unexisting
         object that was just removed.
      
      9) Make sure rcu_callback completion before removing nfnetlink_cttimeout
         module removal.
      
      10) Fix compilation warning in br_netfilter when no nf_defrag_ipv4 and
          nf_defrag_ipv6 are enabled. Patch from Arnd Bergmann.
      
      11) Autoload ctnetlink dependencies when NFULNL_CFG_F_CONNTRACK is
          requested. Again from Ken-ichirou MATSUZAWA.
      
      12) Don't use pointer to previous hook when reinjecting traffic via
          nf_queue with NF_REPEAT verdict since it may be already gone. This
          also avoids a deadloop if the userspace application keeps returning
          NF_REPEAT.
      
      13) A bunch of cleanups for netfilter IPv4 and IPv6 code from Ian Morris.
      
      14) Consolidate logger instance existence check in nfulnl_recv_config().
      
      15) Fix broken atomicity when applying configuration updates to logger
          instances in nfnetlink_log.
      
      16) Get rid of the .owner attribute in our hook object. We don't need
          this anymore since we're dropping pending packets that have escaped
          from the kernel when unremoving the hook. Patch from Florian Westphal.
      
      17) Remove unnecessary rcu_read_lock() from nf_reinject code, we always
          assume RCU read side lock from .call_rcu in nfnetlink. Also from Florian.
      
      18) Use static inline function instead of macros to define NF_HOOK() and
          NF_HOOK_COND() when no netfilter support in on, from Arnd Bergmann.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      371f1c7e
    • santosh.shilimkar@oracle.com's avatar
      RDS: fix rds-ping deadlock over TCP transport · 7b4b0009
      santosh.shilimkar@oracle.com authored
      Sowmini found hang with rds-ping while testing RDS over TCP. Its
      a corner case and doesn't happen always. The issue is not reproducible
      with IB transport. Its clear from below dump why we see it with RDS TCP.
      
       [<ffffffff8153b7e5>] do_tcp_setsockopt+0xb5/0x740
       [<ffffffff8153bec4>] tcp_setsockopt+0x24/0x30
       [<ffffffff814d57d4>] sock_common_setsockopt+0x14/0x20
       [<ffffffffa096071d>] rds_tcp_xmit_prepare+0x5d/0x70 [rds_tcp]
       [<ffffffffa093b5f7>] rds_send_xmit+0xd7/0x740 [rds]
       [<ffffffffa093bda2>] rds_send_pong+0x142/0x180 [rds]
       [<ffffffffa0939d34>] rds_recv_incoming+0x274/0x330 [rds]
       [<ffffffff810815ae>] ? ttwu_queue+0x11e/0x130
       [<ffffffff814dcacd>] ? skb_copy_bits+0x6d/0x2c0
       [<ffffffffa0960350>] rds_tcp_data_recv+0x2f0/0x3d0 [rds_tcp]
       [<ffffffff8153d836>] tcp_read_sock+0x96/0x1c0
       [<ffffffffa0960060>] ? rds_tcp_recv_init+0x40/0x40 [rds_tcp]
       [<ffffffff814d6a90>] ? sock_def_write_space+0xa0/0xa0
       [<ffffffffa09604d1>] rds_tcp_data_ready+0xa1/0xf0 [rds_tcp]
       [<ffffffff81545249>] tcp_data_queue+0x379/0x5b0
       [<ffffffffa0960cdb>] ? rds_tcp_write_space+0xbb/0x110 [rds_tcp]
       [<ffffffff81547fd2>] tcp_rcv_established+0x2e2/0x6e0
       [<ffffffff81552602>] tcp_v4_do_rcv+0x122/0x220
       [<ffffffff81553627>] tcp_v4_rcv+0x867/0x880
       [<ffffffff8152e0b3>] ip_local_deliver_finish+0xa3/0x220
      
      This happens because rds_send_xmit() chain wants to take
      sock_lock which is already taken by tcp_v4_rcv() on its
      way to rds_tcp_data_ready(). Commit db6526dc ("RDS: use
      rds_send_xmit() state instead of RDS_LL_SEND_FULL") which
      was trying to opportunistically finish the send request
      in same thread context.
      
      But because of above recursive lock hang with RDS TCP,
      the send work from rds_send_pong() needs to deferred to
      worker to avoid lock up. Given RDS ping is more of connectivity
      test than performance critical path, its should be ok even
      for transport like IB.
      Reported-by: default avatarSowmini Varadhan <sowmini.varadhan@oracle.com>
      Acked-by: default avatarSowmini Varadhan <sowmini.varadhan@oracle.com>
      Signed-off-by: default avatarSantosh Shilimkar <ssantosh@kernel.org>
      Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@oracle.com>
      Acked-by: default avatarSowmini Varadhan <sowmini.varadhan@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7b4b0009
    • Jesse Gross's avatar
      tunnels: Don't require remote endpoint or ID during creation. · e277de5f
      Jesse Gross authored
      Before lightweight tunnels existed, it really didn't make sense to
      create a tunnel that was not fully specified, such as without a
      destination IP address - the resulting packets would go nowhere.
      However, with lightweight tunnels, the opposite is true - it doesn't
      make sense to require this information when it will be provided later
      on by the route. This loosens the requirements for this information.
      
      An alternative would be to allow the relaxed version only when
      COLLECT_METADATA is enabled. However, since there are several
      variations on this theme (such as NBMA tunnels in GRE), just dropping
      the restrictions seems the most consistent across tunnels and with
      the existing configuration.
      
      CC: John Linville <linville@tuxdriver.com>
      Signed-off-by: default avatarJesse Gross <jesse@nicira.com>
      Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e277de5f
    • stephen hemminger's avatar
      uapi: add mpls_iptunnel.h · b3958b9e
      stephen hemminger authored
      Add missing rule to export mpls iptunnel header needed by iproute2
      Signed-off-by: default avatarStephen Hemminger <stephen@networkplumber.org>
      Acked-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b3958b9e
    • Eric Dumazet's avatar
      tcp: do not set queue_mapping on SYNACK · dc6ef6be
      Eric Dumazet authored
      At the time of commit fff32699 ("tcp: reflect SYN queue_mapping into
      SYNACK packets") we had little ways to cope with SYN floods.
      
      We no longer need to reflect incoming skb queue mappings, and instead
      can pick a TX queue based on cpu cooking the SYNACK, with normal XPS
      affinities.
      
      Note that all SYNACK retransmits were picking TX queue 0, this no longer
      is a win given that SYNACK rtx are now distributed on all cpus.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dc6ef6be
    • Joe Stringer's avatar
      openvswitch: Scrub skb between namespaces · 740dbc28
      Joe Stringer authored
      If OVS receives a packet from another namespace, then the packet should
      be scrubbed. However, people have already begun to rely on the behaviour
      that skb->mark is preserved across namespaces, so retain this one field.
      
      This is mainly to address information leakage between namespaces when
      using OVS internal ports, but by placing it in ovs_vport_receive() it is
      more generally applicable, meaning it should not be overlooked if other
      port types are allowed to be moved into namespaces in future.
      Signed-off-by: default avatarJoe Stringer <joestringer@nicira.com>
      Acked-by: default avatarPravin B Shelar <pshelar@nicira.com>
      Acked-by: default avatarThomas Graf <tgraf@suug.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      740dbc28