Re: adding if_dev member to struct ifnet
From: Vincent Jardin (vjardin_at_wanadoo.fr)
Date: 10/01/03
- Previous message: Brooks Davis: "Re: adding if_dev member to struct ifnet"
- In reply to: Brooks Davis: "Re: adding if_dev member to struct ifnet"
- Next in thread: Brooks Davis: "Re: adding if_dev member to struct ifnet"
- Reply: Brooks Davis: "Re: adding if_dev member to struct ifnet"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: Brooks Davis <brooks@one-eyed-alien.net>, Harti Brandt <brandt@fokus.fraunhofer.de> Date: Wed, 1 Oct 2003 20:38:13 +0200
> > messier BD>example is in the new ATM code where interfaces are looked up
> > by name.
> >
> > Where is this?
>
> One example would be in sys/netatm/atm_if.c around line 1081.
Do you mean pif_name and pif_unit ?
This code could be updated. It uses pif_unit and pif_name that could become
pif_xname.
for (pip = atm_interface_head; pip; pip = pip->pif_next) {
if (strcmp(pip->pif_xname, n) == 0)
break;
}
instead of
for (pip = atm_interface_head; pip; pip = pip->pif_next) {
if ((pip->pif_unit == unit) && (strcmp(pip->pif_name, n) == 0))
break;
}
Moreover, a PIF (Physical IF) is not an ifnet. It is the ATM device. The ATM
PVC are the NIF (Network IF -> ifnet). They are many NIF (PVC) over a single
PIF (ATM device).
With the ATM stack, the main issue is related to AIOCS_SET_NIF. It sets the
ifp's if_name to the NIF's nif_name and the ifp's if_unit to a regular
counter.
In fact we could change the following code
strcpy ( nip->nif_name, asr->asr_nif_pref );
nip->nif_sel = count;
ifp->if_name = nip->nif_name;
ifp->if_unit = count;
to
snprintf(nip->nif_xname, sizeof(nip->nif_xname), "%s%d",
asr->asr_nif_pref, count);
nip->nif_sel = count; /* we need to keep a selector to
build the UNI ATM address */
ifp->if_xname = nip->nif_xname;
#if 0
ifp->if_unit = count; /* it is not required anymore */
#endif
Regards,
Vincent
_______________________________________________
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: Brooks Davis: "Re: adding if_dev member to struct ifnet"
- In reply to: Brooks Davis: "Re: adding if_dev member to struct ifnet"
- Next in thread: Brooks Davis: "Re: adding if_dev member to struct ifnet"
- Reply: Brooks Davis: "Re: adding if_dev member to struct ifnet"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|