• Emmanuel Grumbach's avatar
    iwlwifi: mei: add debugfs hooks · 4ea7da5f
    Emmanuel Grumbach authored
    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: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
    Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
    Link: https://lore.kernel.org/r/20211112062814.7502-3-emmanuel.grumbach@intel.com
    4ea7da5f
main.c 49.6 KB