1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00
freebsd/sys/dev/usb/serial
Ian Lepore 28315e27a7 Implement a mechanism for making changes in the kernel<->driver PPS
interface without breaking ABI or API compatibility with existing drivers.

The existing data structures used to communicate between the kernel and
driver portions of PPS processing contain no spare/padding fields and no
flags field or other straightforward mechanism for communicating changes
in the structures or behaviors of the code.  This makes it difficult to
MFC new features added to the PPS facility.  ABI compatibility is
important; out-of-tree drivers in module form are known to exist.  (Note
that the existing api_version field in the pps_params structure must
contain the value mandated by RFC 2783 and any RFCs that come along after.)

These changes introduce a pair of abi-version fields which are filled in
by the driver and the kernel respectively to indicate the interface
version.  The driver sets its version field before calling the new
pps_init_abi() function.  That lets the kernel know how much of the
pps_state structure is understood by the driver and it can avoid using
newer fields at the end of the structure that it knows about if the driver
is a lower version.  The kernel fills in its version field during the init
call, letting the driver know what features and data the kernel supports.

To implement the new version information in a way that is backwards
compatible with code from before these changes, the high bit of the
lightly-used 'kcmode' field is repurposed as a flag bit that indicates the
driver is aware of the abi versioning scheme.  Basically if this bit is
clear that indicates a "version 0" driver and if it is set the driver_abi
field indicates the version.

These changes also move the recently-added 'mtx' field of pps_state from
the middle to the end of the structure, and make the kernel code that uses
this field conditional on the driver being abi version 1 or higher.  It
changes the only driver currently supplying the mtx field, usb_serial, to
use pps_init_abi().

Reviewed by:	hselasky@
2015-05-04 17:59:39 +00:00
..
u3g.c Add more USB IDs. 2015-03-07 17:11:07 +00:00
uark.c
ubsa.c
ubser.c
uchcom.c
ucycom.c
ufoma.c
uftdi_reg.h
uftdi.c The "get latency" and "get bitmode" device commands are read operations, 2015-04-10 13:20:31 +00:00
ugensa.c
uipaq.c
ulpt.c
umcs.c
umcs.h
umct.c
umodem.c Add support for USB device side mode to the USB modem driver. 2015-01-09 18:40:12 +00:00
umoscom.c
uplcom.c
usb_serial.c Implement a mechanism for making changes in the kernel<->driver PPS 2015-05-04 17:59:39 +00:00
usb_serial.h Add PPS support to USB serial drivers. 2015-03-07 18:25:58 +00:00
uslcom.c
uvisor.c
uvscom.c