Commit Graph

86 Commits

Author SHA1 Message Date
Brian Campbell
9affcf438b bluetooth/hccontrol: Fix unterminated command list
Signed-off-by: Brian Campbell <Brian.Campbell@ed.ac.uk>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/730
2023-05-04 16:01:36 -06:00
Simon J. Gerraty
d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
Elyes Haouas
beb2af45bd bluetooth/hccontrol: Remove useless return at the end of void function
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/656
2023-03-02 07:59:10 -07:00
Maxim Konovalov
b620928d54 hccontrol.8: missed underscore fixed.
PR:	267343
2022-10-25 16:29:44 +00:00
Warner Losh
66d6299848 bluetooth: remove hcseriald
Without ng_h4 gone, there's no need for hcseriald.

Sponsored by:		Netflix
2021-09-29 21:18:17 -06:00
Gordon Bergling
60ee05db4b bluetooth: Fix a mandoc related issues
- new sentence, new line
- sections out of conventional order: Sh FILES
- unusual Xr order: bthost(1) after bthidd(8)
- no blank before trailing delimiter
- whitespace at end of input line
- sections out of conventional order: Sh EXIT STATUS

MFC after:	1 week
2020-12-19 13:36:59 +00:00
Takanori Watanabe
2105611236 Add le_rand command.
PR: 247808
Submitted by: Marc Veldman
2020-07-08 03:57:47 +00:00
Takanori Watanabe
2b2c6d6919 Add le_read_channel_map and le_read_remote_features command
PR: 247051
Submitted by:	  Marc Veldman marc at bumblingdork.com
2020-06-10 05:01:00 +00:00
Takanori Watanabe
f8143ed773 Fix connection event message string (n->\n)
PR: 246664
Submitted by: Marc Veldman (marc@bumblngdork.com)
Reported by:	Jose Luis Duran (jlduran@gmail.com)
2020-05-28 13:48:33 +00:00
Takanori Watanabe
3ac41cce63 Add le_connect command to connect to an LE device.
PR:246664
Submitted by:MarcVeldman
2020-05-26 15:46:18 +00:00
Takanori Watanabe
11fb4bdb4d Add LE Whitelist commands to hccontrol
PR: 214555
Submitted by Marc Veldman
2020-05-19 13:44:32 +00:00
Takanori Watanabe
9287f06d08 Add le_scan subcommand to hccontrol.
PR: 246141
Submitted by:	Marc Veldman
2020-05-11 15:32:32 +00:00
Takanori Watanabe
e961db83e5 Document le_enable subcommand 2020-05-08 01:19:29 +00:00
Takanori Watanabe
1f5d883dd7 Add le_read_buffer_size command and manpage.
It supports both v1 and v2 command.

PR:245964
Submitted by:	Marc Veldman <marc@bumblingdork.com>
2020-04-28 16:00:34 +00:00
Takanori Watanabe
eb2aebeafd Improve error handling
Check return values from hci_request()
Check rp.status
Print error messages with hci_status2str()

PR:	245769
Submitted by:	Marc Veldman
2020-04-28 13:28:58 +00:00
Takanori Watanabe
6ececd21a6 Resolve vendor id to string. 2020-04-27 09:13:22 +00:00
Takanori Watanabe
84662d68e5 Fix advertise packet parsing.
Differential Revision:	https://reviews.freebsd.org/D21779
2020-04-27 02:48:49 +00:00
Hans Petter Selasky
32f32669c3 Properly update AD field length in hccontrol(8).
While at it use strtol() instead of atoi() to support hexadecimal
numbers aswell as 10-base numbers.

Submitted by:	Marc Veldman <marc@bumblingdork.com>
PR:		245899
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-04-26 08:31:08 +00:00
Hans Petter Selasky
7b2f84db82 Put advertising data in correct place.
Submitted by:	Marc Veldman <marc@bumblingdork.com>
PR:		245848
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-04-25 00:57:48 +00:00
Hans Petter Selasky
f75d5ee735 Rename two commands to match the Bluetooth specification in hccontrol(8).
Fix some bad spelling while at it.

