MFC r351196, r351324, r351326:ng_ubt(4): do not attach Intel Wireless 8260/8265 in bootloader mode.Add helper function for synchronous execution of HCI commands at probestage and use this functi
MFC r351196, r351324, r351326:ng_ubt(4): do not attach Intel Wireless 8260/8265 in bootloader mode.Add helper function for synchronous execution of HCI commands at probestage and use this function to check firmware state of Intel Wireless8260/8265 bluetooth devices found in many post 2016 year laptops.Attempt to initialize FreeBSD bluetooth stack while such a device is inbootloader mode locks the adapter hardly so it requires power on/offcycle to restore.This change blocks ng_ubt attachment unless operational firmware isloaded thus preventing the lock up.PR: 237083Reviewed by: hps, emaxMFC after: 2 weeksDifferential Revision: https://reviews.freebsd.org/D21071
show more ...
sys: general adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - errorpro
sys: general adoption of SPDX licensing ID tags.Mainly focus on files that use BSD 2-Clause license, however the tool Iwas using misidentified many licenses so this was mostly a manual - errorprone - task.The Software Package Data Exchange (SPDX) group provides a specificationto make it easier for automated tools to detect and summarize well knownopensource licenses. We are gradually adopting the specification, notingthat the tags are considered only advisory and do not, in any way,superceed or replace the license texts.No functional change intended.
Listening sockets improvements.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. -
Listening sockets improvements.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: NetflixDifferential Revision: https://reviews.freebsd.org/D9770
Make cached Bluetooth LE host advertise information visible from userland.Differential Revision: https://reviews.freebsd.org/D10362
Disconnect LE socket when the HCI connection associated is disconnected.
sys/netgraph: spelling fixes in comments.No functional change.
Remove slightly used const values that can be replaced with nitems().Suggested by: jhb
Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().Most calls to bus_alloc_resource() use "anywhere" as the range, with a givencount. Migrate these to use the new bus_alloc_
Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().Most calls to bus_alloc_resource() use "anywhere" as the range, with a givencount. Migrate these to use the new bus_alloc_resource_anywhere() API.Reviewed by: jhbDifferential Revision: https://reviews.freebsd.org/D5370
Make it possible for sbappend() to preserve M_NOTREADY on mbufs, just likesbappendstream() does. Although, M_NOTREADY may appear only on SOCK_STREAMsockets, due to sendfile(2) supporting only the l
Make it possible for sbappend() to preserve M_NOTREADY on mbufs, just likesbappendstream() does. Although, M_NOTREADY may appear only on SOCK_STREAMsockets, due to sendfile(2) supporting only the latter, there is a cornercase of AF_UNIX/SOCK_STREAM socket, that still uses records for the sakeof control data, albeit being stream socket.Provide private version of m_clrprotoflags(), which understands PRUS_NOTREADY,similar to m_demote().
- grab ng_btsocket_l2cap_sockets_mtx lock in ng_btsocket_l2cap_process_l2ca_enc_change() before calling ng_btsocket_l2cap_pcb_by_cid();- handle possible NULL value returned from ng_btsocket_l
- grab ng_btsocket_l2cap_sockets_mtx lock in 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 orgMFC after: 1 week
Create a USB_PNP_INFO and use it to export the existing PNPtables. Some drivers needed some slight re-arrangement of declarationsto accommodate this. Change the USB pnp tables slightly to allowbet
Create a USB_PNP_INFO and use it to export the existing PNPtables. Some drivers needed some slight re-arrangement of declarationsto accommodate this. Change the USB pnp tables slightly to allowbetter compatibility with the system by moving linux driver info fromstart of each entry to the end. All other PNP tables in the systemhave the per-device flags and such at the end of the elements ratherthat at the beginning.Differential Review: https://reviews.freebsd.org/D3458
Create a generic PCCARD_PNP_INFO from the MODULE_PNP_INFO buildingblock. Use it in all the PNP drivers to export either the current PNPtable. For uart, create a custom table and export it usingMOD
Create a generic PCCARD_PNP_INFO from the MODULE_PNP_INFO buildingblock. Use it in all the PNP drivers to export either the current PNPtable. For uart, create a custom table and export it usingMODULE_PNP_INFO since it's the only one that matches on functionnumber.Differential Review: https://reviews.freebsd.org/D3461
Fix encryption error handling.Close l2cap connection on encryption error.
Bluetooth LE Security Management channel support.Add a socket option to block until underlying HCI connection encrypted.Differential Revision: https://reviews.freebsd.org/D3981
Fix rfcomm_sppd regression I could reproduced.To reproduce it, Two machine running FreeBSD andrunrfcomm_sppd -c 3 -Srfcomm_sppd -a ${PEER} -c 3on each side.
Forgot to add default event mask definition.
Initial Bluetooth LE support.Note that sockaddr_l2cap structure is changed , check socket addressto initialize new structure member and define L2CAP_SOCKET_CHECKEDbefore including ng_btsocket.h
Initial Bluetooth LE support.Note that sockaddr_l2cap structure is changed , check socket addressto initialize new structure member and define L2CAP_SOCKET_CHECKEDbefore including ng_btsocket.hDifferential Revision: https://reviews.freebsd.org/D2021Reviewed by:emax
In order to reduce use of M_EXT outside of the mbuf allocator andsocket-buffer implementations, introduce a return value for MCLGET()(and m_cljget() that underlies it) to allow the caller to avoid
In order to reduce use of M_EXT outside of the mbuf allocator andsocket-buffer implementations, introduce a return value for MCLGET()(and m_cljget() that underlies it) to allow the caller to avoid testingM_EXT itself. Update all callers to use the return value.With this change, very few network device drivers remain aware ofM_EXT; the primary exceptions lie in mbuf-chain pretty printers fordebugging, and in a few cases, custom mbuf and cluster allocationimplementations.NB: This is a difficult-to-test change as it touches many drivers forwhich I don't have physical devices. Instead we've gone for intensivereview, but further post-commit review would definitely be appreciatedto spot errors where changes could not easily be made mechanically,but were largely mechanical in nature.Differential Revision: https://reviews.freebsd.org/D1440Reviewed by: adrian, bz, gnnSponsored by: EMC / Isilon Storage Division
In preparation of merging projects/sendfile, transform bare access tosb_cc member of struct sockbuf to a couple of inline functions:sbavail() and sbused()Right now they are equal, but once notio
In preparation of merging projects/sendfile, transform bare access tosb_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: NetflixSponsored by: Nginx, Inc.
Fix multiple incorrect SYSCTL arguments in the kernel:- Wrong integer type was specified.- Wrong or missing "access" specifier. The "access" specifiersometimes included the SYSCTL type, which it
Fix multiple incorrect SYSCTL arguments in the kernel:- Wrong integer type was specified.- Wrong or missing "access" specifier. The "access" specifiersometimes included the SYSCTL type, which it should not, except forprocedural 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 dynamicallycreated SYSCTLs.- Properly assert the the data type for both static and dynamicSYSCTLs. In the case of static SYSCTLs we only assert that the datapointed to by the SYSCTL data pointer has the correct size, hencethere is no easy way to assert types in the C language outside aC-function.- Rewrote some code which doesn't pass a constant "access" specifierwhen creating dynamic SYSCTL nodes, which is now a requirement.- Updated "EXAMPLES" section in SYSCTL manual page.MFC after: 3 daysSponsored by: Mellanox Technologies
Use callout(9) instead of timeout(9).Reviewed by: emax
Remove ifq_drops from struct ifqueue. Now queue drops are accounted instruct ifnet if_oqdrops.Some netgraph modules used ifqueue w/o ifnet. Accounting of queue dropsis simply removed from them. T
Remove ifq_drops from struct ifqueue. Now queue drops are accounted instruct ifnet if_oqdrops.Some netgraph modules used ifqueue w/o ifnet. Accounting of queue dropsis simply removed from them. There were no API to read this statistic.Sponsored by: NetflixSponsored by: Nginx, Inc.
PF_BLUETOOTH protocols: skip initialization of non-virtualized globalsfor non-default VNET instances.This fixes panic on a vnet initialization when ng_btsocket is loaded.MFC after: 1 week
Be much more specific (and correct) about the device id matching.These device IDs have an AR3012 bluetooth device that shows up withbcdDevice=1 when it doesn't have the firmware loaded, and bcdDev
Be much more specific (and correct) about the device id matching.These device IDs have an AR3012 bluetooth device that shows up withbcdDevice=1 when it doesn't have the firmware loaded, and bcdDevice=2when it's ready to speak full HCI.Tested:* AR5B225 PCIe - AR9485 + AR3012
Add support for the BCM20702A0 chipset, ASUS USB-BT400.PR: kern/181728Submitted by: rakuco
12345678