kernel/wlan: Fix up the MAC address printing and add back __printflike()s.
authorSascha Wildner <saw@online.de>
Thu, 19 Feb 2015 02:18:11 +0000 (03:18 +0100)
committerSascha Wildner <saw@online.de>
Thu, 19 Feb 2015 02:36:02 +0000 (03:36 +0100)
In the recent wlan, iwn and ath upgrades, porting this properly was hacked
around by removing the __printflike()s because DragonFly has no support
for %D (neither in GCC nor in kprintf()). This is wrong because even
though it silences the warning, it will still not print MAC addresses
correctly. So bring all that back.

Also update the wlan's README.DRAGONFLY with some information about how
to port this properly.

16 files changed:
sys/ddb/ddb.h
sys/dev/netif/ath/ath/if_ath.c
sys/dev/netif/ath/ath/if_ath_debug.h
sys/dev/netif/ath/ath/if_ath_tx.c
sys/dev/netif/ath/ath/if_athvar.h
sys/dev/netif/ath/ath_rate/sample/sample.c
sys/dev/netif/iwn/if_iwn.c
sys/dev/netif/iwn/if_iwnvar.h
sys/netproto/802_11/README.DRAGONFLY
sys/netproto/802_11/ieee80211_var.h
sys/netproto/802_11/wlan/ieee80211_ddb.c
sys/netproto/802_11/wlan/ieee80211_hwmp.c
sys/netproto/802_11/wlan/ieee80211_mesh.c
sys/netproto/802_11/wlan/ieee80211_output.c
sys/netproto/802_11/wlan/ieee80211_scan.c
sys/netproto/802_11/wlan/ieee80211_sta.c

index 5975cdb..4a725f9 100644 (file)
@@ -97,11 +97,7 @@ struct vm_map        *db_map_addr (vm_offset_t);
 boolean_t      db_map_current (struct vm_map *);
 boolean_t      db_map_equal (struct vm_map *, struct vm_map *);
 void           db_print_loc_and_inst (db_addr_t loc, db_regs_t *regs);
-
-/*void         db_printf (const char *fmt, ...) __printflike(1, 2);*/
-/* can't use __printflike due to use of %nD */
-void           db_printf (const char *fmt, ...);
-
+void           db_printf (const char *fmt, ...) __printflike(1, 2);
 void           db_vprintf (const char *fmt, __va_list va) __printflike(1, 0);
 void           db_read_bytes (vm_offset_t addr, size_t size, char *data);
                                /* machine-dependent */
index ad6b956..5ced7e8 100644 (file)
@@ -233,6 +233,8 @@ static void ath_start(struct ifnet *ifp, struct ifaltq_subque *ifsq);
 #include <dev/netif/ath/ath/if_ath_tdma.h>
 #endif
 
+extern const char* ath_hal_ether_sprintf(const u_int8_t *mac);
+
 SYSCTL_DECL(_hw_ath);
 
 /* XXX validate sysctl values */
@@ -4202,7 +4204,8 @@ ath_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN])
        /* XXX setup ath_tid */
        ath_tx_tid_init(sc, an);
 
-       DPRINTF(sc, ATH_DEBUG_NODE, "%s: %6D: an %p\n", __func__, mac, ":", an);
+       DPRINTF(sc, ATH_DEBUG_NODE, "%s: %s: an %p\n", __func__,
+           ath_hal_ether_sprintf(mac), an);
        return &an->an_node;
 }
 
@@ -4212,8 +4215,8 @@ ath_node_cleanup(struct ieee80211_node *ni)
        struct ieee80211com *ic = ni->ni_ic;
        struct ath_softc *sc = ic->ic_ifp->if_softc;
 
-       DPRINTF(sc, ATH_DEBUG_NODE, "%s: %6D: an %p\n", __func__,
-           ni->ni_macaddr, ":", ATH_NODE(ni));
+       DPRINTF(sc, ATH_DEBUG_NODE, "%s: %s: an %p\n", __func__,
+           ath_hal_ether_sprintf(ni->ni_macaddr), ATH_NODE(ni));
 
        /* Cleanup ath_tid, free unused bufs, unlink bufs in TXQ */
        ath_tx_node_flush(sc, ATH_NODE(ni));
@@ -4227,8 +4230,8 @@ ath_node_free(struct ieee80211_node *ni)
        struct ieee80211com *ic = ni->ni_ic;
        struct ath_softc *sc = ic->ic_ifp->if_softc;
 
-       DPRINTF(sc, ATH_DEBUG_NODE, "%s: %6D: an %p\n", __func__,
-           ni->ni_macaddr, ":", ATH_NODE(ni));
+       DPRINTF(sc, ATH_DEBUG_NODE, "%s: %s: an %p\n", __func__,
+           ath_hal_ether_sprintf(ni->ni_macaddr), ATH_NODE(ni));
        lockuninit(&ATH_NODE(ni)->an_mtx);
        sc->sc_node_free(ni);
 }
@@ -6339,10 +6342,9 @@ ath_newassoc(struct ieee80211_node *ni, int isnew)
        an->an_mcastrix = ath_tx_findrix(sc, tp->mcastrate);
        an->an_mgmtrix = ath_tx_findrix(sc, tp->mgmtrate);
 
-       DPRINTF(sc, ATH_DEBUG_NODE, "%s: %6D: reassoc; isnew=%d, is_powersave=%d\n",
+       DPRINTF(sc, ATH_DEBUG_NODE, "%s: %s: reassoc; isnew=%d, is_powersave=%d\n",
            __func__,
-           ni->ni_macaddr,
-           ":",
+           ath_hal_ether_sprintf(ni->ni_macaddr),
            isnew,
            an->an_is_powersave);
 
@@ -6366,10 +6368,9 @@ ath_newassoc(struct ieee80211_node *ni, int isnew)
         */
        if (! isnew) {
                DPRINTF(sc, ATH_DEBUG_NODE,
-                   "%s: %6D: reassoc; is_powersave=%d\n",
+                   "%s: %s: reassoc; is_powersave=%d\n",
                    __func__,
-                   ni->ni_macaddr,
-                   ":",
+                   ath_hal_ether_sprintf(ni->ni_macaddr),
                    an->an_is_powersave);
 
                /* XXX for now, we can't hold the lock across assoc */
@@ -6973,10 +6974,9 @@ ath_node_powersave(struct ieee80211_node *ni, int enable)
 
        /* XXX and no TXQ locks should be held here */
 
-       DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, "%s: %6D: enable=%d\n",
+       DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, "%s: %6s: enable=%d\n",
            __func__,
-           ni->ni_macaddr,
-           ":",
+           ath_hal_ether_sprintf(ni->ni_macaddr),
            !! enable);
 
        /* Suspend or resume software queue handling */
@@ -7071,18 +7071,16 @@ ath_node_set_tim(struct ieee80211_node *ni, int enable)
         */
        if (enable && an->an_tim_set == 1) {
                DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
-                   "%s: %6D: enable=%d, tim_set=1, ignoring\n",
+                   "%s: %s: enable=%d, tim_set=1, ignoring\n",
                    __func__,
-                   ni->ni_macaddr,
-                   ":",
+                   ath_hal_ether_sprintf(ni->ni_macaddr),
                    enable);
                ATH_TX_UNLOCK(sc);
        } else if (enable) {
                DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
-                   "%s: %6D: enable=%d, enabling TIM\n",
+                   "%s: %s: enable=%d, enabling TIM\n",
                    __func__,
-                   ni->ni_macaddr,
-                   ":",
+                   ath_hal_ether_sprintf(ni->ni_macaddr),
                    enable);
                an->an_tim_set = 1;
                ATH_TX_UNLOCK(sc);
