mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-03 15:47:35 -04:00
unix: add PTP IOCTLs on Linux
The IOCTLs are used for interacting with PTP-specific functions of NIC and time card drivers. Description: https://netdevconf.info/0x18/docs/netdev-0x18-paper39-talk-slides/netdev-intro-ptp-api.pdf Change-Id: If50d605958e5cee451146cf68cc95a3704917512 GitHub-Last-Rev: 44fac1cb1a96b28050f9b9b0c2d986b0feba933f GitHub-Pull-Request: golang/sys#225 Reviewed-on: https://go-review.googlesource.com/c/sys/+/621375 Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
committed by
Gopher Robot
parent
adbb8bbcaf
commit
256d1dfe8f
@@ -185,6 +185,15 @@ func main() {
|
||||
b = bytes.Replace(b, s, newNames, 1)
|
||||
}
|
||||
|
||||
// Convert []int8 to []byte in PtpPinDesc
|
||||
ptpBytesRegex := regexp.MustCompile(`(Name)(\s+)\[(\d+)\]u?int8`)
|
||||
ptpIoctlType := regexp.MustCompile(`PtpPinDesc\s+struct {[^}]*}`)
|
||||
ptpStructs := ptpIoctlType.FindAll(b, -1)
|
||||
for _, s := range ptpStructs {
|
||||
newNames := ptpBytesRegex.ReplaceAll(s, []byte("$1$2[$3]byte"))
|
||||
b = bytes.Replace(b, s, newNames, 1)
|
||||
}
|
||||
|
||||
// Convert []int8 to []byte in ctl_info ioctl interface
|
||||
convertCtlInfoName := regexp.MustCompile(`(Name)(\s+)\[(\d+)\]int8`)
|
||||
ctlInfoType := regexp.MustCompile(`type CtlInfo struct {[^}]*}`)
|
||||
|
||||
Reference in New Issue
Block a user