if_an.c (108401) | if_an.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 --- 15 unchanged lines hidden (view full) --- 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 * | 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 --- 15 unchanged lines hidden (view full) --- 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 * |
32 * $FreeBSD: head/sys/dev/an/if_an.c 108401 2002-12-29 19:22:07Z ambrisko $ | 32 * $FreeBSD: head/sys/dev/an/if_an.c 109623 2003-01-21 08:56:16Z alfred $ |
33 */ 34 35/* 36 * Aironet 4500/4800 802.11 PCMCIA/ISA/PCI driver for FreeBSD. 37 * 38 * Written by Bill Paul <wpaul@ctr.columbia.edu> 39 * Electrical Engineering Department 40 * Columbia University, New York City --- 88 unchanged lines hidden (view full) --- 129 130#include <machine/md_var.h> 131 132#include <dev/an/if_aironet_ieee.h> 133#include <dev/an/if_anreg.h> 134 135#if !defined(lint) 136static const char rcsid[] = | 33 */ 34 35/* 36 * Aironet 4500/4800 802.11 PCMCIA/ISA/PCI driver for FreeBSD. 37 * 38 * Written by Bill Paul <wpaul@ctr.columbia.edu> 39 * Electrical Engineering Department 40 * Columbia University, New York City --- 88 unchanged lines hidden (view full) --- 129 130#include <machine/md_var.h> 131 132#include <dev/an/if_aironet_ieee.h> 133#include <dev/an/if_anreg.h> 134 135#if !defined(lint) 136static const char rcsid[] = |
137 "$FreeBSD: head/sys/dev/an/if_an.c 108401 2002-12-29 19:22:07Z ambrisko $"; | 137 "$FreeBSD: head/sys/dev/an/if_an.c 109623 2003-01-21 08:56:16Z alfred $"; |
138#endif 139 140/* These are global because we need them in sys/pci/if_an_p.c. */ 141static void an_reset (struct an_softc *); 142static int an_init_mpi350_desc (struct an_softc *); 143static int an_ioctl (struct ifnet *, u_long, caddr_t); 144static void an_init (void *); 145static int an_init_tx_ring (struct an_softc *); --- 771 unchanged lines hidden (view full) --- 917 error = an_read_data(sc, id, sizeof(rx_frame) + 918 rx_frame.an_gaplen, 919 (caddr_t)ih +ieee80211_header_len, 920 rx_frame.an_rx_payload_len); 921 } 922 /* dump raw 802.11 packet to bpf and skip ip stack */ 923 BPF_TAP(ifp, bpf_buf, len); 924 } else { | 138#endif 139 140/* These are global because we need them in sys/pci/if_an_p.c. */ 141static void an_reset (struct an_softc *); 142static int an_init_mpi350_desc (struct an_softc *); 143static int an_ioctl (struct ifnet *, u_long, caddr_t); 144static void an_init (void *); 145static int an_init_tx_ring (struct an_softc *); --- 771 unchanged lines hidden (view full) --- 917 error = an_read_data(sc, id, sizeof(rx_frame) + 918 rx_frame.an_gaplen, 919 (caddr_t)ih +ieee80211_header_len, 920 rx_frame.an_rx_payload_len); 921 } 922 /* dump raw 802.11 packet to bpf and skip ip stack */ 923 BPF_TAP(ifp, bpf_buf, len); 924 } else { |
925 MGETHDR(m, M_DONTWAIT, MT_DATA); | 925 MGETHDR(m, M_NOWAIT, MT_DATA); |
926 if (m == NULL) { 927 ifp->if_ierrors++; 928 return; 929 } | 926 if (m == NULL) { 927 ifp->if_ierrors++; 928 return; 929 } |
930 MCLGET(m, M_DONTWAIT); | 930 MCLGET(m, M_NOWAIT); |
931 if (!(m->m_flags & M_EXT)) { 932 m_freem(m); 933 ifp->if_ierrors++; 934 return; 935 } 936 m->m_pkthdr.rcvif = ifp; 937 /* Read Ethernet encapsulated packet */ 938 --- 63 unchanged lines hidden (view full) --- 1002 = CSR_MEM_AUX_READ_4(sc, 1003 AN_RX_DESC_OFFSET 1004 + (count * sizeof(an_rx_desc)) 1005 + (i * 4)); 1006 1007 if (an_rx_desc.an_done && !an_rx_desc.an_valid) { 1008 buf = sc->an_rx_buffer[count].an_dma_vaddr; 1009 | 931 if (!(m->m_flags & M_EXT)) { 932 m_freem(m); 933 ifp->if_ierrors++; 934 return; 935 } 936 m->m_pkthdr.rcvif = ifp; 937 /* Read Ethernet encapsulated packet */ 938 --- 63 unchanged lines hidden (view full) --- 1002 = CSR_MEM_AUX_READ_4(sc, 1003 AN_RX_DESC_OFFSET 1004 + (count * sizeof(an_rx_desc)) 1005 + (i * 4)); 1006 1007 if (an_rx_desc.an_done && !an_rx_desc.an_valid) { 1008 buf = sc->an_rx_buffer[count].an_dma_vaddr; 1009 |
1010 MGETHDR(m, M_DONTWAIT, MT_DATA); | 1010 MGETHDR(m, M_NOWAIT, MT_DATA); |
1011 if (m == NULL) { 1012 ifp->if_ierrors++; 1013 return; 1014 } | 1011 if (m == NULL) { 1012 ifp->if_ierrors++; 1013 return; 1014 } |
1015 MCLGET(m, M_DONTWAIT); | 1015 MCLGET(m, M_NOWAIT); |
1016 if (!(m->m_flags & M_EXT)) { 1017 m_freem(m); 1018 ifp->if_ierrors++; 1019 return; 1020 } 1021 m->m_pkthdr.rcvif = ifp; 1022 /* Read Ethernet encapsulated packet */ 1023 --- 2551 unchanged lines hidden (view full) --- 3575 case AIROFLSHRST: 3576 return cmdreset(ifp); 3577 break; 3578 case AIROFLSHSTFL: 3579 if (sc->an_flash_buffer) { 3580 free(sc->an_flash_buffer, M_DEVBUF); 3581 sc->an_flash_buffer = NULL; 3582 } | 1016 if (!(m->m_flags & M_EXT)) { 1017 m_freem(m); 1018 ifp->if_ierrors++; 1019 return; 1020 } 1021 m->m_pkthdr.rcvif = ifp; 1022 /* Read Ethernet encapsulated packet */ 1023 --- 2551 unchanged lines hidden (view full) --- 3575 case AIROFLSHRST: 3576 return cmdreset(ifp); 3577 break; 3578 case AIROFLSHSTFL: 3579 if (sc->an_flash_buffer) { 3580 free(sc->an_flash_buffer, M_DEVBUF); 3581 sc->an_flash_buffer = NULL; 3582 } |
3583 sc->an_flash_buffer = malloc(FLASH_SIZE, M_DEVBUF, M_WAITOK); | 3583 sc->an_flash_buffer = malloc(FLASH_SIZE, M_DEVBUF, 0); |
3584 if (sc->an_flash_buffer) 3585 return setflashmode(ifp); 3586 else 3587 return ENOBUFS; 3588 break; 3589 case AIROFLSHGCHR: /* Get char from aux */ 3590 copyin(l_ioctl->data, &sc->areq, l_ioctl->len); 3591 z = *(int *)&sc->areq; --- 41 unchanged lines hidden --- | 3584 if (sc->an_flash_buffer) 3585 return setflashmode(ifp); 3586 else 3587 return ENOBUFS; 3588 break; 3589 case AIROFLSHGCHR: /* Get char from aux */ 3590 copyin(l_ioctl->data, &sc->areq, l_ioctl->len); 3591 z = *(int *)&sc->areq; --- 41 unchanged lines hidden --- |