wil6210: print debug message when transmitting while disconnected
authorMaya Erez <qca_merez@qca.qualcomm.com>
Tue, 26 Apr 2016 11:41:39 +0000 (14:41 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 26 Apr 2016 11:57:45 +0000 (14:57 +0300)
Network stack can try to transmit data while AP / STA is
disconnected.
Change this print-out to debug level as this should not be
handled as error.
This patch also adds wil_dbg_ratelimited, used to limit the
above print-out.

Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/wil6210/debug.c
drivers/net/wireless/ath/wil6210/txrx.c
drivers/net/wireless/ath/wil6210/wil6210.h

index 0a301277c06d91f8f1abbaf70c51a6b097d09670..c312a667c12a395205489c0bc8ef101375a2685d 100644 (file)
@@ -49,6 +49,22 @@ void __wil_err_ratelimited(struct wil6210_priv *wil, const char *fmt, ...)
        }
 }
 
+void wil_dbg_ratelimited(const struct wil6210_priv *wil, const char *fmt, ...)
+{
+       struct va_format vaf;
+       va_list args;
+
+       if (!net_ratelimit())
+               return;
+
+       va_start(args, fmt);
+       vaf.fmt = fmt;
+       vaf.va = &args;
+       netdev_dbg(wil_to_ndev(wil), "%pV", &vaf);
+       trace_wil6210_log_dbg(&vaf);
+       va_end(args);
+}
+
 void __wil_info(struct wil6210_priv *wil, const char *fmt, ...)
 {
        struct net_device *ndev = wil_to_ndev(wil);
index f260b232fd57114907e5aa5664db28094ba15bc4..a4e43796addbd8282584cf2e5fbc324a68aa5bac 100644 (file)
@@ -1759,7 +1759,7 @@ netdev_tx_t wil_start_xmit(struct sk_buff *skb, struct net_device *ndev)
                goto drop;
        }
        if (unlikely(!test_bit(wil_status_fwconnected, wil->status))) {
-               wil_err_ratelimited(wil, "FW not connected\n");
+               wil_dbg_ratelimited(wil, "FW not connected, packet dropped\n");
                goto drop;
        }
        if (unlikely(wil->wdev->iftype == NL80211_IFTYPE_MONITOR)) {
index b6fc256183f0e0222f6ac5644a58f229c4d11091..50acd136d9671b7c2c27628c3889929279f32be1 100644 (file)
@@ -640,6 +640,8 @@ __printf(2, 3)
 void __wil_err_ratelimited(struct wil6210_priv *wil, const char *fmt, ...);
 __printf(2, 3)
 void __wil_info(struct wil6210_priv *wil, const char *fmt, ...);
+__printf(2, 3)
+void wil_dbg_ratelimited(const struct wil6210_priv *wil, const char *fmt, ...);
 #define wil_dbg(wil, fmt, arg...) do { \
        netdev_dbg(wil_to_ndev(wil), fmt, ##arg); \
        wil_dbg_trace(wil, fmt, ##arg); \