debug.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright (c) 2013 Qualcomm Atheros, Inc.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #include "wil6210.h"
  17. #include "trace.h"
  18. void wil_err(struct wil6210_priv *wil, const char *fmt, ...)
  19. {
  20. struct net_device *ndev = wil_to_ndev(wil);
  21. struct va_format vaf = {
  22. .fmt = fmt,
  23. };
  24. va_list args;
  25. va_start(args, fmt);
  26. vaf.va = &args;
  27. netdev_err(ndev, "%pV", &vaf);
  28. trace_wil6210_log_err(&vaf);
  29. va_end(args);
  30. }
  31. void wil_info(struct wil6210_priv *wil, const char *fmt, ...)
  32. {
  33. struct net_device *ndev = wil_to_ndev(wil);
  34. struct va_format vaf = {
  35. .fmt = fmt,
  36. };
  37. va_list args;
  38. va_start(args, fmt);
  39. vaf.va = &args;
  40. netdev_info(ndev, "%pV", &vaf);
  41. trace_wil6210_log_info(&vaf);
  42. va_end(args);
  43. }
  44. void wil_dbg_trace(struct wil6210_priv *wil, const char *fmt, ...)
  45. {
  46. struct va_format vaf = {
  47. .fmt = fmt,
  48. };
  49. va_list args;
  50. va_start(args, fmt);
  51. vaf.va = &args;
  52. trace_wil6210_log_dbg(&vaf);
  53. va_end(args);
  54. }