1. 07 10月, 2013 1 次提交
  2. 06 10月, 2013 11 次提交
  3. 05 10月, 2013 2 次提交
  4. 03 10月, 2013 8 次提交
    • D
      Bluetooth: Add the definition for Slave Page Response Timeout · 2ed01805
      DoHyun Pyun 提交于
      The Slave Page Response Timeout event indicates to the Host that a
      slave page response timeout has occurred in the BR/EDR Controller.
      
      The Core Spec Addendum 4 adds this command in part B Connectionless
      Slave Broadcast.
      
      Bluetooth Core Specification Addendum 4 - Page 110
      
      "7.7.72 Slave Page Response Timeout Event [New Section]
      ...
      Note: this event will be generated if the slave BR/EDR Controller
      responds to a page but does not receive the master FHS packet
      (see Baseband, Section 8.3.3) within pagerespTO.
      
      Event Parameters: NONE"
      Signed-off-by: NDohyun Pyun <dh79.pyun@samsung.com>
      Signed-off-by: NC S Bhargava <cs.bhargava@samsung.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      2ed01805
    • D
      Bluetooth: Add the definition and stcuture for Sync Train Complete · 2b359445
      DoHyun Pyun 提交于
      The Synchronization Train Complete event indicates that the Start
      Synchronization Train command has completed.
      
      The Core Spec Addendum 4 adds this command in part B Connectionless
      Slave Broadcast.
      
      Bluetooth Core Specification Addendum 4 - Page 103
      
      "7.7.67 Synchronization Train Complete Event [New Section]
      ...
      
      Event Parameters:
      
      Status 0x00       Start Synchronization Train command completed
                        successfully.
             0x01-0xFF  Start Synchronization Train command failed.
                        See Part D, Error Codes, for error codes and
                        descriptions."
      Signed-off-by: NDohyun Pyun <dh79.pyun@samsung.com>
      Signed-off-by: NC S Bhargava <cs.bhargava@samsung.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      2b359445
    • D
      Bluetooth: Add the definition for Start Synchronization Train · cefded98
      DoHyun Pyun 提交于
      The Start_Synchronization_Train command controls the Synchronization
      Train functionality in the BR/EDR Controller.
      
      The Core Spec Addendum 4 adds this command in part B Connectionless
      Slave Broadcast.
      
      Bluetooth Core Specification Addendum 4 - Page 86
      
      "7.1.51 Start Synchronization Train Command [New Section]
      ...
      If connectionless slave broadcast mode is not enabled, the Command
      Disallowed (0x0C) error code shall be returned. After receiving this
      command and returning a Command Status event, the Baseband starts
      attempting to send synchronization train packets containing information
      related to the enabled Connectionless Slave Broadcast packet timing.
      
      Note: The AFH_Channel_Map used in the synchronization train packets is
      configured by the Set_AFH_Channel_Classification command and the local
      channel classification in the BR/EDR Controller.
      
      The synchronization train packets will be sent using the parameters
      specified by the latest Write_Synchronization_Train_Parameters command.
      The Synchronization Train will continue until synchronization_trainTO
      slots (as specified in the last Write_Synchronization_Train command)
      have passed or until the Host disables the Connectionless Slave Broadcast
      logical transport."
      Signed-off-by: NDohyun Pyun <dh79.pyun@samsung.com>
      Signed-off-by: NC S Bhargava <cs.bhargava@samsung.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      cefded98
    • D
      Bluetooth: Add the definition and structure for Set CSB · 8c9a041b
      DoHyun Pyun 提交于
      he Set_Connectionless_Slave_Broadcast command controls the
      Connectionless Slave Broadcast functionality in the BR/EDR
      Controller.
      
      The Core Spec Addendum 4 adds this command in part B Connectionless
      Slave Broadcast.
      
      Bluetooth Core Specification Addendum 4 - Page 78
      
      "7.1.49 Set Connectionless Slave Broadcast Command [New Section]
      ...
      The LT_ADDR indicated in the Set_Connectionless_Slave_Broadcast shall be
      pre-allocated using the HCI_Set_Reserved_LT_ADDR command. If the
      LT_ADDR has not been reserved, the Unknown Connection Identifier (0x02)
      error code shall be returned. If the controller is unable to reserve
      sufficient bandwidth for the requested activity, the Connection Rejected
      Due to Limited Resources (0x0D) error code shall be returned.
      
      The LPO_Allowed parameter informs the BR/EDR Controller whether it is
      allowed to sleep.
      
      The Packet_Type parameter specifies which packet types are allowed. The
      Host shall either enable BR packet types only, or shall enable EDR and DM1
      packet types only.
      
      The Interval_Min and Interval_Max parameters specify the range from which
      the BR/EDR Controller must select the Connectionless Slave Broadcast
      Interval. The selected Interval is returned."
      Signed-off-by: NDohyun Pyun <dh79.pyun@samsung.com>
      Signed-off-by: NC S Bhargava <cs.bhargava@samsung.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      8c9a041b
    • D
      Bluetooth: Add the structure for Write Sync Train Parameters · a9b07a64
      DoHyun Pyun 提交于
      The Write_Synchronization_Train_Parameters command configures
      the Synchronization Train functionality in the BR/EDR Controller.
      
      The Core Spec Addendum 4 adds this command in part B Connectionless
      Slave Broadcast.
      
      Bluetooth Core Specification Addendum 4 - Page 97
      
      "7.3.90 Write Synchronization Train Parameters Command [New Section]
      ...
      Note: The AFH_Channel_Map used in the Synchronization Train packets is
      configured by the Set_AFH_Channel_Classification command and the local
      channel classification in the BR/EDR Controller.
      
      Interval_Min and Interval_Max specify the allowed range of
      Sync_Train_Interval. Refer to [Vol. 2], Part B, section 2.7.2 for
      a detailed description of Sync_Train_Interval. The BR/EDR Controller shall
      select an interval from this range and return it in Sync_Train_Interval.
      If the Controller is unable to select a value from this range, it shall
      return the Invalid HCI Command Parameters (0x12) error code.
      
      Once started (via the Start_Synchronization_Train Command) the
      Synchronization Train will continue until synchronization_trainTO slots have
      passed or Connectionless Slave Broadcast has been disabled."
      Signed-off-by: NDohyun Pyun <dh79.pyun@samsung.com>
      Signed-off-by: NC S Bhargava <cs.bhargava@samsung.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      a9b07a64
    • D
      Bluetooth: Add the definition and structure for Set CSB Data · 7d1dab49
      DoHyun Pyun 提交于
      The Set_Connectionless_Slave_Broadcast_Data command provides the
      ability for the Host to set Connectionless Slave Broadcast data in
      the BR/EDR Controller.
      
      The Core Spec Addendum 4 adds this command in part B Connectionless
      Slave Broadcast.
      
      Bluetooth Core Specification Addendum 4 - Page 93
      
      "7.3.88 Set Connectionless Slave Broadcast Data Command [New Section]
      ...
      If connectionless slave broadcast mode is disabled, this data shall be
      kept by the BR/EDR Controller and used once connectionless slave broadcast
      mode is enabled. If connectionless slave broadcast mode is enabled,
      and this command is successful, this data will be sent starting with
      the next Connectionless Slave Broadcast instant.
      
      The Data_Length field may be zero, in which case no data needs to be
      provided.
      
      The Host may fragment the data using the Fragment field in the command. If
      the combined length of the fragments exceeds the capacity of the largest
      allowed packet size specified in the Set Connectionless Slave Broadcast
      command, all fragments associated with the data being assembled shall be
      discarded and the Invalid HCI Command Parameters error (0x12) shall be
      returned."
      Signed-off-by: NDohyun Pyun <dh79.pyun@samsung.com>
      Signed-off-by: NC S Bhargava <cs.bhargava@samsung.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      7d1dab49
    • D
      Bluetooth: Add the definition and structure for Delete Reserved LT_ADDR · 6a20eaf4
      DoHyun Pyun 提交于
      The Delete_Reserved_LT_ADDR command requests that the BR/EDR
      Controller cancel the reservation for a specific LT_ADDR reserved for the
      purposes of Connectionless Slave Broadcast.
      
      The Core Spec Addendum 4 adds this command in part B Connectionless
      Slave Broadcast.
      
      Bluetooth Core Specification Addendum 4 - Page 92
      
      "7.3.87 Delete Reserved LT_ADDR Command [New Section]
      ...
      If the LT_ADDR indicated in the LT_ADDR parameter is not reserved by the
      BR/EDR Controller, it shall return the Unknown Connection Identifier (0x02)
      error code.
      If connectionless slave broadcast mode is still active, then the Controller
      shall return the Command Disallowed (0x0C) error code."
      Signed-off-by: NDohyun Pyun <dh79.pyun@samsung.com>
      Signed-off-by: NC S Bhargava <cs.bhargava@samsung.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      6a20eaf4
    • D
      Bluetooth: Add the definition and structure for Set Reserved LT_ADDR · d0bf75a5
      DoHyun Pyun 提交于
      The Set_Reserved_LT_ADDR command allows the host to request that the
      BR/EDR Controller reserve a specific LT_ADDR for Connectionless Slave
      Broadcast.
      
      The Core Spec Addendum 4 adds this command in part B Connectionless
      Slave Broadcast.
      
      Bluetooth Core Specification Addendum 4 - Page 90
      
      "7.3.86 Set Reserved LT_ADDR Command [New Section]
      ...
      If the LT_ADDR indicated in the LT_ADDR parameter is already in use by the
      BR/EDR Controller, it shall return the ACL Connection Already Exists (0x0B)
      error code. If the LT_ADDR indicated in the LT_ADDR parameter is out of
      range, the controller shall return the Invalid HCI Command Parameters (0x12)
      error code. If the command succeeds, then the reserved LT_ADDR shall be
      used when issuing subsequent Set Connectionless Slave Broadcast Data and
      Set Connectionless Slave Broadcast commands.
      To ensure that the reserved LT_ADDR is not already allocated, it is
      recommended that this command be issued at some point after HCI_Reset is
      issued but before page scanning is enabled or paging is initiated."
      Signed-off-by: NDohyun Pyun <dh79.pyun@samsung.com>
      Signed-off-by: NC S Bhargava <cs.bhargava@samsung.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      d0bf75a5
  5. 02 10月, 2013 5 次提交
    • M
      Bluetooth: Add management command for setting static address · d13eafce
      Marcel Holtmann 提交于
      On dual-mode BR/EDR/LE and LE only controllers it is possible
      to configure a random address. There are two types or random
      addresses, one is static and the other private. Since the
      random private addresses require special privacy feature to
      be supported, the configuration of these two are kept separate.
      
      This command allows for setting the static random address. It is
      only supported on controllers with LE support. The static random
      address is suppose to be valid for the lifetime of the controller
      or at least until the next power cycle. To ensure such behavior,
      setting of the address is limited to when the controller is
      powered off.
      
      The special BDADDR_ANY address (00:00:00:00:00:00) can be used to
      disable the static address. This is also the default value.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      d13eafce
    • J
      Bluetooth: Add a new mgmt_set_bredr command · 0663ca2a
      Johan Hedberg 提交于
      This patch introduces a new mgmt command for enabling/disabling BR/EDR
      functionality. This can be convenient when one wants to make a dual-mode
      controller behave like a single-mode one. The command is only available
      for dual-mode controllers and requires that LE is enabled before using
      it. The BR/EDR setting can be enabled at any point, however disabling it
      requires the controller to be powered off (otherwise a "rejected"
      response will be sent).
      
      Disabling the BR/EDR setting will automatically disable all other BR/EDR
      related settings.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      0663ca2a
    • J
      Bluetooth: Introduce a new HCI_BREDR_ENABLED flag · 56f87901
      Johan Hedberg 提交于
      To allow treating dual-mode (BR/EDR/LE) controllers as single-mode ones
      (LE-only) we want to introduce a new HCI_BREDR_ENABLED flag to track
      whether BR/EDR is enabled or not (previously we simply looked at the
      feature bit with lmp_bredr_enabled).
      
      This patch add the new flag and updates the relevant places to test
      against it instead of using lmp_bredr_enabled. The flag is by default
      enabled when registering an adapter and only cleared if necessary once
      the local features have been read during the HCI init procedure.
      
      We cannot completely block BR/EDR usage in case user space uses raw HCI
      sockets but the patch tries to block this in places where possible, such
      as the various BR/EDR specific ioctls.
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      56f87901
    • M
      Bluetooth: Provide high speed configuration option · 848566b3
      Marcel Holtmann 提交于
      Hiding the Bluetooth high speed support behind a module parameter is
      not really useful. This can be enabled and disabled at runtime via
      the management interface. This also has the advantage that this can
      now be changed per controller and not just global.
      
      This patch removes the module parameter and exposes the high speed
      setting of the management interface to all controllers.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      848566b3
    • M
      Bluetooth: Replace BDADDR_LOCAL with BDADDR_NONE · a59ac2f7
      Marcel Holtmann 提交于
      The BDADDR_LOCAL is a relict from userspace and has never been used
      within the kernel. So remove that constant and replace it with a new
      BDADDR_NONE that is similar to HCI_DEV_NONE with all bits set.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      a59ac2f7
  6. 26 9月, 2013 3 次提交
  7. 19 9月, 2013 5 次提交
  8. 17 9月, 2013 2 次提交
    • M
      Bluetooth: Introduce new HCI socket channel for user operation · 23500189
      Marcel Holtmann 提交于
      This patch introcuces a new HCI socket channel that allows user
      applications to take control over a specific HCI device. The application
      gains exclusive access to this device and forces the kernel to stay away
      and not manage it. In case of the management interface it will actually
      hide the device.
      
      Such operation is useful for security testing tools that need to operate
      underneath the Bluetooth stack and need full control over a device. The
      advantage here is that the kernel still provides the service of hardware
      abstraction and HCI level access. The use of Bluetooth drivers for
      hardware access also means that sniffing tools like btmon or hcidump
      are still working and the whole set of transaction can be traced with
      existing tools.
      
      With the new channel it is possible to send HCI commands, ACL and SCO
      data packets and receive HCI events, ACL and SCO packets from the
      device. The format follows the well established H:4 protocol.
      
      The new HCI user channel can only be established when a device has been
      through its setup routine and is currently powered down. This is
      enforced to not cause any problems with current operations. In addition
      only one user channel per HCI device is allowed. It is exclusive access
      for one user application. Access to this channel is limited to process
      with CAP_NET_RAW capability.
      
      Using this new facility does not require any external library or special
      ioctl or socket filters. Just create the socket and bind it. After that
      the file descriptor is ready to speak H:4 protocol.
      
              struct sockaddr_hci addr;
              int fd;
      
              fd = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI);
      
              memset(&addr, 0, sizeof(addr));
              addr.hci_family = AF_BLUETOOTH;
              addr.hci_dev = 0;
              addr.hci_channel = HCI_CHANNEL_USER;
      
              bind(fd, (struct sockaddr *) &addr, sizeof(addr));
      
      The example shows on how to create a user channel for hci0 device. Error
      handling has been left out of the example. However with the limitations
      mentioned above it is advised to handle errors. Binding of the user
      cahnnel socket can fail for various reasons. Specifically if the device
      is currently activated by BlueZ or if the access permissions are not
      present.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      23500189
    • M
      Bluetooth: Introduce user channel flag for HCI devices · 0736cfa8
      Marcel Holtmann 提交于
      This patch introduces a new user channel flag that allows to give full
      control of a HCI device to a user application. The kernel will stay away
      from the device and does not allow any further modifications of the
      device states.
      
      The existing raw flag is not used since it has a bit of unclear meaning
      due to its legacy. Using a new flag makes the code clearer.
      
      A device with the user channel flag set can still be enumerate using the
      legacy API, but it does not longer enumerate using the new management
      interface used by BlueZ 5 and beyond. This is intentional to not confuse
      users of modern systems.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      0736cfa8
  9. 06 9月, 2013 1 次提交
    • J
      vxlan: Notify drivers for listening UDP port changes · 53cf5275
      Joseph Gasparakis 提交于
      This patch adds two more ndo ops: ndo_add_rx_vxlan_port() and
      ndo_del_rx_vxlan_port().
      
      Drivers can get notifications through the above functions about changes
      of the UDP listening port of VXLAN. Also, when physical ports come up,
      now they can call vxlan_get_rx_port() in order to obtain the port number(s)
      of the existing VXLAN interface in case they already up before them.
      
      This information about the listening UDP port would be used for VXLAN
      related offloads.
      
      A big thank you to John Fastabend (john.r.fastabend@intel.com) for his
      input and his suggestions on this patch set.
      
      CC: John Fastabend <john.r.fastabend@intel.com>
      CC: Stephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: NJoseph Gasparakis <joseph.gasparakis@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      53cf5275
  10. 05 9月, 2013 2 次提交
    • D
      net: ipv6: mld: get rid of MLDV2_MRC and simplify calculation · e3f5b170
      Daniel Borkmann 提交于
      Get rid of MLDV2_MRC and use our new macros for mantisse and
      exponent to calculate Maximum Response Delay out of the Maximum
      Response Code.
      Signed-off-by: NDaniel Borkmann <dborkman@redhat.com>
      Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
      Acked-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e3f5b170
    • D
      net: ipv6: mld: fix v1/v2 switchback timeout to rfc3810, 9.12. · 89225d1c
      Daniel Borkmann 提交于
      i) RFC3810, 9.2. Query Interval [QI] says:
      
         The Query Interval variable denotes the interval between General
         Queries sent by the Querier. Default value: 125 seconds. [...]
      
      ii) RFC3810, 9.3. Query Response Interval [QRI] says:
      
        The Maximum Response Delay used to calculate the Maximum Response
        Code inserted into the periodic General Queries. Default value:
        10000 (10 seconds) [...] The number of seconds represented by the
        [Query Response Interval] must be less than the [Query Interval].
      
      iii) RFC3810, 9.12. Older Version Querier Present Timeout [OVQPT] says:
      
        The Older Version Querier Present Timeout is the time-out for
        transitioning a host back to MLDv2 Host Compatibility Mode. When an
        MLDv1 query is received, MLDv2 hosts set their Older Version Querier
        Present Timer to [Older Version Querier Present Timeout].
      
        This value MUST be ([Robustness Variable] times (the [Query Interval]
        in the last Query received)) plus ([Query Response Interval]).
      
      Hence, on *default* the timeout results in:
      
        [RV] = 2, [QI] = 125sec, [QRI] = 10sec
        [OVQPT] = [RV] * [QI] + [QRI] = 260sec
      
      Having that said, we currently calculate [OVQPT] (here given as 'switchback'
      variable) as ...
      
        switchback = (idev->mc_qrv + 1) * max_delay
      
      RFC3810, 9.12. says "the [Query Interval] in the last Query received". In
      section "9.14. Configuring timers", it is said:
      
        This section is meant to provide advice to network administrators on
        how to tune these settings to their network. Ambitious router
        implementations might tune these settings dynamically based upon
        changing characteristics of the network. [...]
      
      iv) RFC38010, 9.14.2. Query Interval:
      
        The overall level of periodic MLD traffic is inversely proportional
        to the Query Interval. A longer Query Interval results in a lower
        overall level of MLD traffic. The value of the Query Interval MUST
        be equal to or greater than the Maximum Response Delay used to
        calculate the Maximum Response Code inserted in General Query
        messages.
      
      I assume that was why switchback is calculated as is (3 * max_delay), although
      this setting seems to be meant for routers only to configure their [QI]
      interval for non-default intervals. So usage here like this is clearly wrong.
      
      Concluding, the current behaviour in IPv6's multicast code is not conform
      to the RFC as switch back is calculated wrongly. That is, it has a too small
      value, so MLDv2 hosts switch back again to MLDv2 way too early, i.e. ~30secs
      instead of ~260secs on default.
      
      Hence, introduce necessary helper functions and fix this up properly as it
      should be.
      
      Introduced in 06da92283 ("[IPV6]: Add MLDv2 support."). Credits to Hannes
      Frederic Sowa who also had a hand in this as well. Also thanks to Hangbin Liu
      who did initial testing.
      Signed-off-by: NDaniel Borkmann <dborkman@redhat.com>
      Cc: David Stevens <dlstevens@us.ibm.com>
      Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
      Acked-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      89225d1c