@@ -7090,10 +7088,9 @@ ath_node_set_tim(struct ieee80211_node *ni, int enable)
        } else if (an->an_swq_depth == 0) {
                /* disable */
                DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
-                   "%s: %6D: enable=%d, an_swq_depth == 0, disabling\n",
+                   "%s: %s: enable=%d, an_swq_depth == 0, disabling\n",
                    __func__,
-                   ni->ni_macaddr,
-                   ":",
+                   ath_hal_ether_sprintf(ni->ni_macaddr),
                    enable);
                an->an_tim_set = 0;
                ATH_TX_UNLOCK(sc);
@@ -7103,10 +7100,9 @@ ath_node_set_tim(struct ieee80211_node *ni, int enable)
                 * disable regardless; the node isn't in powersave now
                 */
                DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
-                   "%s: %6D: enable=%d, an_pwrsave=0, disabling\n",
+                   "%s: %s: enable=%d, an_pwrsave=0, disabling\n",
                    __func__,
-                   ni->ni_macaddr,
-                   ":",
+                   ath_hal_ether_sprintf(ni->ni_macaddr),
                    enable);
                an->an_tim_set = 0;
                ATH_TX_UNLOCK(sc);
@@ -7119,10 +7115,9 @@ ath_node_set_tim(struct ieee80211_node *ni, int enable)
                 */
                ATH_TX_UNLOCK(sc);
                DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
-                   "%s: %6D: enable=%d, an_swq_depth > 0, ignoring\n",
+                   "%s: %s: enable=%d, an_swq_depth > 0, ignoring\n",
                    __func__,
-                   ni->ni_macaddr,
-                   ":",
+                   ath_hal_ether_sprintf(ni->ni_macaddr),
                    enable);
                changed = 0;
        }
@@ -7192,10 +7187,9 @@ ath_tx_update_tim(struct ath_softc *sc, struct ieee80211_node *ni,
                    an->an_tim_set == 0 &&
                    an->an_swq_depth != 0) {
                        DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
-                           "%s: %6D: swq_depth>0, tim_set=0, set!\n",
+                           "%s: %s: swq_depth>0, tim_set=0, set!\n",
                            __func__,
-                           ni->ni_macaddr,
-                           ":");
+                           ath_hal_ether_sprintf(ni->ni_macaddr));
                        an->an_tim_set = 1;
                        (void) avp->av_set_tim(ni, 1);
                }
@@ -7211,11 +7205,10 @@ ath_tx_update_tim(struct ath_softc *sc, struct ieee80211_node *ni,
                    an->an_tim_set == 1 &&
                    an->an_swq_depth == 0) {
                        DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
-                           "%s: %6D: swq_depth=0, tim_set=1, psq_set=0,"
+                           "%s: %s: swq_depth=0, tim_set=1, psq_set=0,"
                            " clear!\n",
                            __func__,
-                           ni->ni_macaddr,
-                           ":");
+                           ath_hal_ether_sprintf(ni->ni_macaddr));
                        an->an_tim_set = 0;
                        (void) avp->av_set_tim(ni, 0);
                }
@@ -7225,24 +7218,6 @@ ath_tx_update_tim(struct ath_softc *sc, struct ieee80211_node *ni,
 #endif /* ATH_SW_PSQ */
 }
 
-/*
- * A device_printf() equivalent that does not require gcc hacks
- */
-int
-athdev_printf(device_t dev, const char *ctl, ...)
-{
-       __va_list va;
-       int retval;
-
-       retval = device_print_prettyname(dev);
-       __va_start(va, ctl);
-       retval += kvprintf(ctl, va);
-       __va_end(va);
-
-       return retval;
-}
-
-
 /*
  * Received a ps-poll frame from net80211.
  *
@@ -7311,10 +7286,9 @@ ath_node_recv_pspoll(struct ieee80211_node *ni, struct mbuf *m)
         */
        if (! an->an_is_powersave) {
                DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
-                   "%s: %6D: not in powersave?\n",
+                   "%s: %s: not in powersave?\n",
                    __func__,
-                   ni->ni_macaddr,
-                   ":");
+                   ath_hal_ether_sprintf(ni->ni_macaddr));
                ATH_TX_UNLOCK(sc);
                avp->av_recv_pspoll(ni, m);
                return;
@@ -7337,10 +7311,9 @@ ath_node_recv_pspoll(struct ieee80211_node *ni, struct mbuf *m)
        if (an->an_swq_depth == 0) {
                ATH_TX_UNLOCK(sc);
                DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
-                   "%s: %6D: SWQ empty; punting to net80211\n",
+                   "%s: %s: SWQ empty; punting to net80211\n",
                    __func__,
-                   ni->ni_macaddr,
-                   ":");
+                   ath_hal_ether_sprintf(ni->ni_macaddr));
                avp->av_recv_pspoll(ni, m);
                return;
        }
@@ -7365,10 +7338,9 @@ ath_node_recv_pspoll(struct ieee80211_node *ni, struct mbuf *m)
                ATH_TX_UNLOCK(sc);
                taskqueue_enqueue(sc->sc_tq, &sc->sc_txqtask);
                DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
-                   "%s: %6D: leaking frame to TID %d\n",
+                   "%s: %s: leaking frame to TID %d\n",
                    __func__,
-                   ni->ni_macaddr,
-                   ":",
+                   ath_hal_ether_sprintf(ni->ni_macaddr),
                    tid);
                return;
        }
@@ -7379,10 +7351,9 @@ ath_node_recv_pspoll(struct ieee80211_node *ni, struct mbuf *m)
         * XXX nothing in the TIDs at this point? Eek.
         */
        DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
-           "%s: %6D: TIDs empty, but ath_node showed traffic?!\n",
+           "%s: %s: TIDs empty, but ath_node showed traffic?!\n",
            __func__,
-           ni->ni_macaddr,
-           ":");
+           ath_hal_ether_sprintf(ni->ni_macaddr));
        avp->av_recv_pspoll(ni, m);
 #else
        avp->av_recv_pspoll(ni, m);
index b99425d..337ecf7 100644 (file)
@@ -101,25 +101,10 @@ extern uint64_t ath_debug;
 #define        IFF_DUMPPKTS(sc, m) \
        ((sc->sc_debug & (m)) || \
            (sc->sc_ifp->if_flags & (IFF_DEBUG|IFF_LINK2)) == (IFF_DEBUG|IFF_LINK2))
-
-#if defined(__DragonFly__)
-
-/* doesn't support %6D (requires hacking gcc, not gonna do it) */
 #define        DPRINTF(sc, m, fmt, ...) do {                           \
        if (sc->sc_debug & (m))                                 \
