Commit graph

10 commits

Author SHA1 Message Date
Warner Losh 3e15b01d69 libsa: Remove redundant sys/cdefs.h
Sponsored by:		Netflix
2024-02-22 09:31:57 -07:00
Warner Losh 1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Warner Losh c4f4a6c983 stand: Use c99 structure initialization for network device
Use c99 structure init for devsw.

Sponsored by:		Netflix
2022-07-24 16:53:34 -06:00
Toomas Soome 98e805b4a1 loader: net_open() should not replace f->f_devdata
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
2021-10-19 19:43:56 +03:00
Toomas Soome 1a25c51e38 loader: dev_net.c should use __func__ with printf
We have printf calls with function name hardwired to string,
sometimes wrong name. Use __func__ instead.

MFC after:	1 week
2021-09-24 17:12:19 +03:00
Kyle Evans e49f2c66d1 stand: dev_net: correct net_open's interpretation of params
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
2019-02-15 18:28:51 +00:00
Warner Losh 09001b5c78 Revert r333365
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.
2018-05-10 20:27:12 +00:00
Warner Losh a1947307e7 We don't use f_devdata, so don't set it. Should that need to change
later, we can. This leaves ZFS as the only irregular f_devdata
user in the tree.
2018-05-08 16:16:56 +00:00
Toomas Soome a9abb85906 net_parse_rootpath() has no parameters
Add void for parameter list.
2017-11-22 10:04:09 +00:00
Warner Losh ca987d4641 Move sys/boot to stand. Fix all references to new location
Sponsored by:	Netflix
2017-11-14 23:02:19 +00:00
Renamed from sys/boot/common/dev_net.c (Browse further)