Deleted Added
sdiff udiff text old ( 209802 ) new ( 209807 )
full compact
1/*-
2 * Copyright (c) 2009, Oleksandr Tymoshenko
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/mips/atheros/if_arge.c 209802 2010-07-08 14:34:15Z adrian $");
30
31/*
32 * AR71XX gigabit ethernet driver
33 */
34#ifdef HAVE_KERNEL_OPTION_HEADERS
35#include "opt_device_polling.h"
36#endif
37

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

829 /* Start listening */
830 ARGE_WRITE(sc, AR71XX_DMA_RX_CONTROL, DMA_RX_CONTROL_EN);
831
832 /* Enable interrupts */
833 ARGE_WRITE(sc, AR71XX_DMA_INTR, DMA_INTR_ALL);
834}
835
836/*
837 * Encapsulate an mbuf chain in a descriptor by coupling the mbuf data
838 * pointers to the fragment pointers.
839 */
840static int
841arge_encap(struct arge_softc *sc, struct mbuf **m_head)
842{
843 struct arge_txdesc *txd;
844 struct arge_desc *desc, *prev_desc;
845 bus_dma_segment_t txsegs[ARGE_MAXFRAGS];
846 int error, i, nsegs, prod, prev_prod;
847 struct mbuf *m;
848
849 ARGE_LOCK_ASSERT(sc);
850
851 /*
852 * Fix mbuf chain, all fragments should be 4 bytes aligned and
853 * even 4 bytes
854 */
855 m = *m_head;
856 if((mtod(m, intptr_t) & 3) != 0) {
857 m = m_defrag(*m_head, M_DONTWAIT);
858 if (m == NULL) {
859 *m_head = NULL;
860 return (ENOBUFS);
861 }
862 *m_head = m;
863 }
864

--- 963 unchanged lines hidden ---