if_wi.c (123339) | if_wi.c (123922) |
---|---|
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 123339 2003-12-09 07:41:07Z imp $"); | 65__FBSDID("$FreeBSD: head/sys/dev/wi/if_wi.c 123922 2003-12-28 03:56:00Z sam $"); |
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> --- 868 unchanged lines hidden (view full) --- 942 frmhdr.wi_tx_ctl |= htole16(WI_TXCNTL_NOCRYPT); 943 } 944 m_copydata(m0, 0, sizeof(struct ieee80211_frame), 945 (caddr_t)&frmhdr.wi_whdr); 946 m_adj(m0, sizeof(struct ieee80211_frame)); 947 frmhdr.wi_dat_len = htole16(m0->m_pkthdr.len); 948#if NBPFILTER > 0 949 if (sc->sc_drvbpf) { | 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> --- 868 unchanged lines hidden (view full) --- 942 frmhdr.wi_tx_ctl |= htole16(WI_TXCNTL_NOCRYPT); 943 } 944 m_copydata(m0, 0, sizeof(struct ieee80211_frame), 945 (caddr_t)&frmhdr.wi_whdr); 946 m_adj(m0, sizeof(struct ieee80211_frame)); 947 frmhdr.wi_dat_len = htole16(m0->m_pkthdr.len); 948#if NBPFILTER > 0 949 if (sc->sc_drvbpf) { |
950 struct mbuf *mb; 951 952 MGETHDR(mb, M_DONTWAIT, m0->m_type); 953 if (mb != NULL) { 954 mb->m_next = m0; 955 mb->m_data = (caddr_t)&sc->sc_tx_th; 956 mb->m_len = sizeof(sc->sc_tx_th); 957 mb->m_pkthdr.len += mb->m_len; 958 bpf_mtap(sc->sc_drvbpf, mb); 959 m_free(mb); 960 } | 950 bpf_mtap2(sc->sc_drvbpf, 951 &sc->sc_tx_th, sizeof(sc->sc_tx_th), m0); |
961 } 962#endif 963 if (IFF_DUMPPKTS(ifp)) 964 wi_dump_pkt(&frmhdr, NULL, -1); 965 fid = sc->sc_txd[cur].d_fid; 966 off = sizeof(frmhdr); 967 error = wi_write_bap(sc, fid, 0, &frmhdr, sizeof(frmhdr)) != 0 968 || wi_mwrite_bap(sc, fid, off, m0, m0->m_pkthdr.len) != 0; --- 522 unchanged lines hidden (view full) --- 1491 m->m_data + sizeof(struct ieee80211_frame), len); 1492 m->m_pkthdr.len = m->m_len = sizeof(struct ieee80211_frame) + len; 1493 m->m_pkthdr.rcvif = ifp; 1494 1495 CSR_WRITE_2(sc, WI_EVENT_ACK, WI_EV_RX); 1496 1497#if NBPFILTER > 0 1498 if (sc->sc_drvbpf) { | 952 } 953#endif 954 if (IFF_DUMPPKTS(ifp)) 955 wi_dump_pkt(&frmhdr, NULL, -1); 956 fid = sc->sc_txd[cur].d_fid; 957 off = sizeof(frmhdr); 958 error = wi_write_bap(sc, fid, 0, &frmhdr, sizeof(frmhdr)) != 0 959 || wi_mwrite_bap(sc, fid, off, m0, m0->m_pkthdr.len) != 0; --- 522 unchanged lines hidden (view full) --- 1482 m->m_data + sizeof(struct ieee80211_frame), len); 1483 m->m_pkthdr.len = m->m_len = sizeof(struct ieee80211_frame) + len; 1484 m->m_pkthdr.rcvif = ifp; 1485 1486 CSR_WRITE_2(sc, WI_EVENT_ACK, WI_EV_RX); 1487 1488#if NBPFILTER > 0 1489 if (sc->sc_drvbpf) { |
1499 struct mbuf *mb; 1500 1501 /* XXX pre-allocate space when setting up recv's */ 1502 MGETHDR(mb, M_DONTWAIT, m->m_type); 1503 if (mb != NULL) { 1504 /* XXX replace divide by table */ 1505 sc->sc_rx_th.wr_rate = frmhdr.wi_rx_rate / 5; 1506 sc->sc_rx_th.wr_antsignal = 1507 WI_RSSI_TO_DBM(sc, frmhdr.wi_rx_signal); 1508 sc->sc_rx_th.wr_antnoise = 1509 WI_RSSI_TO_DBM(sc, frmhdr.wi_rx_silence); 1510 sc->sc_rx_th.wr_time = 1511 htole32((frmhdr.wi_rx_tstamp1 << 16) | 1512 frmhdr.wi_rx_tstamp0); 1513 1514 (void) m_dup_pkthdr(mb, m, M_DONTWAIT); 1515 mb->m_next = m; 1516 mb->m_data = (caddr_t)&sc->sc_rx_th; 1517 mb->m_len = sizeof(sc->sc_rx_th); 1518 mb->m_pkthdr.len += mb->m_len; 1519 bpf_mtap(sc->sc_drvbpf, mb); 1520 m_free(mb); 1521 } | 1490 sc->sc_rx_th.wr_rate = frmhdr.wi_rx_rate / 5; 1491 sc->sc_rx_th.wr_antsignal = 1492 WI_RSSI_TO_DBM(sc, frmhdr.wi_rx_signal); 1493 sc->sc_rx_th.wr_antnoise = 1494 WI_RSSI_TO_DBM(sc, frmhdr.wi_rx_silence); 1495 sc->sc_rx_th.wr_time = 1496 htole32((frmhdr.wi_rx_tstamp1 << 16) | 1497 frmhdr.wi_rx_tstamp0); 1498 bpf_mtap2(sc->sc_drvbpf, 1499 &sc->sc_rx_th, sizeof(sc->sc_rx_th), m); |
1522 } 1523#endif 1524 wh = mtod(m, struct ieee80211_frame *); 1525 if (wh->i_fc[1] & IEEE80211_FC1_WEP) { 1526 /* 1527 * WEP is decrypted by hardware. Clear WEP bit 1528 * header for ieee80211_input(). 1529 */ --- 1662 unchanged lines hidden --- | 1500 } 1501#endif 1502 wh = mtod(m, struct ieee80211_frame *); 1503 if (wh->i_fc[1] & IEEE80211_FC1_WEP) { 1504 /* 1505 * WEP is decrypted by hardware. Clear WEP bit 1506 * header for ieee80211_input(). 1507 */ --- 1662 unchanged lines hidden --- |