debug.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. int 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. int ret;
  26. va_start(args, fmt);
  27. vaf.va = &args;
  28. ret = netdev_err(ndev, "%pV", &vaf);
  29. trace_wil6210_log_err(&vaf);
  30. va_end(args);
  31. return ret;
  32. }
  33. int wil_info(struct wil6210_priv *wil, const char *fmt, ...)
  34. {
  35. struct net_device *ndev = wil_to_ndev(wil);
  36. struct va_format vaf = {
  37. .fmt = fmt,
  38. };
  39. va_list args;
  40. int ret;
  41. va_start(args, fmt);
  42. vaf.va = &args;
  43. ret = netdev_info(ndev, "%pV", &vaf);
  44. trace_wil6210_log_info(&vaf);
  45. va_end(args);
  46. return ret;
  47. }
  48. int wil_dbg_trace(struct wil6210_priv *wil, const char *fmt, ...)
  49. {
  50. struct va_format vaf = {
  51. .fmt = fmt,
  52. };
  53. va_list args;
  54. va_start(args, fmt);
  55. vaf.va = &args;
  56. trace_wil6210_log_dbg(&vaf);
  57. va_end(args);
  58. return 0;
  59. }