aboutsummaryrefslogtreecommitdiff
path: root/stand/common/dev_net.c
Commit message (Collapse)AuthorAgeFilesLines
* Add DEBUG_PRINTF to stand.hSimon J. Gerraty2025-07-171-40/+17
| | | | | | | | | | | | | | | | | | | | | | | | stand/ is mostly debugged with printfs, in an ad hoc and sometimes fragile manner. For example BOOTP_DEBUG in bootp.c cannot be defined unless NETIF_DEBUG is defined in dev_net.c or build fails for lack of the symbol debug. The DEBUG_PRINTF implementation in stand.h addresses that and allows for more control over debug output. It is compatible with the usage in libsecureboot. Simply define _DEBUG_LEVEL to the desired level of debug or in the case of libsecureboot _DEBUG_LEVEL_VAR to the variable that will hold that value - default is _debug which is static so each translation unit can be controlled independently. The 1st arg to DEBUG_PRINTF is a level which must be greater than or equal to _DEBUG_LEVEL_VAR if the printf is to be called. See libsecureboot for more examples. Reviewed by: imp Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D51269
* machine/stdarg.h -> sys/stdarg.hBrooks Davis2025-06-111-1/+2
| | | | | | | | | | | | | Switch to using sys/stdarg.h for va_list type and va_* builtins. Make an attempt to insert the include in a sensible place. Where style(9) was followed this is easy, where it was ignored, aim for the first block of sys/*.h headers and don't get too fussy or try to fix other style bugs. Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595
* libsa: Remove redundant sys/cdefs.hWarner Losh2024-02-221-1/+0
| | | | Sponsored by: Netflix
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* stand: Use c99 structure initialization for network deviceWarner Losh2022-07-241-9/+9
| | | | | | Use c99 structure init for devsw. Sponsored by: Netflix
* loader: net_open() should not replace f->f_devdataToomas Soome2021-10-191-3/+5
| | | | | | | | | | | | | | | net_open() does replace f_devdata with pointer to netdev_sock, this will cause memory leak when device is closed, but also does alter the devopen() logic. We should store &netdev_sock to dev->d_opendata instead, this would preserve and follow the devopen() logic. Fixes network boot on aarch64 (tested by bz). Reviewed-by: imp MFC After: 2 weeks Differential Revision: https://reviews.freebsd.org/D32227
* loader: dev_net.c should use __func__ with printfToomas Soome2021-09-241-14/+16
| | | | | | | We have printf calls with function name hardwired to string, sometimes wrong name. Use __func__ instead. MFC after: 1 week
* stand: dev_net: correct net_open's interpretation of paramsKyle Evans2019-02-151-3/+5
| | | | | | | | | | | | | | | | | | | net_open previously casted the first vararg to a char * and this was half-OK: at first, it is passed to netif_open, which would cast it back to the struct devdesc * that it really is and use it properly. It is then strdup()d and used as the netdev_name, which is objectively wrong. Correct it so that the first vararg is properly casted to a struct devdesc * and the netdev_name gets set properly to make it more clear at a glance that it's not doing something horribly wrong. Reported by: mmel Reviewed by: imp, mmel, tsoome MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D19206 Notes: svn path=/head/; revision=344161
* Revert r333365Warner Losh2018-05-101-0/+4
| | | | | | | | | Even though we don't use it, it appears something else requires it to be != 0 to work. This breaks tftp boot in loader.efi, so revert until that can be sorted out. Notes: svn path=/head/; revision=333471
* We don't use f_devdata, so don't set it. Should that need to changeWarner Losh2018-05-081-4/+0
| | | | | | | | later, we can. This leaves ZFS as the only irregular f_devdata user in the tree. Notes: svn path=/head/; revision=333365
* net_parse_rootpath() has no parametersToomas Soome2017-11-221-1/+1
| | | | | | | Add void for parameter list. Notes: svn path=/head/; revision=326090
* Move sys/boot to stand. Fix all references to new locationWarner Losh2017-11-141-0/+435
Sponsored by: Netflix Notes: svn path=/head/; revision=325834