if_wi.c (158651) | if_wi.c (159180) |
---|---|
1/* $NetBSD: wi.c,v 1.109 2003/01/09 08:52:19 dyoung Exp $ */ 2 3/*- 4 * Copyright (c) 1997, 1998, 1999 5 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 48 unchanged lines hidden (view full) --- 57 * from the HCF Light code and corresponding documentation. 58 * 59 * This driver supports the ISA, PCMCIA and PCI versions of the Lucent 60 * WaveLan cards (based on the Hermes chipset), as well as the newer 61 * Prism 2 chipsets with firmware from Intersil and Symbol. 62 */ 63 64#include <sys/cdefs.h> | 1/* $NetBSD: wi.c,v 1.109 2003/01/09 08:52:19 dyoung Exp $ */ 2 3/*- 4 * Copyright (c) 1997, 1998, 1999 5 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 48 unchanged lines hidden (view full) --- 57 * from the HCF Light code and corresponding documentation. 58 * 59 * This driver supports the ISA, PCMCIA and PCI versions of the Lucent 60 * WaveLan cards (based on the Hermes chipset), as well as the newer 61 * Prism 2 chipsets with firmware from Intersil and Symbol. 62 */ 63 64#include <sys/cdefs.h> |
65__FBSDID("$FreeBSD: head/sys/dev/wi/if_wi.c 158651 2006-05-16 14:37:58Z phk $"); | 65__FBSDID("$FreeBSD: head/sys/dev/wi/if_wi.c 159180 2006-06-02 19:59:33Z csjp $"); |
66 67#define WI_HERMES_AUTOINC_WAR /* Work around data write autoinc bug. */ 68#define WI_HERMES_STATS_WAR /* Work around stats counter bug. */ 69 70#define NBPFILTER 1 71 72#include <sys/param.h> 73#include <sys/systm.h> --- 882 unchanged lines hidden (view full) --- 956 if (m0 == NULL) { 957 ifp->if_oerrors++; 958 ieee80211_free_node(ni); 959 continue; 960 } 961 wh = mtod(m0, struct ieee80211_frame *); 962 } 963#if NBPFILTER > 0 | 66 67#define WI_HERMES_AUTOINC_WAR /* Work around data write autoinc bug. */ 68#define WI_HERMES_STATS_WAR /* Work around stats counter bug. */ 69 70#define NBPFILTER 1 71 72#include <sys/param.h> 73#include <sys/systm.h> --- 882 unchanged lines hidden (view full) --- 956 if (m0 == NULL) { 957 ifp->if_oerrors++; 958 ieee80211_free_node(ni); 959 continue; 960 } 961 wh = mtod(m0, struct ieee80211_frame *); 962 } 963#if NBPFILTER > 0 |
964 if (ic->ic_rawbpf) | 964 if (bpf_peers_present(ic->ic_rawbpf)) |
965 bpf_mtap(ic->ic_rawbpf, m0); 966#endif 967 frmhdr.wi_tx_ctl = htole16(WI_ENC_TX_802_11|WI_TXCNTL_TX_EX); 968 /* XXX check key for SWCRYPT instead of using operating mode */ 969 if ((wh->i_fc[1] & IEEE80211_FC1_WEP) && 970 (sc->sc_encryption & HOST_ENCRYPT)) { 971 struct ieee80211_key *k; 972 973 k = ieee80211_crypto_encap(ic, ni, m0); 974 if (k == NULL) { 975 if (ni != NULL) 976 ieee80211_free_node(ni); 977 m_freem(m0); 978 continue; 979 } 980 frmhdr.wi_tx_ctl |= htole16(WI_TXCNTL_NOCRYPT); 981 } 982#if NBPFILTER > 0 | 965 bpf_mtap(ic->ic_rawbpf, m0); 966#endif 967 frmhdr.wi_tx_ctl = htole16(WI_ENC_TX_802_11|WI_TXCNTL_TX_EX); 968 /* XXX check key for SWCRYPT instead of using operating mode */ 969 if ((wh->i_fc[1] & IEEE80211_FC1_WEP) && 970 (sc->sc_encryption & HOST_ENCRYPT)) { 971 struct ieee80211_key *k; 972 973 k = ieee80211_crypto_encap(ic, ni, m0); 974 if (k == NULL) { 975 if (ni != NULL) 976 ieee80211_free_node(ni); 977 m_freem(m0); 978 continue; 979 } 980 frmhdr.wi_tx_ctl |= htole16(WI_TXCNTL_NOCRYPT); 981 } 982#if NBPFILTER > 0 |
983 if (sc->sc_drvbpf) { | 983 if (bpf_peers_present(ic->ic_rawbpf)) { |
984 sc->sc_tx_th.wt_rate = 985 ni->ni_rates.rs_rates[ni->ni_txrate]; 986 bpf_mtap2(sc->sc_drvbpf, 987 &sc->sc_tx_th, sc->sc_tx_th_len, m0); 988 } 989#endif 990 m_copydata(m0, 0, sizeof(struct ieee80211_frame), 991 (caddr_t)&frmhdr.wi_whdr); --- 537 unchanged lines hidden (view full) --- 1529 * is stripped. Clear WEP bit so we don't 1530 * try to process it in ieee80211_input. 1531 * XXX fix for TKIP, et. al. 1532 */ 1533 wh->i_fc[1] &= ~IEEE80211_FC1_WEP; 1534 } 1535 1536#if NBPFILTER > 0 | 984 sc->sc_tx_th.wt_rate = 985 ni->ni_rates.rs_rates[ni->ni_txrate]; 986 bpf_mtap2(sc->sc_drvbpf, 987 &sc->sc_tx_th, sc->sc_tx_th_len, m0); 988 } 989#endif 990 m_copydata(m0, 0, sizeof(struct ieee80211_frame), 991 (caddr_t)&frmhdr.wi_whdr); --- 537 unchanged lines hidden (view full) --- 1529 * is stripped. Clear WEP bit so we don't 1530 * try to process it in ieee80211_input. 1531 * XXX fix for TKIP, et. al. 1532 */ 1533 wh->i_fc[1] &= ~IEEE80211_FC1_WEP; 1534 } 1535 1536#if NBPFILTER > 0 |
1537 if (sc->sc_drvbpf) { | 1537 if (bpf_peers_present(sc->sc_drvbpf)) { |
1538 /* XXX replace divide by table */ 1539 sc->sc_rx_th.wr_rate = frmhdr.wi_rx_rate / 5; 1540 sc->sc_rx_th.wr_antsignal = frmhdr.wi_rx_signal; 1541 sc->sc_rx_th.wr_antnoise = frmhdr.wi_rx_silence; 1542 sc->sc_rx_th.wr_flags = 0; 1543 if (frmhdr.wi_status & WI_STAT_PCF) 1544 sc->sc_rx_th.wr_flags |= IEEE80211_RADIOTAP_F_CFP; 1545 /* XXX IEEE80211_RADIOTAP_F_WEP */ --- 1724 unchanged lines hidden --- | 1538 /* XXX replace divide by table */ 1539 sc->sc_rx_th.wr_rate = frmhdr.wi_rx_rate / 5; 1540 sc->sc_rx_th.wr_antsignal = frmhdr.wi_rx_signal; 1541 sc->sc_rx_th.wr_antnoise = frmhdr.wi_rx_silence; 1542 sc->sc_rx_th.wr_flags = 0; 1543 if (frmhdr.wi_status & WI_STAT_PCF) 1544 sc->sc_rx_th.wr_flags |= IEEE80211_RADIOTAP_F_CFP; 1545 /* XXX IEEE80211_RADIOTAP_F_WEP */ --- 1724 unchanged lines hidden --- |