Deleted Added
full compact
if_patm.c (139749) if_patm.c (147256)
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:

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

25 * SUCH DAMAGE.
26 *
27 * Author: Hartmut Brandt <harti@freebsd.org>
28 *
29 * Driver for IDT77252 based cards like ProSum's.
30 */
31
32#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:

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

25 * SUCH DAMAGE.
26 *
27 * Author: Hartmut Brandt <harti@freebsd.org>
28 *
29 * Driver for IDT77252 based cards like ProSum's.
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/dev/patm/if_patm.c 139749 2005-01-06 01:43:34Z imp $");
33__FBSDID("$FreeBSD: head/sys/dev/patm/if_patm.c 147256 2005-06-10 16:49:24Z brooks $");
34
35#include "opt_inet.h"
36#include "opt_natm.h"
37
38#include <sys/types.h>
39#include <sys/param.h>
40#include <sys/systm.h>
41#include <sys/malloc.h>

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

199 sc->scd0->q.ifq_maxlen = PATM_DLFT_MAXQ;
200
201 patm_scd_setup(sc, sc->scd0);
202 patm_tct_setup(sc, sc->scd0, NULL);
203
204 patm_debug(sc, ATTACH, "go...");
205
206 sc->utopia.flags &= ~UTP_FL_POLL_CARRIER;
34
35#include "opt_inet.h"
36#include "opt_natm.h"
37
38#include <sys/types.h>
39#include <sys/param.h>
40#include <sys/systm.h>
41#include <sys/malloc.h>

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

199 sc->scd0->q.ifq_maxlen = PATM_DLFT_MAXQ;
200
201 patm_scd_setup(sc, sc->scd0);
202 patm_tct_setup(sc, sc->scd0, NULL);
203
204 patm_debug(sc, ATTACH, "go...");
205
206 sc->utopia.flags &= ~UTP_FL_POLL_CARRIER;
207 sc->ifatm.ifnet.if_flags |= IFF_RUNNING;
207 sc->ifp->if_flags |= IFF_RUNNING;
208
209 /* enable interrupts, Tx and Rx paths */
210 cfg |= IDT_CFG_RXPTH | IDT_CFG_RXIIMM | IDT_CFG_RAWIE | IDT_CFG_RQFIE |
211 IDT_CFG_TIMOIE | IDT_CFG_FBIE | IDT_CFG_TXENB | IDT_CFG_TXINT |
212 IDT_CFG_TXUIE | IDT_CFG_TXSFI | IDT_CFG_PHYIE;
213 patm_nor_write(sc, IDT_NOR_CFG, cfg);
214
215 for (i = 0; i < sc->mmap->max_conn; i++)
216 if (sc->vccs[i] != NULL)
217 patm_load_vc(sc, sc->vccs[i], 1);
218
208
209 /* enable interrupts, Tx and Rx paths */
210 cfg |= IDT_CFG_RXPTH | IDT_CFG_RXIIMM | IDT_CFG_RAWIE | IDT_CFG_RQFIE |
211 IDT_CFG_TIMOIE | IDT_CFG_FBIE | IDT_CFG_TXENB | IDT_CFG_TXINT |
212 IDT_CFG_TXUIE | IDT_CFG_TXSFI | IDT_CFG_PHYIE;
213 patm_nor_write(sc, IDT_NOR_CFG, cfg);
214
215 for (i = 0; i < sc->mmap->max_conn; i++)
216 if (sc->vccs[i] != NULL)
217 patm_load_vc(sc, sc->vccs[i], 1);
218
219 ATMEV_SEND_IFSTATE_CHANGED(&sc->ifatm,
219 ATMEV_SEND_IFSTATE_CHANGED(IFP2IFATM(sc->ifp),
220 sc->utopia.carrier == UTP_CARR_OK);
221}
222
223/*
224 * External callable start function
225 */
226void
227patm_init(void *p)

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

240void
241patm_stop(struct patm_softc *sc)
242{
243 u_int i;
244 struct mbuf *m;
245 struct patm_txmap *map;
246 struct patm_scd *scd;
247
220 sc->utopia.carrier == UTP_CARR_OK);
221}
222
223/*
224 * External callable start function
225 */
226void
227patm_init(void *p)

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

240void
241patm_stop(struct patm_softc *sc)
242{
243 u_int i;
244 struct mbuf *m;
245 struct patm_txmap *map;
246 struct patm_scd *scd;
247
248 sc->ifatm.ifnet.if_flags &= ~IFF_RUNNING;
248 sc->ifp->if_flags &= ~IFF_RUNNING;
249 sc->utopia.flags |= UTP_FL_POLL_CARRIER;
250
251 patm_reset(sc);
252
253 mtx_lock(&sc->tst_lock);
254 i = sc->tst_state;
255 sc->tst_state = 0;
256 callout_stop(&sc->tst_callout);

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

330 }
331 sc->scd0 = NULL;
332
333 sc->flags &= ~PATM_CLR;
334
335 /* reset raw cell queue */
336 sc->rawh = NULL;
337
249 sc->utopia.flags |= UTP_FL_POLL_CARRIER;
250
251 patm_reset(sc);
252
253 mtx_lock(&sc->tst_lock);
254 i = sc->tst_state;
255 sc->tst_state = 0;
256 callout_stop(&sc->tst_callout);

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

330 }
331 sc->scd0 = NULL;
332
333 sc->flags &= ~PATM_CLR;
334
335 /* reset raw cell queue */
336 sc->rawh = NULL;
337
338 ATMEV_SEND_IFSTATE_CHANGED(&sc->ifatm,
338 ATMEV_SEND_IFSTATE_CHANGED(IFP2IFATM(sc->ifp),
339 sc->utopia.carrier == UTP_CARR_OK);
340}
341
342/*
343 * Stop the card and reset it
344 */
345void
346patm_reset(struct patm_softc *sc)

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

392
393 /* TST2 */
394 for (i = 0; i < sc->mmap->tst_size - 1; i++)
395 patm_sram_write(sc, idle + i, IDT_TST_VBR);
396 patm_sram_write(sc, sc->tst_jump[1], IDT_TST_BR | (idle << 2));
397
398 sc->tst_free = sc->mmap->tst_size - 1;
399 sc->tst_reserve = sc->tst_free * PATM_TST_RESERVE / 100;
339 sc->utopia.carrier == UTP_CARR_OK);
340}
341
342/*
343 * Stop the card and reset it
344 */
345void
346patm_reset(struct patm_softc *sc)

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

392
393 /* TST2 */
394 for (i = 0; i < sc->mmap->tst_size - 1; i++)
395 patm_sram_write(sc, idle + i, IDT_TST_VBR);
396 patm_sram_write(sc, sc->tst_jump[1], IDT_TST_BR | (idle << 2));
397
398 sc->tst_free = sc->mmap->tst_size - 1;
399 sc->tst_reserve = sc->tst_free * PATM_TST_RESERVE / 100;
400 sc->bwrem = sc->ifatm.mib.pcr;
400 sc->bwrem = IFP2IFATM(sc->ifp)->mib.pcr;
401}
402
403/*
404 * Initialize the SCDs. This is done by building a list of all free
405 * SCDs in SRAM. The first word of each potential SCD is used as a
406 * link to the next free SCD. The list is rooted in softc.
407 */
408static void

--- 103 unchanged lines hidden ---
401}
402
403/*
404 * Initialize the SCDs. This is done by building a list of all free
405 * SCDs in SRAM. The first word of each potential SCD is used as a
406 * link to the next free SCD. The list is rooted in softc.
407 */
408static void

--- 103 unchanged lines hidden ---