-               athdev_printf(sc->sc_dev, fmt, __VA_ARGS__);            \
+               device_printf(sc->sc_dev, fmt, __VA_ARGS__);    \
 } while (0)
-
-#else
-
-#define        DPRINTF(sc, m, fmt, ...) do {                           \
-       if (sc->sc_debug & (m))                                 \
-               device_printf(sc->sc_dev, fmt, __VA_ARGS__);            \
-} while (0)
-
-#endif
-
-
 #define        KEYPRINTF(sc, ix, hk, mac) do {                         \
        if (sc->sc_debug & ATH_DEBUG_KEYCACHE)                  \
                ath_keyprint(sc, __func__, ix, hk, mac);        \
index 94c75fa..0cdf904 100644 (file)
@@ -105,6 +105,8 @@ __FBSDID("$FreeBSD$");
 #include <dev/netif/ath/ath/if_ath_alq.h>
 #endif
 
+extern  const char* ath_hal_ether_sprintf(const uint8_t *mac);
+
 /*
  * How many retries to perform in software
  */
@@ -1478,9 +1480,10 @@ ath_tx_should_swq_frame(struct ath_softc *sc, struct ath_node *an,
                 * for now!
                 */
                DPRINTF(sc, ATH_DEBUG_XMIT, 
-                   "%s: %6D: Node is asleep; sending mgmt "
+                   "%s: %s: Node is asleep; sending mgmt "
                    "(type=%d, subtype=%d)\n",
-                   __func__, ni->ni_macaddr, ":", type, subtype);
+                   __func__, ath_hal_ether_sprintf(ni->ni_macaddr),
+                   type, subtype);
                return (0);
        } else {
                return (1);
@@ -2813,10 +2816,9 @@ ath_tx_leak_count_update(struct ath_softc *sc, struct ath_tid *tid,
                        wh->i_fc[1] &= ~IEEE80211_FC1_MORE_DATA;
 
                DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE,
-                   "%s: %6D: leak count = %d, psq=%d, swq=%d, MORE=%d\n",
+                   "%s: %s: leak count = %d, psq=%d, swq=%d, MORE=%d\n",
                    __func__,
-                   tid->an->an_node.ni_macaddr,
-                   ":",
+                   ath_hal_ether_sprintf(tid->an->an_node.ni_macaddr),
                    tid->an->an_leak_count,
                    tid->an->an_stack_psq,
                    tid->an->an_swq_depth,
@@ -3282,9 +3284,9 @@ ath_tx_tid_pause(struct ath_softc *sc, struct ath_tid *tid)
 
        ATH_TX_LOCK_ASSERT(sc);
        tid->paused++;
-       DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: [%6D]: tid=%d, paused = %d\n",
+       DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: [%s]: tid=%d, paused = %d\n",
            __func__,
-           tid->an->an_node.ni_macaddr, ":",
+           ath_hal_ether_sprintf(tid->an->an_node.ni_macaddr),
            tid->tid,
            tid->paused);
 }
@@ -3303,19 +3305,19 @@ ath_tx_tid_resume(struct ath_softc *sc, struct ath_tid *tid)
         * until it's actually resolved.
         */
        if (tid->paused == 0) {
-               athdev_printf(sc->sc_dev,
-                   "%s: [%6D]: tid=%d, paused=0?\n",
+               device_printf(sc->sc_dev,
+                   "%s: [%s]: tid=%d, paused=0?\n",
                    __func__,
-                   tid->an->an_node.ni_macaddr, ":",
+                   ath_hal_ether_sprintf(tid->an->an_node.ni_macaddr),
                    tid->tid);
        } else {
                tid->paused--;
        }
 
        DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
-           "%s: [%6D]: tid=%d, unpaused = %d\n",
+           "%s: [%s]: tid=%d, unpaused = %d\n",
            __func__,
-           tid->an->an_node.ni_macaddr, ":",
+           ath_hal_ether_sprintf(tid->an->an_node.ni_macaddr),
            tid->tid,
            tid->paused);
 
@@ -3594,16 +3596,16 @@ ath_tx_tid_bar_unsuspend(struct ath_softc *sc, struct ath_tid *tid)
        ATH_TX_LOCK_ASSERT(sc);
 
        DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
-           "%s: %6D: TID=%d, called\n",
+           "%s: %s: TID=%d, called\n",
            __func__,
-           tid->an->an_node.ni_macaddr,
-           ":",
+           ath_hal_ether_sprintf(tid->an->an_node.ni_macaddr),
            tid->tid);
 
        if (tid->bar_tx == 0 || tid->bar_wait == 0) {
                DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
-                   "%s: %6D: TID=%d, bar_tx=%d, bar_wait=%d: ?\n",
-                   __func__, tid->an->an_node.ni_macaddr, ":",
+                   "%s: %s: TID=%d, bar_tx=%d, bar_wait=%d: ?\n",
+                   __func__,
+                   ath_hal_ether_sprintf(tid->an->an_node.ni_macaddr),
                    tid->tid, tid->bar_tx, tid->bar_wait);
        }
 
@@ -3626,10 +3628,9 @@ ath_tx_tid_bar_tx_ready(struct ath_softc *sc, struct ath_tid *tid)
                return (0);
 
        DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
-           "%s: %6D: TID=%d, bar ready\n",
+           "%s: %s: TID=%d, bar ready\n",
            __func__,
-           tid->an->an_node.ni_macaddr,
-           ":",
+           ath_hal_ether_sprintf(tid->an->an_node.ni_macaddr),
            tid->tid);
 
        return (1);
@@ -3655,10 +3656,9 @@ ath_tx_tid_bar_tx(struct ath_softc *sc, struct ath_tid *tid)
        ATH_TX_LOCK_ASSERT(sc);
 
        DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
-           "%s: %6D: TID=%d, called\n",
+           "%s: %s: TID=%d, called\n",
            __func__,
-           tid->an->an_node.ni_macaddr,
-           ":",
+           ath_hal_ether_sprintf(tid->an->an_node.ni_macaddr),
            tid->tid);
 
        tap = ath_tx_get_tx_tid(tid->an, tid->tid);
@@ -3668,8 +3668,9 @@ ath_tx_tid_bar_tx(struct ath_softc *sc, struct ath_tid *tid)
         */
        if (tid->bar_wait == 0 || tid->bar_tx == 1) {
                DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
-                   "%s: %6D: TID=%d, bar_tx=%d, bar_wait=%d: ?\n",
-                   __func__, tid->an->an_node.ni_macaddr, ":",
+                   "%s: %s: TID=%d, bar_tx=%d, bar_wait=%d: ?\n",
+                   __func__,
+                   ath_hal_ether_sprintf(tid->an->an_node.ni_macaddr),
                    tid->tid, tid->bar_tx, tid->bar_wait);
                return;
        }
@@ -3677,10 +3678,9 @@ ath_tx_tid_bar_tx(struct ath_softc *sc, struct ath_tid *tid)
        /* Don't do anything if we still have pending frames */
        if (tid->hwq_depth > 0) {
                DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
-                   "%s: %6D: TID=%d, hwq_depth=%d, waiting\n",
+                   "%s: %s: TID=%d, hwq_depth=%d, waiting\n",
                    __func__,
-                   tid->an->an_node.ni_macaddr,
-                   ":",
+                   ath_hal_ether_sprintf(tid->an->an_node.ni_macaddr),
                    tid->tid,
                    tid->hwq_depth);
                return;
