summaryrefslogtreecommitdiffstats
path: root/net/bluetooth (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'x86-x32-for-linus' of ↵Linus Torvalds2012-03-301-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x32 support for x86-64 from Ingo Molnar: "This tree introduces the X32 binary format and execution mode for x86: 32-bit data space binaries using 64-bit instructions and 64-bit kernel syscalls. This allows applications whose working set fits into a 32 bits address space to make use of 64-bit instructions while using a 32-bit address space with shorter pointers, more compressed data structures, etc." Fix up trivial context conflicts in arch/x86/{Kconfig,vdso/vma.c} * 'x86-x32-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (71 commits) x32: Fix alignment fail in struct compat_siginfo x32: Fix stupid ia32/x32 inversion in the siginfo format x32: Add ptrace for x32 x32: Switch to a 64-bit clock_t x32: Provide separate is_ia32_task() and is_x32_task() predicates x86, mtrr: Use explicit sizing and padding for the 64-bit ioctls x86/x32: Fix the binutils auto-detect x32: Warn and disable rather than error if binutils too old x32: Only clear TIF_X32 flag once x32: Make sure TS_COMPAT is cleared for x32 tasks fs: Remove missed ->fds_bits from cessation use of fd_set structs internally fs: Fix close_on_exec pointer in alloc_fdtable x32: Drop non-__vdso weak symbols from the x32 VDSO x32: Fix coding style violations in the x32 VDSO code x32: Add x32 VDSO support x32: Allow x32 to be configured x32: If configured, add x32 system calls to system call tables x32: Handle process creation x32: Signal-related system calls x86: Add #ifdef CONFIG_COMPAT to <asm/sys_ia32.h> ...
| * compat: Use COMPAT_USE_64BIT_TIME in the Bluetooth subsystemH. J. Lu2012-02-201-1/+2
| | | | | | | | | | | | | | | | | | | | Enable the Bluetooth subsystem to be used with a compat ABI with 64-bit time. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: Marcel Holtmann <marcel@holtmann.org> Cc: Gustavo F. Padovan <padovan@profusion.mobi> Cc: David S. Miller <davem@davemloft.net>
* | Remove all #inclusions of asm/system.hDavid Howells2012-03-289-9/+0
| | | | | | | | | | | | | | | | | | Remove all #inclusions of asm/system.h preparatory to splitting and killing it. Performed with the following command: perl -p -i -e 's!^#\s*include\s*<asm/system[.]h>.*\n!!' `grep -Irl '^#\s*include\s*<asm/system[.]h>' *` Signed-off-by: David Howells <dhowells@redhat.com>
* | Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-nextLinus Torvalds2012-03-2115-1788/+3585
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull networking merge from David Miller: "1) Move ixgbe driver over to purely page based buffering on receive. From Alexander Duyck. 2) Add receive packet steering support to e1000e, from Bruce Allan. 3) Convert TCP MD5 support over to RCU, from Eric Dumazet. 4) Reduce cpu usage in handling out-of-order TCP packets on modern systems, also from Eric Dumazet. 5) Support the IP{,V6}_UNICAST_IF socket options, making the wine folks happy, from Erich Hoover. 6) Support VLAN trunking from guests in hyperv driver, from Haiyang Zhang. 7) Support byte-queue-limtis in r8169, from Igor Maravic. 8) Outline code intended for IP_RECVTOS in IP_PKTOPTIONS existed but was never properly implemented, Jiri Benc fixed that. 9) 64-bit statistics support in r8169 and 8139too, from Junchang Wang. 10) Support kernel side dump filtering by ctmark in netfilter ctnetlink, from Pablo Neira Ayuso. 11) Support byte-queue-limits in gianfar driver, from Paul Gortmaker. 12) Add new peek socket options to assist with socket migration, from Pavel Emelyanov. 13) Add sch_plug packet scheduler whose queue is controlled by userland daemons using explicit freeze and release commands. From Shriram Rajagopalan. 14) Fix FCOE checksum offload handling on transmit, from Yi Zou." * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1846 commits) Fix pppol2tp getsockname() Remove printk from rds_sendmsg ipv6: fix incorrent ipv6 ipsec packet fragment cpsw: Hook up default ndo_change_mtu. net: qmi_wwan: fix build error due to cdc-wdm dependecy netdev: driver: ethernet: Add TI CPSW driver netdev: driver: ethernet: add cpsw address lookup engine support phy: add am79c874 PHY support mlx4_core: fix race on comm channel bonding: send igmp report for its master fs_enet: Add MPC5125 FEC support and PHY interface selection net: bpf_jit: fix BPF_S_LDX_B_MSH compilation net: update the usage of CHECKSUM_UNNECESSARY fcoe: use CHECKSUM_UNNECESSARY instead of CHECKSUM_PARTIAL on tx net: do not do gso for CHECKSUM_UNNECESSARY in netif_needs_gso ixgbe: Fix issues with SR-IOV loopback when flow control is disabled net/hyperv: Fix the code handling tx busy ixgbe: fix namespace issues when FCoE/DCB is not enabled rtlwifi: Remove unused ETH_ADDR_LEN defines igbvf: Use ETH_ALEN ... Fix up fairly trivial conflicts in drivers/isdn/gigaset/interface.c and drivers/net/usb/{Kconfig,qmi_wwan.c} as per David.
| * | Bluetooth: Set security level on incoming pairing requestIdo Yariv2012-03-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a master would like to raise the security level, it will send a pairing request. While the pending security level is set on an incoming security request (from a slave), it is not set on a pairing request. As a result, the security level would not be raised on the slave in such case. Fix this by setting the pending security when receiving pairing requests according to the requested authorization. Signed-off-by: Ido Yariv <ido@wizery.com> Acked-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| * | Bluetooth: Fix access to the STK generation methods matrixIdo Yariv2012-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The major index of the table is actually the remote I/O capabilities, not the local ones. As a result, devices with different I/O capabilities could have used wrong or even unsupported generation methods. Signed-off-by: Ido Yariv <ido@wizery.com> CC: Brian Gix <bgix@codeaurora.org> Acked-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| * | Bluetooth: Fix using uninitialized variableLuiz Augusto von Dentz2012-03-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + src/net/bluetooth/rfcomm/tty.c: warning: 'p' is used uninitialized in this function: => 218 + src/net/bluetooth/rfcomm/tty.c: warning: 'p' may be used uninitialized in this function: => 218 Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| * | Bluetooth: fix conding style issues all over the treeGustavo F. Padovan2012-03-086-353/+339
| | | | | | | | | | | | Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| * | Bluetooth: Don't force DISCOVERY_STOPPED state in inquiry_cache_flushAndre Guedes2012-03-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are not supposed to force DISCOVERY_STOPPED in inquiry_cache_flush because we may break the discovery state machine. For instance, during interleaved discovery, when we are about to start inquiry, the state machine forcibly goes to DISCOVERY_STOPPED while it should stay in DISCOVERY_FINDING state. This problem results in unexpected behaviors such as sending two mgmt_discovering events to userspace (when only one event is expected) and Stop Discovery failures. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * | Bluetooth: mgmt: Fix updating local name when powering onJohan Hedberg2012-03-032-16/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When powering on we need to apply whatever name has been set through mgmt_set_local_name. The appropriate place for this is mgmt_powered() and not hci_setup() since this needs to be applied also if the HCI init sequence was already completed but the adapter was still "powered off" from a mgmt perspective due the the HCI_AUTO_OFF still being set. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: Remove HCI_PI_MGMT_INIT flag for socketsJohan Hedberg2012-03-032-11/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This flag is of no use right now and is in fact harmful in that it prevents the HCI_MGMT flag to be set for any controllers that may need it after the first one that bluetoothd takes into use (the flag is cleared for the first controller so any subsequent ones through the same bluetoothd mgmt socket never get the HCI_MGMT flag set). Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: mgmt: Add new error code for invalid indexJohan Hedberg2012-03-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | The index is part of the command header and not its parameters so it makes sense to distinguish this from the invalid parameters error. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: mgmt: Fix command status error code valuesJohan Hedberg2012-03-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Error codes in the command status should always be from the set of values defined for mgmt and never e.g. POSIX error codes. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: Fix clearing of HCI_PENDING_CLASS flagJohan Hedberg2012-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | When doing reset HCI_PENDING_CLASS is one of the flags that should be cleared (since it's used for a pending HCI command and a reset clear all pending commands). Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: Update MGMT and SMP timeout constants to use msecs_to_jiffiesMarcel Holtmann2012-03-012-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | The MGMT and SMP timeout constants are always used in form of jiffies. So just include the conversion from msecs in the define itself. This has the advantage of making the code where the timeout is used more readable. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * | Bluetooth: Update L2CAP timeout constants to use msecs_to_jiffiesMarcel Holtmann2012-03-012-13/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | The L2CAP timeout constants are always used in form of jiffies. So just include the conversion from msecs in the define itself. This has the advantage of making the code where the timeout is used more readable. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * | Bluetooth: mgmt: Centralize message length checksJohan Hedberg2012-03-011-168/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves the command length information into the command handler table allowing the removal of length checks from the handler functions and doing the check in a single place before calling the handler function. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: mgmt: Move command handlers into a tableJohan Hedberg2012-03-011-140/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By moving the command handlers into a table (the index being equal to the opcode) the lookup is made a bit more efficient. Having a struct to describe each handler also paves the way to add more meta-data for each handler, e.g. the minimum message size for the command and allow handling of common tasks like this in a centralized place. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: mgmt: Initialize HCI_MGMT flag for any commandJohan Hedberg2012-03-011-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The read_controller_info is typically the first command that user space sends when taking a controller into use. This is also the reason why this command has been used as the trigger to set the HCI_MGMT flag. However, when not running the user-space daemon and using command line tools it is possible that read_controller_info is not the first controller specific command. This patch moves the HCI_MGMT initialization to a generic place where it will be set for whatever happens to be the first mgmt command targetting a specific controller. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: mgmt: Refactor hci_dev lookup for commandsJohan Hedberg2012-03-011-490/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Almost all mgmt commands need to lookup a struct hci_dev based on the index received within the mgmt headers. It makese therefore sense to look this up in a single place and then just pass the hdev pointer to each command handler function. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: Fix init sequence for some CSR based controllersJohan Hedberg2012-03-011-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some CSR controllers will generate a spontaneous reset during init and just eat up any pending command without sending a command complete for it. This patch solves the issue by just resending whatever was the last sent command. hci_send_cmd is not used since we need to bypass all other commands in the send queue. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: Check capabilities in BR/EDR and LE-Only discoveryAndre Guedes2012-03-011-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch add an extra check for BR/EDR and LE-Only discovery. This way, we are able to return error immediately if the discovery type requested is not supported by the device. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * | Bluetooth: mgmt: Add missing hci_dev locking to set_le()Johan Hedberg2012-03-011-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | The set_le() function was missing hci_dev locking which is e.g. critical for the mgmt pending command adding/removing. Acked-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * | Bluetooth: Fix coding style with breaking linesGustavo F. Padovan2012-03-012-3/+3
| | | | | | | | | | | | | | | | | | Our limit is 80 and broken lines should as right as possible. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
| * | Bluetooth: Fix Kconfig help descriptionAndre Guedes2012-02-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SMP is not a kernel module, it is part of Bluetooth Core (as already described in lines above). Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Acked-by: Gustavo F. Padovan <padovan@profusion.mobi> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * | Bluetooth: Use NULL instead of integer for mgmt_device_connected paramSzymon Janc2012-02-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Last param of mgmt_device_connected is of pointer type, so use NULL instead of 0 for it. This fix following sparse warning: CHECK net/bluetooth/hci_event.c net/bluetooth/hci_event.c:3262:74: warning: Using plain integer as NULL pointer Signed-off-by: Szymon Janc <szymon@janc.net.pl> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * | Bluetooth: Change interleaved discovery behaviorAndre Guedes2012-02-291-24/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to last discussion on IRC, if an interleaved discovery is issued, but the device is not dual mode, we should return error instead of performing a regular BR/EDR or LE-only discovery. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * | Bluetooth: Save remote L2CAP fixed channel maskAndrei Emeltchenko2012-02-291-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed channel mask needs to be stored to decide whether to use A2MP for example. So far save only one relevant byte which keeps all information we need. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * | Bluetooth: change min_t() cast in hci_reassembly()Dan Carpenter2012-02-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "count" is type int so the cast to __u16 truncates the high bits away and triggers a Smatch static checker warning. It looks like a high value of count could cause a forever loop, but I didn't follow it through to see if count is capped somewhere. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * | Bluetooth: use kfree_skb() instead of kfree()Dan Carpenter2012-02-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | sk_buffs should be freed using kfree_skb(). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * | Bluetooth: Use LMP_HOST_SSP define instead of magic valuesJohan Hedberg2012-02-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the code to use the proper LMP_HOST_SSP define instead of magic values and thereby makes the code more readable. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: Remove redundant read_host_features commandsJohan Hedberg2012-02-281-25/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the write_le_enable would trigger a read_host_features command but since we have access to the value LE support was set to we can simply just clear or set the bit in hdev->host_features. This also removes a second unnecessary read_host_features command from the device initialization procedure since LE is only enabled after the first read_host_features command completes. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: Don't send unnecessary write_le_enable commandJohan Hedberg2012-02-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | If the local host features indicate that LE is already in the state that is desired there's no point in sending the HCI command to try to change the setting. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: Use kernel int types instead of ones from stdint.hJohan Hedberg2012-02-274-11/+11
| | | | | | | | | | | | | | | | | | | | | u8/__u8/u32/etc should be used in the kernel instead of stdint.h types. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: Remove duplicated code in l2cap conn reqAndrei Emeltchenko2012-02-241-30/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The same sequence sending L2CAP Connection Request was used in several places. Using subroutine makes those places easy to read. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Reviewed-by: Ulisses Furquim <ulisses@profusion.mobi> Acked-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * | Bluetooth: Fix double locking in LE and conless chanAndrei Emeltchenko2012-02-241-20/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove socket lock since chan->ops->recv locks socket itself. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Reviewed-by: Ulisses Furquim <ulisses@profusion.mobi> Acked-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * | Bluetooth: Fix init request completion with AMP controllersAndrei Emeltchenko2012-02-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Mark request status as done for Read Local Version HCI command. In AMP initialization this HCI command is the last and needs to be completed. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * | Bluetooth: Fix init request completion with old controllersJohan Hedberg2012-02-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | With Bluetooth 1.1 controllers the last command in the HCI init sequence will be a write_local_name, however there was no callback to indicate init request completion in this case. This patch fixes the issue by adding the necessary callback to the write_local_name_complete handler. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * | Bluetooth: mgmt: Fix clear_uuids responseJohan Hedberg2012-02-231-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the clear_uuids operation doesn't send an immediate HCI command but just sets off a timer to wait for subsequent add_uuid calls it doesn't make sense to wait until the timer fires off to send the response. Instead send the response immediately. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: mgmt: Fix dev_class related command response timingJohan Hedberg2012-02-231-5/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | All mgmt commands that may fire off a hci_write_class_of_device command should wait for the completion of the HCI command before sending a response to user space. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: mgmt: Track pending class changesJohan Hedberg2012-02-231-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a flag to track pending changes to the class of device. This is needed since we cannot cleanly handle multiple simultaneous commands and need to return a "busy" error status in the mgmt commands that might trigger a class change. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: mgmt: Add flags parameter to device_connectedJohan Hedberg2012-02-232-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | This patch updates the Device Connected events to match the latest API by adding a flags parameter to them. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: mgmt: Fix clear UUIDs responseJohan Hedberg2012-02-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | We also need to send a proper response when clearing UUIDs. This patch adds fixes the missing response for this use case. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: mgmt: Move service cache setting to a more sensible placeJohan Hedberg2012-02-231-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we can now add UUIDs when powered off we don't really need to always use the service cache to avoid large bursts of HCI commands. Instead, the only important use case is when we're already powered and user space starts to initialize itself. This can be easiest detected by a "clear UUIDs" operation which is where this patch moves the service cache setting. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: mgmt: Fix return value of add/remove_uuidJohan Hedberg2012-02-231-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | The Add/Remove UUID commands should return the device class instead of an empty parameter list. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Gustavo F. Padovan <padovan@profusion.mobi> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: mgmt: Fix update_eir/class with HCI_AUTO_OFF flag setJohan Hedberg2012-02-231-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we're powered but still have the HCI_AUTO_OFF flag set the update_eir and update_class functions should not do anything. Additionally these functions need to be called when the flag is finally cleared through set_powered or when powering on for real. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Gustavo F. Padovan <padovan@profusion.mobi> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: Set DISCOVERY_STOPPED if controller resetsAndre Guedes2012-02-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If controller is reset during the discovery procedure, Start Discovery command stops working. This can be easily reproduced by running "hciconfig hci0 reset" while discovering devices, for instance. We should force discovery state to DISCOVERY_STOPPED in case we receive a reset command complete event. Otherwise we may stuck in one of the active discovery states (DISCOVERY_INQUIRY, DISCOVERY_LE_SCAN and DISCOVERY_RESOLVING) and subsequent Start Discovery commands will simply fail. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * | Bluetooth: mgmt: Fix count parameter in get_connections replyJohan Hedberg2012-02-231-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the count parameter in the Get Connections reply message. We cannot know the right number until iterating through all connections so set the parameter value only after the loop. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Marcel Holtmann <marcel@holtmann.org>
| * | Bluetooth: Remove socket lock checkAndrei Emeltchenko2012-02-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Simplify code so that we do not need to check whether socket is locked. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Acked-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
| * | Bluetooth: Change sk lock to chan lock in L2CAP coreAndrei Emeltchenko2012-02-232-70/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change sk lock to chan lock in l2cap core and move sk locks to l2cap sock code. bh_locks were used because of being RCU critical section. When needed use explicit socket locks. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Reviewed-by: Ulisses Furquim <ulisses@profusion.mobi> Acked-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>