debugfs.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /******************************************************************************
  2. *
  3. * This file is provided under a dual BSD/GPLv2 license. When using or
  4. * redistributing this file, you may do so under either license.
  5. *
  6. * GPL LICENSE SUMMARY
  7. *
  8. * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  9. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
  10. * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of version 2 of the GNU General Public License as
  14. * published by the Free Software Foundation.
  15. *
  16. * This program is distributed in the hope that it will be useful, but
  17. * WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  19. * General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program.
  23. *
  24. * The full GNU General Public License is included in this distribution
  25. * in the file called COPYING.
  26. *
  27. * Contact Information:
  28. * Intel Linux Wireless <linuxwifi@intel.com>
  29. * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
  30. *
  31. * BSD LICENSE
  32. *
  33. * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
  34. * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
  35. * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
  36. * All rights reserved.
  37. *
  38. * Redistribution and use in source and binary forms, with or without
  39. * modification, are permitted provided that the following conditions
  40. * are met:
  41. *
  42. * * Redistributions of source code must retain the above copyright
  43. * notice, this list of conditions and the following disclaimer.
  44. * * Redistributions in binary form must reproduce the above copyright
  45. * notice, this list of conditions and the following disclaimer in
  46. * the documentation and/or other materials provided with the
  47. * distribution.
  48. * * Neither the name Intel Corporation nor the names of its
  49. * contributors may be used to endorse or promote products derived
  50. * from this software without specific prior written permission.
  51. *
  52. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  53. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  54. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  55. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  56. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  57. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  58. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  59. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  60. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  61. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  62. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  63. *
  64. *****************************************************************************/
  65. #include "runtime.h"
  66. #ifdef CONFIG_IWLWIFI_DEBUGFS
  67. int iwl_fwrt_dbgfs_register(struct iwl_fw_runtime *fwrt,
  68. struct dentry *dbgfs_dir);
  69. static inline void iwl_fw_cancel_timestamp(struct iwl_fw_runtime *fwrt)
  70. {
  71. fwrt->timestamp.delay = 0;
  72. cancel_delayed_work_sync(&fwrt->timestamp.wk);
  73. }
  74. static inline void iwl_fw_suspend_timestamp(struct iwl_fw_runtime *fwrt)
  75. {
  76. cancel_delayed_work_sync(&fwrt->timestamp.wk);
  77. }
  78. static inline void iwl_fw_resume_timestamp(struct iwl_fw_runtime *fwrt)
  79. {
  80. if (!fwrt->timestamp.delay)
  81. return;
  82. schedule_delayed_work(&fwrt->timestamp.wk,
  83. round_jiffies_relative(fwrt->timestamp.delay));
  84. }
  85. void iwl_fw_trigger_timestamp(struct iwl_fw_runtime *fwrt, u32 delay);
  86. #else
  87. static inline int iwl_fwrt_dbgfs_register(struct iwl_fw_runtime *fwrt,
  88. struct dentry *dbgfs_dir)
  89. {
  90. return 0;
  91. }
  92. static inline void iwl_fw_cancel_timestamp(struct iwl_fw_runtime *fwrt) {}
  93. static inline void iwl_fw_suspend_timestamp(struct iwl_fw_runtime *fwrt) {}
  94. static inline void iwl_fw_resume_timestamp(struct iwl_fw_runtime *fwrt) {}
  95. static inline void iwl_fw_trigger_timestamp(struct iwl_fw_runtime *fwrt,
  96. u32 delay) {}
  97. #endif /* CONFIG_IWLWIFI_DEBUGFS */