Re: adding if_dev member to struct ifnet
From: John Baldwin (jhb_at_FreeBSD.org)
Date: 09/30/03
- Previous message: John Baldwin: "Re: finishing the if.h/if_var.h split"
- In reply to: Poul-Henning Kamp: "Re: adding if_dev member to struct ifnet"
- Next in thread: Poul-Henning Kamp: "Re: adding if_dev member to struct ifnet"
- Reply: Poul-Henning Kamp: "Re: adding if_dev member to struct ifnet"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 30 Sep 2003 10:33:48 -0400 (EDT) To: Poul-Henning Kamp <phk@phk.freebsd.dk>
On 30-Sep-2003 Poul-Henning Kamp wrote:
> In message <200309301045.15776.vjardin@wanadoo.fr>, Vincent Jardin writes:
>>Le Mardi 30 Septembre 2003 03:03, Brooks Davis a écrit :
>>> [Previously posted to -net in another form.]
>>>
>>> I propose to add an if_dev member to struct ifnet. It would be of type
>>> device_t and be defined to point to the device for the interface or NULL
>>> if there is no device (or if there was not an easy way to get access to
>>> one).
>>>
>>> This change would codify the the relationship between an interface and
>>> the underlying physical device. It also would get rid of the existing
>>> abuses of if_name to look up the driver associated with an interface
>>> and simplify a number of messy cases in the conversion from if_unit and
>>> if_name to if_xname.
>>>
>>> Does this seem like a reasonable thing to do?
>>
>>Yes, if it helps to remove if_name/if_unit, it is a thing to do. Moreover it
>>sounds a good idea to have the if_dev field into the ifnet structure.
>
> Somebody please explain how this would work for non-hardware
> interfaces like if_loop, if_tun, if_tap etc ?
>
> device_t is what we use to hitch drivers to hardware.
>
> ifnet is what we use to hitch drivers to the netstack.
>
> They should not be tangled.
You mean like dev_t and device_t shouldn't be tangled like we do
with si_drv1? Oh, wait...
-- John Baldwin <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ _______________________________________________ freebsd-arch@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-arch To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
- Previous message: John Baldwin: "Re: finishing the if.h/if_var.h split"
- In reply to: Poul-Henning Kamp: "Re: adding if_dev member to struct ifnet"
- Next in thread: Poul-Henning Kamp: "Re: adding if_dev member to struct ifnet"
- Reply: Poul-Henning Kamp: "Re: adding if_dev member to struct ifnet"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]