28 Feb, 2017
1 commit
-
Fix typos and add the following to the scripts/spelling.txt:
an user||a user
an userspace||a userspaceI also added "userspace" to the list since it is a common word in Linux.
I found some instances for "an userfaultfd", but I did not add it to the
list. I felt it is endless to find words that start with "user" such as
"userland" etc., so must draw a line somewhere.Link: http://lkml.kernel.org/r/1481573103-11329-4-git-send-email-yamada.masahiro@socionext.com
Signed-off-by: Masahiro Yamada
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
20 Sep, 2016
13 commits
-
When opening and closing HCI user channel, send monitoring messages to
be able to trace its behavior.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg -
In case an unbound HCI raw socket is later on bound, ensure that the
monitor notification messages indicate a close and re-open. None of
the userspace tools use the socket this, but it is actually possible
to use an ioctl on an unbound socket and then later bind it.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg -
When opening and closing HCI raw sockets their main usage is for legacy
userspace. To track interaction with the modern mgmt interface, send
open and close monitoring messages for these action.The HCI raw sockets is special since it supports unbound ioctl operation
and for that special case delay the notification message until at least
one ioctl has been executed. The difference between a bound and unbound
socket will be detailed by the fact the HCI index is present or not.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg -
The control open and close monitoring events require special channel
checks to ensure messages are only send when the right events happen.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg -
Assignment of the hci_pi(sk)->channel should be done early when binding
the HCI socket. This avoids confusion with the RAW channel that is used
for legacy access.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg -
Only when the cookie has been assigned, then send the open and close
monitor messages. Also if the socket is bound to a device, then include
the index into the message.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg -
Instead of keeping a version string around, use version and revision
numbers and then stringify them for use as module parameter.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg -
Instead of manually allocating cookie information each time, use helper
functions for generating and releasing cookies.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg -
Instead of hiding everything behind a general managment events flag,
introduce indivdual flags that allow fine control over which events are
send to a given management channel.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg -
This adds support for tracing all management commands and events via the
monitor interface.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg -
This sends new notifications to the monitor support whenever a
management channel has been opened or closed. This allows tracing of
control channels really easily.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg -
To further allow unique identification and tracking of control socket,
store cookie and comm information when binding the socket.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg -
The SOL_HCI level should be enforced when using socket options on the
HCI raw socket interface.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg
26 Aug, 2016
1 commit
-
Similar to bt_sock_recvmsg MSG_TRUNC shall be checked using the original
flags not msg_flags.Signed-off-by: Luiz Augusto von Dentz
Signed-off-by: Marcel Holtmann
10 Jul, 2016
1 commit
-
The HCI_BREDR naming is confusing since it actually stands for Primary
Bluetooth Controller. Which is a term that has been used in the latest
standard. However from a legacy point of view there only really have
been Basic Rate (BR) and Enhanced Data Rate (EDR). Recent versions of
Bluetooth introduced Low Energy (LE) and made this terminology a little
bit confused since Dual Mode Controllers include BR/EDR and LE. To
simplify this the name HCI_PRIMARY stands for the Primary Controller
which can be a single mode or dual mode controller.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg
08 Jul, 2016
1 commit
-
If recvmsg is called with a destination buffer that is too small to
receive the contents of skb in its entirety, the return value from
recvmsg was inconsistent with common SOCK_SEQPACKET or SOCK_DGRAM
semantics.If destination buffer provided by userspace is too small (e.g. len <
copied), then MSG_TRUNC flag is set and copied is returned. Instead, it
should return the length of the message, which is consistent with how
other datagram based sockets act. Quoting 'man recv':"All three calls return the length of the message on successful comple‐
tion. If a message is too long to fit in the supplied buffer, excess
bytes may be discarded depending on the type of socket the message is
received from."and
"MSG_TRUNC (since Linux 2.2)
For raw (AF_PACKET), Internet datagram (since Linux
2.4.27/2.6.8), netlink (since Linux 2.6.22), and UNIX datagram
(since Linux 3.4) sockets: return the real length of the packet
or datagram, even when it was longer than the passed buffer."Signed-off-by: Denis Kenzior
Signed-off-by: Marcel Holtmann
06 Jan, 2016
1 commit
-
Instead, allow using string formatting with send_monitor_note()
and access init_utsname().Signed-off-by: Johannes Berg
Signed-off-by: Marcel Holtmann
20 Nov, 2015
6 commits
-
To enable controller specific logging, the userspace daemon has to have
the ability to log per controller. To facilitate this support, provide
a dedicated logging channel. Messages in this channel will be included
in the monitor queue and with that also forwarded to monitoring tools
along with the actual hardware traces.All messages from the logging channel are timestamped and with that
allow an easy correlation between userspace messages and hardware
events. This will increase the ability to debug problems faster.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg -
The monitor channel can be used to send generic system notes as text
strings for debugging purposes. This adds the system note monitor code
and uses it for including kernel and subsystem version into traces.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg -
The HCI sockets code has still some old casting coding style. Fix this
to match with the rest of the code.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg -
When HCI commands are injected via the raw socket, the core was not
including the decoded opcode value. So ensure that it is actually set.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg -
We can reduce the size of the hci_ctrl struct by converting
'bool req_start' to 'u8 req_flags' and making the two function
pointers a union (since only one is ever set at a time).Signed-off-by: Johan Hedberg
Signed-off-by: Marcel Holtmann -
The new hci_skb_pkt_* wrappers only help if they are used consistently
in the Bluetooth subsystem. So first convert the core packet handling.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg
26 Oct, 2015
2 commits
-
The SKB context buffer for HCI request is really not just for requests,
information in their are preserved for the whole HCI layer. So it makes
more sense to actually rename it into bt_cb()->hci and also call it then
struct hci_ctrl.In addition that allows moving the decoded opcode for outgoing packets
into that struct. So far it was just consuming valuable space from the
main shared items. And opcode are not valid for L2CAP packets.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg -
There are two checks that are still using (MSG_OOB) instead of just
MSG_OOB and so lets just fix them.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg
21 Oct, 2015
3 commits
-
Before the vendor specific setup stage is triggered call back into the
core to trigger an internal notification event. That event is used to
send an index update to the monitor interface. With that specific event
it is possible to update userspace with manufacturer information before
any HCI command has been executed. This is useful for early stage
debugging of vendor specific initialization sequences.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg -
When using the HCI_CHANNEL_RAW, restrict the packet types to valid ones
from the Bluetooth specification.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg -
The HCI_VENDOR_PKT quirk was needed for BPA-100/105 devices that send
these messages. Now that there is support for proper diagnostic channel
this quirk is no longer needed.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg
08 Oct, 2015
2 commits
-
Introduce hci_recv_diag function for HCI drivers to allow sending vendor
specific diagnostic messages into the Bluetooth core stack. The messages
are not processed, but they are forwarded to the monitor channel and can
be retrieved by user space diagnostic tools.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg -
The Bluetooth public device address might change during controller setup
and it makes it a lot simpler for monitoring tools if they just get told
what the new address is. In addition include the manufacturer / company
information of the controller. That allows for easy vendor specific HCI
command and event handling.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg
05 Oct, 2015
2 commits
-
When the core starts or shuts down the actual HCI transport, send a new
monitor event that indicates that this is happening. These new events
correspond to HCI_DEV_OPEN and HCI_DEV_CLOSE events.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg -
The stack internal events that are exposed to userspace should be
limited to HCI_DEV_REG, HCI_DEV_UNREG, HCI_DEV_UP and HCI_DEV_DOWN.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg
17 Sep, 2015
1 commit
-
With 9380f9eacfbbee701daa416edd6625efcd3e29e1 the order of unsetting
the HCI_USER_CHANNEL flag of the HCI device was reverted to ensure
the device is first closed before making it available again.Due to hci_dev_close checking for HCI_USER_CHANNEL being set on the
device it was never really closed and was kept opened. We're now
calling hci_dev_do_close directly to make sure the device is correctly
closed and we keep the correct order to unset the flag on our device
object.Signed-off-by: Simon Fels
Signed-off-by: Marcel Holtmann
08 Jun, 2015
1 commit
-
During the initial setup stage of a controller, the low-level transport
is actually active. This means that HCI_UP is true. To avoid toggling
the transport off and back on again for normal operation the kernel
holds a grace period with HCI_AUTO_OFF that will turn the low-level
transport off in case no user is present.The idea of the grace period is important to avoid having to initialize
all of the controller twice. So legacy ioctl and the new management
interface knows how to clear this grace period and then start normal
operation.For the user channel operation this grace period has not been taken into
account which results in the problem that HCI_UP and HCI_AUTO_OFF are
set and the kernel will return EBUSY. However from a system point of
view the controller is ready to be grabbed by either the ioctl, the
management interface or the user channel.This patch brings the user channel to the same level as the other two
entries for operating a controller.Signed-off-by: Marcel Holtmann
Signed-off-by: Johan Hedberg
Cc: stable@vger.kernel.org
07 Jun, 2015
1 commit
-
The hci close method needs to know if we are in user channel context.
Only add the index to mgmt once close is performed.Signed-off-by: Loic Poulain
Signed-off-by: Marcel Holtmann
11 May, 2015
1 commit
-
In preparation for changing how struct net is refcounted
on kernel sockets pass the knowledge that we are creating
a kernel socket from sock_create_kern through to sk_alloc.Signed-off-by: "Eric W. Biederman"
Signed-off-by: David S. Miller
31 Mar, 2015
1 commit
-
In order to shrink the size of bt_skb_cb, this patch moves the HCI
request related variables into their own req_ctrl struct. Additionall
the L2CAP and HCI request structs are placed inside the same union since
they will never be used at the same time for the same skb.Signed-off-by: Johan Hedberg
Signed-off-by: Marcel Holtmann
18 Mar, 2015
2 commits
-
The mgmt.c file should be reserved purely for HCI_CHANNEL_CONTROL. The
mgmt_control() function in it is already completely generic and has a
single user in hci_sock.c. This patch moves the function there and
renames it a bit more appropriately to hci_mgmt_cmd() (as it's a command
dispatcher).Signed-off-by: Johan Hedberg
Signed-off-by: Marcel Holtmann -
We'll need to have access to which HCI channel a socket is bound to, in
order to manage pending mgmt commands in clean way. This patch adds a
helper for the purpose.Signed-off-by: Johan Hedberg
Signed-off-by: Marcel Holtmann