Changeset View
Changeset View
Standalone View
Standalone View
head/sys/net/altq/altq_subr.c
Show First 20 Lines • Show All 514 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
/* | /* | ||||
* add a discipline or a queue | * add a discipline or a queue | ||||
* Locking is done in the discipline specific functions with regards to | * Locking is done in the discipline specific functions with regards to | ||||
* malloc with WAITOK, also it is not yet clear which lock to use. | * malloc with WAITOK, also it is not yet clear which lock to use. | ||||
*/ | */ | ||||
int | int | ||||
altq_add(struct pf_altq *a) | altq_add(struct ifnet *ifp, struct pf_altq *a) | ||||
{ | { | ||||
int error = 0; | int error = 0; | ||||
if (a->qname[0] != 0) | if (a->qname[0] != 0) | ||||
return (altq_add_queue(a)); | return (altq_add_queue(a)); | ||||
if (machclk_freq == 0) | if (machclk_freq == 0) | ||||
init_machclk(); | init_machclk(); | ||||
if (machclk_freq == 0) | if (machclk_freq == 0) | ||||
panic("altq_add: no cpu clock"); | panic("altq_add: no cpu clock"); | ||||
switch (a->scheduler) { | switch (a->scheduler) { | ||||
#ifdef ALTQ_CBQ | #ifdef ALTQ_CBQ | ||||
case ALTQT_CBQ: | case ALTQT_CBQ: | ||||
error = cbq_add_altq(a); | error = cbq_add_altq(ifp, a); | ||||
break; | break; | ||||
#endif | #endif | ||||
#ifdef ALTQ_PRIQ | #ifdef ALTQ_PRIQ | ||||
case ALTQT_PRIQ: | case ALTQT_PRIQ: | ||||
error = priq_add_altq(a); | error = priq_add_altq(ifp, a); | ||||
break; | break; | ||||
#endif | #endif | ||||
#ifdef ALTQ_HFSC | #ifdef ALTQ_HFSC | ||||
case ALTQT_HFSC: | case ALTQT_HFSC: | ||||
error = hfsc_add_altq(a); | error = hfsc_add_altq(ifp, a); | ||||
break; | break; | ||||
#endif | #endif | ||||
#ifdef ALTQ_FAIRQ | #ifdef ALTQ_FAIRQ | ||||
case ALTQT_FAIRQ: | case ALTQT_FAIRQ: | ||||
error = fairq_add_altq(a); | error = fairq_add_altq(ifp, a); | ||||
break; | break; | ||||
#endif | #endif | ||||
#ifdef ALTQ_CODEL | #ifdef ALTQ_CODEL | ||||
case ALTQT_CODEL: | case ALTQT_CODEL: | ||||
error = codel_add_altq(a); | error = codel_add_altq(ifp, a); | ||||
break; | break; | ||||
#endif | #endif | ||||
default: | default: | ||||
error = ENXIO; | error = ENXIO; | ||||
} | } | ||||
return (error); | return (error); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,370 Lines • Show Last 20 Lines |