summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2014-04-12 14:02:20 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2014-04-12 14:02:20 +0000
commitdd7da444383d73840b5a2c1b75e957ddbd04cd8f (patch)
treeacd98cb071b36b3ff6c0d59b2d1e2d3d22a40315 /sys/dev
parent7bcd23bc09c21a45d3cc492d8737c1017409ec5b (diff)
simplify flag tests
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/if_axe.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c
index 4f76747b292..45ab35df6e3 100644
--- a/sys/dev/usb/if_axe.c
+++ b/sys/dev/usb/if_axe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_axe.c,v 1.123 2013/11/15 10:17:39 pirofti Exp $ */
+/* $OpenBSD: if_axe.c,v 1.124 2014/04/12 14:02:19 jsg Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Jonathan Gray <jsg@openbsd.org>
@@ -476,7 +476,7 @@ axe_iff(struct axe_softc *sc)
* Always accept frames destined to our station address.
*/
rxmode |= AXE_RXCMD_BROADCAST;
- if (!sc->axe_flags & AX178 && !sc->axe_flags & AX772)
+ if ((sc->axe_flags & (AX178 | AX772)) == 0)
rxmode |= AXE_172_RXCMD_UNICAST;
if (ifp->if_flags & IFF_PROMISC || ac->ac_multirangecnt > 0) {
@@ -712,7 +712,7 @@ axe_attach(struct device *parent, struct device *self, void *aux)
id = usbd_get_interface_descriptor(sc->axe_iface);
/* decide on what our bufsize will be */
- if (sc->axe_flags & AX178 || sc->axe_flags & AX772)
+ if (sc->axe_flags & (AX178 | AX772))
sc->axe_bufsz = (sc->axe_udev->speed == USB_SPEED_HIGH) ?
AXE_178_MAX_BUFSZ : AXE_178_MIN_BUFSZ;
else
@@ -765,7 +765,7 @@ axe_attach(struct device *parent, struct device *self, void *aux)
/*
* Get station address.
*/
- if (sc->axe_flags & AX178 || sc->axe_flags & AX772)
+ if (sc->axe_flags & (AX178 | AX772))
axe_cmd(sc, AXE_178_CMD_READ_NODEID, 0, 0, &eaddr);
else
axe_cmd(sc, AXE_172_CMD_READ_NODEID, 0, 0, &eaddr);
@@ -1027,7 +1027,7 @@ axe_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
usbd_get_xfer_status(xfer, NULL, NULL, &total_len, NULL);
do {
- if (sc->axe_flags & AX178 || sc->axe_flags & AX772) {
+ if (sc->axe_flags & (AX178 | AX772)) {
if (total_len < sizeof(hdr)) {
ifp->if_ierrors++;
goto done;
@@ -1214,7 +1214,7 @@ axe_encap(struct axe_softc *sc, struct mbuf *m, int idx)
c = &sc->axe_cdata.axe_tx_chain[idx];
- if (sc->axe_flags & AX178 || sc->axe_flags & AX772) {
+ if (sc->axe_flags & (AX178 | AX772)) {
boundary = (sc->axe_udev->speed == USB_SPEED_HIGH) ? 512 : 64;
hdr.len = htole16(m->m_pkthdr.len);
@@ -1318,7 +1318,7 @@ axe_init(void *xsc)
axe_reset(sc);
/* set MAC address */
- if (sc->axe_flags & AX178 || sc->axe_flags & AX772)
+ if (sc->axe_flags & (AX178 | AX772))
axe_cmd(sc, AXE_178_CMD_WRITE_NODEID, 0, 0,
&sc->arpcom.ac_enaddr);
@@ -1339,7 +1339,7 @@ axe_init(void *xsc)
}
/* Set transmitter IPG values */
- if (sc->axe_flags & AX178 || sc->axe_flags & AX772)
+ if (sc->axe_flags & (AX178 | AX772))
axe_cmd(sc, AXE_178_CMD_WRITE_IPG012, sc->axe_ipgs[2],
(sc->axe_ipgs[1] << 8) | (sc->axe_ipgs[0]), NULL);
else {
@@ -1357,7 +1357,7 @@ axe_init(void *xsc)
rxmode |= AXE_RXCMD_ENABLE;
if (sc->axe_flags & AX772B)
rxmode |= AXE_772B_RXCMD_RH1M;
- else if (sc->axe_flags & AX178 || sc->axe_flags & AX772) {
+ else if (sc->axe_flags & (AX178 | AX772)) {
if (sc->axe_udev->speed == USB_SPEED_HIGH) {
/* largest possible USB buffer size for AX88178 */
rxmode |= AXE_178_RXCMD_MFB;