summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/if_atu.c29
-rw-r--r--sys/dev/usb/if_atureg.h16
2 files changed, 12 insertions, 33 deletions
diff --git a/sys/dev/usb/if_atu.c b/sys/dev/usb/if_atu.c
index 1f3d4a2f8cb..08dd80db566 100644
--- a/sys/dev/usb/if_atu.c
+++ b/sys/dev/usb/if_atu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_atu.c,v 1.46 2004/12/20 12:11:57 deraadt Exp $ */
+/* $OpenBSD: if_atu.c,v 1.47 2004/12/23 13:19:38 dlg Exp $ */
/*
* Copyright (c) 2003, 2004
* Daan Vreeken <Danovitsch@Vitsch.net>. All rights reserved.
@@ -192,6 +192,7 @@ int atu_newstate(struct ieee80211com *, enum ieee80211_state, int);
int atu_tx_start(struct atu_softc *, struct ieee80211_node *,
struct atu_chain *, struct mbuf *);
void atu_complete_attach(struct atu_softc *);
+u_int8_t atu_calculate_padding(int);
usbd_status
atu_usb_request(struct atu_softc *sc, u_int8_t type,
@@ -1700,19 +1701,17 @@ atu_txeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status)
atu_start(ifp);
}
-#ifdef ATU_TX_PADDING
u_int8_t
atu_calculate_padding(int size)
{
size %= 64;
if (size < 50)
- return 50 - size;
+ return (50 - size);
if (size >=61)
- return 64 + 50 - size;
- return 0;
+ return (64 + 50 - size);
+ return (0);
}
-#endif /* ATU_TX_PADDING */
int
atu_tx_start(struct atu_softc *sc, struct ieee80211_node *ni,
@@ -1722,9 +1721,7 @@ atu_tx_start(struct atu_softc *sc, struct ieee80211_node *ni,
int len;
struct atu_tx_hdr *h;
usbd_status err;
-#ifdef ATU_TX_PADDING
- u_int8_t padding;
-#endif /* ATU_TX_PADDING */
+ u_int8_t pad;
DPRINTFN(25, ("%s: atu_tx_start\n", USBDEVNAME(sc->atu_dev)));
@@ -1744,16 +1741,12 @@ atu_tx_start(struct atu_softc *sc, struct ieee80211_node *ni,
memset(h, 0, ATU_TX_HDRLEN);
USETW(h->length, len);
h->tx_rate = 4; /* XXX rate = auto */
- h->padding = 0;
-
len += ATU_TX_HDRLEN;
-#ifdef ATU_TX_PADDING
-/*
- padding = atu_calculate_padding(len % 64);
- len += padding;
- pkt->AtHeader.padding = padding;
-*/
-#endif /* ATU_TX_PADDING */
+
+ pad = atu_calculate_padding(len);
+ len += pad;
+ h->padding = pad;
+
c->atu_length = len;
c->atu_mbuf = m;
diff --git a/sys/dev/usb/if_atureg.h b/sys/dev/usb/if_atureg.h
index b5bbb163ac1..5b923cce568 100644
--- a/sys/dev/usb/if_atureg.h
+++ b/sys/dev/usb/if_atureg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_atureg.h,v 1.20 2004/12/20 12:11:57 deraadt Exp $ */
+/* $OpenBSD: if_atureg.h,v 1.21 2004/12/23 13:19:38 dlg Exp $ */
/*
* Copyright (c) 2003
* Daan Vreeken <Danovitsch@Vitsch.net>. All rights reserved.
@@ -54,20 +54,6 @@
#define ATU_TX_LIST_CNT 8
/*
- * Whether or not we pad usb packets transfered to the adapter. looking at
- * drivers on other platforms there seems to be something magic about the
- * padding.
- * my measurements :
- * on - 532.55 KB/sec
- * off - 536.74 KB/sec
- * I don't see the reason why we should pad bytes here. The adapter seems
- * to be transmitting packets just fine without the padding. So the default is
- * to have no padding, but it's at least supplied as an option. This seems to
- * be necessary with newer firmware versions, but I haven't tested that yet.
- */
-/* #define ATU_TX_PADDING */
-
-/*
* According to the 802.11 spec (7.1.2) the frame body can be up to 2312 bytes
*/
#define ATU_RX_BUFSZ (ATU_RX_HDRLEN + \