Changeset View
Changeset View
Standalone View
Standalone View
head/sys/net/altq/altq_fairq.c
Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | fairq_pfattach(struct pf_altq *a) | ||||
error = altq_attach(&ifp->if_snd, ALTQT_FAIRQ, a->altq_disc, | error = altq_attach(&ifp->if_snd, ALTQT_FAIRQ, a->altq_disc, | ||||
fairq_enqueue, fairq_dequeue, fairq_request, NULL, NULL); | fairq_enqueue, fairq_dequeue, fairq_request, NULL, NULL); | ||||
return (error); | return (error); | ||||
} | } | ||||
int | int | ||||
fairq_add_altq(struct pf_altq *a) | fairq_add_altq(struct ifnet *ifp, struct pf_altq *a) | ||||
{ | { | ||||
struct fairq_if *pif; | struct fairq_if *pif; | ||||
struct ifnet *ifp; | |||||
if ((ifp = ifunit(a->ifname)) == NULL) | if (ifp == NULL) | ||||
return (EINVAL); | return (EINVAL); | ||||
if (!ALTQ_IS_READY(&ifp->if_snd)) | if (!ALTQ_IS_READY(&ifp->if_snd)) | ||||
return (ENODEV); | return (ENODEV); | ||||
pif = malloc(sizeof(struct fairq_if), | pif = malloc(sizeof(struct fairq_if), | ||||
M_DEVBUF, M_WAITOK | M_ZERO); | M_DEVBUF, M_WAITOK | M_ZERO); | ||||
pif->pif_bandwidth = a->ifbandwidth; | pif->pif_bandwidth = a->ifbandwidth; | ||||
▲ Show 20 Lines • Show All 745 Lines • Show Last 20 Lines |