Migrating io-sock
networking drivers with PTP to QNX SDP 8.0.1 io-sock
QNX SDP 7.1 and 8.0 io-sock
networking drivers that implement the Precision Time Protocol (PTP) in hardware must now use the io-sock
PTP module to
work with ptpd2
.
Header changes
- Removed the following commands:
- PTP_GET_TX_TIMESTAMP
- PTP_GET_RX_TIMESTAMP
- Moved the definition of ETHERTYPE_PTP to net/ethernet.h.
- Changed the definition of PTP_PORT to PTP_PORT_EVENT.
- Changed the name of
ptp_comp_t
tostruct ptp_comp
. - Changed the name of
ptp_time_t
tostruct ptp_time
, and the structure's sec member to anint64_t
. - Replaced
ptp_extts_t
withstruct ptp_tstmp
. - Added qnx/ptp/ptp_mod.h for PTP module functions.
TX and RX timestamps
TX/RX timestamp handling should no longer have a per-driver implementation. Instead, use the ptp_*() module functions
as described in "Adding PTP to io-sock Network Drivers."
Because all software timestamp queueing is now managed by the PTP module, a driver does not have to store information
specific to a packet to be retrieved. Drivers no longer need to use ptp_extts_t
, meaning
struct ptp_tstmp
should only be seen by the user. This change coincides with the removal of the PTP_GET_TX_TIMESTAMP and
PTP_GET_RX_TIMESTAMP commands.
Note: No PTP packet processing should be necessary with the PTP module.
Devctl commands
The PTP_* devctl() commands are still sent with a SIOCGDRVSPEC or SIOCSDRVSPEC command, but ptp_ioctl() should be called to process the PTP_* commands. The PTP module then calls the DEVMETHOD() functions that the driver has set up, as described in the "Adding PTP to io-sock Network Drivers."
64-bit timestamp support
When the driver uses the ptp_*() functions, the PTP module calculates the upper portion of the 64-bit sec member of
struct ptp_time
. The driver should not attempt to calculate a number of seconds greater than the maximum specified by the
max member of ptp_attach().