htc_hang_event.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (c) 2020, The Linux Foundation. All rights reserved.
  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 <qdf_hang_event_notifier.h>
  17. #include <qdf_notifier.h>
  18. #include "htc_hang_event.h"
  19. #include "htc_internal.h"
  20. #include "htc_credit_history.h"
  21. static int htc_recovery_notifier_call(struct notifier_block *block,
  22. unsigned long state,
  23. void *data)
  24. {
  25. htc_log_hang_credit_history(block, data);
  26. return NOTIFY_OK;
  27. }
  28. static qdf_notif_block htc_recovery_notifier = {
  29. .notif_block.notifier_call = htc_recovery_notifier_call,
  30. };
  31. QDF_STATUS htc_hang_event_notifier_register(HTC_TARGET *target)
  32. {
  33. htc_recovery_notifier.priv_data = target;
  34. return qdf_hang_event_register_notifier(&htc_recovery_notifier);
  35. }
  36. QDF_STATUS htc_hang_event_notifier_unregister(void)
  37. {
  38. return qdf_hang_event_unregister_notifier(&htc_recovery_notifier);
  39. }