svn commit: r280102 - head/sys/dev/wpi
Adrian Chadd
adrian at FreeBSD.org
Sun Mar 15 21:12:58 UTC 2015
Author: adrian
Date: Sun Mar 15 21:12:57 2015
New Revision: 280102
URL: https://svnweb.freebsd.org/changeset/base/280102
Log:
Rearrange checks in wpi_send_rxon().
PR: kern/197143
Submitted by: Andriy Voskoboinyk <s3erios at gmail.com>
Modified:
head/sys/dev/wpi/if_wpi.c
Modified: head/sys/dev/wpi/if_wpi.c
==============================================================================
--- head/sys/dev/wpi/if_wpi.c Sun Mar 15 21:12:05 2015 (r280101)
+++ head/sys/dev/wpi/if_wpi.c Sun Mar 15 21:12:57 2015 (r280102)
@@ -3648,32 +3648,32 @@ wpi_send_rxon(struct wpi_softc *sc, int
error = wpi_cmd(sc, WPI_CMD_RXON_ASSOC, &rxon_assoc,
sizeof (struct wpi_assoc), async);
+ if (error != 0) {
+ device_printf(sc->sc_dev,
+ "RXON_ASSOC command failed, error %d\n", error);
+ return error;
+ }
} else {
- if (async)
+ if (async) {
WPI_NT_LOCK(sc);
-
- error = wpi_cmd(sc, WPI_CMD_RXON, &sc->rxon,
- sizeof (struct wpi_rxon), async);
-
- wpi_clear_node_table(sc);
-
- if (async)
+ error = wpi_cmd(sc, WPI_CMD_RXON, &sc->rxon,
+ sizeof (struct wpi_rxon), async);
+ if (error == 0)
+ wpi_clear_node_table(sc);
WPI_NT_UNLOCK(sc);
- }
- if (error != 0) {
- device_printf(sc->sc_dev, "RXON command failed, error %d\n",
- error);
- return error;
- }
+ } else {
+ error = wpi_cmd(sc, WPI_CMD_RXON, &sc->rxon,
+ sizeof (struct wpi_rxon), async);
+ if (error == 0)
+ wpi_clear_node_table(sc);
+ }
- /* Configuration has changed, set Tx power accordingly. */
- if ((error = wpi_set_txpower(sc, async)) != 0) {
- device_printf(sc->sc_dev,
- "%s: could not set TX power, error %d\n", __func__, error);
- return error;
- }
+ if (error != 0) {
+ device_printf(sc->sc_dev,
+ "RXON command failed, error %d\n", error);
+ return error;
+ }
- if (!(sc->rxon.filter & htole32(WPI_FILTER_BSS))) {
/* Add broadcast node. */
error = wpi_add_broadcast_node(sc, async);
if (error != 0) {
@@ -3683,6 +3683,13 @@ wpi_send_rxon(struct wpi_softc *sc, int
}
}
+ /* Configuration has changed, set Tx power accordingly. */
+ if ((error = wpi_set_txpower(sc, async)) != 0) {
+ device_printf(sc->sc_dev,
+ "%s: could not set TX power, error %d\n", __func__, error);
+ return error;
+ }
+
return 0;
}
More information about the svn-src-head
mailing list