Deleted Added
full compact
if_hatm_tx.c (119280) if_hatm_tx.c (121687)
1/*
2 * Copyright (c) 2001-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:

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

27 * Author: Hartmut Brandt <harti@freebsd.org>
28 *
29 * ForeHE driver.
30 *
31 * Transmission.
32 */
33
34#include <sys/cdefs.h>
1/*
2 * Copyright (c) 2001-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:

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

27 * Author: Hartmut Brandt <harti@freebsd.org>
28 *
29 * ForeHE driver.
30 *
31 * Transmission.
32 */
33
34#include <sys/cdefs.h>
35__FBSDID("$FreeBSD: head/sys/dev/hatm/if_hatm_tx.c 119280 2003-08-22 06:00:27Z imp $");
35__FBSDID("$FreeBSD: head/sys/dev/hatm/if_hatm_tx.c 121687 2003-10-29 15:15:19Z harti $");
36
37#include "opt_inet.h"
38#include "opt_natm.h"
39
40#include <sys/types.h>
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/kernel.h>

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

316 return;
317 }
318 arg->vcc->ntpds += tpd_cnt;
319}
320
321
322/*
323 * Start output on the interface
36
37#include "opt_inet.h"
38#include "opt_natm.h"
39
40#include <sys/types.h>
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/kernel.h>

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

316 return;
317 }
318 arg->vcc->ntpds += tpd_cnt;
319}
320
321
322/*
323 * Start output on the interface
324 *
325 * For raw aal we process only the first cell in the mbuf chain! XXX
326 */
327void
328hatm_start(struct ifnet *ifp)
329{
330 struct hatm_softc *sc = (struct hatm_softc *)ifp->if_softc;
331 struct mbuf *m;
332 struct atm_pseudohdr *aph;
333 u_int cid;

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

376 m_freem(m);
377 sc->istats.flow_drop++;
378 continue;
379 }
380
381 arg.pti = 0;
382 if (arg.vcc->param.aal == ATMIO_AAL_RAW) {
383 if (len < 52) {
324 */
325void
326hatm_start(struct ifnet *ifp)
327{
328 struct hatm_softc *sc = (struct hatm_softc *)ifp->if_softc;
329 struct mbuf *m;
330 struct atm_pseudohdr *aph;
331 u_int cid;

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

374 m_freem(m);
375 sc->istats.flow_drop++;
376 continue;
377 }
378
379 arg.pti = 0;
380 if (arg.vcc->param.aal == ATMIO_AAL_RAW) {
381 if (len < 52) {
382 /* too short */
384 m_freem(m);
385 continue;
386 }
383 m_freem(m);
384 continue;
385 }
387 if (len > 52) {
388 m_adj(m, -((int)(len - 52)));
389 len = 52;
390 }
386
387 /*
388 * Get the header and ignore except
389 * payload type and CLP.
390 */
391 if (m->m_len < 4 && (m = m_pullup(m, 4)) == NULL)
392 continue;
391 if (m->m_len < 4 && (m = m_pullup(m, 4)) == NULL)
392 continue;
393
394 /* ignore header except payload type and CLP */
395 arg.pti = mtod(m, u_char *)[3] & 0xf;
396 arg.pti = ((arg.pti & 0xe) << 2) | ((arg.pti & 1) << 1);
397 m_adj(m, 4);
398 len -= 4;
393 arg.pti = mtod(m, u_char *)[3] & 0xf;
394 arg.pti = ((arg.pti & 0xe) << 2) | ((arg.pti & 1) << 1);
395 m_adj(m, 4);
396 len -= 4;
397
398 if (len % 48 != 0) {
399 m_adj(m, -((int)(len % 48)));
400 len -= len % 48;
401 }
399 }
400
401#ifdef ENABLE_BPF
402 if (!(arg.vcc->param.flags & ATMIO_FLAG_NG) &&
403 (arg.vcc->param.aal == ATMIO_AAL_5) &&
404 (arg.vcc->param.flags & ATM_PH_LLCSNAP))
405 BPF_MTAP(ifp, m);
406#endif

--- 376 unchanged lines hidden ---
402 }
403
404#ifdef ENABLE_BPF
405 if (!(arg.vcc->param.flags & ATMIO_FLAG_NG) &&
406 (arg.vcc->param.aal == ATMIO_AAL_5) &&
407 (arg.vcc->param.flags & ATM_PH_LLCSNAP))
408 BPF_MTAP(ifp, m);
409#endif

--- 376 unchanged lines hidden ---