summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordamien <damien@openbsd.org>2006-08-18 16:04:56 +0000
committerdamien <damien@openbsd.org>2006-08-18 16:04:56 +0000
commit95547211a2fdcdab73904687e444a5de95b3194c (patch)
tree1f140d34c632ade5c262d4393c4838927235415a
parentfix a printf format string (diff)
downloadwireguard-openbsd-95547211a2fdcdab73904687e444a5de95b3194c.tar.xz
wireguard-openbsd-95547211a2fdcdab73904687e444a5de95b3194c.zip
set of unrelated cosmetic tweaks.
-rw-r--r--sys/dev/pci/if_ipw.c30
-rw-r--r--sys/dev/pci/if_iwi.c16
-rw-r--r--sys/dev/pci/if_wpi.c10
-rw-r--r--sys/dev/usb/if_ral.c13
-rw-r--r--sys/dev/usb/if_rum.c8
5 files changed, 43 insertions, 34 deletions
diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c
index cdc88b57649..07cddc8afb5 100644
--- a/sys/dev/pci/if_ipw.c
+++ b/sys/dev/pci/if_ipw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ipw.c,v 1.58 2006/06/14 18:40:23 brad Exp $ */
+/* $OpenBSD: if_ipw.c,v 1.59 2006/08/18 16:04:56 damien Exp $ */
/*-
* Copyright (c) 2004-2006
@@ -27,9 +27,8 @@
* SUCH DAMAGE.
*/
-/*-
- * Intel(R) PRO/Wireless 2100 MiniPCI driver
- * http://www.intel.com/network/connectivity/products/wireless/prowireless_mobile.htm
+/*
+ * Driver for Intel PRO/Wireless 2100 802.11 network adapters.
*/
#include "bpfilter.h"
@@ -231,13 +230,17 @@ ipw_attach(struct device *parent, struct device *self, void *aux)
}
ic->ic_phytype = IEEE80211_T_DS;
- ic->ic_opmode = IEEE80211_M_STA;
+ ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */
ic->ic_state = IEEE80211_S_INIT;
/* set device capabilities */
- ic->ic_caps = IEEE80211_C_IBSS | IEEE80211_C_MONITOR |
- IEEE80211_C_PMGT | IEEE80211_C_TXPMGT | IEEE80211_C_WEP |
- IEEE80211_C_SHPREAMBLE | IEEE80211_C_SCANALL;
+ ic->ic_caps =
+ IEEE80211_C_IBSS | /* IBSS mode supported */
+ IEEE80211_C_MONITOR | /* monitor mode supported */
+ IEEE80211_C_TXPMGT | /* tx power management */
+ IEEE80211_C_SHPREAMBLE | /* short preamble supported */
+ IEEE80211_C_WEP | /* s/w WEP */
+ IEEE80211_C_SCANALL; /* h/w scanning */
/* read MAC address from EEPROM */
val = ipw_read_prom_word(sc, IPW_EEPROM_MAC + 0);
@@ -1158,10 +1161,15 @@ ipw_tx_start(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node *ni)
struct mbuf *mnew;
int error, i;
- if (ic->ic_flags & IEEE80211_F_WEPON) {
+ wh = mtod(m, struct ieee80211_frame *);
+
+ if (wh->i_fc[1] & IEEE80211_FC1_WEP) {
m = ieee80211_wep_crypt(ifp, m, 1);
if (m == NULL)
return ENOBUFS;
+
+ /* packet header may have moved, reset our local pointer */
+ wh = mtod(m, struct ieee80211_frame *);
}
#if NBPFILTER > 0
@@ -1182,8 +1190,6 @@ ipw_tx_start(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node *ni)
}
#endif
- wh = mtod(m, struct ieee80211_frame *);
-
shdr = SLIST_FIRST(&sc->free_shdr);
sbuf = SLIST_FIRST(&sc->free_sbuf);
@@ -2032,5 +2038,5 @@ ipw_write_mem_1(struct ipw_softc *sc, bus_size_t offset, uint8_t *datap,
}
struct cfdriver ipw_cd = {
- 0, "ipw", DV_IFNET
+ NULL, "ipw", DV_IFNET
};
diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c
index a8768088abc..c9979da7da6 100644
--- a/sys/dev/pci/if_iwi.c
+++ b/sys/dev/pci/if_iwi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwi.c,v 1.69 2006/06/14 18:40:23 brad Exp $ */
+/* $OpenBSD: if_iwi.c,v 1.70 2006/08/18 16:04:56 damien Exp $ */
/*-
* Copyright (c) 2004-2006
@@ -27,9 +27,8 @@
* SUCH DAMAGE.
*/
-/*-
- * Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver
- * http://www.intel.com/network/connectivity/products/wireless/prowireless_mobile.htm
+/*
+ * Driver for Intel(R) PRO/Wireless 2200BG/2915ABG 802.11 network adapters.
*/
#include "bpfilter.h"
@@ -283,9 +282,9 @@ iwi_attach(struct device *parent, struct device *self, void *aux)
ic->ic_caps =
IEEE80211_C_IBSS | /* IBSS mode supported */
IEEE80211_C_MONITOR | /* monitor mode supported */
- IEEE80211_C_WEP | /* h/w WEP supported */
IEEE80211_C_TXPMGT | /* tx power management */
IEEE80211_C_SHPREAMBLE | /* short preamble supported */
+ IEEE80211_C_WEP | /* h/w WEP supported */
IEEE80211_C_SCANALL; /* h/w scanning */
/* read MAC address from EEPROM */
@@ -1364,10 +1363,9 @@ iwi_tx_start(struct ifnet *ifp, struct mbuf *m0, struct ieee80211_node *ni)
if (!IEEE80211_IS_MULTICAST(desc->wh.i_addr1))
desc->flags |= IWI_DATA_FLAG_NEED_ACK;
- if (ic->ic_flags & IEEE80211_F_WEPON) {
- desc->wh.i_fc[1] |= IEEE80211_FC1_WEP;
+ if (desc->wh.i_fc[1] & IEEE80211_FC1_WEP)
desc->wep_txkey = ic->ic_wep_txkey;
- } else
+ else
desc->flags |= IWI_DATA_FLAG_NO_WEP;
if (ic->ic_flags & IEEE80211_F_SHPREAMBLE)
@@ -2260,5 +2258,5 @@ iwi_stop(struct ifnet *ifp, int disable)
}
struct cfdriver iwi_cd = {
- 0, "iwi", DV_IFNET
+ NULL, "iwi", DV_IFNET
};
diff --git a/sys/dev/pci/if_wpi.c b/sys/dev/pci/if_wpi.c
index 083df73cf81..f8b412e6ba8 100644
--- a/sys/dev/pci/if_wpi.c
+++ b/sys/dev/pci/if_wpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wpi.c,v 1.28 2006/08/10 09:23:32 damien Exp $ */
+/* $OpenBSD: if_wpi.c,v 1.29 2006/08/18 16:04:56 damien Exp $ */
/*-
* Copyright (c) 2006
@@ -493,9 +493,8 @@ wpi_alloc_shared(struct wpi_softc *sc)
int error;
/* must be aligned on a 4K-page boundary */
- error = wpi_dma_contig_alloc(sc, &sc->shared_dma,
- (void **)&sc->shared, sizeof (struct wpi_shared), PAGE_SIZE,
- BUS_DMA_NOWAIT);
+ error = wpi_dma_contig_alloc(sc, &sc->shared_dma, (void **)&sc->shared,
+ sizeof (struct wpi_shared), PAGE_SIZE, BUS_DMA_NOWAIT);
if (error != 0) {
printf("%s: could not allocate shared area DMA memory\n",
sc->sc_dev.dv_xname);
@@ -518,8 +517,7 @@ wpi_alloc_rx_ring(struct wpi_softc *sc, struct wpi_rx_ring *ring)
ring->cur = 0;
- error = wpi_dma_contig_alloc(sc, &ring->desc_dma,
- (void **)&ring->desc,
+ error = wpi_dma_contig_alloc(sc, &ring->desc_dma, (void **)&ring->desc,
WPI_RX_RING_COUNT * sizeof (struct wpi_rx_desc),
WPI_RING_DMA_ALIGN, BUS_DMA_NOWAIT);
if (error != 0) {
diff --git a/sys/dev/usb/if_ral.c b/sys/dev/usb/if_ral.c
index 5ec3f5313e2..2547838aa68 100644
--- a/sys/dev/usb/if_ral.c
+++ b/sys/dev/usb/if_ral.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ral.c,v 1.74 2006/08/18 15:23:13 damien Exp $ */
+/* $OpenBSD: if_ral.c,v 1.75 2006/08/18 16:04:56 damien Exp $ */
/*-
* Copyright (c) 2005, 2006
@@ -301,8 +301,8 @@ USB_ATTACH(ural)
USBDEVNAME(sc->sc_dev), sc->macbbp_rev, sc->asic_rev,
ural_get_rf(sc->rf_rev), ether_sprintf(ic->ic_myaddr));
- ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
- ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */
+ ic->ic_phytype = IEEE80211_T_OFDM; /* not only, but not used */
+ ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */
ic->ic_state = IEEE80211_S_INIT;
/* set device capabilities */
@@ -990,7 +990,10 @@ ural_setup_tx_desc(struct ural_softc *sc, struct ural_tx_desc *desc,
desc->flags |= htole32(RAL_TX_NEWSEQ);
desc->flags |= htole32(len << 16);
- desc->wme = htole16(RAL_AIFSN(2) | RAL_LOGCWMIN(3) | RAL_LOGCWMAX(5));
+ desc->wme = htole16(
+ RAL_AIFSN(2) |
+ RAL_LOGCWMIN(3) |
+ RAL_LOGCWMAX(5));
/* setup PLCP fields */
desc->plcp_signal = ural_plcp_signal(rate);
@@ -2108,7 +2111,7 @@ ural_amrr_start(struct ural_softc *sc, struct ieee80211_node *ni)
Static void
ural_amrr_timeout(void *arg)
{
- struct ural_softc *sc = (struct ural_softc *)arg;
+ struct ural_softc *sc = arg;
usb_device_request_t req;
int s;
diff --git a/sys/dev/usb/if_rum.c b/sys/dev/usb/if_rum.c
index a582c371cd1..9a3d6fdb09f 100644
--- a/sys/dev/usb/if_rum.c
+++ b/sys/dev/usb/if_rum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rum.c,v 1.34 2006/08/18 15:23:13 damien Exp $ */
+/* $OpenBSD: if_rum.c,v 1.35 2006/08/18 16:04:56 damien Exp $ */
/*-
* Copyright (c) 2005, 2006 Damien Bergamini <damien.bergamini@free.fr>
@@ -67,6 +67,10 @@
#include <dev/usb/if_rumreg.h>
#include <dev/usb/if_rumvar.h>
+#ifdef USB_DEBUG
+#define RUM_DEBUG
+#endif
+
#ifdef RUM_DEBUG
#define DPRINTF(x) do { if (rum_debug) logprintf x; } while (0)
#define DPRINTFN(n, x) do { if (rum_debug >= (n)) logprintf x; } while (0)
@@ -2116,7 +2120,7 @@ rum_amrr_start(struct rum_softc *sc, struct ieee80211_node *ni)
Static void
rum_amrr_timeout(void *arg)
{
- struct rum_softc *sc = (struct rum_softc *)arg;
+ struct rum_softc *sc = arg;
usb_device_request_t req;
int s;