Lines Matching full:ipa
14 #include "ipa.h"
34 /** struct ipa_priv - IPA network device private data */
36 struct ipa *ipa; member
43 struct ipa *ipa = priv->ipa; in ipa_open() local
46 ret = ipa_endpoint_enable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]); in ipa_open()
49 ret = ipa_endpoint_enable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_RX]); in ipa_open()
58 ipa_endpoint_disable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]); in ipa_open()
67 struct ipa *ipa = priv->ipa; in ipa_stop() local
71 ipa_endpoint_disable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_RX]); in ipa_stop()
72 ipa_endpoint_disable_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]); in ipa_stop()
90 struct ipa *ipa = priv->ipa; in ipa_start_xmit() local
97 endpoint = ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]; in ipa_start_xmit()
170 struct ipa *ipa = priv->ipa; in ipa_modem_suspend() local
174 ipa_endpoint_suspend_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_RX]); in ipa_modem_suspend()
175 ipa_endpoint_suspend_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]); in ipa_modem_suspend()
186 struct ipa *ipa = priv->ipa; in ipa_modem_resume() local
188 ipa_endpoint_resume_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]); in ipa_modem_resume()
189 ipa_endpoint_resume_one(ipa->name_map[IPA_ENDPOINT_AP_MODEM_RX]); in ipa_modem_resume()
194 int ipa_modem_start(struct ipa *ipa) in ipa_modem_start() argument
202 state = atomic_cmpxchg(&ipa->modem_state, IPA_MODEM_STATE_STOPPED, in ipa_modem_start()
216 ipa->name_map[IPA_ENDPOINT_AP_MODEM_TX]->netdev = netdev; in ipa_modem_start()
217 ipa->name_map[IPA_ENDPOINT_AP_MODEM_RX]->netdev = netdev; in ipa_modem_start()
220 priv->ipa = ipa; in ipa_modem_start()
226 ipa->modem_netdev = netdev; in ipa_modem_start()
230 atomic_set(&ipa->modem_state, IPA_MODEM_STATE_STOPPED); in ipa_modem_start()
232 atomic_set(&ipa->modem_state, IPA_MODEM_STATE_RUNNING); in ipa_modem_start()
238 int ipa_modem_stop(struct ipa *ipa) in ipa_modem_stop() argument
240 struct net_device *netdev = ipa->modem_netdev; in ipa_modem_stop()
245 state = atomic_cmpxchg(&ipa->modem_state, IPA_MODEM_STATE_RUNNING, in ipa_modem_stop()
257 ipa_smp2p_disable(ipa); in ipa_modem_stop()
265 ipa->modem_netdev = NULL; in ipa_modem_stop()
274 atomic_set(&ipa->modem_state, IPA_MODEM_STATE_RUNNING); in ipa_modem_stop()
276 atomic_set(&ipa->modem_state, IPA_MODEM_STATE_STOPPED); in ipa_modem_stop()
283 static void ipa_modem_crashed(struct ipa *ipa) in ipa_modem_crashed() argument
285 struct device *dev = &ipa->pdev->dev; in ipa_modem_crashed()
288 ipa_endpoint_modem_pause_all(ipa, true); in ipa_modem_crashed()
290 ipa_endpoint_modem_hol_block_clear_all(ipa); in ipa_modem_crashed()
292 ipa_table_reset(ipa, true); in ipa_modem_crashed()
294 ret = ipa_table_hash_flush(ipa); in ipa_modem_crashed()
298 ret = ipa_endpoint_modem_exception_reset_all(ipa); in ipa_modem_crashed()
302 ipa_endpoint_modem_pause_all(ipa, false); in ipa_modem_crashed()
304 ret = ipa_modem_stop(ipa); in ipa_modem_crashed()
309 ret = ipa_mem_zero_modem(ipa); in ipa_modem_crashed()
317 struct ipa *ipa = container_of(nb, struct ipa, nb); in ipa_modem_notify() local
319 struct device *dev = &ipa->pdev->dev; in ipa_modem_notify()
324 ipa_smp2p_notify_reset(ipa); in ipa_modem_notify()
334 if (ipa->setup_complete) in ipa_modem_notify()
335 ipa_modem_crashed(ipa); in ipa_modem_notify()
350 int ipa_modem_init(struct ipa *ipa, bool modem_init) in ipa_modem_init() argument
352 return ipa_smp2p_init(ipa, modem_init); in ipa_modem_init()
355 void ipa_modem_exit(struct ipa *ipa) in ipa_modem_exit() argument
357 ipa_smp2p_exit(ipa); in ipa_modem_exit()
360 int ipa_modem_config(struct ipa *ipa) in ipa_modem_config() argument
364 ipa->nb.notifier_call = ipa_modem_notify; in ipa_modem_config()
366 notifier = qcom_register_ssr_notifier("mpss", &ipa->nb); in ipa_modem_config()
370 ipa->notifier = notifier; in ipa_modem_config()
375 void ipa_modem_deconfig(struct ipa *ipa) in ipa_modem_deconfig() argument
377 struct device *dev = &ipa->pdev->dev; in ipa_modem_deconfig()
380 ret = qcom_unregister_ssr_notifier(ipa->notifier, &ipa->nb); in ipa_modem_deconfig()
384 ipa->notifier = NULL; in ipa_modem_deconfig()
385 memset(&ipa->nb, 0, sizeof(ipa->nb)); in ipa_modem_deconfig()
388 int ipa_modem_setup(struct ipa *ipa) in ipa_modem_setup() argument
390 return ipa_qmi_setup(ipa); in ipa_modem_setup()
393 void ipa_modem_teardown(struct ipa *ipa) in ipa_modem_teardown() argument
395 ipa_qmi_teardown(ipa); in ipa_modem_teardown()