Deleted Added
full compact
if_patmvar.h (139749) if_patmvar.h (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:

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
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 *
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:

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
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 * $FreeBSD: head/sys/dev/patm/if_patmvar.h 139749 2005-01-06 01:43:34Z imp $
29 * $FreeBSD: head/sys/dev/patm/if_patmvar.h 147256 2005-06-10 16:49:24Z brooks $
30 *
31 * Driver for IDT77252 (ABR) based cards like ProSum's.
32 */
33
34/* legal values are 0, 1, 2 and 8 */
35#define PATM_VPI_BITS 2
36#define PATM_CFG_VPI IDT_CFG_VP2
37

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

144 SLIST_ENTRY(lmbuf) link; /* free list link */
145 bus_dmamap_t map; /* DMA map */
146 u_int handle; /* this is the handle index */
147 struct mbuf *m; /* the current mbuf */
148 bus_addr_t phy; /* phy addr */
149};
150
151#define PATM_CID(SC, VPI, VCI) \
30 *
31 * Driver for IDT77252 (ABR) based cards like ProSum's.
32 */
33
34/* legal values are 0, 1, 2 and 8 */
35#define PATM_VPI_BITS 2
36#define PATM_CFG_VPI IDT_CFG_VP2
37

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

144 SLIST_ENTRY(lmbuf) link; /* free list link */
145 bus_dmamap_t map; /* DMA map */
146 u_int handle; /* this is the handle index */
147 struct mbuf *m; /* the current mbuf */
148 bus_addr_t phy; /* phy addr */
149};
150
151#define PATM_CID(SC, VPI, VCI) \
152 (((VPI) << (SC)->ifatm.mib.vci_bits) | (VCI))
152 (((VPI) << IFP2IFATM((SC)->ifp)->mib.vci_bits) | (VCI))
153
154/*
155 * Internal driver statistics
156 */
157struct patm_stats {
158 uint32_t raw_cells;
159 uint32_t raw_no_vcc;
160 uint32_t raw_no_buf;

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

213#define PATM_RAW_NOHEC 0x0100 /* 52 byte cells */
214#define PATM_RAW_CS 0x0200 /* 64 byte cell stream */
215#define PATM_RAW_FORMAT 0x0300 /* format mask */
216
217/*
218 * Per adapter data
219 */
220struct patm_softc {
153
154/*
155 * Internal driver statistics
156 */
157struct patm_stats {
158 uint32_t raw_cells;
159 uint32_t raw_no_vcc;
160 uint32_t raw_no_buf;

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

213#define PATM_RAW_NOHEC 0x0100 /* 52 byte cells */
214#define PATM_RAW_CS 0x0200 /* 64 byte cell stream */
215#define PATM_RAW_FORMAT 0x0300 /* format mask */
216
217/*
218 * Per adapter data
219 */
220struct patm_softc {
221 struct ifatm ifatm; /* common ATM stuff */
221 struct ifnet *ifp; /* common ATM stuff */
222 struct mtx mtx; /* lock */
223 struct ifmedia media; /* media */
224 device_t dev; /* device */
225 struct resource * memres; /* memory resource */
226 bus_space_handle_t memh; /* handle */
227 bus_space_tag_t memt; /* ... and tag */
228 int irqid; /* resource id */
229 struct resource * irqres; /* resource */

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

320#define TST_BOTH 0x03000000
321#define TST_CH0 0x01000000
322#define TST_CH1 0x02000000
323/* tst_state */
324#define TST_ACT1 0x0001 /* active TST */
325#define TST_PENDING 0x0002 /* need update */
326#define TST_WAIT 0x0004 /* wait fo jump */
327
222 struct mtx mtx; /* lock */
223 struct ifmedia media; /* media */
224 device_t dev; /* device */
225 struct resource * memres; /* memory resource */
226 bus_space_handle_t memh; /* handle */
227 bus_space_tag_t memt; /* ... and tag */
228 int irqid; /* resource id */
229 struct resource * irqres; /* resource */

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

320#define TST_BOTH 0x03000000
321#define TST_CH0 0x01000000
322#define TST_CH1 0x02000000
323/* tst_state */
324#define TST_ACT1 0x0001 /* active TST */
325#define TST_PENDING 0x0002 /* need update */
326#define TST_WAIT 0x0004 /* wait fo jump */
327
328#define patm_printf(SC, ...) if_printf(&(SC)->ifatm.ifnet, __VA_ARGS__);
328#define patm_printf(SC, ...) if_printf((SC)->ifp, __VA_ARGS__);
329
330#ifdef PATM_DEBUG
331/*
332 * Debugging
333 */
334enum {
335 DBG_ATTACH = 0x0001, /* attaching the card */
336 DBG_INTR = 0x0002, /* interrupts */

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

343 DBG_TX = 0x0100, /* transmission */
344 DBG_TST = 0x0200, /* TST */
345
346 DBG_ALL = 0xffff
347};
348
349#define patm_debug(SC, FLAG, ...) do { \
350 if((SC)->debug & DBG_##FLAG) { \
329
330#ifdef PATM_DEBUG
331/*
332 * Debugging
333 */
334enum {
335 DBG_ATTACH = 0x0001, /* attaching the card */
336 DBG_INTR = 0x0002, /* interrupts */

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

343 DBG_TX = 0x0100, /* transmission */
344 DBG_TST = 0x0200, /* TST */
345
346 DBG_ALL = 0xffff
347};
348
349#define patm_debug(SC, FLAG, ...) do { \
350 if((SC)->debug & DBG_##FLAG) { \
351 if_printf(&(SC)->ifatm.ifnet, "%s: ", __func__); \
351 if_printf((SC)->ifp, "%s: ", __func__); \
352 printf(__VA_ARGS__); \
353 printf("\n"); \
354 } \
355 } while (0)
356#else
357
358#define patm_debug(SC, FLAG, ...) do { } while (0)
359

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

505 patm_nor_write(sc, IDT_NOR_D0, v0);
506 patm_nor_write(sc, IDT_NOR_D1, v1);
507 patm_nor_write(sc, IDT_NOR_D2, v2);
508 patm_nor_write(sc, IDT_NOR_D3, v3);
509 patm_cmd_exec(sc, IDT_MKCMD_WSRAM(addr, 3));
510}
511
512#define LEGAL_VPI(SC, VPI) \
352 printf(__VA_ARGS__); \
353 printf("\n"); \
354 } \
355 } while (0)
356#else
357
358#define patm_debug(SC, FLAG, ...) do { } while (0)
359

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

505 patm_nor_write(sc, IDT_NOR_D0, v0);
506 patm_nor_write(sc, IDT_NOR_D1, v1);
507 patm_nor_write(sc, IDT_NOR_D2, v2);
508 patm_nor_write(sc, IDT_NOR_D3, v3);
509 patm_cmd_exec(sc, IDT_MKCMD_WSRAM(addr, 3));
510}
511
512#define LEGAL_VPI(SC, VPI) \
513 (((VPI) & ~((1 << (SC)->ifatm.mib.vpi_bits) - 1)) == 0)
513 (((VPI) & ~((1 << IFP2IFATM((SC)->ifp)->mib.vpi_bits) - 1)) == 0)
514#define LEGAL_VCI(SC, VCI) \
514#define LEGAL_VCI(SC, VCI) \
515 (((VCI) & ~((1 << (SC)->ifatm.mib.vci_bits) - 1)) == 0)
515 (((VCI) & ~((1 << IFP2IFATM((SC)->ifp)->mib.vci_bits) - 1)) == 0)
516
517extern const uint32_t patm_rtables155[];
518extern const uint32_t patm_rtables25[];
519extern const u_int patm_rtables_size;
520extern const u_int patm_rtables_ntab;
516
517extern const uint32_t patm_rtables155[];
518extern const uint32_t patm_rtables25[];
519extern const u_int patm_rtables_size;
520extern const u_int patm_rtables_ntab;