Submitted by:	Marc Veldman <marc@bumblingdork.com>
PR:		245868
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-04-24 14:53:55 +00:00
Hans Petter Selasky
c3f60abc30 Add support for LE advertising to hccontrol(8).
Submitted by:	Marc Veldman <marc@bumblingdork.com>
PR:		245848
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-04-24 08:07:59 +00:00
Hans Petter Selasky
1719371ae5 Add support for Read_Local_Supported_Commands command to hccontrol(8).
Submitted by:	Marc Veldman <marc@bumblingdork.com>
PR:		245811
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-04-22 14:38:39 +00:00
Hans Petter Selasky
872d83be7b Update string tables in hccontrol(8).
Submitted by:	Marc Veldman <marc@bumblingdork.com>
PR:		245796
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-04-21 17:51:54 +00:00
Hans Petter Selasky
21eefd310a Substitute le_read_supported_status with le_read_supported_states.
Refer to bluetooth core v5.2 specifications Vol4. Part E. 7.8.27.

PR:		245763
Submitted by:	Marc Veldman <marc@bumblingdork.com>
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-04-20 13:44:14 +00:00
Hans Petter Selasky
6cf6c1510d Fix cut and paste off-by-one error in hccontrol(8).
Make sure strncpy() doesn't write beyond its given buffer.

PR:		245739
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-04-19 14:25:56 +00:00
Hans Petter Selasky
ea01149104 Improve printing of le features in hccontrol(8).
Submitted by:	Marc Veldman <marc@bumblingdork.com>
PR:		245739
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-04-19 14:22:21 +00:00
Hans Petter Selasky
3bc36313e4 Bring HCI error messages up-to-date.
See Bluetooth v5.6 core specification Vol.1 Part F: Controller error codes.

Submitted by:	Marc Veldman <marc@bumblingdork.com>
PR:		245737
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-04-19 10:24:15 +00:00
Hans Petter Selasky
6f80a2c88e Add missing feature descriptions to hci_features2str().
The list of possible features in hccontrol/features2str() is incomplete.
Refer to "Bluetooth Core Specification 5.2 Vol. 2 Part C. 3.3 Feature Mask Definition".

Submitted by:	Marc Veldman <marc@bumblingdork.com>
PR:		245354
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-04-18 08:29:16 +00:00
Ed Maste
b4b880cb6d correct 'disble' typo in hccontrol
PR:		245125
Submitted by:	Marc Veldman
MFC after:	1 week
2020-03-30 17:38:13 +00:00
Emmanuel Vadot
9553ea80a8 pkgbase: Add a FreeBSD-bluetooth package
Move the bluetooth related files from FreeBSD-runtime to a new package named
FreeBSD-bluetooth
The FreeBSD runtime is only intended to have everything for a working
FreeBSD installation and bluetooth isn't needed for that.

Reviewed by:	bapt, gjb
Differential Revision:	https://reviews.freebsd.org/D20959
2019-07-19 15:10:03 +00:00
Brad Davis
c8e7055577 Move all bluetooth related config files out of etc
This helps with pkgbase by switching to CONFS so they are properly tagged as
config files.

Approved by:	will (mentor)
Differential Revision:	https://reviews.freebsd.org/D16833
2018-08-21 19:28:53 +00:00
Pedro F. Giffuni
1de7b4b805 various: general adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
2017-11-27 15:37:16 +00:00
Bryan Drewery
ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Stephen J. Kiernan
63c1ff65d1 When the input parameter node is NULL, memory is allocated to it.
To later free the memory, introduce a new variable lnode to track when
this happens.