@@ -3702,10 +3702,9 @@ ath_tx_tid_bar_tx(struct ath_softc *sc, struct ath_tid *tid)
         * XXX verify this is _actually_ the valid value to begin at!
         */
        DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
-           "%s: %6D: TID=%d, new BAW left edge=%d\n",
+           "%s: %s: TID=%d, new BAW left edge=%d\n",
            __func__,
-           tid->an->an_node.ni_macaddr,
-           ":",
+           ath_hal_ether_sprintf(tid->an->an_node.ni_macaddr),
            tid->tid,
            tap->txa_start);
 
@@ -3722,8 +3721,9 @@ ath_tx_tid_bar_tx(struct ath_softc *sc, struct ath_tid *tid)
        /* Failure? For now, warn loudly and continue */
        ATH_TX_LOCK(sc);
        DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
-           "%s: %6D: TID=%d, failed to TX BAR, continue!\n",
-           __func__, tid->an->an_node.ni_macaddr, ":",
+           "%s: %s: TID=%d, failed to TX BAR, continue!\n",
+           __func__,
+           ath_hal_ether_sprintf(tid->an->an_node.ni_macaddr),
            tid->tid);
        ath_tx_tid_bar_unsuspend(sc, tid);
 }
@@ -3780,48 +3780,44 @@ ath_tx_tid_drain_print(struct ath_softc *sc, struct ath_node *an,
        tap = ath_tx_get_tx_tid(an, tid->tid);
 
        DPRINTF(sc, ATH_DEBUG_SW_TX | ATH_DEBUG_RESET,
-           "%s: %s: %6D: bf=%p: addbaw=%d, dobaw=%d, "
+           "%s: %s: %s: bf=%p: addbaw=%d, dobaw=%d, "
            "seqno=%d, retry=%d\n",
            __func__,
            pfx,
-           ni->ni_macaddr,
-           ":",
+           ath_hal_ether_sprintf(ni->ni_macaddr),
            bf,
            bf->bf_state.bfs_addedbaw,
            bf->bf_state.bfs_dobaw,
            SEQNO(bf->bf_state.bfs_seqno),
            bf->bf_state.bfs_retries);
        DPRINTF(sc, ATH_DEBUG_SW_TX | ATH_DEBUG_RESET,
-           "%s: %s: %6D: bf=%p: txq[%d] axq_depth=%d, axq_aggr_depth=%d\n",
+           "%s: %s: %s: bf=%p: txq[%d] axq_depth=%d, axq_aggr_depth=%d\n",
            __func__,
            pfx,
-           ni->ni_macaddr,
-           ":",
+           ath_hal_ether_sprintf(ni->ni_macaddr),
            bf,
            txq->axq_qnum,
            txq->axq_depth,
            txq->axq_aggr_depth);
        DPRINTF(sc, ATH_DEBUG_SW_TX | ATH_DEBUG_RESET,
-           "%s: %s: %6D: bf=%p: tid txq_depth=%d hwq_depth=%d, bar_wait=%d, "
+           "%s: %s: %s: bf=%p: tid txq_depth=%d hwq_depth=%d, bar_wait=%d, "
              "isfiltered=%d\n",
            __func__,
            pfx,
-           ni->ni_macaddr,
-           ":",
+           ath_hal_ether_sprintf(ni->ni_macaddr),
            bf,
            tid->axq_depth,
            tid->hwq_depth,
            tid->bar_wait,
            tid->isfiltered);
        DPRINTF(sc, ATH_DEBUG_SW_TX | ATH_DEBUG_RESET,
-           "%s: %s: %6D: tid %d: "
+           "%s: %s: %s: tid %d: "
            "sched=%d, paused=%d, "
            "incomp=%d, baw_head=%d, "
            "baw_tail=%d txa_start=%d, ni_txseqs=%d\n",
             __func__,
             pfx,
-            ni->ni_macaddr,
-            ":",
+            ath_hal_ether_sprintf(ni->ni_macaddr),
             tid->tid,
             tid->sched, tid->paused,
             tid->incomp, tid->baw_head,
@@ -3922,10 +3918,9 @@ ath_tx_tid_drain(struct ath_softc *sc, struct ath_node *an,
        if (tap) {
 #if 1
                DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
-                   "%s: %6D: node %p: TID %d: sliding BAW left edge to %d\n",
+                   "%s: %s: node %p: TID %d: sliding BAW left edge to %d\n",
                    __func__,
-                   ni->ni_macaddr,
-                   ":",
+                   ath_hal_ether_sprintf(ni->ni_macaddr),
                    an,
                    tid->tid,
                    tap->txa_start);
@@ -4023,11 +4018,10 @@ ath_tx_node_flush(struct ath_softc *sc, struct ath_node *an)
 
        ATH_TX_LOCK(sc);
        DPRINTF(sc, ATH_DEBUG_NODE,
-           "%s: %6D: flush; is_powersave=%d, stack_psq=%d, tim=%d, "
+           "%s: %s: flush; is_powersave=%d, stack_psq=%d, tim=%d, "
            "swq_depth=%d, clrdmask=%d, leak_count=%d\n",
            __func__,
-           an->an_node.ni_macaddr,
-           ":",
+           ath_hal_ether_sprintf(an->an_node.ni_macaddr),
            an->an_is_powersave,
            an->an_stack_psq,
            an->an_tim_set,
@@ -5794,10 +5788,9 @@ ath_addba_request(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap,
        ATH_TX_UNLOCK(sc);
 
        DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
-           "%s: %6D: called; dialogtoken=%d, baparamset=%d, batimeout=%d\n",
+           "%s: %s: called; dialogtoken=%d, baparamset=%d, batimeout=%d\n",
            __func__,
-           ni->ni_macaddr,
-           ":",
+           ath_hal_ether_sprintf(ni->ni_macaddr),
            dialogtoken, baparamset, batimeout);
        DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
            "%s: txa_start=%d, ni_txseqs=%d\n",
@@ -5838,9 +5831,8 @@ ath_addba_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap,
        int r;
 
        DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
-           "%s: %6D: called; status=%d, code=%d, batimeout=%d\n", __func__,
-           ni->ni_macaddr,
-           ":",
+           "%s: %s: called; status=%d, code=%d, batimeout=%d\n", __func__,
+           ath_hal_ether_sprintf(ni->ni_macaddr),
            status, code, batimeout);
 
        DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
@@ -5885,10 +5877,9 @@ ath_addba_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap)
        ath_bufhead bf_cq;
        struct ath_buf *bf;
 
-       DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: %6D: called\n",
+       DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: %s: called\n",
            __func__,
-           ni->ni_macaddr,
-           ":");
+           ath_hal_ether_sprintf(ni->ni_macaddr));
 
        /*
         * Pause TID traffic early, so there aren't any races
@@ -5971,10 +5962,9 @@ ath_tx_node_reassoc(struct ath_softc *sc, struct ath_node *an)
                if (tid->hwq_depth == 0)
                        continue;
                DPRINTF(sc, ATH_DEBUG_NODE,
-                   "%s: %6D: TID %d: cleaning up TID\n",
+                   "%s: %s: TID %d: cleaning up TID\n",
                    __func__,
-                   an->an_node.ni_macaddr,
-                   ":",
+                   ath_hal_ether_sprintf(an->an_node.ni_macaddr),
                    i);
                /*
                 * In case there's a followup call to this, only call it
@@ -6021,10 +6011,9 @@ ath_bar_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap,
        int old_txa_start;
 
        DPRINTF(sc, ATH_DEBUG_SW_TX_BAR,
-           "%s: %6D: called; txa_tid=%d, atid->tid=%d, status=%d, attempts=%d, txa_start=%d, txa_seqpending=%d\n",
+           "%s: %s: called; txa_tid=%d, atid->tid=%d, status=%d, attempts=%d, txa_start=%d, txa_seqpending=%d\n",
            __func__,
-           ni->ni_macaddr,
-           ":",
+           ath_hal_ether_sprintf(ni->ni_macaddr),
            tap->txa_tid,
            atid->tid,
            status,
@@ -6092,10 +6081,9 @@ ath_addba_response_timeout(struct ieee80211_node *ni,
        struct ath_tid *atid = &an->an_tid[tid];
 
        DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL,
-           "%s: %6D: TID=%d, called; resuming\n",
+           "%s: %s: TID=%d, called; resuming\n",
            __func__,
-           ni->ni_macaddr,
-           ":",
+           ath_hal_ether_sprintf(ni->ni_macaddr),
            tid);
 
        ATH_TX_LOCK(sc);
@@ -6155,8 +6143,8 @@ ath_tx_node_sleep(struct ath_softc *sc, struct ath_node *an)
 
        if (an->an_is_powersave) {
                DPRINTF(sc, ATH_DEBUG_XMIT,
-                   "%s: %6D: node was already asleep!\n",
-                   __func__, an->an_node.ni_macaddr, ":");
+                   "%s: %s: node was already asleep!\n",
+                   __func__, ath_hal_ether_sprintf(an->an_node.ni_macaddr));
                ATH_TX_UNLOCK(sc);
                return;
        }
index aa3c4b3..a95504e 100644 (file)
@@ -1040,7 +1040,6 @@ void      ath_resume(struct ath_softc *);
 void   ath_suspend(struct ath_softc *);
 void   ath_shutdown(struct ath_softc *);
 void   ath_intr(void *);
-int    athdev_printf(device_t dev, const char *, ...);
 
 #if defined(__DragonFly__)
 
index 38cf3e5..ad6682c 100644 (file)
@@ -79,6 +79,8 @@ __FBSDID("$FreeBSD$");
 #include <dev/netif/ath/ath_hal/ah_desc.h>
 #include <dev/netif/ath/ath_rate/sample/tx_schedules.h>
 
+extern  const char* ath_hal_ether_sprintf(const uint8_t *mac);
+
 /*
  * This file is an implementation of the SampleRate algorithm
  * in "Bit-rate Selection in Wireless Networks"
@@ -1090,8 +1092,8 @@ ath_rate_ctl_reset(struct ath_softc *sc, struct ieee80211_node *ni)
        if (ieee80211_msg(ni->ni_vap, IEEE80211_MSG_RATECTL)) {
                uint64_t mask;
 
-               ieee80211_note(ni->ni_vap, "[%6D] %s: size 1600 rate/tt",
-                   ni->ni_macaddr, ":", __func__);
+               ieee80211_note(ni->ni_vap, "[%s] %s: size 1600 rate/tt",
+                   ath_hal_ether_sprintf(ni->ni_macaddr), __func__);
                for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) {
                        if ((mask & 1) == 0)
                                continue;
index ba891bf..1918532 100644 (file)
@@ -613,7 +613,7 @@ iwn_attach(device_t dev)
            ((sc->rxchainmask >> 1) & 1) +
            ((sc->rxchainmask >> 0) & 1);
        if (bootverbose) {
-               iwndev_printf(dev, "MIMO %dT%dR, %.4s, address %s\n",
+               device_printf(dev, "MIMO %dT%dR, %.4s, address %s\n",
                    sc->ntxchains, sc->nrxchains, sc->eeprom_domain,
                    kether_ntoa(macaddr, ethstr));
        }
@@ -9122,23 +9122,6 @@ iwn_debug_register(struct iwn_softc *sc)
 }
 #endif
 
-/*
- * A device_printf() equivalent that does not require gcc hacks
- */
-int
-iwndev_printf(device_t dev, const char *ctl, ...)
-{
-       __va_list va;
-       int retval;
-
-       retval = device_print_prettyname(dev);
-       __va_start(va, ctl);
-       retval += kvprintf(ctl, va);
-       __va_end(va);
-
-       return retval;
-}
-
 #if defined(__DragonFly__)
 
 static int
