diff options
author | harti <harti@FreeBSD.org> | 2003-08-06 14:07:54 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2003-08-06 14:07:54 +0000 |
commit | 2335fa9eb3c27791e9ada6ce202bd045494c5761 (patch) | |
tree | 31a0c36f7fdd923ffacb23f344a7d16a98fe1578 /sys/netnatm | |
parent | 65e49017604fba0d060a6a3b9a3c8e9ec05f91b0 (diff) | |
download | FreeBSD-src-2335fa9eb3c27791e9ada6ce202bd045494c5761.zip FreeBSD-src-2335fa9eb3c27791e9ada6ce202bd045494c5761.tar.gz |
Use the new OPENVCC and CLOSEVCC ioctls to open and close the NATM
channel. These have been the last consumers of the old ioctls.
Diffstat (limited to 'sys/netnatm')
-rw-r--r-- | sys/netnatm/natm.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/sys/netnatm/natm.c b/sys/netnatm/natm.c index 29ff2b2..05b3063 100644 --- a/sys/netnatm/natm.c +++ b/sys/netnatm/natm.c @@ -147,7 +147,7 @@ natm_usr_connect(struct socket *so, struct sockaddr *nam, d_thread_t *p) { struct natmpcb *npcb; struct sockaddr_natm *snatm; - struct atm_pseudoioctl api; + struct atmio_openvcc op; struct ifnet *ifp; int error = 0; int s2, s = SPLSOFTNET(); @@ -198,15 +198,20 @@ natm_usr_connect(struct socket *so, struct sockaddr *nam, d_thread_t *p) } /* - * enable rx + * open the channel */ - ATM_PH_FLAGS(&api.aph) = (proto == PROTO_NATMAAL5) ? ATM_PH_AAL5 : 0; - ATM_PH_VPI(&api.aph) = npcb->npcb_vpi; - ATM_PH_SETVCI(&api.aph, npcb->npcb_vci); - api.rxhand = npcb; + bzero(&op, sizeof(op)); + op.rxhand = npcb; + op.param.flags = ATMIO_FLAG_PVC; + op.param.vpi = npcb->npcb_vpi; + op.param.vci = npcb->npcb_vci; + op.param.rmtu = op.param.tmtu = ifp->if_mtu; + op.param.aal = (proto == PROTO_NATMAAL5) ? ATMIO_AAL_5 : ATMIO_AAL_0; + op.param.traffic = ATMIO_TRAFFIC_UBR; + s2 = splimp(); if (ifp->if_ioctl == NULL || - ifp->if_ioctl(ifp, SIOCATMENA, (caddr_t) &api) != 0) { + ifp->if_ioctl(ifp, SIOCATMOPENVCC, (caddr_t)&op) != 0) { splx(s2); npcb_free(npcb, NPCB_REMOVE); error = EIO; @@ -225,7 +230,7 @@ static int natm_usr_disconnect(struct socket *so) { struct natmpcb *npcb; - struct atm_pseudoioctl api; + struct atmio_closevcc cl; struct ifnet *ifp; int error = 0; int s2, s = SPLSOFTNET(); @@ -246,13 +251,11 @@ natm_usr_disconnect(struct socket *so) /* * disable rx */ - ATM_PH_FLAGS(&api.aph) = ATM_PH_AAL5; - ATM_PH_VPI(&api.aph) = npcb->npcb_vpi; - ATM_PH_SETVCI(&api.aph, npcb->npcb_vci); - api.rxhand = npcb; + cl.vpi = npcb->npcb_vpi; + cl.vci = npcb->npcb_vci; s2 = splimp(); if (ifp->if_ioctl != NULL) - ifp->if_ioctl(ifp, SIOCATMDIS, (caddr_t) &api); + ifp->if_ioctl(ifp, SIOCATMCLOSEVCC, (caddr_t)&cl); splx(s2); npcb_free(npcb, NPCB_REMOVE); |