Deleted Added
full compact
if_patm_ioctl.c (118548) if_patm_ioctl.c (118601)
1/*
2 * Copyright (c) 2003
3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus).
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 15 unchanged lines hidden (view full) ---

24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * Author: Hartmut Brandt <harti@freebsd.org>
28 *
29 * Driver for IDT77252 based cards like ProSum's.
30 */
31#include <sys/cdefs.h>
1/*
2 * Copyright (c) 2003
3 * Fraunhofer Institute for Open Communication Systems (FhG Fokus).
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 15 unchanged lines hidden (view full) ---

24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * Author: Hartmut Brandt <harti@freebsd.org>
28 *
29 * Driver for IDT77252 based cards like ProSum's.
30 */
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/dev/patm/if_patm_ioctl.c 118548 2003-08-06 14:53:27Z harti $");
32__FBSDID("$FreeBSD: head/sys/dev/patm/if_patm_ioctl.c 118601 2003-08-07 14:30:58Z harti $");
33
34#include "opt_inet.h"
35#include "opt_natm.h"
36
37#include <sys/types.h>
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/malloc.h>

--- 125 unchanged lines hidden (view full) ---

166 (error = patm_tx_vcc_can_open(sc, vcc)) != 0)
167 goto done;
168 if (!(vcc->vcc.flags & ATMIO_FLAG_NORX) &&
169 (error = patm_rx_vcc_can_open(sc, vcc)) != 0)
170 goto done;
171
172 /* ok - go ahead */
173 sc->vccs[cid] = vcc;
33
34#include "opt_inet.h"
35#include "opt_natm.h"
36
37#include <sys/types.h>
38#include <sys/param.h>
39#include <sys/systm.h>
40#include <sys/malloc.h>

--- 125 unchanged lines hidden (view full) ---

166 (error = patm_tx_vcc_can_open(sc, vcc)) != 0)
167 goto done;
168 if (!(vcc->vcc.flags & ATMIO_FLAG_NORX) &&
169 (error = patm_rx_vcc_can_open(sc, vcc)) != 0)
170 goto done;
171
172 /* ok - go ahead */
173 sc->vccs[cid] = vcc;
174 patm_load_vc(sc, vcc, 0);
174
175
175 patm_debug(sc, VCC, "Open VCC: opening");
176 if (!(vcc->vcc.flags & ATMIO_FLAG_NOTX))
177 patm_tx_vcc_open(sc, vcc);
178 if (!(vcc->vcc.flags & ATMIO_FLAG_NORX))
179 patm_rx_vcc_open(sc, vcc);
180
181 /* inform management about non-NG and NG-PVCs */
182 if (!(vcc->vcc.flags & ATMIO_FLAG_NG) ||
183 (vcc->vcc.flags & ATMIO_FLAG_PVC))
184 ATMEV_SEND_VCC_CHANGED(&sc->ifatm, vcc->vcc.vpi,
185 vcc->vcc.vci, 1);
186
187 patm_debug(sc, VCC, "Open VCC: now open");
188
189 /* don't free below */
190 vcc = NULL;
176 /* don't free below */
177 vcc = NULL;
191
192 sc->vccs_open++;
193
194 /* done */
195 done:
196 mtx_unlock(&sc->mtx);
197 if (vcc != NULL)
198 uma_zfree(sc->vcc_zone, vcc);
199 return (error);
200}
201
178 sc->vccs_open++;
179
180 /* done */
181 done:
182 mtx_unlock(&sc->mtx);
183 if (vcc != NULL)
184 uma_zfree(sc->vcc_zone, vcc);
185 return (error);
186}
187
188void
189patm_load_vc(struct patm_softc *sc, struct patm_vcc *vcc, int reload)
190{
191
192 patm_debug(sc, VCC, "Open VCC: opening");
193 if (!(vcc->vcc.flags & ATMIO_FLAG_NOTX))
194 patm_tx_vcc_open(sc, vcc);
195 if (!(vcc->vcc.flags & ATMIO_FLAG_NORX))
196 patm_rx_vcc_open(sc, vcc);
197
198 if (!reload) {
199 /* inform management about non-NG and NG-PVCs */
200 if (!(vcc->vcc.flags & ATMIO_FLAG_NG) ||
201 (vcc->vcc.flags & ATMIO_FLAG_PVC))
202 ATMEV_SEND_VCC_CHANGED(&sc->ifatm, vcc->vcc.vpi,
203 vcc->vcc.vci, 1);
204 }
205
206 patm_debug(sc, VCC, "Open VCC: now open");
207}
208
202/*
203 * Try to close the given VCC
204 */
205static int
206patm_close_vcc(struct patm_softc *sc, struct atmio_closevcc *arg)
207{
208 u_int cid;
209 struct patm_vcc *vcc;

--- 194 unchanged lines hidden ---
209/*
210 * Try to close the given VCC
211 */
212static int
213patm_close_vcc(struct patm_softc *sc, struct atmio_closevcc *arg)
214{
215 u_int cid;
216 struct patm_vcc *vcc;

--- 194 unchanged lines hidden ---