index 7ff4c4d..f03c513 100644 (file)
@@ -426,5 +426,3 @@ struct iwn_softc {
 #define IWN_LOCK_ASSERT(_sc)           KKASSERT(lockstatus(&(_sc)->sc_mtx, curthread) == LK_EXCLUSIVE)
 #define IWN_UNLOCK(_sc)                        lockmgr(&(_sc)->sc_mtx, LK_RELEASE)
 #define IWN_LOCK_DESTROY(_sc)          lockuninit(&(_sc)->sc_mtx)
-
-int iwndev_printf(device_t dev, const char *ctl, ...);
index 780627b..4ceccb2 100644 (file)
                         size, 1, size,
                         BUS_DMA_NOWAIT, &dma->tag);
 
-    * device_printf() may be used with "%6D".  This is effectively asking
-      to print an ether address, but it required hacking gcc to actually
-      accept the "%6D" in a __printflike() function.  So instead, rename
-      any such calls to blahdev_printf() and write a blahdev_printf()
-      function (see athdev_printf() in netif/ath for an example).
-
+    * device_printf() may be used with "%6D".  This is a FreeBSD specific
+      conversion specifier that was removed from DragonFly.  There is a
+      generic kether_ntoa() helper function that can be used for printing
+      MAC addresses. ath(4) also has an ath_hal_ether_sprintf() for this
+      purpose and the wlan stack has an ether_sprintf(). Simply removing
+      the __printflike() to silence the warning is wrong since that will
+      still not print the MAC address correctly (due to removed support
+      in the kprintf() functions).
index 65c3719..7775a4c 100644 (file)
@@ -926,11 +926,14 @@ ieee80211_get_node_txpower(struct ieee80211_node *ni)
        if (ieee80211_msg(_vap, _m))                                    \
                ieee80211_note_frame(_vap, _wh, _fmt, __VA_ARGS__);     \
 } while (0)
