From owner-freebsd-hackers Wed Jul 8 19:39:00 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA08181 for freebsd-hackers-outgoing; Wed, 8 Jul 1998 19:39:00 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from heathers2.stdio.com (lile@heathers2.stdio.com [199.89.192.5]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA08174 for ; Wed, 8 Jul 1998 19:38:58 -0700 (PDT) (envelope-from lile@stdio.com) Received: (from lile@localhost) by heathers2.stdio.com (8.8.8/8.8.8) id WAA15990; Wed, 8 Jul 1998 22:36:02 -0400 (EDT) Date: Wed, 8 Jul 1998 22:36:02 -0400 (EDT) From: "Larry S. Lile" To: hackers@FreeBSD.ORG Subject: Network driver question Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Okay, I'm confused. I have got the tokenring driver passing packets up to the higher network layers but to no avail. If I receive and arp packet it should be fed to the arp layer and result in an arp packet begin generated and sent back, but the output routine is never being called. The same for IP packets. I am pretty sure things are working correctly up to that point because tcpdump is printing the incoming packets on the interface (well trying to anyway, it can't decode them yet). Also my iso88025_input (hacked version of ether_input) is printing debug information that make me think everything is working ok up to that point. Here is what I have: (full sources at http://anarchy.stdio.com) void iso88025_input(ifp, th, m) struct ifnet *ifp; register struct iso88025_header *th; struct mbuf *m; { register struct ifqueue *inq; u_short ether_type; int s; register struct llc *l = mtod(m, struct llc *); printf("iso88025_input: entered.\n"); printf("iso88025_input: adjusting mbuf.\n"); m->m_pkthdr.len = m->m_len = m->m_len - 8; /* Length of LLC header in our case */ m->m_data += 8; /* Length of LLC header in our case */ if ((ifp->if_flags & IFF_UP) == 0) { m_freem(m); return; } ifp->if_ibytes += m->m_pkthdr.len + sizeof (*th); if (th->iso88025_dhost[0] & 1) { if (bcmp((caddr_t)etherbroadcastaddr, (caddr_t)th->iso88025_dhost, sizeof(etherbroadcastaddr)) == 0) m->m_flags |= M_BCAST; else m->m_flags |= M_MCAST; } if (m->m_flags & (M_BCAST|M_MCAST)) ifp->if_imcasts++; ether_type = ntohs(l->llc_un.type_snap.ether_type); switch (ether_type) { #ifdef INET case ETHERTYPE_IP: printf("iso88025_input: IP Packet\n"); if (ipflow_fastforward(m)) return; schednetisr(NETISR_IP); inq = &ipintrq; break; case ETHERTYPE_ARP: printf("iso88025_input: ARP Packet\n"); schednetisr(NETISR_ARP); inq = &arpintrq; break; #endif [SNIP] s = splimp(); if (IF_QFULL(inq)) { IF_DROP(inq); m_freem(m); printf("iso88025_input: Packet dropped (Queue full).\n"); } else IF_ENQUEUE(inq, m); printf("iso88025_input: Packet queued.\n"); splx(s); } And the dmesg info is: tok0: Receive interrupt called. tok: isrp e[2] o[8] isra e[7] o[0] (tok_rx_intr 1). tok0: Packet received data: cmd[81] station_id[100] bptr[1c2e] lhdr[10] dhdr[3] len[70] ncb[6] tok0: copying packet into mbuf. tok0: adjusting mbuf. tok0:Packet data: aa aa 3 0 0 0 8 0 45 0 0 58 33 6d 0 0 1e 11 54 28 a 0 0 2 a 0 0 ff 2 1 2 1 0 44 37 10 1 1 0 0 35 a4 26 54 0 0 0 0 63 79 6e 69 63 69 73 6d 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 35 9d 74 3 tok0: calling iso88025 input routine. iso88025_input: entered. iso88025_input: adjusting mbuf. iso88025_input: IP Packet iso88025_input: Packet queued. tok0: ack'ing packet to adapter (rc=0). tok: isrp e[2] o[8] isra e[3] o[10] (tok_rx_intr 2). tok0: asb->bptr [1c2e] arb->bptr [1c2e]. tcpdump for that interface is putting out things like: 22:06:24.254811 ff:ff:90:0:5a:b1 18:40:ff:ff:ff:ff c5ec 112: 8220 aaaa 0300 0000 0800 4500 0058 3368 0000 1e11 542d 0a00 0002 0a00 00ff 0201 0201 0044 37c4 0101 0000 35a4 25a0 0000 0000 6379 6e69 Which is correct if not somewhat shifted a bit (or several :) (Note: these packets are not neccesarily the same) So what is going wrong? Larry Lile lile@stdio.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message