From owner-p4-projects@FreeBSD.ORG Fri Mar 10 06:40:04 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8255316A423; Fri, 10 Mar 2006 06:40:03 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5A1E416A420 for ; Fri, 10 Mar 2006 06:40:03 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 260E143D45 for ; Fri, 10 Mar 2006 06:40:03 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k2A6e3xe072340 for ; Fri, 10 Mar 2006 06:40:03 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k2A6e2fM072334 for perforce@freebsd.org; Fri, 10 Mar 2006 06:40:02 GMT (envelope-from imp@freebsd.org) Date: Fri, 10 Mar 2006 06:40:02 GMT Message-Id: <200603100640.k2A6e2fM072334@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 93095 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Mar 2006 06:40:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=93095 Change 93095 by imp@imp_hammer on 2006/03/10 06:39:29 Try to use m_devget() as suggested by jhb and done in the de driver. Affected files ... .. //depot/projects/arm/src/sys/arm/at91/if_ate.c#38 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/if_ate.c#38 (text+ko) ==== @@ -24,10 +24,8 @@ /* TODO: (in no order) * - * 5) Setup RX buffers in ateinit_locked * 8) Need to sync busdma goo in atestop * 9) atestop should maybe free the mbufs? - * 10) On Rx, how do we get a new mbuf? * * 1) detach * 2) Free dma setup @@ -657,7 +655,8 @@ mb->m_len = rx_stat & ETH_LEN_MASK; mb->m_pkthdr.len = mb->m_len; mb->m_pkthdr.rcvif = sc->ifp; - tmp_mbuf = m_copyup(mb, ETHER_HDR_LEN, 2); + tmp_mbuf = m_devget(mtod(md, caddr_t), mb->m_len, + ETHER_ALIGN, sc->ifp, NULL); /* * For the last buffer, set the wrap bit so * the controller restarts from the first @@ -671,7 +670,8 @@ BUS_DMASYNC_PREREAD); bus_dmamap_sync(sc->rx_desc_tag, sc->rx_desc_map, BUS_DMASYNC_PREWRITE); - (*sc->ifp->if_input)(sc->ifp, tmp_mbuf); + if (tmp_mbuf != NULL) + (*sc->ifp->if_input)(sc->ifp, tmp_mbuf); } } if (status & ETH_ISR_TCOM) {