OSDN Git Service

iwlwifi: mei: add debugfs hooks
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Fri, 12 Nov 2021 06:28:11 +0000 (08:28 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 26 Nov 2021 16:31:47 +0000 (18:31 +0200)
commit4ea7da5fad43f47eb2adab032f989a9fa6678a9c
tree74a05a96a4abe4346b248dddc001bff370fdd763
parent2da4366f9e2c44afedec4acad65a99a3c7da1a35
iwlwifi: mei: add debugfs hooks

Add three debugfs hooks:
* status: Check if we have a connection with the CSME
  firwmare. This hook is a read only.

* req_ownership: Send a SAP command to request ownership. This
  flow should be triggered by iwlwifi (from user space through
  vendor commands really), but being able to trigger an ownership
  request from debugfs allows us to request ownership without
  connecting afterwards. This is an "error" flow that the CSME
  firmware is designed to handle this way:
  + Grant ownership since the host asked for it
  + Wait 3 seconds to let the host connect
  + If the host didn't connect, take the device back (forcefully).
  + Don't grant any new ownership request in the following 30
  seconds.
  This debugfs hook allows us to test this flow.

* send_start_message: Restart the communication with the CSME
  firmware from the very beginning. At the very beginning (upon
  iwlwifi start), iwlmei send a special message: SAP_ME_MSG_START.
  This hook allows to send it again and this will retrigger the
  whole flow. It is important to test this restart in the middle
  of normal operation since it can happen (in case the CSME
  firmware decided to reset for example).

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211112062814.7502-3-emmanuel.grumbach@intel.com
drivers/net/wireless/intel/iwlwifi/mei/main.c