-void   ieee80211_note(const struct ieee80211vap *, const char *, ...);
+void   ieee80211_note(const struct ieee80211vap *, const char *, ...)
+               __printflike(2, 3);
 void   ieee80211_note_mac(const struct ieee80211vap *,
-               const uint8_t mac[IEEE80211_ADDR_LEN], const char *, ...);
+               const uint8_t mac[IEEE80211_ADDR_LEN], const char *, ...)
+               __printflike(3, 4);
 void   ieee80211_note_frame(const struct ieee80211vap *,
-               const struct ieee80211_frame *, const char *, ...);
+               const struct ieee80211_frame *, const char *, ...)
+               __printflike(3, 4);
 #define        ieee80211_msg_debug(_vap) \
        ((_vap)->iv_debug & IEEE80211_MSG_DEBUG)
 #define        ieee80211_msg_dumppkts(_vap) \
@@ -968,12 +971,15 @@ void      ieee80211_note_frame(const struct ieee80211vap *,
 } while (0)
 
 void ieee80211_discard_frame(const struct ieee80211vap *,
-       const struct ieee80211_frame *, const char *type, const char *fmt, ...);
+       const struct ieee80211_frame *, const char *type, const char *fmt, ...)
+       __printflike(4, 5);
 void ieee80211_discard_ie(const struct ieee80211vap *,
-       const struct ieee80211_frame *, const char *type, const char *fmt, ...);
+       const struct ieee80211_frame *, const char *type, const char *fmt, ...)
+       __printflike(4, 5);
 void ieee80211_discard_mac(const struct ieee80211vap *,
        const uint8_t mac[IEEE80211_ADDR_LEN], const char *type,
-       const char *fmt, ...);
+       const char *fmt, ...)
+       __printflike(4, 5);
 #else
 #define        IEEE80211_DPRINTF(_vap, _m, _fmt, ...)
 #define        IEEE80211_NOTE(_vap, _m, _ni, _fmt, ...)
index 6ca93fd..b343aac 100644 (file)
@@ -889,8 +889,9 @@ _db_show_mesh(const struct ieee80211_mesh_state *ms)
        db_printf("routing table:\n");
        i = 0;
        TAILQ_FOREACH(rt, &ms->ms_routes, rt_next) {
-               db_printf("entry %d:\tdest: %6D nexthop: %6D metric: %p", i,
-                   rt->rt_dest, ":", rt->rt_nexthop, ":", rt->rt_metric);
+               db_printf("entry %d:\tdest: %s nexthop: %s metric: %u", i,
+                   ether_sprintf(rt->rt_dest), ether_sprintf(rt->rt_nexthop),
+                   rt->rt_metric);
 
                db_printf("\tlifetime: %u lastseq: %u priv: %p\n",
                    ieee80211_mesh_rt_update(rt, 0),
index 6d6c3dc..a1af0e7 100644 (file)
@@ -918,8 +918,8 @@ hwmp_update_transmitter(struct ieee80211vap *vap, struct ieee80211_node *ni,
                rttran = ieee80211_mesh_rt_add(vap, ni->ni_macaddr);
                if (rttran == NULL) {
                        IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-                           "unable to add path to transmitter %6D of %s",
-                           ni->ni_macaddr, ":", hwmp_frame);
+                           "unable to add path to transmitter %s of %s",
+                           ether_sprintf(ni->ni_macaddr), hwmp_frame);
                        vap->iv_stats.is_mesh_rtaddfailed++;
                        return;
                }
@@ -929,9 +929,10 @@ hwmp_update_transmitter(struct ieee80211vap *vap, struct ieee80211_node *ni,
            rttran->rt_metric > metric)
        {
                IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-                   "%s path to transmitter %6D of %s, metric %d:%d",
+                   "%s path to transmitter %s of %s, metric %d:%d",
                    rttran->rt_flags & IEEE80211_MESHRT_FLAGS_VALID ?
-                   "prefer" : "update", ni->ni_macaddr, ":", hwmp_frame,
+                   "prefer" : "update", ether_sprintf(ni->ni_macaddr),
+                   hwmp_frame,
                    rttran->rt_metric, metric);
                IEEE80211_ADDR_COPY(rttran->rt_nexthop, ni->ni_macaddr);
                rttran->rt_metric = metric;
@@ -967,8 +968,9 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_node *ni,
                return;
 
        IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-           "received PREQ, orig %6D, targ(0) %6D", preq->preq_origaddr, ":",
-           PREQ_TADDR(0), ":");
+           "received PREQ, orig %s, targ(0) %s",
+           ether_sprintf(preq->preq_origaddr),
+           ether_sprintf(PREQ_TADDR(0)));
 
        /*
         * Acceptance criteria: (if the PREQ is not for us or not broadcast,
@@ -999,8 +1001,8 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_node *ni,
            !IEEE80211_ADDR_EQ(vap->iv_myaddr, PREQ_TADDR(0))) {
                IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_HWMP,
                    preq->preq_origaddr, NULL,
-                   "unicast addressed PREQ of unknown target %6D",
-                   PREQ_TADDR(0), ":");
+                   "unicast addressed PREQ of unknown target %s",
+                   ether_sprintf(PREQ_TADDR(0)));
                return;
        }
 
@@ -1011,13 +1013,14 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_node *ni,
                rtorig = ieee80211_mesh_rt_add(vap, preq->preq_origaddr);
                if (rtorig == NULL) {
                        IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-                           "unable to add orig path to %6D",
-                           preq->preq_origaddr, ":");
+                           "unable to add orig path to %s",
+                           ether_sprintf(preq->preq_origaddr));
                        vap->iv_stats.is_mesh_rtaddfailed++;
                        return;
                }
                IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-                   "adding originator %6D", preq->preq_origaddr, ":");
+                   "adding originator %s",
+                   ether_sprintf(preq->preq_origaddr));
        }
        hrorig = IEEE80211_MESH_ROUTE_PRIV(rtorig, struct ieee80211_hwmp_route);
 
@@ -1047,9 +1050,9 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_node *ni,
            (rtorig->rt_flags & IEEE80211_MESHRT_FLAGS_VALID &&
            preqid >= preq->preq_id)) {
                IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-                   "discard PREQ from %6D, old seqno %u <= %u,"
+                   "discard PREQ from %s, old seqno %u <= %u,"
                    " or old preqid %u < %u",
-                   preq->preq_origaddr, ":",
+                   ether_sprintf(preq->preq_origaddr),
                    preq->preq_origseq, hrorig->hr_seq,
                    preq->preq_id, preqid);
                return;
@@ -1081,7 +1084,8 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_node *ni,
                if (rttarg != NULL && /* if NULL it means we are the target */
                    rttarg->rt_flags & IEEE80211_MESHRT_FLAGS_PROXY) {
                        IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-                           "reply for proxy %6D", rttarg->rt_dest, ":");
+                           "reply for proxy %s",
+                           ether_sprintf(rttarg->rt_dest));
                        prep.prep_flags |= IEEE80211_MESHPREP_FLAGS_AE;
                        IEEE80211_ADDR_COPY(prep.prep_target_ext_addr,
                            rttarg->rt_dest);
@@ -1101,7 +1105,7 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_node *ni,
                prep.prep_origseq = preq->preq_origseq;
 
                IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-                   "reply to %6D", preq->preq_origaddr, ":");
+                   "reply to %s", ether_sprintf(preq->preq_origaddr));
                hwmp_send_prep(vap, wh->i_addr2, &prep);
                return;
        }
@@ -1114,8 +1118,8 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_node *ni,
                            preq->preq_orig_ext_addr);
                        if (rtorig_ext == NULL) {
                                IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-                                   "unable to add orig ext proxy to %6D",
-                                   preq->preq_orig_ext_addr, ":");
+                                   "unable to add orig ext proxy to %s",
+                                   ether_sprintf(preq->preq_orig_ext_addr));
                                vap->iv_stats.is_mesh_rtaddfailed++;
                                return;
                        }
@@ -1132,7 +1136,8 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_node *ni,
        if (IEEE80211_ADDR_EQ(PREQ_TADDR(0), broadcastaddr) &&
            (PREQ_TFLAGS(0) & IEEE80211_MESHPREQ_TFLAGS_TO)) {
                IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-                   "root mesh station @ %6D", preq->preq_origaddr, ":");
+                   "root mesh station @ %s",
+                   ether_sprintf(preq->preq_origaddr));
 
                /* Check if root is a mesh gate, mark it */
                if (preq->preq_flags & IEEE80211_MESHPREQ_FLAGS_GATE) {
@@ -1191,8 +1196,8 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_node *ni,
                                struct ieee80211_meshprep_ie prep;
 
                                IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-                                   "intermediate reply for PREQ from %6D",
-                                   preq->preq_origaddr, ":");
+                                   "intermediate reply for PREQ from %s",
+                                   ether_sprintf(preq->preq_origaddr));
                                prep.prep_flags = 0;
                                prep.prep_hopcount = rttarg->rt_nhops;
                                prep.prep_ttl = ms->ms_ttl;
@@ -1216,8 +1221,8 @@ hwmp_recv_preq(struct ieee80211vap *vap, struct ieee80211_node *ni,
                }
 
                IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-                   "forward PREQ from %6D",
-                   preq->preq_origaddr, ":");
+                   "forward PREQ from %s",
+                   ether_sprintf(preq->preq_origaddr));
                ppreq.preq_hopcount += 1;
                ppreq.preq_ttl -= 1;
                ppreq.preq_metric += ms->ms_pmetric->mpm_metric(ni);
@@ -1282,8 +1287,9 @@ hwmp_recv_prep(struct ieee80211vap *vap, struct ieee80211_node *ni,
        const uint8_t *addr;
 
        IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-           "received PREP, orig %6D, targ %6D", prep->prep_origaddr, ":",
-           prep->prep_targetaddr, ":");
+           "received PREP, orig %s, targ %s",
+           ether_sprintf(prep->prep_origaddr),
+           ether_sprintf(prep->prep_targetaddr));
 
        /*
         * Acceptance criteria: (If the corresponding PREP was not generated
@@ -1295,8 +1301,8 @@ hwmp_recv_prep(struct ieee80211vap *vap, struct ieee80211_node *ni,
            (rtorig != NULL && IS_PROXY(rtorig) && !PROXIED_BY_US(rtorig))) &&
            !(ms->ms_flags & IEEE80211_MESHFLAGS_FWD)){
                IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-                   "discard PREP, orig(%6D) not proxied or generated by us",
-                   prep->prep_origaddr, ":");
+                   "discard PREP, orig(%s) not proxied or generated by us",
+                   ether_sprintf(prep->prep_origaddr));
                return;
        }
 
@@ -1314,13 +1320,13 @@ hwmp_recv_prep(struct ieee80211vap *vap, struct ieee80211_node *ni,
                rt = ieee80211_mesh_rt_add(vap, prep->prep_targetaddr);
                if (rt == NULL) {
                        IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-                           "unable to add PREP path to %6D",
-                           prep->prep_targetaddr, ":");
+                           "unable to add PREP path to %s",
+                           ether_sprintf(prep->prep_targetaddr));
                        vap->iv_stats.is_mesh_rtaddfailed++;
                        return;
                }
                IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-                   "adding target %6D", prep->prep_targetaddr, ":");
+                   "adding target %s", ether_sprintf(prep->prep_targetaddr));
        }
        hr = IEEE80211_MESH_ROUTE_PRIV(rt, struct ieee80211_hwmp_route);
        /* update path metric */
@@ -1328,25 +1334,25 @@ hwmp_recv_prep(struct ieee80211vap *vap, struct ieee80211_node *ni,
        if ((rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID)) {
                if (HWMP_SEQ_LT(prep->prep_targetseq, hr->hr_seq)) {
                        IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-                           "discard PREP from %6D, old seq no %u < %u",
-                           prep->prep_targetaddr, ":",
+                           "discard PREP from %s, old seq no %u < %u",
+                           ether_sprintf(prep->prep_targetaddr),
                            prep->prep_targetseq, hr->hr_seq);
                        return;
                } else if (HWMP_SEQ_LEQ(prep->prep_targetseq, hr->hr_seq) &&
                    metric > rt->rt_metric) {
                        IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-                           "discard PREP from %6D, new metric %u > %u",
-                           prep->prep_targetaddr, ":",
+                           "discard PREP from %s, new metric %u > %u",
+                           ether_sprintf(prep->prep_targetaddr),
                            metric, rt->rt_metric);
                        return;
                }
        }
 
        IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-           "%s path to %6D, hopcount %d:%d metric %d:%d",
+           "%s path to %s, hopcount %d:%d metric %d:%d",
            rt->rt_flags & IEEE80211_MESHRT_FLAGS_VALID ?
            "prefer" : "update",
-           prep->prep_targetaddr, ":",
+           ether_sprintf(prep->prep_targetaddr),
            rt->rt_nhops, prep->prep_hopcount + 1,
            rt->rt_metric, metric);
 
@@ -1380,14 +1386,14 @@ hwmp_recv_prep(struct ieee80211vap *vap, struct ieee80211_node *ni,
                 */
                if (rtorig == NULL) {
                        IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-                           "received PREP for an unknown orig(%6D)",
-                           prep->prep_origaddr, ":");
+                           "received PREP for an unknown orig(%s)",
+                           ether_sprintf(prep->prep_origaddr));
                        return;
                }
 
                IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-                   "propagate PREP from %6D",
-                   prep->prep_targetaddr, ":");
+                   "propagate PREP from %s",
+                   ether_sprintf(prep->prep_targetaddr));
 
                memcpy(&pprep, prep, sizeof(pprep));
                pprep.prep_hopcount += 1;
@@ -1411,17 +1417,17 @@ hwmp_recv_prep(struct ieee80211vap *vap, struct ieee80211_node *ni,
                                prep->prep_target_ext_addr);
                        if (rtext == NULL) {
                                IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-                                   "unable to add PREP path to proxy %6D",
-                                   prep->prep_targetaddr, ":");
+                                   "unable to add PREP path to proxy %s",
+                                   ether_sprintf(prep->prep_targetaddr));
                                vap->iv_stats.is_mesh_rtaddfailed++;
                                return;
                        }
                }
                IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-                   "%s path to %6D, hopcount %d:%d metric %d:%d",
+                   "%s path to %s, hopcount %d:%d metric %d:%d",
                    rtext->rt_flags & IEEE80211_MESHRT_FLAGS_VALID ?
                    "prefer" : "update",
