aboutsummaryrefslogtreecommitdiffstats
path: root/sys/netgraph/bluetooth
Commit message (Collapse)AuthorAgeFilesLines
* MFS r366395: Fix Typo in ng_hci_le_connection_complete_ep struct.Kyle Evans2020-10-041-1/+1
| | | | | | | Approved by: re (gjb) Notes: svn path=/releng/12.2/; revision=366419
* MFC: 364430:Warner Losh2020-09-091-0/+2
| | | | | | | | | | | | | r364430 | imp | 2020-08-20 11:19:40 -0600 (Thu, 20 Aug 2020) | 6 lines Tag pccard drivers with gone in 13. MFC After: 3 days Reviewed by: emaste, brooks, adrian (on twitter) Differential Revision: https://reviews.freebsd.org/D26095 Notes: svn path=/stable/12/; revision=365539
* MFC r364509:Mark Johnston2020-08-301-0/+1
| | | | | | | | | ng_ubt: Add a device ID. PR: 248838 Notes: svn path=/stable/12/; revision=364972
* MFC r361582:Hans Petter Selasky2020-06-081-3/+4
| | | | | | | | | | Fix check for wMaxPacketSize in USB bluetooth driver, in case device is not FULL speed. Sponsored by: Mellanox Technologies Notes: svn path=/stable/12/; revision=361914
* MFC r360116:Hans Petter Selasky2020-05-182-5/+5
| | | | | | | | | | | | 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> Sponsored by: Mellanox Technologies Notes: svn path=/stable/12/; revision=361164
* MFC r360092:Hans Petter Selasky2020-05-181-1/+29
| | | | | | | | | | | | 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 Sponsored by: Mellanox Technologies Notes: svn path=/stable/12/; revision=361155
* MFC r351196, r351324, r351326:Vladimir Kondratyev2019-09-093-2/+322
| | | | | | | | | | | | | | | | | | | | | | | ng_ubt(4): do not attach Intel Wireless 8260/8265 in bootloader mode. Add helper function for synchronous execution of HCI commands at probe stage and use this function to check firmware state of Intel Wireless 8260/8265 bluetooth devices found in many post 2016 year laptops. Attempt to initialize FreeBSD bluetooth stack while such a device is in bootloader mode locks the adapter hardly so it requires power on/off cycle to restore. This change blocks ng_ubt attachment unless operational firmware is loaded thus preventing the lock up. PR: 237083 Reviewed by: hps, emax MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D21071 Notes: svn path=/stable/12/; revision=352101
* sys: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-2750-0/+100
| | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=326272
* Listening sockets improvements.Gleb Smirnoff2017-06-083-58/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Separate fields of struct socket that belong to listening from fields that belong to normal dataflow, and unionize them. This shrinks the structure a bit. - Take out selinfo's from the socket buffers into the socket. The first reason is to support braindamaged scenario when a socket is added to kevent(2) and then listen(2) is cast on it. The second reason is that there is future plan to make socket buffers pluggable, so that for a dataflow socket a socket buffer can be changed, and in this case we also want to keep same selinfos through the lifetime of a socket. - Remove struct struct so_accf. Since now listening stuff no longer affects struct socket size, just move its fields into listening part of the union. - Provide sol_upcall field and enforce that so_upcall_set() may be called only on a dataflow socket, which has buffers, and for listening sockets provide solisten_upcall_set(). o Remove ACCEPT_LOCK() global. - Add a mutex to socket, to be used instead of socket buffer lock to lock fields of struct socket that don't belong to a socket buffer. - Allow to acquire two socket locks, but the first one must belong to a listening socket. - Make soref()/sorele() to use atomic(9). This allows in some situations to do soref() without owning socket lock. There is place for improvement here, it is possible to make sorele() also to lock optionally. - Most protocols aren't touched by this change, except UNIX local sockets. See below for more information. o Reduce copy-and-paste in kernel modules that accept connections from listening sockets: provide function solisten_dequeue(), and use it in the following modules: ctl(4), iscsi(4), ng_btsocket(4), ng_ksocket(4), infiniband, rpc. o UNIX local sockets. - Removal of ACCEPT_LOCK() global uncovered several races in the UNIX local sockets. Most races exist around spawning a new socket, when we are connecting to a local listening socket. To cover them, we need to hold locks on both PCBs when spawning a third one. This means holding them across sonewconn(). This creates a LOR between pcb locks and unp_list_lock. - To fix the new LOR, abandon the global unp_list_lock in favor of global unp_link_lock. Indeed, separating these two locks didn't provide us any extra parralelism in the UNIX sockets. - Now call into uipc_attach() may happen with unp_link_lock hold if, we are accepting, or without unp_link_lock in case if we are just creating a socket. - Another problem in UNIX sockets is that uipc_close() basicly did nothing for a listening socket. The vnode remained opened for connections. This is fixed by removing vnode in uipc_close(). Maybe the right way would be to do it for all sockets (not only listening), simply move the vnode teardown from uipc_detach() to uipc_close()? Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D9770 Notes: svn path=/head/; revision=319722
* Make cached Bluetooth LE host advertise information visible from userland.Takanori Watanabe2017-04-276-15/+53
| | | | | | | Differential Revision: https://reviews.freebsd.org/D10362 Notes: svn path=/head/; revision=317506
* Disconnect LE socket when the HCI connection associated is disconnected.Takanori Watanabe2016-06-073-3/+10
| | | | Notes: svn path=/head/; revision=301558
* sys/netgraph: spelling fixes in comments.Pedro F. Giffuni2016-04-2911-21/+21
| | | | | | | No functional change. Notes: svn path=/head/; revision=298813
* Remove slightly used const values that can be replaced with nitems().Pedro F. Giffuni2016-04-211-3/+2
| | | | | | | Suggested by: jhb Notes: svn path=/head/; revision=298411
* Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().Justin Hibbits2016-02-271-2/+2
| | | | | | | | | | | Most calls to bus_alloc_resource() use "anywhere" as the range, with a given count. Migrate these to use the new bus_alloc_resource_anywhere() API. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D5370 Notes: svn path=/head/; revision=296137
* Make it possible for sbappend() to preserve M_NOTREADY on mbufs, just likeGleb Smirnoff2016-01-081-2/+2
| | | | | | | | | | | | | sbappendstream() does. Although, M_NOTREADY may appear only on SOCK_STREAM sockets, due to sendfile(2) supporting only the latter, there is a corner case of AF_UNIX/SOCK_STREAM socket, that still uses records for the sake of control data, albeit being stream socket. Provide private version of m_clrprotoflags(), which understands PRUS_NOTREADY, similar to m_demote(). Notes: svn path=/head/; revision=293432
* - grab ng_btsocket_l2cap_sockets_mtx lock inMaksim Yevmenkin2015-12-231-0/+8
| | | | | | | | | | | | | | ng_btsocket_l2cap_process_l2ca_enc_change() before calling ng_btsocket_l2cap_pcb_by_cid(); - handle possible NULL value returned from ng_btsocket_l2cap_pcb_by_cid(); Submitted by: Hans Petter Selasky; hps at selasky dot org MFC after: 1 week Notes: svn path=/head/; revision=292660
* Create a USB_PNP_INFO and use it to export the existing PNPWarner Losh2015-12-112-7/+9
| | | | | | | | | | | | | | tables. Some drivers needed some slight re-arrangement of declarations to accommodate this. Change the USB pnp tables slightly to allow better compatibility with the system by moving linux driver info from start of each entry to the end. All other PNP tables in the system have the per-device flags and such at the end of the elements rather that at the beginning. Differential Review: https://reviews.freebsd.org/D3458 Notes: svn path=/head/; revision=292080
* Create a generic PCCARD_PNP_INFO from the MODULE_PNP_INFO buildingWarner Losh2015-12-111-6/+6
| | | | | | | | | | | | block. Use it in all the PNP drivers to export either the current PNP table. For uart, create a custom table and export it using MODULE_PNP_INFO since it's the only one that matches on function number. Differential Review: https://reviews.freebsd.org/D3461 Notes: svn path=/head/; revision=292079
* Fix encryption error handling.Takanori Watanabe2015-11-072-4/+10
| | | | | | | Close l2cap connection on encryption error. Notes: svn path=/head/; revision=290491
* Bluetooth LE Security Management channel support.Takanori Watanabe2015-10-2716-52/+320
| | | | | | | | | Add a socket option to block until underlying HCI connection encrypted. Differential Revision: https://reviews.freebsd.org/D3981 Notes: svn path=/head/; revision=290038
* Fix rfcomm_sppd regression I could reproduced.Takanori Watanabe2015-07-072-1/+5
| | | | | | | | | | | To reproduce it, Two machine running FreeBSD and run rfcomm_sppd -c 3 -S rfcomm_sppd -a ${PEER} -c 3 on each side. Notes: svn path=/head/; revision=285244
* Forgot to add default event mask definition.Takanori Watanabe2015-04-181-0/+3
| | | | Notes: svn path=/head/; revision=281683
* Initial Bluetooth LE support.Takanori Watanabe2015-04-0723-172/+1503
| | | | | | | | | | | | Note that sockaddr_l2cap structure is changed , check socket address to initialize new structure member and define L2CAP_SOCKET_CHECKED before including ng_btsocket.h Differential Revision: https://reviews.freebsd.org/D2021 Reviewed by:emax Notes: svn path=/head/; revision=281198
* In order to reduce use of M_EXT outside of the mbuf allocator andRobert Watson2015-01-062-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | socket-buffer implementations, introduce a return value for MCLGET() (and m_cljget() that underlies it) to allow the caller to avoid testing M_EXT itself. Update all callers to use the return value. With this change, very few network device drivers remain aware of M_EXT; the primary exceptions lie in mbuf-chain pretty printers for debugging, and in a few cases, custom mbuf and cluster allocation implementations. NB: This is a difficult-to-test change as it touches many drivers for which I don't have physical devices. Instead we've gone for intensive review, but further post-commit review would definitely be appreciated to spot errors where changes could not easily be made mechanically, but were largely mechanical in nature. Differential Revision: https://reviews.freebsd.org/D1440 Reviewed by: adrian, bz, gnn Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=276750
* In preparation of merging projects/sendfile, transform bare access toGleb Smirnoff2014-11-123-6/+5
| | | | | | | | | | | | | | | sb_cc member of struct sockbuf to a couple of inline functions: sbavail() and sbused() Right now they are equal, but once notion of "not ready socket buffer data", will be checked in, they are going to be different. Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=274421
* Fix multiple incorrect SYSCTL arguments in the kernel:Hans Petter Selasky2014-10-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Wrong integer type was specified. - Wrong or missing "access" specifier. The "access" specifier sometimes included the SYSCTL type, which it should not, except for procedural SYSCTL nodes. - Logical OR where binary OR was expected. - Properly assert the "access" argument passed to all SYSCTL macros, using the CTASSERT macro. This applies to both static- and dynamically created SYSCTLs. - Properly assert the the data type for both static and dynamic SYSCTLs. In the case of static SYSCTLs we only assert that the data pointed to by the SYSCTL data pointer has the correct size, hence there is no easy way to assert types in the C language outside a C-function. - Rewrote some code which doesn't pass a constant "access" specifier when creating dynamic SYSCTL nodes, which is now a requirement. - Updated "EXAMPLES" section in SYSCTL manual page. MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=273377
* Use callout(9) instead of timeout(9).John Baldwin2014-09-204-17/+12
| | | | | | | Reviewed by: emax Notes: svn path=/head/; revision=271908
* Remove ifq_drops from struct ifqueue. Now queue drops are accounted inGleb Smirnoff2014-09-192-3/+0
| | | | | | | | | | | | | struct ifnet if_oqdrops. Some netgraph modules used ifqueue w/o ifnet. Accounting of queue drops is simply removed from them. There were no API to read this statistic. Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=271856
* PF_BLUETOOTH protocols: skip initialization of non-virtualized globalsMikolaj Golub2014-06-105-0/+27
| | | | | | | | | | | for non-default VNET instances. This fixes panic on a vnet initialization when ng_btsocket is loaded. MFC after: 1 week Notes: svn path=/head/; revision=267336
* Be much more specific (and correct) about the device id matching.Adrian Chadd2014-01-091-16/+16
| | | | | | | | | | | | | These device IDs have an AR3012 bluetooth device that shows up with bcdDevice=1 when it doesn't have the firmware loaded, and bcdDevice=2 when it's ready to speak full HCI. Tested: * AR5B225 PCIe - AR9485 + AR3012 Notes: svn path=/head/; revision=260482
* Add support for the BCM20702A0 chipset, ASUS USB-BT400.Eitan Adler2013-09-011-0/+1
| | | | | | | | PR: kern/181728 Submitted by: rakuco Notes: svn path=/head/; revision=255128
* Sync USB bluetooth product list with Linux.Hans Petter Selasky2013-08-311-0/+60
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=255090
* PR: kern/168520Craig Rodrigues2013-07-151-9/+1
| | | | | | | Revert GRN 253255. It is not needed now that GRN 253346 is committed. Notes: svn path=/head/; revision=253347
* PR: 168520 170096Craig Rodrigues2013-07-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | Submitted by: adrian, zec Fix multiple kernel panics when VIMAGE is enabled in the kernel. These fixes are based on patches submitted by Adrian Chadd and Marko Zec. (1) Set curthread->td_vnet to vnet0 in device_probe_and_attach() just before calling device_attach(). This fixes multiple VIMAGE related kernel panics when trying to attach Bluetooth or USB Ethernet devices because curthread->td_vnet is NULL. (2) Set curthread->td_vnet in if_detach(). This fixes kernel panics when detaching networking interfaces, especially USB Ethernet devices. (3) Use VNET_DOMAIN_SET() in ng_btsocket.c (4) In ng_unref_node() set curthread->td_vnet. This fixes kernel panics when detaching Netgraph nodes. Notes: svn path=/head/; revision=253346
* PR: kern/168520Craig Rodrigues2013-07-121-1/+9
| | | | | | | | | | | | | | | | | | Submitted by: "YAMAMOTO, Shigeru" <shigeru@iij.ad.jp> Reviewed by: adrian In PC-BSD 9.1, VIMAGE is enabled in the kernel config. For laptops with Bluetooth capability, such as the HP Elitebook 8460p, the kernel will panic upon bootup, because curthread->td_vnet is not initialized. Properly initialize curthread->td_vnet when initializing the Bluetooth stack. This allows laptops such as the HP Elitebook 8460p laptop to properly boot with VIMAGE kernels. Notes: svn path=/head/; revision=253255
* Fix several typosEitan Adler2013-05-121-1/+1
| | | | | | | | | PR: kern/176054 Submitted by: Christoph Mallon <christoph.mallon@gmx.de> MFC after: 3 days Notes: svn path=/head/; revision=250576
* Fxi a bunch of typos.Eitan Adler2013-05-101-1/+1
| | | | | | | | PR: misc/174625 Submitted by: Jeremy Chadwick <jdc@koitsu.org> Notes: svn path=/head/; revision=250460
* Add blacklist entries for Atheros bluetooth device IDs that are known toAdrian Chadd2013-04-051-0/+33
| | | | | | | | | | | need firmware before they will re-attach as correctly functioning bluetooth devices. Reviewed by: maksim Obtained from: Linux ath3k device driver Notes: svn path=/head/; revision=249178
* Use DEVMETHOD_END, as suggested by hselasky@.Raphael Kubo da Costa2012-12-261-1/+1
| | | | | | | Approved by: glebius Notes: svn path=/head/; revision=244715
* Use the correct USB interface macros instead of USB_IF_CSI.Raphael Kubo da Costa2012-12-261-1/+3
| | | | | | | | | | | | | | | As pointed out by hselasky@, USB_IF_CSI is the wrong macro here since we want to declare the device's interface class, subclass and protocol, not class, subclass and driver info. Follow-up to r244704. PR: kern/174707 Approved by: glebius MFC after: 1 week Notes: svn path=/head/; revision=244714
* Add vendor IDs for Broadcom USB dongles (BCM20702).Gleb Smirnoff2012-12-261-0/+4
| | | | | | | | PR: kern/174707 Submitted by: rakuco Notes: svn path=/head/; revision=244704
* Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff2012-12-0515-46/+46
| | | | | | | | | | | | malloc(9) flags within sys. Exceptions: - sys/contrib not touched - sys/mbuf.h edited manually Notes: svn path=/head/; revision=243882
* The USB Bluetooth driver should only grab its own interfaces. This allows theHans Petter Selasky2012-09-301-4/+16
| | | | | | | | | | USB bluetooth driver to co-exist with other USB device classes and drivers. Reported by: Geoffrey Levand MFC after: 1 week Notes: svn path=/head/; revision=241078
* Fix compiler warnings, mostly signed issues,Hans Petter Selasky2012-04-021-6/+6
| | | | | | | | | when USB modules are compiled with WARNS=9. MFC after: 1 weeks Notes: svn path=/head/; revision=233774
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.Ed Schouten2011-11-075-5/+5
| | | | | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static. Notes: svn path=/head/; revision=227309
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.Ed Schouten2011-11-075-6/+6
| | | | | | | This means that their use is restricted to a single C file. Notes: svn path=/head/; revision=227293
* - Move all USB device ID arrays into so-called sections,Hans Petter Selasky2011-06-242-3/+3
| | | | | | | | | | | | | | | sorted according to the mode which they support: host, device or dual mode - Add generic tool to extract these data: tools/bus_autoconf Discussed with: imp Suggested by: Robert Millan <rmh@debian.org> PR: misc/157903 MFC after: 14 days Notes: svn path=/head/; revision=223486
* usb: fix a missed use of use_generic in r222051Andriy Gapon2011-05-181-4/+5
| | | | | | | | | | Submitted by: gcooper Pointyhat to: avg MFC after: 1 month X-MFC with: r222051 Notes: svn path=/head/; revision=222055
* Node constructor methods are supposed to be called in syscallGleb Smirnoff2011-04-182-8/+2
| | | | | | | | | | context always. Convert nodes to consistently use M_WAITOK flag for memory allocation. Reviewed by: julian Notes: svn path=/head/; revision=220768
* Fix typos - remove duplicate "the".Rebecca Cran2011-02-211-1/+1
| | | | | | | | | PR: bin/154928 Submitted by: Eitan Adler <lists at eitanadler.com> MFC after: 3 days Notes: svn path=/head/; revision=218909