Commit 63961f54 authored by Alex Elder's avatar Alex Elder Committed by David S. Miller

net: ipa: kill ipa_modem_setup()

The functions ipa_modem_setup() and ipa_modem_teardown() are trivial
wrappers that call ipa_qmi_setup() and ipa_qmi_teardown().  Just
call the QMI functions directly, and get rid of the wrappers.

Improve the documentation of what setting up QMI does.
Signed-off-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 323e0cb4
...@@ -167,7 +167,7 @@ int ipa_setup(struct ipa *ipa) ...@@ -167,7 +167,7 @@ int ipa_setup(struct ipa *ipa)
ipa_endpoint_default_route_set(ipa, exception_endpoint->endpoint_id); ipa_endpoint_default_route_set(ipa, exception_endpoint->endpoint_id);
/* We're all set. Now prepare for communication with the modem */ /* We're all set. Now prepare for communication with the modem */
ret = ipa_modem_setup(ipa); ret = ipa_qmi_setup(ipa);
if (ret) if (ret)
goto err_default_route_clear; goto err_default_route_clear;
...@@ -204,7 +204,7 @@ static void ipa_teardown(struct ipa *ipa) ...@@ -204,7 +204,7 @@ static void ipa_teardown(struct ipa *ipa)
struct ipa_endpoint *exception_endpoint; struct ipa_endpoint *exception_endpoint;
struct ipa_endpoint *command_endpoint; struct ipa_endpoint *command_endpoint;
ipa_modem_teardown(ipa); ipa_qmi_teardown(ipa);
ipa_endpoint_default_route_clear(ipa); ipa_endpoint_default_route_clear(ipa);
exception_endpoint = ipa->name_map[IPA_ENDPOINT_AP_LAN_RX]; exception_endpoint = ipa->name_map[IPA_ENDPOINT_AP_LAN_RX];
ipa_endpoint_disable_one(exception_endpoint); ipa_endpoint_disable_one(exception_endpoint);
......
...@@ -377,13 +377,3 @@ void ipa_modem_deconfig(struct ipa *ipa) ...@@ -377,13 +377,3 @@ void ipa_modem_deconfig(struct ipa *ipa)
ipa->notifier = NULL; ipa->notifier = NULL;
memset(&ipa->nb, 0, sizeof(ipa->nb)); memset(&ipa->nb, 0, sizeof(ipa->nb));
} }
int ipa_modem_setup(struct ipa *ipa)
{
return ipa_qmi_setup(ipa);
}
void ipa_modem_teardown(struct ipa *ipa)
{
ipa_qmi_teardown(ipa);
}
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#define _IPA_MODEM_H_ #define _IPA_MODEM_H_
struct ipa; struct ipa;
struct ipa_endpoint;
struct net_device; struct net_device;
struct sk_buff; struct sk_buff;
...@@ -25,7 +24,4 @@ void ipa_modem_exit(struct ipa *ipa); ...@@ -25,7 +24,4 @@ void ipa_modem_exit(struct ipa *ipa);
int ipa_modem_config(struct ipa *ipa); int ipa_modem_config(struct ipa *ipa);
void ipa_modem_deconfig(struct ipa *ipa); void ipa_modem_deconfig(struct ipa *ipa);
int ipa_modem_setup(struct ipa *ipa);
void ipa_modem_teardown(struct ipa *ipa);
#endif /* _IPA_MODEM_H_ */ #endif /* _IPA_MODEM_H_ */
...@@ -467,10 +467,7 @@ static const struct qmi_ops ipa_client_ops = { ...@@ -467,10 +467,7 @@ static const struct qmi_ops ipa_client_ops = {
.new_server = ipa_client_new_server, .new_server = ipa_client_new_server,
}; };
/* This is called by ipa_setup(). We can be informed via remoteproc that /* Set up for QMI message exchange */
* the modem has shut down, in which case this function will be called
* again to prepare for it coming back up again.
*/
int ipa_qmi_setup(struct ipa *ipa) int ipa_qmi_setup(struct ipa *ipa)
{ {
struct ipa_qmi *ipa_qmi = &ipa->qmi; struct ipa_qmi *ipa_qmi = &ipa->qmi;
...@@ -526,6 +523,7 @@ int ipa_qmi_setup(struct ipa *ipa) ...@@ -526,6 +523,7 @@ int ipa_qmi_setup(struct ipa *ipa)
return ret; return ret;
} }
/* Tear down IPA QMI handles */
void ipa_qmi_teardown(struct ipa *ipa) void ipa_qmi_teardown(struct ipa *ipa)
{ {
cancel_work_sync(&ipa->qmi.init_driver_work); cancel_work_sync(&ipa->qmi.init_driver_work);
......
...@@ -39,7 +39,26 @@ struct ipa_qmi { ...@@ -39,7 +39,26 @@ struct ipa_qmi {
bool indication_sent; bool indication_sent;
}; };
/**
* ipa_qmi_setup() - Set up for QMI message exchange
* @ipa: IPA pointer
*
* This is called at the end of ipa_setup(), to prepare for the exchange
* of QMI messages that perform a "handshake" between the AP and modem.
* When the modem QMI server announces its presence, an AP request message
* supplies operating parameters to be used to the modem, and the modem
* acknowledges receipt of those parameters. The modem will not touch the
* IPA hardware until this handshake is complete.
*
* If the modem crashes (or shuts down) a new handshake begins when the
* modem's QMI server is started again.
*/
int ipa_qmi_setup(struct ipa *ipa); int ipa_qmi_setup(struct ipa *ipa);
/**
* ipa_qmi_teardown() - Tear down IPA QMI handles
* @ipa: IPA pointer
*/
void ipa_qmi_teardown(struct ipa *ipa); void ipa_qmi_teardown(struct ipa *ipa);
#endif /* !_IPA_QMI_H_ */ #endif /* !_IPA_QMI_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment