aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/en/midway.c
diff options
context:
space:
mode:
authorHartmut Brandt <harti@FreeBSD.org>2003-08-06 11:35:41 +0000
committerHartmut Brandt <harti@FreeBSD.org>2003-08-06 11:35:41 +0000
commit2ac9f225567a7b474852f23ba0729db6d2feddad (patch)
tree10ba0270cbd9465f1d435bdede7ce81fb5646127 /sys/dev/en/midway.c
parentefa3048b1efca073eefed4c824b453e7c54857c1 (diff)
downloadsrc-2ac9f225567a7b474852f23ba0729db6d2feddad.tar.gz
src-2ac9f225567a7b474852f23ba0729db6d2feddad.zip
When sending check that the channel is really open. Get the information
whether we use AAL5 or not from the aal field of the channel parameters instead of the flag in the pseudo header. This flag will go away soon.
Notes
Notes: svn path=/head/; revision=118533
Diffstat (limited to 'sys/dev/en/midway.c')
-rw-r--r--sys/dev/en/midway.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/en/midway.c b/sys/dev/en/midway.c
index 9d5c2b633d13..91e081ceba7c 100644
--- a/sys/dev/en/midway.c
+++ b/sys/dev/en/midway.c
@@ -978,6 +978,7 @@ en_start(struct ifnet *ifp)
u_int flags;
uint32_t tbd[2];
uint32_t pdu[2];
+ struct en_vcc *vc;
struct en_map *map;
struct en_txslot *tx;
@@ -990,15 +991,17 @@ en_start(struct ifnet *ifp)
ap = mtod(m, struct atm_pseudohdr *);
vci = ATM_PH_VCI(ap);
- if (ATM_PH_FLAGS(ap) & ATM_PH_AAL5)
- flags |= TX_AAL5;
- if (ATM_PH_VPI(ap) != 0 || vci >= MID_N_VC) {
+ if (ATM_PH_VPI(ap) != 0 || vci >= MID_N_VC ||
+ (vc = sc->vccs[vci]) == NULL ||
+ (vc->vflags & VCC_CLOSE_RX)) {
DBG(sc, TX, ("output vpi=%u, vci=%u -- drop",
ATM_PH_VPI(ap), vci));
m_freem(m);
continue;
}
+ if (vc->vcc.aal == ATMIO_AAL_5)
+ flags |= TX_AAL5;
m_adj(m, sizeof(struct atm_pseudohdr));
/*
@@ -1058,8 +1061,7 @@ en_start(struct ifnet *ifp)
if (M_WRITABLE(m) && M_LEADINGSPACE(m) >= MID_TBD_SIZE) {
tbd[0] = htobe32(MID_TBD_MK1((flags & TX_AAL5) ?
MID_TBD_AAL5 : MID_TBD_NOAAL5,
- sc->vccs[vci]->txspeed,
- m->m_pkthdr.len / MID_ATMDATASZ));
+ vc->txspeed, m->m_pkthdr.len / MID_ATMDATASZ));
tbd[1] = htobe32(MID_TBD_MK2(vci, 0, 0));
m->m_data -= MID_TBD_SIZE;
@@ -1098,7 +1100,7 @@ en_start(struct ifnet *ifp)
/*
* get assigned channel (will be zero unless txspeed is set)
*/
- tx = sc->vccs[vci]->txslot;
+ tx = vc->txslot;
if (m->m_pkthdr.len > EN_TXSZ * 1024) {
DBG(sc, TX, ("tx%zu: packet larger than xmit buffer "
@@ -2264,7 +2266,7 @@ en_service(struct en_softc *sc)
EN_COUNT(sc->stats.ttrash);
DBG(sc, SERV, ("RX overflow lost %d cells!", MID_RBD_CNT(rbd)));
- } else if (!(vc->vcc.flags & ATM_PH_AAL5)) {
+ } else if (vc->vcc.aal != ATMIO_AAL_5) {
/* 1 cell (ick!) */
mlen = MID_CHDR_SIZE + MID_ATMDATASZ;
rx.pre_skip = MID_RBD_SIZE;