diff options
author | Warner Losh <imp@FreeBSD.org> | 2021-06-23 02:27:57 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2021-06-23 02:52:06 +0000 |
commit | ddfc9c4c59e2ea4871100d8c076adffe3af8ff21 (patch) | |
tree | 3a4cc2294b046b13050512960da01d0af6acc963 /sys/dev/ntb/ntb_hw | |
parent | a7f6c6fd94d658b9e3f6f9bec02edfefb1a3d652 (diff) | |
download | src-ddfc9c4c59e2ea4871100d8c076adffe3af8ff21.tar.gz src-ddfc9c4c59e2ea4871100d8c076adffe3af8ff21.zip |
newbus: Move from bus_child_{pnpinfo,location}_src to bus_child_{pnpinfo,location} with sbuf
Now that the upper layers all go through a layer to tie into these
information functions that translates an sbuf into char * and len. The
current interface suffers issues of what to do in cases of truncation,
etc. Instead, migrate all these functions to using struct sbuf and these
issues go away. The caller is also in charge of any memory allocation
and/or expansion that's needed during this process.
Create a bus_generic_child_{pnpinfo,location} and make it default. It
just returns success. This is for those busses that have no information
for these items. Migrate the now-empty routines to using this as
appropriate.
Document these new interfaces with man pages, and oversight from before.
Reviewed by: jhb, bcr
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D29937
Diffstat (limited to 'sys/dev/ntb/ntb_hw')
-rw-r--r-- | sys/dev/ntb/ntb_hw/ntb_hw_amd.c | 2 | ||||
-rw-r--r-- | sys/dev/ntb/ntb_hw/ntb_hw_intel.c | 2 | ||||
-rw-r--r-- | sys/dev/ntb/ntb_hw/ntb_hw_plx.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/ntb/ntb_hw/ntb_hw_amd.c b/sys/dev/ntb/ntb_hw/ntb_hw_amd.c index 450a3a2fa2b8..2d13dc1321cb 100644 --- a/sys/dev/ntb/ntb_hw/ntb_hw_amd.c +++ b/sys/dev/ntb/ntb_hw/ntb_hw_amd.c @@ -1274,7 +1274,7 @@ static device_method_t ntb_amd_methods[] = { DEVMETHOD(device_detach, amd_ntb_detach), /* Bus interface */ - DEVMETHOD(bus_child_location_str, ntb_child_location_str), + DEVMETHOD(bus_child_location, ntb_child_location), DEVMETHOD(bus_print_child, ntb_print_child), DEVMETHOD(bus_get_dma_tag, ntb_get_dma_tag), diff --git a/sys/dev/ntb/ntb_hw/ntb_hw_intel.c b/sys/dev/ntb/ntb_hw/ntb_hw_intel.c index 8eb210efb065..88fc3d6a36a1 100644 --- a/sys/dev/ntb/ntb_hw/ntb_hw_intel.c +++ b/sys/dev/ntb/ntb_hw/ntb_hw_intel.c @@ -3476,7 +3476,7 @@ static device_method_t ntb_intel_methods[] = { DEVMETHOD(device_attach, intel_ntb_attach), DEVMETHOD(device_detach, intel_ntb_detach), /* Bus interface */ - DEVMETHOD(bus_child_location_str, ntb_child_location_str), + DEVMETHOD(bus_child_location, ntb_child_location), DEVMETHOD(bus_print_child, ntb_print_child), DEVMETHOD(bus_get_dma_tag, ntb_get_dma_tag), /* NTB interface */ diff --git a/sys/dev/ntb/ntb_hw/ntb_hw_plx.c b/sys/dev/ntb/ntb_hw/ntb_hw_plx.c index f3d8af4971a4..4231b1209291 100644 --- a/sys/dev/ntb/ntb_hw/ntb_hw_plx.c +++ b/sys/dev/ntb/ntb_hw/ntb_hw_plx.c @@ -1053,7 +1053,7 @@ static device_method_t ntb_plx_methods[] = { DEVMETHOD(device_attach, ntb_plx_attach), DEVMETHOD(device_detach, ntb_plx_detach), /* Bus interface */ - DEVMETHOD(bus_child_location_str, ntb_child_location_str), + DEVMETHOD(bus_child_location, ntb_child_location), DEVMETHOD(bus_print_child, ntb_print_child), DEVMETHOD(bus_get_dma_tag, ntb_get_dma_tag), /* NTB interface */ |