summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Pascoe <pascoe@cvs.openbsd.org>2005-07-31 23:08:59 +0000
committerChristopher Pascoe <pascoe@cvs.openbsd.org>2005-07-31 23:08:59 +0000
commit2e18af05ed318f15623b80c13efd49bab7f9ff98 (patch)
tree9ed7aa97362a4309d5571838e97bb9febbfe739a
parentd729c7d385182b2a20a11878b0f697316fa2b253 (diff)
Move large receive/decryption buffer allocation from the stack into
wi_softc. ok millert
-rw-r--r--sys/dev/ic/if_wi.c11
-rw-r--r--sys/dev/ic/if_wivar.h3
2 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/ic/if_wi.c b/sys/dev/ic/if_wi.c
index 64dc2703816..3604b294760 100644
--- a/sys/dev/ic/if_wi.c
+++ b/sys/dev/ic/if_wi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi.c,v 1.118 2005/07/12 17:23:19 jsg Exp $ */
+/* $OpenBSD: if_wi.c,v 1.119 2005/07/31 23:08:58 pascoe Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -127,7 +127,7 @@ u_int32_t widebug = WIDEBUG;
#if !defined(lint) && !defined(__OpenBSD__)
static const char rcsid[] =
- "$OpenBSD: if_wi.c,v 1.118 2005/07/12 17:23:19 jsg Exp $";
+ "$OpenBSD: if_wi.c,v 1.119 2005/07/31 23:08:58 pascoe Exp $";
#endif /* lint */
#ifdef foo
@@ -764,17 +764,16 @@ wi_rxeof(sc)
if (sc->wi_use_wep &&
rx_frame.wi_frame_ctl & htole16(WI_FCTL_WEP)) {
int len;
- u_int8_t rx_buf[1596];
switch (sc->wi_crypto_algorithm) {
case WI_CRYPTO_FIRMWARE_WEP:
break;
case WI_CRYPTO_SOFTWARE_WEP:
m_copydata(m, 0, m->m_pkthdr.len,
- (caddr_t)rx_buf);
+ (caddr_t)sc->wi_rxbuf);
len = m->m_pkthdr.len -
sizeof(struct ether_header);
- if (wi_do_hostdecrypt(sc, rx_buf +
+ if (wi_do_hostdecrypt(sc, sc->wi_rxbuf +
sizeof(struct ether_header), len)) {
if (sc->sc_arpcom.ac_if.if_flags & IFF_DEBUG)
printf(WI_PRT_FMT ": Error decrypting incoming packet.\n", WI_PRT_ARG(sc));
@@ -793,7 +792,7 @@ wi_rxeof(sc)
m_copyback(m, sizeof(struct ether_header) -
WI_ETHERTYPE_LEN, WI_ETHERTYPE_LEN +
(len - WI_SNAPHDR_LEN),
- rx_buf + sizeof(struct ether_header) +
+ sc->wi_rxbuf + sizeof(struct ether_header) +
IEEE80211_WEP_IVLEN +
IEEE80211_WEP_KIDLEN + WI_SNAPHDR_LEN);
m_adj(m, -(WI_ETHERTYPE_LEN +
diff --git a/sys/dev/ic/if_wivar.h b/sys/dev/ic/if_wivar.h
index d9058470204..fb9c62fc1ee 100644
--- a/sys/dev/ic/if_wivar.h
+++ b/sys/dev/ic/if_wivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wivar.h,v 1.25 2005/02/15 19:44:15 reyk Exp $ */
+/* $OpenBSD: if_wivar.h,v 1.26 2005/07/31 23:08:58 pascoe Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -69,6 +69,7 @@ struct wi_softc {
u_int16_t wi_supprates;
u_int16_t wi_diversity;
+ u_int8_t wi_rxbuf[1596];
u_int8_t wi_txbuf[1596];
u_int8_t wi_scanbuf[1596];