1. 09 10月, 2013 3 次提交
    • E
      tcp/dccp: remove twchain · 05dbc7b5
      Eric Dumazet 提交于
      TCP listener refactoring, part 3 :
      
      Our goal is to hash SYN_RECV sockets into main ehash for fast lookup,
      and parallel SYN processing.
      
      Current inet_ehash_bucket contains two chains, one for ESTABLISH (and
      friend states) sockets, another for TIME_WAIT sockets only.
      
      As the hash table is sized to get at most one socket per bucket, it
      makes little sense to have separate twchain, as it makes the lookup
      slightly more complicated, and doubles hash table memory usage.
      
      If we make sure all socket types have the lookup keys at the same
      offsets, we can use a generic and faster lookup. It turns out TIME_WAIT
      and ESTABLISHED sockets already have common lookup fields for IPv4.
      
      [ INET_TW_MATCH() is no longer needed ]
      
      I'll provide a follow-up to factorize IPv6 lookup as well, to remove
      INET6_TW_MATCH()
      
      This way, SYN_RECV pseudo sockets will be supported the same.
      
      A new sock_gen_put() helper is added, doing either a sock_put() or
      inet_twsk_put() [ and will support SYN_RECV later ].
      
      Note this helper should only be called in real slow path, when rcu
      lookup found a socket that was moved to another identity (freed/reused
      immediately), but could eventually be used in other contexts, like
      sock_edemux()
      
      Before patch :
      
      dmesg | grep "TCP established"
      
      TCP established hash table entries: 524288 (order: 11, 8388608 bytes)
      
      After patch :
      
      TCP established hash table entries: 524288 (order: 10, 4194304 bytes)
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      05dbc7b5
    • S
      net: ipv4 only populate IP_PKTINFO when needed · fbf8866d
      Shawn Bohrer 提交于
      The since the removal of the routing cache computing
      fib_compute_spec_dst() does a fib_table lookup for each UDP multicast
      packet received.  This has introduced a performance regression for some
      UDP workloads.
      
      This change skips populating the packet info for sockets that do not have
      IP_PKTINFO set.
      
      Benchmark results from a netperf UDP_RR test:
      Before 89789.68 transactions/s
      After  90587.62 transactions/s
      
      Benchmark results from a fio 1 byte UDP multicast pingpong test
      (Multicast one way unicast response):
      Before 12.63us RTT
      After  12.48us RTT
      Signed-off-by: NShawn Bohrer <sbohrer@rgmadvisors.com>
      Acked-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fbf8866d
    • S
      udp: ipv4: Add udp early demux · 421b3885
      Shawn Bohrer 提交于
      The removal of the routing cache introduced a performance regression for
      some UDP workloads since a dst lookup must be done for each packet.
      This change caches the dst per socket in a similar manner to what we do
      for TCP by implementing early_demux.
      
      For UDP multicast we can only cache the dst if there is only one
      receiving socket on the host.  Since caching only works when there is
      one receiving socket we do the multicast socket lookup using RCU.
      
      For UDP unicast we only demux sockets with an exact match in order to
      not break forwarding setups.  Additionally since the hash chains may be
      long we only check the first socket to see if it is a match and not
      waste extra time searching the whole chain when we might not find an
      exact match.
      
      Benchmark results from a netperf UDP_RR test:
      Before 87961.22 transactions/s
      After  89789.68 transactions/s
      
      Benchmark results from a fio 1 byte UDP multicast pingpong test
      (Multicast one way unicast response):
      Before 12.97us RTT
      After  12.63us RTT
      Signed-off-by: NShawn Bohrer <sbohrer@rgmadvisors.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      421b3885
  2. 08 10月, 2013 3 次提交
    • E
      net: Separate the close_list and the unreg_list v2 · 5cde2829
      Eric W. Biederman 提交于
      Separate the unreg_list and the close_list in dev_close_many preventing
      dev_close_many from permuting the unreg_list.  The permutations of the
      unreg_list have resulted in cases where the loopback device is accessed
      it has been freed in code such as dst_ifdown.  Resulting in subtle memory
      corruption.
      
      This is the second bug from sharing the storage between the close_list
      and the unreg_list.  The issues that crop up with sharing are
      apparently too subtle to show up in normal testing or usage, so let's
      forget about being clever and use two separate lists.
      
      v2: Make all callers pass in a close_list to dev_close_many
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5cde2829
    • A
      net: fix unsafe set_memory_rw from softirq · d45ed4a4
      Alexei Starovoitov 提交于
      on x86 system with net.core.bpf_jit_enable = 1
      
      sudo tcpdump -i eth1 'tcp port 22'
      
      causes the warning:
      [   56.766097]  Possible unsafe locking scenario:
      [   56.766097]
      [   56.780146]        CPU0
      [   56.786807]        ----
      [   56.793188]   lock(&(&vb->lock)->rlock);
      [   56.799593]   <Interrupt>
      [   56.805889]     lock(&(&vb->lock)->rlock);
      [   56.812266]
      [   56.812266]  *** DEADLOCK ***
      [   56.812266]
      [   56.830670] 1 lock held by ksoftirqd/1/13:
      [   56.836838]  #0:  (rcu_read_lock){.+.+..}, at: [<ffffffff8118f44c>] vm_unmap_aliases+0x8c/0x380
      [   56.849757]
      [   56.849757] stack backtrace:
      [   56.862194] CPU: 1 PID: 13 Comm: ksoftirqd/1 Not tainted 3.12.0-rc3+ #45
      [   56.868721] Hardware name: System manufacturer System Product Name/P8Z77 WS, BIOS 3007 07/26/2012
      [   56.882004]  ffffffff821944c0 ffff88080bbdb8c8 ffffffff8175a145 0000000000000007
      [   56.895630]  ffff88080bbd5f40 ffff88080bbdb928 ffffffff81755b14 0000000000000001
      [   56.909313]  ffff880800000001 ffff880800000000 ffffffff8101178f 0000000000000001
      [   56.923006] Call Trace:
      [   56.929532]  [<ffffffff8175a145>] dump_stack+0x55/0x76
      [   56.936067]  [<ffffffff81755b14>] print_usage_bug+0x1f7/0x208
      [   56.942445]  [<ffffffff8101178f>] ? save_stack_trace+0x2f/0x50
      [   56.948932]  [<ffffffff810cc0a0>] ? check_usage_backwards+0x150/0x150
      [   56.955470]  [<ffffffff810ccb52>] mark_lock+0x282/0x2c0
      [   56.961945]  [<ffffffff810ccfed>] __lock_acquire+0x45d/0x1d50
      [   56.968474]  [<ffffffff810cce6e>] ? __lock_acquire+0x2de/0x1d50
      [   56.975140]  [<ffffffff81393bf5>] ? cpumask_next_and+0x55/0x90
      [   56.981942]  [<ffffffff810cef72>] lock_acquire+0x92/0x1d0
      [   56.988745]  [<ffffffff8118f52a>] ? vm_unmap_aliases+0x16a/0x380
      [   56.995619]  [<ffffffff817628f1>] _raw_spin_lock+0x41/0x50
      [   57.002493]  [<ffffffff8118f52a>] ? vm_unmap_aliases+0x16a/0x380
      [   57.009447]  [<ffffffff8118f52a>] vm_unmap_aliases+0x16a/0x380
      [   57.016477]  [<ffffffff8118f44c>] ? vm_unmap_aliases+0x8c/0x380
      [   57.023607]  [<ffffffff810436b0>] change_page_attr_set_clr+0xc0/0x460
      [   57.030818]  [<ffffffff810cfb8d>] ? trace_hardirqs_on+0xd/0x10
      [   57.037896]  [<ffffffff811a8330>] ? kmem_cache_free+0xb0/0x2b0
      [   57.044789]  [<ffffffff811b59c3>] ? free_object_rcu+0x93/0xa0
      [   57.051720]  [<ffffffff81043d9f>] set_memory_rw+0x2f/0x40
      [   57.058727]  [<ffffffff8104e17c>] bpf_jit_free+0x2c/0x40
      [   57.065577]  [<ffffffff81642cba>] sk_filter_release_rcu+0x1a/0x30
      [   57.072338]  [<ffffffff811108e2>] rcu_process_callbacks+0x202/0x7c0
      [   57.078962]  [<ffffffff81057f17>] __do_softirq+0xf7/0x3f0
      [   57.085373]  [<ffffffff81058245>] run_ksoftirqd+0x35/0x70
      
      cannot reuse jited filter memory, since it's readonly,
      so use original bpf insns memory to hold work_struct
      
      defer kfree of sk_filter until jit completed freeing
      
      tested on x86_64 and i386
      Signed-off-by: NAlexei Starovoitov <ast@plumgrid.com>
      Acked-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d45ed4a4
    • M
      netif_set_xps_queue: make cpu mask const · 3573540c
      Michael S. Tsirkin 提交于
      virtio wants to pass in cpumask_of(cpu), make parameter
      const to avoid build warnings.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3573540c
  3. 04 10月, 2013 4 次提交
    • E
      tcp: shrink tcp6_timewait_sock by one cache line · 96f817fe
      Eric Dumazet 提交于
      While working on tcp listener refactoring, I found that it
      would really make things easier if sock_common could include
      the IPv6 addresses needed in the lookups, instead of doing
      very complex games to get their values (depending on sock
      being SYN_RECV, ESTABLISHED, TIME_WAIT)
      
      For this to happen, I need to be sure that tcp6_timewait_sock
      and tcp_timewait_sock consume same number of cache lines.
      
      This is possible if we only use 32bits for tw_ttd, as we remove
      one 32bit hole in inet_timewait_sock
      
      inet_tw_time_stamp() is defined and used, even if its current
      implementation looks like tcp_time_stamp : We might need finer
      resolution for tcp_time_stamp in the future.
      
      Before patch : sizeof(struct tcp6_timewait_sock) = 0xc8
      
      After patch : sizeof(struct tcp6_timewait_sock) = 0xc0
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      96f817fe
    • N
      bonding: modify the old and add new xmit hash policies · 32819dc1
      Nikolay Aleksandrov 提交于
      This patch adds two new hash policy modes which use skb_flow_dissect:
      3 - Encapsulated layer 2+3
      4 - Encapsulated layer 3+4
      There should be a good improvement for tunnel users in those modes.
      It also changes the old hash functions to:
      hash ^= (__force u32)flow.dst ^ (__force u32)flow.src;
      hash ^= (hash >> 16);
      hash ^= (hash >> 8);
      
      Where hash will be initialized either to L2 hash, that is
      SRCMAC[5] XOR DSTMAC[5], or to flow->ports which should be extracted
      from the upper layer. Flow's dst and src are also extracted based on the
      xmit policy either directly from the buffer or by using skb_flow_dissect,
      but in both cases if the protocol is IPv6 then dst and src are obtained by
      ipv6_addr_hash() on the real addresses. In case of a non-dissectable
      packet, the algorithms fall back to L2 hashing.
      The bond_set_mode_ops() function is now obsolete and thus deleted
      because it was used only to set the proper hash policy. Also we trim a
      pointer from struct bonding because we no longer need to keep the hash
      function, now there's only a single hash function - bond_xmit_hash that
      works based on bond->params.xmit_policy.
      
      The hash function and skb_flow_dissect were suggested by Eric Dumazet.
      The layer names were suggested by Andy Gospodarek, because I suck at
      semantics.
      Signed-off-by: NNikolay Aleksandrov <nikolay@redhat.com>
      Acked-by: NEric Dumazet <edumazet@google.com>
      Acked-by: NVeaceslav Falico <vfalico@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      32819dc1
    • N
      flow_dissector: factor out the ports extraction in skb_flow_get_ports · 357afe9c
      Nikolay Aleksandrov 提交于
      Factor out the code that extracts the ports from skb_flow_dissect and
      add a new function skb_flow_get_ports which can be re-used.
      Suggested-by: NVeaceslav Falico <vfalico@redhat.com>
      Signed-off-by: NNikolay Aleksandrov <nikolay@redhat.com>
      Acked-by: NEric Dumazet <edumazet@google.com>
      Reviewed-by: NVeaceslav Falico <vfalico@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      357afe9c
    • E
      inet: consolidate INET_TW_MATCH · 50805466
      Eric Dumazet 提交于
      TCP listener refactoring, part 2 :
      
      We can use a generic lookup, sockets being in whatever state, if
      we are sure all relevant fields are at the same place in all socket
      types (ESTABLISH, TIME_WAIT, SYN_RECV)
      
      This patch removes these macros :
      
       inet_addrpair, inet_addrpair, tw_addrpair, tw_portpair
      
      And adds :
      
       sk_portpair, sk_addrpair, sk_daddr, sk_rcv_saddr
      
      Then, INET_TW_MATCH() is really the same than INET_MATCH()
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      50805466
  4. 03 10月, 2013 11 次提交
    • D
      include/linux/skbuff.h: move CONFIG_XFRM check inside the skb_sec_path() · 0b3d8e08
      Denis Kirjanov 提交于
      And thus we have only one function definition
      Signed-off-by: NDenis Kirjanov <kda@linux-powerpc.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0b3d8e08
    • S
      tc: export tc_defact.h to userspace · 5bc3db5c
      stephen hemminger 提交于
      Jamal sent patch to add tc user simple actions to iproute2
      but required header was not being exported.
      Signed-off-by: NStephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5bc3db5c
    • H
      ssb: provide phy address for Gigabit Ethernet driver · 4bcef89f
      Hauke Mehrtens 提交于
      Add a function to provide the phy address which should be used to the
      Gigabit Ethernet driver connected to ssb.
      Signed-off-by: NHauke Mehrtens <hauke@hauke-m.de>
      Reviewed-by: NNithin Nayak Sujir <nsujir@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4bcef89f
    • 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. 01 10月, 2013 14 次提交