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 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 |
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 */ |
383 m_freem(m); 384 continue; 385 } |
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; |
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 } |
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 --- |