This patch adds management connect failed event when LE Create Connection
Command fails to inform user space that LE Connection failed to get
established.
Signed-off-by: Hemant Gupta <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
This patch prevents resetting of discovery type while stopping
discovery, since otherwise the wrong type might be send in case of
discovery failure. It also doesn't matter that we are "lazy" with
updating the type since it is anyway reset when starting discovery again
and it's not needed to know the current discovery state.
Signed-off-by: Hemant Gupta <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
This patch removes the MGMT_ADDR_INVALID macro. If the address type
isn't LE, we consider it is BR/EDR type.
Signed-off-by: Andre Guedes <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
This patch updates the address type sent from kernel to management
interface of BlueZ while sending the Long Term Key.
Signed-off-by: Hemant Gupta <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
Remove zero initialization since channel is allocated with kzalloc
in l2cap_chan_create.
Signed-off-by: Andrei Emeltchenko <[email protected]>
Acked-by: Marcel Holtmann <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
For each kernel release where commands or events are added to the
management interface, the revision field should be increment by one.
The increment should only happen once per kernel release and not
for every command/event that gets added. The revision value is for
informational purposes only, but this simple policy would make any
future debugging a lot simple.
Signed-off-by: Marcel Holtmann <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
Following the separation if core and sock code this change avoid
manipulation of sk inside l2cap_chan_create().
Signed-off-by: Gustavo Padovan <[email protected]>
Remove sparse warnings below:
...
net/bluetooth/l2cap_core.c:302:6: warning: symbol '__l2cap_chan_add' was
not declared. Should it be static?
net/bluetooth/l2cap_core.c:351:6: warning: symbol 'l2cap_chan_add' was
not declared. Should it be static?
...
Signed-off-by: Andrei Emeltchenko <[email protected]>
Acked-by: Marcel Holtmann <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
This patch changes inquiry result function handlers so they ignore
inquiry result events if periodic inquiry is enabled.
Signed-off-by: Andre Guedes <[email protected]>
Acked-by: Marcel Holtmann <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
This patch adds a HCI_PERIODIC_INQ check to start_discovery.
If periodic inquiry is enabled, we fail MGMT Start Discovery
command with MGMT_STATUS_BUSY code.
Signed-off-by: Andre Guedes <[email protected]>
Acked-by: Marcel Holtmann <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
This patch adds the HCI_PERIODIC_INQ flag to dev_flags. This flag
tracks if periodic inquiry is enabled or not.
Signed-off-by: Andre Guedes <[email protected]>
Acked-by: Marcel Holtmann <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
This patch does a trivial code refactoring in stop_discovery
function by using a switch statement instead of an if-return-else
approach.
Signed-off-by: Andre Guedes <[email protected]>
Acked-by: Marcel Holtmann <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
We should return -EALREADY in hci_cancel_inquiry since it is more
suitable than -EPERM error code.
Signed-off-by: Andre Guedes <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
Reply with MGMT_STATUS_INVALID_PARAMS when userspace is trying to set
source with out-of-scope value.
Signed-off-by: Szymon Janc <[email protected]>
Acked-by: Gustavo Padovan <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
This patch adds LE support to MGMT stop discovery command. So,
now we are able to cancel LE discovery procedures (LE-only and
interleaved).
Signed-off-by: Andre Guedes <[email protected]>
Acked-by: Marcel Holtmann <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
This patch adds to hci_core the hci_cancel_le_scan function which
should be used to cancel an ongoing LE scan.
Signed-off-by: Andre Guedes <[email protected]>
Acked-by: Marcel Holtmann <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
Fix sparse warnings related to incorrect type in assignment and static
symbol. Also use const keyword. Warnings are shown below:
...
net/bluetooth/mgmt.c:305:28: warning: incorrect type in assignment
(different base types)
net/bluetooth/mgmt.c:305:28: expected unsigned short [usertype] *opcode
net/bluetooth/mgmt.c:305:28: got restricted __le16 *<noident>
...
net/bluetooth/mgmt.c:2609:3: warning: symbol 'mgmt_handlers' was not declared.
Should it be static?
...
Signed-off-by: Andrei Emeltchenko <[email protected]>
Acked-by: Marcel Holtmann <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
In case the struct is already __packed, there is no need to use unaligned
access to the data. So just use __le16_to_cpu in these cases.
Signed-off-by: Marcel Holtmann <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
opcode to be accessed is in le16 format so convert it
first to cpu byte order.
Signed-off-by: Andrei Emeltchenko <[email protected]>
Acked-by: Marcel Holtmann <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
In L2CAP we use le16 format so change direction of conversion
from le16_to_cpu to cpu_to_le16.
Signed-off-by: Andrei Emeltchenko <[email protected]>
Acked-by: Marcel Holtmann <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
Create Chan Rsp shall put result and status in le format.
Signed-off-by: Andrei Emeltchenko <[email protected]>
Acked-by: Marcel Holtmann <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
L2CAP channel id is used in host format in internal L2CAP code.
Fix sparse warnings about wrong endian conversion.
Signed-off-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
cmd->len is in le format so convert it to host format before use.
Signed-off-by: Andrei Emeltchenko <[email protected]>
Acked-by: Marcel Holtmann <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
In case the struct is already __packed, there is no need to use
unaligned access to the data. So just use cpu_to_le16 or
__constant_cpu_to_le16 in these cases.
Signed-off-by: Marcel Holtmann <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
The Device ID details need to be programmed into the kernel for every
controller at least once. So provide management command for this.
Signed-off-by: Marcel Holtmann <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
The Device ID information can be provided via Extended Inquiry Data
as well. If a valid source is present, then include it.
Signed-off-by: Marcel Holtmann <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
The Inquiry Response TX power tag should be added to the Extended
Inquiry Data (EIR) as well.
Signed-off-by: Marcel Holtmann <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
We initialize the "struct device" in hci_alloc_dev() for a long time now
so we can access hdev->dev.parent directly. Hence, we can drop the
temporary field hdev->parent which is used in no other place than
hci_add_sysfs().
SET_HCIDEV_DEV() is never called after registering a device by the
drivers so we do not overwrite internal device-state. Furthermore,
hdev->dev is initialized to 0 by kzalloc() inside hci_alloc_dev() so the
default behavior with dev.parent = NULL is kept.
Signed-off-by: David Herrmann <[email protected]>
Acked-by: Marcel Holtmann <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
In order to do interleaved discovery we should be in DISCOVERY_
FINDING state. Otherwise, discovery should be stopped.
Signed-off-by: Andre Guedes <[email protected]>
Signed-off-by: Gustavo F. Padovan <[email protected]>
chan->psm is kept in __le16 format which was not always taken
into account. Fix several bugs related to extra conversion.
Signed-off-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Gustavo F. Padovan <[email protected]>
Value to be converted is already in __le32 format.
Signed-off-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Gustavo F. Padovan <[email protected]>
Correct type warnings reported by sparse to show that this
functions takes ediv argument in __le16 format.
Signed-off-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Gustavo F. Padovan <[email protected]>
In each remaining case the tty_lock is associated with a specific tty. This
means we can now lock on a per tty basis. We do need tty_lock_pair() for
the pty case. Uglier but still a step in the right direction.
[fixed up calls in 3 missing drivers - gregkh]
Signed-off-by: Alan Cox <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Move the hid drivers of the bus drivers to a common generic hid
driver, and make it a proper module. This ought to simplify device
handling moving forward.
Cc: Gustavo Padovan <[email protected]>
Signed-off-by: Henrik Rydberg <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Devices that do not have a special driver are handled by the generic
driver. This patch does the same thing using device groups; Instead of
forcing a particular driver, the appropriate driver is picked up by
udev. As a consequence, one can now move a device from generic to
specific handling by a simple rebind. By adding a new device id to the
generic driver, the same thing can be done in reverse.
Signed-off-by: Henrik Rydberg <[email protected]>
Acked-by: Benjamin Tissoires <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Command complete event for HCI_OP_USER_PASSKEY_NEG_REPLY would result
in calling handler function also for HCI_OP_LE_SET_SCAN_PARAM. This
could result in undefined behaviour.
Signed-off-by: Szymon Janc <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
If a key is non persistent then it should not be used in future
connections but it should be kept for current connection. And it
should be removed when connecion is removed.
Signed-off-by: Vishal Agarwal <[email protected]>
Acked-by: Marcel Holtmann <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
This patch changes the return type of function hci_persistent_key
from int to bool because it makes more sense to return information
whether a key is persistent or not as a bool.
Signed-off-by: Vishal Agarwal <[email protected]>
Acked-by: Marcel Holtmann <[email protected]>
Signed-off-by: Johan Hedberg <[email protected]>
This means converting an atomic counter to a counter protected by
lock. This is the first step needed to convert the rest of the code to
the tty_port helpers.
Signed-off-by: Jiri Slaby <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>