Submitted by:	Thomas Rix <trix@juniper.net>
Reviewed by:	emax
Approved by:	sjg (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D9878
2017-06-06 22:17:55 +00:00
Takanori Watanabe
4aa92fe2f3 Make cached Bluetooth LE host advertise information visible from userland.
Differential Revision:	https://reviews.freebsd.org/D10362
2017-04-27 15:03:24 +00:00
Alan Somers
8907f744ff Improve performance and functionality of the bitstring(3) api
Two new functions are provided, bit_ffs_at() and bit_ffc_at(), which allow
for efficient searching of set or cleared bits starting from any bit offset
within the bit string.

Performance is improved by operating on longs instead of bytes and using
ffsl() for searches within a long. ffsl() is a compiler builtin in both
clang and gcc for most architectures, converting what was a brute force
while loop search into a couple of instructions.

All of the bitstring(3) API continues to be contained in the header file.
Some of the functions are large enough that perhaps they should be uninlined
and moved to a library, but that is beyond the scope of this commit.

sys/sys/bitstring.h:
        Convert the majority of the existing bit string implementation from
        macros to inline functions.

        Properly protect the implementation from inadvertant macro expansion
        when included in a user's program by prefixing all private
        macros/functions and local variables with '_'.

        Add bit_ffs_at() and bit_ffc_at(). Implement bit_ffs() and
        bit_ffc() in terms of their "at" counterparts.

        Provide a kernel implementation of bit_alloc(), making the full API
        usable in the kernel.

        Improve code documenation.

share/man/man3/bitstring.3:
        Add pre-exisiting API bit_ffc() to the synopsis.

        Document new APIs.

        Document the initialization state of the bit strings
        allocated/declared by bit_alloc() and bit_decl().

        Correct documentation for bitstr_size(). The original code comments
        indicate the size is in bytes, not "elements of bitstr_t". The new
        implementation follows this lead. Only hastd assumed "elements"
        rather than bytes and it has been corrected.

etc/mtree/BSD.tests.dist:
tests/sys/Makefile:
tests/sys/sys/Makefile:
tests/sys/sys/bitstring.c:
        Add tests for all existing and new functionality.

include/bitstring.h
	Include all headers needed by sys/bitstring.h

lib/libbluetooth/bluetooth.h:
usr.sbin/bluetooth/hccontrol/le.c:
        Include bitstring.h instead of sys/bitstring.h.

sbin/hastd/activemap.c:
        Correct usage of bitstr_size().

sys/dev/xen/blkback/blkback.c
        Use new bit_alloc.

sys/kern/subr_unit.c:
        Remove hard-coded assumption that sizeof(bitstr_t) is 1.  Get rid of
        unrb.busy, which caches the number of bits set in unrb.map.  When
        INVARIANTS are disabled, nothing needs to know that information.
        callapse_unr can be adapted to use bit_ffs and bit_ffc instead.
        Eliminating unrb.busy saves memory, simplifies the code, and
        provides a slight speedup when INVARIANTS are disabled.

sys/net/flowtable.c:
        Use the new kernel implementation of bit-alloc, instead of hacking
        the old libc-dependent macro.

sys/sys/param.h
        Update __FreeBSD_version to indicate availability of new API

Submitted by:   gibbs, asomers
Reviewed by:    gibbs, ngie
MFC after:      4 weeks
Sponsored by:   Spectra Logic Corp
Differential Revision:  https://reviews.freebsd.org/D6004
2016-05-04 22:34:11 +00:00
Pedro F. Giffuni
beb45c4fd4 bluetooth: minor spelling fixes.
User-visible strings.

MFC after:	2 weeks
2016-05-01 16:36:14 +00:00
Takanori Watanabe
05e526fb5a fix compare argument for address type.
Submitted by: issei10193 (via Twitter)
2015-09-09 13:24:39 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Takanori Watanabe
4cae2db2a8 To ensure j formatting string valid, cast uint64_t values to uintmax_t. 2015-04-18 17:41:09 +00:00
Takanori Watanabe
4315b1cb29 Change printf formatting to unbroke i386 arch.
Submitted by:david@catwhisker.org
2015-04-18 16:04:32 +00:00
Takanori Watanabe
bf9b5107ef Fix Typo. 2015-04-18 09:08:47 +00:00
Marcelo Araujo
af5c4f8b4b Fix misspelling. 2015-04-18 06:53:13 +00:00
Marcelo Araujo
9c3471fa12 Improve code style(9), no functional changes.
Differential Revision:	D2320
Reviewed by:		takawata
2015-04-18 06:48:03 +00:00
Takanori Watanabe
bcff2d9100 Add LE related HCI control command to hccontrol(1). 2015-04-18 04:53:17 +00:00
Takanori Watanabe
bb9157d5e3 Accept LE event on hccontrol socket. 2015-04-12 15:08:41 +00:00
Takanori Watanabe
4bb0556352 Add HCI/LMP revision information. 2015-04-12 14:38:18 +00:00
Takanori Watanabe
8d6f425ddd Check l2cap socket initialisation and define L2CAP_SOCKET_CHECKED
This will fix build.
2015-04-07 16:48:23 +00:00