summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/en/midway.c37
-rw-r--r--sys/dev/en/midwayvar.h1
-rw-r--r--sys/dev/fatm/if_fatm.c47
-rw-r--r--sys/dev/hatm/if_hatm_ioctl.c56
-rw-r--r--sys/dev/patm/if_patm_ioctl.c49
5 files changed, 22 insertions, 168 deletions
diff --git a/sys/dev/en/midway.c b/sys/dev/en/midway.c
index 02440c0..bfb503d 100644
--- a/sys/dev/en/midway.c
+++ b/sys/dev/en/midway.c
@@ -1265,7 +1265,7 @@ en_close_finish(struct en_softc *sc, struct en_vcc *vc)
* LOCK: unlocked, needed
*/
static int
-en_close_vcc(struct en_softc *sc, struct atmio_closevcc *cl, int wait)
+en_close_vcc(struct en_softc *sc, struct atmio_closevcc *cl)
{
uint32_t oldmode, newmode;
struct en_vcc *vc;
@@ -1315,10 +1315,8 @@ en_close_vcc(struct en_softc *sc, struct atmio_closevcc *cl, int wait)
vc->vflags |= VCC_DRAIN;
DBG(sc, IOCTL, ("VCI %u now draining", cl->vci));
- if (!wait || (vc->vcc.flags & ATMIO_FLAG_ASYNC)) {
- vc->vflags |= VCC_ASYNC;
+ if (vc->vcc.flags & ATMIO_FLAG_ASYNC)
goto done;
- }
vc->vflags |= VCC_CLOSE_RX;
while ((sc->ifatm.ifnet.if_flags & IFF_RUNNING) &&
@@ -1549,34 +1547,11 @@ en_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
struct en_softc *sc = (struct en_softc *)ifp->if_softc;
struct ifaddr *ifa = (struct ifaddr *)data;
struct ifreq *ifr = (struct ifreq *)data;
- struct atm_pseudoioctl *pa = (struct atm_pseudoioctl *)data;
struct atmio_vcctable *vtab;
- struct atmio_openvcc ena;
- struct atmio_closevcc dis;
int error = 0;
switch (cmd) {
- case SIOCATMENA: /* enable circuit for recv */
- bzero(&ena, sizeof(ena));
- ena.param.flags = ATM_PH_FLAGS(&pa->aph) &
- (ATM_PH_AAL5 | ATM_PH_LLCSNAP);
- ena.param.vpi = ATM_PH_VPI(&pa->aph);
- ena.param.vci = ATM_PH_VCI(&pa->aph);
- ena.param.aal = (ATM_PH_FLAGS(&pa->aph) & ATM_PH_AAL5) ?
- ATMIO_AAL_5 : ATMIO_AAL_0;
- ena.param.traffic = ATMIO_TRAFFIC_UBR;
- ena.rxhand = pa->rxhand;
- error = en_open_vcc(sc, &ena);
- break;
-
- case SIOCATMDIS: /* disable circuit for recv */
- bzero(&dis, sizeof(dis));
- dis.vpi = ATM_PH_VPI(&pa->aph);
- dis.vci = ATM_PH_VCI(&pa->aph);
- error = en_close_vcc(sc, &dis, 0);
- break;
-
case SIOCSIFADDR:
EN_LOCK(sc);
ifp->if_flags |= IFF_UP;
@@ -1627,12 +1602,12 @@ en_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
error = ifmedia_ioctl(ifp, ifr, &sc->media, cmd);
break;
- case SIOCATMOPENVCC: /* netgraph/harp internal use */
+ case SIOCATMOPENVCC: /* kernel internal use */
error = en_open_vcc(sc, (struct atmio_openvcc *)data);
break;
- case SIOCATMCLOSEVCC: /* netgraph and HARP internal use */
- error = en_close_vcc(sc, (struct atmio_closevcc *)data, 1);
+ case SIOCATMCLOSEVCC: /* kernel internal use */
+ error = en_close_vcc(sc, (struct atmio_closevcc *)data);
break;
case SIOCATMGETVCCS: /* internal netgraph use */
@@ -1873,7 +1848,7 @@ en_rx_drain(struct en_softc *sc, u_int drq)
(en_read(sc, MID_VC(vc->vcc.vci)) & MIDV_INSERVICE) == 0 &&
(vc->vflags & VCC_SWSL) == 0) {
vc->vflags &= ~VCC_CLOSE_RX;
- if (vc->vflags & VCC_ASYNC)
+ if (vc->vcc.flags & ATMIO_FLAG_ASYNC)
en_close_finish(sc, vc);
else
cv_signal(&sc->cv_close);
diff --git a/sys/dev/en/midwayvar.h b/sys/dev/en/midwayvar.h
index 78ed634..4869dbd 100644
--- a/sys/dev/en/midwayvar.h
+++ b/sys/dev/en/midwayvar.h
@@ -149,7 +149,6 @@ struct en_vcc {
#define VCC_DRAIN 0x0001 /* closed, but draining rx */
#define VCC_SWSL 0x0002 /* on rx software service list */
#define VCC_CLOSE_RX 0x0004 /* currently closing */
-#define VCC_ASYNC 0x0008 /* async close */
/*
* softc
diff --git a/sys/dev/fatm/if_fatm.c b/sys/dev/fatm/if_fatm.c
index f9a9068..db8f8d1 100644
--- a/sys/dev/fatm/if_fatm.c
+++ b/sys/dev/fatm/if_fatm.c
@@ -2195,7 +2195,7 @@ fatm_waitvcc(struct fatm_softc *sc, struct cmdqueue *q)
* Start to open a VCC. This just initiates the operation.
*/
static int
-fatm_open_vcc(struct fatm_softc *sc, struct atmio_openvcc *op, int wait)
+fatm_open_vcc(struct fatm_softc *sc, struct atmio_openvcc *op)
{
uint32_t cmd;
int error;
@@ -2261,8 +2261,8 @@ fatm_open_vcc(struct fatm_softc *sc, struct atmio_openvcc *op, int wait)
cmd |= (5 << 8);
q = fatm_start_vcc(sc, op->param.vpi, op->param.vci, cmd, 1,
- (wait && !(op->param.flags & ATMIO_FLAG_ASYNC)) ?
- fatm_cmd_complete : fatm_open_complete);
+ (op->param.flags & ATMIO_FLAG_ASYNC) ?
+ fatm_open_complete : fatm_cmd_complete);
if (q == NULL) {
error = EIO;
goto done;
@@ -2272,7 +2272,7 @@ fatm_open_vcc(struct fatm_softc *sc, struct atmio_openvcc *op, int wait)
sc->vccs[op->param.vci] = vc;
sc->open_vccs++;
- if (wait && !(op->param.flags & ATMIO_FLAG_ASYNC)) {
+ if (!(op->param.flags & ATMIO_FLAG_ASYNC)) {
error = fatm_waitvcc(sc, q);
if (error != 0) {
sc->vccs[op->param.vci] = NULL;
@@ -2336,7 +2336,7 @@ fatm_close_complete(struct fatm_softc *sc, struct cmdqueue *q)
* Initiate closing a VCC
*/
static int
-fatm_close_vcc(struct fatm_softc *sc, struct atmio_closevcc *cl, int wait)
+fatm_close_vcc(struct fatm_softc *sc, struct atmio_closevcc *cl)
{
int error;
struct cmdqueue *q;
@@ -2360,8 +2360,8 @@ fatm_close_vcc(struct fatm_softc *sc, struct atmio_closevcc *cl, int wait)
q = fatm_start_vcc(sc, cl->vpi, cl->vci,
FATM_OP_DEACTIVATE_VCIN | FATM_OP_INTERRUPT_SEL, 1,
- (wait && !(vc->param.flags & ATMIO_FLAG_ASYNC)) ?
- fatm_cmd_complete : fatm_close_complete);
+ (vc->param.flags & ATMIO_FLAG_ASYNC) ?
+ fatm_close_complete : fatm_cmd_complete);
if (q == NULL) {
error = EIO;
goto done;
@@ -2370,7 +2370,7 @@ fatm_close_vcc(struct fatm_softc *sc, struct atmio_closevcc *cl, int wait)
vc->vflags &= ~(FATM_VCC_OPEN | FATM_VCC_TRY_OPEN);
vc->vflags |= FATM_VCC_TRY_CLOSE;
- if (wait && !(vc->param.flags & ATMIO_FLAG_ASYNC)) {
+ if (!(vc->param.flags & ATMIO_FLAG_ASYNC)) {
error = fatm_waitvcc(sc, q);
if (error != 0)
goto done;
@@ -2395,40 +2395,17 @@ fatm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t arg)
struct ifreq *ifr = (struct ifreq *)arg;
struct atmio_closevcc *cl = (struct atmio_closevcc *)arg;
struct atmio_openvcc *op = (struct atmio_openvcc *)arg;
- struct atm_pseudoioctl *pa = (struct atm_pseudoioctl *)arg;
struct atmio_vcctable *vtab;
- struct atmio_openvcc ena;
- struct atmio_closevcc dis;
error = 0;
switch (cmd) {
- case SIOCATMENA: /* internal NATM use */
- bzero(&ena, sizeof(ena));
- ena.param.flags = ATM_PH_FLAGS(&pa->aph) &
- (ATM_PH_AAL5 | ATM_PH_LLCSNAP);
- ena.param.vpi = ATM_PH_VPI(&pa->aph);
- ena.param.vci = ATM_PH_VCI(&pa->aph);
- ena.param.aal = (ATM_PH_FLAGS(&pa->aph) & ATM_PH_AAL5) ?
- ATMIO_AAL_5 : ATMIO_AAL_0;
- ena.param.traffic = ATMIO_TRAFFIC_UBR;
- ena.rxhand = pa->rxhand;
- error = fatm_open_vcc(sc, &ena, 0);
+ case SIOCATMOPENVCC: /* kernel internal use */
+ error = fatm_open_vcc(sc, op);
break;
- case SIOCATMDIS: /* internal NATM use */
- bzero(&dis, sizeof(dis));
- dis.vpi = ATM_PH_VPI(&pa->aph);
- dis.vci = ATM_PH_VCI(&pa->aph);
- error = fatm_close_vcc(sc, &dis, 0);
- break;
-
- case SIOCATMOPENVCC:
- error = fatm_open_vcc(sc, op, 1);
- break;
-
- case SIOCATMCLOSEVCC:
- error = fatm_close_vcc(sc, cl, 1);
+ case SIOCATMCLOSEVCC: /* kernel internal use */
+ error = fatm_close_vcc(sc, cl);
break;
case SIOCSIFADDR:
diff --git a/sys/dev/hatm/if_hatm_ioctl.c b/sys/dev/hatm/if_hatm_ioctl.c
index 5a38c43..c49e5ae 100644
--- a/sys/dev/hatm/if_hatm_ioctl.c
+++ b/sys/dev/hatm/if_hatm_ioctl.c
@@ -184,39 +184,6 @@ hatm_open_vcc(struct hatm_softc *sc, struct atmio_openvcc *arg)
}
/*
- * Enable ioctl for NATM. Map to an open ioctl.
- */
-static int
-hatm_open_vcc1(struct hatm_softc *sc, struct atm_pseudoioctl *ph)
-{
- struct atmio_openvcc *v;
- int error;
-
- if ((v = malloc(sizeof(*v), M_TEMP, M_NOWAIT | M_ZERO)) == NULL)
- return (ENOMEM);
-
- v->param.flags = ATM_PH_FLAGS(&ph->aph) &
- (ATM_PH_AAL5 | ATM_PH_LLCSNAP);
- v->param.flags |= ATMIO_FLAG_ASYNC;
- v->param.vpi = ATM_PH_VPI(&ph->aph);
- v->param.vci = ATM_PH_VCI(&ph->aph);
- v->param.aal = (ATM_PH_FLAGS(&ph->aph) & ATM_PH_AAL5)
- ? ATMIO_AAL_5 : ATMIO_AAL_0;
- v->param.traffic = hatm_natm_traffic;
- v->rxhand = ph->rxhand;
- if ((v->param.tparam.pcr = hatm_natm_pcr) == 0 ||
- hatm_natm_pcr > sc->ifatm.mib.pcr)
- v->param.tparam.pcr = sc->ifatm.mib.pcr;
- v->param.tparam.mcr = 0;
-
- error = hatm_open_vcc(sc, v);
-
- free(v, M_TEMP);
-
- return (error);
-}
-
-/*
* VCC has been finally closed.
*/
void
@@ -291,17 +258,6 @@ hatm_close_vcc(struct hatm_softc *sc, struct atmio_closevcc *arg)
return (error);
}
-static int
-hatm_close_vcc1(struct hatm_softc *sc, struct atm_pseudoioctl *ph)
-{
- struct atmio_closevcc v;
-
- v.vpi = ATM_PH_VPI(&ph->aph);
- v.vci = ATM_PH_VCI(&ph->aph);
-
- return (hatm_close_vcc(sc, &v));
-}
-
/*
* IOCTL handler
*/
@@ -373,14 +329,6 @@ hatm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
free(vtab, M_DEVBUF);
break;
- case SIOCATMENA: /* NATM internal use */
- error = hatm_open_vcc1(sc, (struct atm_pseudoioctl *)data);
- break;
-
- case SIOCATMDIS: /* NATM internal use */
- error = hatm_close_vcc1(sc, (struct atm_pseudoioctl *)data);
- break;
-
case SIOCATMGETVCCS: /* netgraph internal use */
vtab = atm_getvccs((struct atmio_vcc **)sc->vccs,
HE_MAX_VCCS, sc->open_vccs, &sc->mtx, 0);
@@ -391,11 +339,11 @@ hatm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
*(void **)data = vtab;
break;
- case SIOCATMOPENVCC: /* netgraph/harp internal use */
+ case SIOCATMOPENVCC: /* kernel internal use */
error = hatm_open_vcc(sc, (struct atmio_openvcc *)data);
break;
- case SIOCATMCLOSEVCC: /* netgraph and HARP internal use */
+ case SIOCATMCLOSEVCC: /* kernel internal use */
error = hatm_close_vcc(sc, (struct atmio_closevcc *)data);
break;
diff --git a/sys/dev/patm/if_patm_ioctl.c b/sys/dev/patm/if_patm_ioctl.c
index 1bce9db..bbabf97 100644
--- a/sys/dev/patm/if_patm_ioctl.c
+++ b/sys/dev/patm/if_patm_ioctl.c
@@ -200,29 +200,6 @@ patm_open_vcc(struct patm_softc *sc, struct atmio_openvcc *arg)
}
/*
- * Enable ioctl for NATM. Map to an open ioctl.
- */
-static int
-patm_open_vcc1(struct patm_softc *sc, struct atm_pseudoioctl *ph)
-{
- struct atmio_openvcc v;
-
- bzero(&v, sizeof(v));
- v.param.flags = ATM_PH_FLAGS(&ph->aph) & (ATM_PH_AAL5 | ATM_PH_LLCSNAP);
- v.param.flags |= ATMIO_FLAG_ASYNC;
-
- v.param.vpi = ATM_PH_VPI(&ph->aph);
- v.param.vci = ATM_PH_VCI(&ph->aph);
- v.param.aal = (ATM_PH_FLAGS(&ph->aph) & ATM_PH_AAL5)
- ? ATMIO_AAL_5 : ATMIO_AAL_0;
- v.param.traffic = ATMIO_TRAFFIC_UBR;;
- v.param.tparam.pcr = sc->ifatm.mib.pcr;
- v.rxhand = ph->rxhand;
-
- return (patm_open_vcc(sc, &v));
-}
-
-/*
* Try to close the given VCC
*/
static int
@@ -282,20 +259,6 @@ patm_close_vcc(struct patm_softc *sc, struct atmio_closevcc *arg)
}
/*
- * Close a VCC asynchronuosly
- */
-static int
-patm_close_vcc1(struct patm_softc *sc, struct atm_pseudoioctl *ph)
-{
- struct atmio_closevcc v;
-
- v.vpi = ATM_PH_VPI(&ph->aph);
- v.vci = ATM_PH_VCI(&ph->aph);
-
- return (patm_close_vcc(sc, &v));
-}
-
-/*
* VCC has been finally closed.
*/
void
@@ -403,22 +366,14 @@ patm_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
ifp->if_mtu = ifr->ifr_mtu;
break;
- case SIOCATMOPENVCC: /* netgraph/harp internal use */
+ case SIOCATMOPENVCC: /* kernel internal use */
error = patm_open_vcc(sc, (struct atmio_openvcc *)data);
break;
- case SIOCATMCLOSEVCC: /* netgraph and HARP internal use */
+ case SIOCATMCLOSEVCC: /* kernel internal use */
error = patm_close_vcc(sc, (struct atmio_closevcc *)data);
break;
- case SIOCATMENA: /* NATM internal use */
- error = patm_open_vcc1(sc, (struct atm_pseudoioctl *)data);
- break;
-
- case SIOCATMDIS: /* NATM internal use */
- error = patm_close_vcc1(sc, (struct atm_pseudoioctl *)data);
- break;
-
case SIOCATMGVCCS: /* external use */
/* return vcc table */
vtab = atm_getvccs((struct atmio_vcc **)sc->vccs,
OpenPOWER on IntegriCloud