summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordamien <damien@openbsd.org>2007-11-17 14:29:11 +0000
committerdamien <damien@openbsd.org>2007-11-17 14:29:11 +0000
commit47956b50a00756d2fdf403ee8a3c71dbde27a29a (patch)
tree872c026975595d2e3212347075770449331b47d0
parentupdate the descriptions for ral(4) and ural(4); (diff)
downloadwireguard-openbsd-47956b50a00756d2fdf403ee8a3c71dbde27a29a.tar.xz
wireguard-openbsd-47956b50a00756d2fdf403ee8a3c71dbde27a29a.zip
RT2560+RT2661: update the physical address in the RX descriptor after
bus_dmamap_load() in the case where the same mbuf is reloaded. RT2661: remove a 2x prototype, fix an error message.
-rw-r--r--sys/dev/ic/rt2560.c4
-rw-r--r--sys/dev/ic/rt2661.c13
2 files changed, 11 insertions, 6 deletions
diff --git a/sys/dev/ic/rt2560.c b/sys/dev/ic/rt2560.c
index 3c82860ceba..de3de628cb3 100644
--- a/sys/dev/ic/rt2560.c
+++ b/sys/dev/ic/rt2560.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2560.c,v 1.34 2007/10/15 01:37:49 fgsch Exp $ */
+/* $OpenBSD: rt2560.c,v 1.35 2007/11/17 14:29:11 damien Exp $ */
/*-
* Copyright (c) 2005, 2006
@@ -1140,6 +1140,8 @@ rt2560_decryption_intr(struct rt2560_softc *sc)
panic("%s: could not load old rx mbuf",
sc->sc_dev.dv_xname);
}
+ /* physical address may have changed */
+ desc->physaddr = htole32(data->map->dm_segs->ds_addr);
ifp->if_ierrors++;
goto skip;
}
diff --git a/sys/dev/ic/rt2661.c b/sys/dev/ic/rt2661.c
index d7510886284..0cc21cd0910 100644
--- a/sys/dev/ic/rt2661.c
+++ b/sys/dev/ic/rt2661.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2661.c,v 1.39 2007/10/15 01:37:49 fgsch Exp $ */
+/* $OpenBSD: rt2661.c,v 1.40 2007/11/17 14:29:11 damien Exp $ */
/*-
* Copyright (c) 2006
@@ -154,7 +154,6 @@ int rt2661_prepare_beacon(struct rt2661_softc *);
void rt2661_enable_tsf_sync(struct rt2661_softc *);
int rt2661_get_rssi(struct rt2661_softc *, uint8_t);
void rt2661_power(int, void *);
-void rt2661_shutdown(void *);
static const struct {
uint32_t reg;
@@ -332,6 +331,7 @@ rt2661_attach(void *xsc, int id)
printf("%s: WARNING: unable to establish shutdown hook\n",
sc->sc_dev.dv_xname);
}
+
sc->sc_powerhook = powerhook_establish(rt2661_power, sc);
if (sc->sc_powerhook == NULL) {
printf("%s: WARNING: unable to establish power hook\n",
@@ -361,6 +361,7 @@ rt2661_detach(void *xsc)
if (sc->sc_powerhook != NULL)
powerhook_disestablish(sc->sc_powerhook);
+
if (sc->sc_sdhook != NULL)
shutdownhook_disestablish(sc->sc_sdhook);
@@ -766,7 +767,6 @@ rt2661_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
enum ieee80211_state ostate;
struct ieee80211_node *ni;
uint32_t tmp;
- int error = 0;
ostate = ic->ic_state;
timeout_del(&sc->scan_to);
@@ -822,7 +822,7 @@ rt2661_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
break;
}
- return (error != 0) ? error : sc->sc_newstate(ic, nstate, arg);
+ return sc->sc_newstate(ic, nstate, arg);
}
/*
@@ -1063,6 +1063,8 @@ rt2661_rx_intr(struct rt2661_softc *sc)
panic("%s: could not load old rx mbuf",
sc->sc_dev.dv_xname);
}
+ /* physical address may have changed */
+ desc->physaddr = htole32(data->map->dm_segs->ds_addr);
ifp->if_ierrors++;
goto skip;
}
@@ -2660,7 +2662,8 @@ rt2661_load_microcode(struct rt2661_softc *sc, const uint8_t *ucode, int size)
DELAY(100);
}
if (ntries == 500) {
- printf("timeout waiting for MCU to initialize\n");
+ printf("%s: timeout waiting for MCU to initialize\n",
+ sc->sc_dev.dv_xname);
return EIO;
}
return 0;