Deleted Added
full compact
if_xl.c (109517) if_xl.c (109623)
1/*
2 * Copyright (c) 1997, 1998, 1999
3 * Bill Paul <wpaul@ctr.columbia.edu>. 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

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

96 * support the PCI "boomerang" chips even though they work with the
97 * "vortex" driver in order to obtain better performance.
98 *
99 * This driver is in the /sys/pci directory because it only supports
100 * PCI-based NICs.
101 */
102
103#include <sys/cdefs.h>
1/*
2 * Copyright (c) 1997, 1998, 1999
3 * Bill Paul <wpaul@ctr.columbia.edu>. 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

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

96 * support the PCI "boomerang" chips even though they work with the
97 * "vortex" driver in order to obtain better performance.
98 *
99 * This driver is in the /sys/pci directory because it only supports
100 * PCI-based NICs.
101 */
102
103#include <sys/cdefs.h>
104__FBSDID("$FreeBSD: head/sys/pci/if_xl.c 109517 2003-01-19 04:47:54Z obrien $");
104__FBSDID("$FreeBSD: head/sys/pci/if_xl.c 109623 2003-01-21 08:56:16Z alfred $");
105
106#include <sys/param.h>
107#include <sys/systm.h>
108#include <sys/sockio.h>
109#include <sys/endian.h>
110#include <sys/mbuf.h>
111#include <sys/malloc.h>
112#include <sys/kernel.h>

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

926xl_testpacket(sc)
927 struct xl_softc *sc;
928{
929 struct mbuf *m;
930 struct ifnet *ifp;
931
932 ifp = &sc->arpcom.ac_if;
933
105
106#include <sys/param.h>
107#include <sys/systm.h>
108#include <sys/sockio.h>
109#include <sys/endian.h>
110#include <sys/mbuf.h>
111#include <sys/malloc.h>
112#include <sys/kernel.h>

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

926xl_testpacket(sc)
927 struct xl_softc *sc;
928{
929 struct mbuf *m;
930 struct ifnet *ifp;
931
932 ifp = &sc->arpcom.ac_if;
933
934 MGETHDR(m, M_DONTWAIT, MT_DATA);
934 MGETHDR(m, M_NOWAIT, MT_DATA);
935
936 if (m == NULL)
937 return;
938
939 bcopy(&sc->arpcom.ac_enaddr,
940 mtod(m, struct ether_header *)->ether_dhost, ETHER_ADDR_LEN);
941 bcopy(&sc->arpcom.ac_enaddr,
942 mtod(m, struct ether_header *)->ether_shost, ETHER_ADDR_LEN);

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

1926xl_newbuf(sc, c)
1927 struct xl_softc *sc;
1928 struct xl_chain_onefrag *c;
1929{
1930 struct mbuf *m_new = NULL;
1931 int error;
1932 u_int32_t baddr;
1933
935
936 if (m == NULL)
937 return;
938
939 bcopy(&sc->arpcom.ac_enaddr,
940 mtod(m, struct ether_header *)->ether_dhost, ETHER_ADDR_LEN);
941 bcopy(&sc->arpcom.ac_enaddr,
942 mtod(m, struct ether_header *)->ether_shost, ETHER_ADDR_LEN);

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

1926xl_newbuf(sc, c)
1927 struct xl_softc *sc;
1928 struct xl_chain_onefrag *c;
1929{
1930 struct mbuf *m_new = NULL;
1931 int error;
1932 u_int32_t baddr;
1933
1934 MGETHDR(m_new, M_DONTWAIT, MT_DATA);
1934 MGETHDR(m_new, M_NOWAIT, MT_DATA);
1935 if (m_new == NULL)
1936 return(ENOBUFS);
1937
1935 if (m_new == NULL)
1936 return(ENOBUFS);
1937
1938 MCLGET(m_new, M_DONTWAIT);
1938 MCLGET(m_new, M_NOWAIT);
1939 if (!(m_new->m_flags & M_EXT)) {
1940 m_freem(m_new);
1941 return(ENOBUFS);
1942 }
1943
1944 m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
1945
1946 /* Force longword alignment for packet payload. */

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

2427 * data into an mbuf cluster. Note that we don't
2428 * bother clearing the values in the other fragment
2429 * pointers/counters; it wouldn't gain us anything,
2430 * and would waste cycles.
2431 */
2432 if (error) {
2433 struct mbuf *m_new = NULL;
2434
1939 if (!(m_new->m_flags & M_EXT)) {
1940 m_freem(m_new);
1941 return(ENOBUFS);
1942 }
1943
1944 m_new->m_len = m_new->m_pkthdr.len = MCLBYTES;
1945
1946 /* Force longword alignment for packet payload. */

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

2427 * data into an mbuf cluster. Note that we don't
2428 * bother clearing the values in the other fragment
2429 * pointers/counters; it wouldn't gain us anything,
2430 * and would waste cycles.
2431 */
2432 if (error) {
2433 struct mbuf *m_new = NULL;
2434
2435 MGETHDR(m_new, M_DONTWAIT, MT_DATA);
2435 MGETHDR(m_new, M_NOWAIT, MT_DATA);
2436 if (m_new == NULL) {
2437 m_freem(m_head);
2438 printf("xl%d: no memory for tx list\n", sc->xl_unit);
2439 return(1);
2440 }
2441 if (m_head->m_pkthdr.len > MHLEN) {
2436 if (m_new == NULL) {
2437 m_freem(m_head);
2438 printf("xl%d: no memory for tx list\n", sc->xl_unit);
2439 return(1);
2440 }
2441 if (m_head->m_pkthdr.len > MHLEN) {
2442 MCLGET(m_new, M_DONTWAIT);
2442 MCLGET(m_new, M_NOWAIT);
2443 if (!(m_new->m_flags & M_EXT)) {
2444 m_freem(m_new);
2445 m_freem(m_head);
2446 printf("xl%d: no memory for tx list\n",
2447 sc->xl_unit);
2448 return(1);
2449 }
2450 }

--- 820 unchanged lines hidden ---
2443 if (!(m_new->m_flags & M_EXT)) {
2444 m_freem(m_new);
2445 m_freem(m_head);
2446 printf("xl%d: no memory for tx list\n",
2447 sc->xl_unit);
2448 return(1);
2449 }
2450 }

--- 820 unchanged lines hidden ---