-                   prep->prep_target_ext_addr, ":",
+                   ether_sprintf(prep->prep_target_ext_addr),
                    rtext->rt_nhops, prep->prep_hopcount + 1,
                    rtext->rt_metric, metric);
 
@@ -1549,7 +1555,7 @@ hwmp_recv_perr(struct ieee80211vap *vap, struct ieee80211_node *ni,
        int i, j = 0, forward = 0;
 
        IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-           "received PERR from %6D", wh->i_addr2, ":");
+           "received PERR from %s", ether_sprintf(wh->i_addr2));
 
        /*
         * if forwarding is true, prepare pperr
@@ -1625,7 +1631,7 @@ hwmp_recv_perr(struct ieee80211vap *vap, struct ieee80211_node *ni,
         */
        if (forward && perr->perr_ttl > 1) {
                IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni,
-                   "propagate PERR from %6D", wh->i_addr2, ":");
+                   "propagate PERR from %s", ether_sprintf(wh->i_addr2));
                pperr->perr_ndests = j;
                pperr->perr_ttl--;
                hwmp_send_perr(vap, broadcastaddr, pperr);
@@ -1782,8 +1788,8 @@ hwmp_recv_rann(struct ieee80211vap *vap, struct ieee80211_node *ni,
                rt = ieee80211_mesh_rt_add(vap, rann->rann_addr);
                if (rt == NULL) {
                        IEEE80211_DISCARD(vap, IEEE80211_MSG_HWMP, wh, NULL,
-                           "unable to add mac for RANN root %6D",
-                           rann->rann_addr, ":");
+                           "unable to add mac for RANN root %s",
+                           ether_sprintf(rann->rann_addr));
                            vap->iv_stats.is_mesh_rtaddfailed++;
                        return;
                }
@@ -1935,8 +1941,8 @@ hwmp_discover(struct ieee80211vap *vap,
                        rt = ieee80211_mesh_rt_add(vap, dest);
                        if (rt == NULL) {
                                IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP,
-                                   ni, "unable to add discovery path to %6D",
-                                   dest, ":");
+                                   ni, "unable to add discovery path to %s",
+                                   ether_sprintf(dest));
                                vap->iv_stats.is_mesh_rtaddfailed++;
                                goto done;
                        }
index 394645e..3d97a64 100644 (file)
@@ -1126,8 +1126,8 @@ ieee80211_mesh_forward_to_gates(struct ieee80211vap *vap,
                if (rt_gate == NULL) {
                        IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_HWMP,
                                rt_dest->rt_dest,
-                               "mesh gate with no path %6D",
-                               gr->gr_addr, ":");
+                               "mesh gate with no path %s",
+                               ether_sprintf(gr->gr_addr));
                        continue;
                }
                if ((rt_gate->rt_flags & IEEE80211_MESHRT_FLAGS_VALID) == 0)
@@ -1429,7 +1429,7 @@ mesh_recv_indiv_data_to_fwrd(struct ieee80211vap *vap, struct mbuf *m,
        rt_meshda = ieee80211_mesh_rt_find(vap, qwh->i_addr3);
        if (rt_meshda == NULL) {
                IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, qwh->i_addr2,
-                   "no route to meshDA(%6D)", qwh->i_addr3, ":");
+                   "no route to meshDA(%s)", ether_sprintf(qwh->i_addr3));
                /*
                 * [Optional] any of the following three actions:
                 * o silently discard                           [X]
@@ -1516,8 +1516,9 @@ mesh_recv_indiv_data_to_me(struct ieee80211vap *vap, struct mbuf *m,
                 * addressed according to 13.11.3.2.
                 */
                IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_OUTPUT, qwh->i_addr2,
-                   "forward frame to DS, SA(%6D) DA(%6D)",
-                   mc10->mc_addr6, ":", mc10->mc_addr5, ":");
+                   "forward frame to DS, SA(%s) DA(%s)",
+                   ether_sprintf(mc10->mc_addr6),
+                   ether_sprintf(mc10->mc_addr5));
        }
        return (0); /* process locally */
 }
@@ -2638,7 +2639,8 @@ mesh_recv_action_meshgate(struct ieee80211_node *ni,
                return 0;
 
        IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_MESH, ni->ni_macaddr,
-           "received GANN, meshgate: %6D (seq %u)", ie.gann_addr, ":",
+           "received GANN, meshgate: %s (seq %u)",
+           ether_sprintf(ie.gann_addr),
            ie.gann_seq);
 
        if (ms == NULL)
index d168b19..88edf6f 100644 (file)
@@ -382,9 +382,9 @@ ieee80211_start_pkt(struct ieee80211vap *vap, struct mbuf *m)
                                return (ENOBUFS);
                        }
                        IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT,
-                           "forward frame from DS SA(%6D), DA(%6D)\n",
-                           eh->ether_shost, ":",
-                           eh->ether_dhost, ":");
+                           "forward frame from DS SA(%s), DA(%s)\n",
+                           ether_sprintf(eh->ether_shost),
+                           ether_sprintf(eh->ether_dhost));
                        ieee80211_mesh_proxy_check(vap, eh->ether_shost);
                }
                ni = ieee80211_mesh_discover(vap, eh->ether_dhost, m);
@@ -2201,7 +2201,7 @@ ieee80211_send_probereq(struct ieee80211_node *ni,
        IEEE80211_DPRINTF(vap, IEEE80211_MSG_DEBUG | IEEE80211_MSG_DUMPPKTS,
            "send probe req on channel %u bssid %s ssid \"%.*s\"\n",
            ieee80211_chan2ieee(ic, ic->ic_curchan), ether_sprintf(bssid),
-           ssidlen, ssid);
+           (int)ssidlen, ssid);
 
        memset(&params, 0, sizeof(params));
        params.ibp_pri = M_WME_GETAC(m);
index 029cdd8..fb49bdb 100644 (file)
@@ -607,7 +607,7 @@ ieee80211_bg_scan(struct ieee80211vap *vap, int flags)
                duration = IEEE80211_SCAN_OFFCHANNEL;
 
                IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN,
-                   "%s: %s scan, ticks %u duration %l\n", __func__,
+                   "%s: %s scan, ticks %u duration %u\n", __func__,
                    ss->ss_flags & IEEE80211_SCAN_ACTIVE ? "active" : "passive",
                    ticks, duration);
 
index 660984c..81dbd75 100644 (file)
@@ -615,8 +615,9 @@ sta_input(struct ieee80211_node *ni, struct mbuf *m, int rssi, int nf)
                if ((! IEEE80211_IS_MULTICAST(wh->i_addr1))
                    && (! IEEE80211_ADDR_EQ(wh->i_addr1, IF_LLADDR(ifp)))) {
                        IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
-                           bssid, NULL, "not to cur sta: lladdr=%6D, addr1=%6D",
-                           IF_LLADDR(ifp), ":", wh->i_addr1, ":");
+                           bssid, NULL, "not to cur sta: lladdr=%s, addr1=%s",
+                           ether_sprintf(IF_LLADDR(ifp)),
+                           ether_sprintf(wh->i_addr1));
                        vap->iv_stats.is_rx_wrongbss++;
                        goto out;
                }