From 0528191a1a235d5c325d4f3e8e6fd136bd81ef30 Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Sun, 15 Mar 2015 21:05:59 +0000 Subject: [PATCH] Add WPI_DEBUG_NODE + some debugging. PR: kern/197143 Submitted by: Andriy Voskoboinyk --- sys/dev/wpi/if_wpi.c | 8 ++++++++ sys/dev/wpi/if_wpi_debug.h | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/dev/wpi/if_wpi.c b/sys/dev/wpi/if_wpi.c index 04d40cf74ec3..1cf5a4a0b898 100644 --- a/sys/dev/wpi/if_wpi.c +++ b/sys/dev/wpi/if_wpi.c @@ -3173,6 +3173,9 @@ wpi_add_node(struct wpi_softc *sc, struct ieee80211_node *ni) node.action = htole32(WPI_ACTION_SET_RATE); node.antenna = WPI_ANTENNA_BOTH; + DPRINTF(sc, WPI_DEBUG_NODE, "%s: adding node %d (%s)\n", __func__, + wn->id, ether_sprintf(ni->ni_macaddr)); + error = wpi_cmd(sc, WPI_CMD_ADD_NODE, &node, sizeof node, 1); if (error != 0) { device_printf(sc->sc_dev, @@ -3213,6 +3216,8 @@ wpi_add_broadcast_node(struct wpi_softc *sc, int async) node.action = htole32(WPI_ACTION_SET_RATE); node.antenna = WPI_ANTENNA_BOTH; + DPRINTF(sc, WPI_DEBUG_NODE, "%s: adding broadcast node\n", __func__); + return wpi_cmd(sc, WPI_CMD_ADD_NODE, &node, sizeof node, async); } @@ -3279,6 +3284,9 @@ wpi_del_node(struct wpi_softc *sc, struct ieee80211_node *ni) IEEE80211_ADDR_COPY(node.macaddr, ni->ni_macaddr); node.count = 1; + DPRINTF(sc, WPI_DEBUG_NODE, "%s: deleting node %d (%s)\n", __func__, + wn->id, ether_sprintf(ni->ni_macaddr)); + error = wpi_cmd(sc, WPI_CMD_DEL_NODE, &node, sizeof node, 1); if (error != 0) { device_printf(sc->sc_dev, diff --git a/sys/dev/wpi/if_wpi_debug.h b/sys/dev/wpi/if_wpi_debug.h index 677f0fb8daa3..245bf59903cb 100644 --- a/sys/dev/wpi/if_wpi_debug.h +++ b/sys/dev/wpi/if_wpi_debug.h @@ -39,8 +39,9 @@ enum { WPI_DEBUG_TRACE = 0x00002000, /* Print begin and start driver function */ WPI_DEBUG_PWRSAVE = 0x00004000, /* Power save operations */ WPI_DEBUG_EEPROM = 0x00008000, /* EEPROM info */ - WPI_DEBUG_KEY = 0x00010000, /* node key management */ - WPI_DEBUG_EDCA = 0x00020000, /* WME info */ + WPI_DEBUG_NODE = 0x00010000, /* node addition/removal */ + WPI_DEBUG_KEY = 0x00020000, /* node key management */ + WPI_DEBUG_EDCA = 0x00040000, /* WME info */ WPI_DEBUG_REGISTER = 0x00080000, /* print chipset register */ WPI_DEBUG_ANY = 0xffffffff };