Deleted Added
full compact
if_patm.c (118158) if_patm.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.c 118158 2003-07-29 13:21:57Z harti $");
32__FBSDID("$FreeBSD: head/sys/dev/patm/if_patm.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>

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

206 sc->ifatm.ifnet.if_flags |= IFF_RUNNING;
207
208 /* enable interrupts, Tx and Rx paths */
209 cfg |= IDT_CFG_RXPTH | IDT_CFG_RXIIMM | IDT_CFG_RAWIE | IDT_CFG_RQFIE |
210 IDT_CFG_TIMOIE | IDT_CFG_FBIE | IDT_CFG_TXENB | IDT_CFG_TXINT |
211 IDT_CFG_TXUIE | IDT_CFG_TXSFI | IDT_CFG_PHYIE;
212 patm_nor_write(sc, IDT_NOR_CFG, cfg);
213
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>

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

206 sc->ifatm.ifnet.if_flags |= IFF_RUNNING;
207
208 /* enable interrupts, Tx and Rx paths */
209 cfg |= IDT_CFG_RXPTH | IDT_CFG_RXIIMM | IDT_CFG_RAWIE | IDT_CFG_RQFIE |
210 IDT_CFG_TIMOIE | IDT_CFG_FBIE | IDT_CFG_TXENB | IDT_CFG_TXINT |
211 IDT_CFG_TXUIE | IDT_CFG_TXSFI | IDT_CFG_PHYIE;
212 patm_nor_write(sc, IDT_NOR_CFG, cfg);
213
214 for (i = 0; i < sc->mmap->max_conn; i++)
215 if (sc->vccs[i] != NULL)
216 patm_load_vc(sc, sc->vccs[i], 1);
217
214 ATMEV_SEND_IFSTATE_CHANGED(&sc->ifatm,
215 sc->utopia.carrier == UTP_CARR_OK);
216}
217
218/*
219 * External callable start function
220 */
221void

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

279
280 /* free aal0 buffers that are on the card */
281 patm_debug(sc, ATTACH, "freeing aal0 buffers...");
282 mbp_card_free(sc->vbuf_pool);
283
284 /* freeing partial receive chains and reset vcc state */
285 for (i = 0; i < sc->mmap->max_conn; i++) {
286 if (sc->vccs[i] != NULL) {
218 ATMEV_SEND_IFSTATE_CHANGED(&sc->ifatm,
219 sc->utopia.carrier == UTP_CARR_OK);
220}
221
222/*
223 * External callable start function
224 */
225void

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

283
284 /* free aal0 buffers that are on the card */
285 patm_debug(sc, ATTACH, "freeing aal0 buffers...");
286 mbp_card_free(sc->vbuf_pool);
287
288 /* freeing partial receive chains and reset vcc state */
289 for (i = 0; i < sc->mmap->max_conn; i++) {
290 if (sc->vccs[i] != NULL) {
287 if (sc->vccs[i]->chain != NULL)
291 if (sc->vccs[i]->chain != NULL) {
288 m_freem(sc->vccs[i]->chain);
292 m_freem(sc->vccs[i]->chain);
293 sc->vccs[i]->chain = NULL;
294 sc->vccs[i]->last = NULL;
295 }
289
296
290 if (sc->vccs[i]->vcc.flags & ATMIO_FLAG_NG) {
297 if (sc->vccs[i]->vflags & (PATM_VCC_RX_CLOSING |
298 PATM_VCC_TX_CLOSING)) {
291 uma_zfree(sc->vcc_zone, sc->vccs[i]);
292 sc->vccs[i] = NULL;
293 } else {
299 uma_zfree(sc->vcc_zone, sc->vccs[i]);
300 sc->vccs[i] = NULL;
301 } else {
294 /* keep HARP and NG */
295 sc->vccs[i]->chain = NULL;
296 sc->vccs[i]->last = NULL;
297 sc->vccs[i]->vflags = 0;
302 /* keep */
303 sc->vccs[i]->vflags &= ~PATM_VCC_OPEN;
304 sc->vccs[i]->cps = 0;
305 sc->vccs[i]->scd = NULL;
298 }
299 }
300 }
301
302 /* stop all active SCDs */
303 while ((scd = LIST_FIRST(&sc->scd_list)) != NULL) {
304 /* free queue packets */
305 for (;;) {

--- 200 unchanged lines hidden ---
306 }
307 }
308 }
309
310 /* stop all active SCDs */
311 while ((scd = LIST_FIRST(&sc->scd_list)) != NULL) {
312 /* free queue packets */
313 for (;;) {

--- 200 unchanged lines hidden ---