alistair23-linux/drivers/net/ipa/ipa_qmi.h
Alex Elder 530f9216a9 soc: qcom: ipa: AP/modem communications
This patch implements two forms of out-of-band communication between
the AP and modem.

  - QMI is a mechanism that allows clients running on the AP
    interact with services running on the modem (and vice-versa).
    The AP IPA driver uses QMI to communicate with the corresponding
    IPA driver resident on the modem, to agree on parameters used
    with the IPA hardware and to ensure both sides are ready before
    entering operational mode.

  - SMP2P is a more primitive mechanism available for the modem and
    AP to communicate with each other.  It provides a means for either
    the AP or modem to interrupt the other, and furthermore, to provide
    32 bits worth of information.  The IPA driver uses SMP2P to tell
    the modem what the state of the IPA clock was in the event of a
    crash.  This allows the modem to safely access the IPA hardware
    (or avoid doing so) when a crash occurs, for example, to access
    information within the IPA hardware.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-03-08 22:07:10 -07:00

42 lines
1.1 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
* Copyright (C) 2018-2020 Linaro Ltd.
*/
#ifndef _IPA_QMI_H_
#define _IPA_QMI_H_
#include <linux/types.h>
#include <linux/soc/qcom/qmi.h>
struct ipa;
/**
* struct ipa_qmi - QMI state associated with an IPA
* @client_handle - used to send an QMI requests to the modem
* @server_handle - used to handle QMI requests from the modem
* @initialized - whether QMI initialization has completed
* @indication_register_received - tracks modem request receipt
* @init_driver_response_received - tracks modem response receipt
*/
struct ipa_qmi {
struct qmi_handle client_handle;
struct qmi_handle server_handle;
/* Information used for the client handle */
struct sockaddr_qrtr modem_sq;
struct work_struct init_driver_work;
/* Flags used in negotiating readiness */
bool initial_boot;
bool uc_ready;
bool modem_ready;
bool indication_requested;
bool indication_sent;
};
int ipa_qmi_setup(struct ipa *ipa);
void ipa_qmi_teardown(struct ipa *ipa);
#endif /* !_IPA_QMI_H_ */