Lines Matching refs:endpoint
114 if (data->endpoint.filter_support) { in ipa_endpoint_data_valid_one()
124 if (data->endpoint.config.status_enable) { in ipa_endpoint_data_valid_one()
125 other_name = data->endpoint.config.tx.status_endpoint; in ipa_endpoint_data_valid_one()
153 if (!other_data->endpoint.config.status_enable) { in ipa_endpoint_data_valid_one()
162 if (data->endpoint.config.dma_mode) { in ipa_endpoint_data_valid_one()
163 other_name = data->endpoint.config.dma_endpoint; in ipa_endpoint_data_valid_one()
234 static struct gsi_trans *ipa_endpoint_trans_alloc(struct ipa_endpoint *endpoint, in ipa_endpoint_trans_alloc() argument
237 struct gsi *gsi = &endpoint->ipa->gsi; in ipa_endpoint_trans_alloc()
238 u32 channel_id = endpoint->channel_id; in ipa_endpoint_trans_alloc()
241 direction = endpoint->toward_ipa ? DMA_TO_DEVICE : DMA_FROM_DEVICE; in ipa_endpoint_trans_alloc()
250 ipa_endpoint_init_ctrl(struct ipa_endpoint *endpoint, bool suspend_delay) in ipa_endpoint_init_ctrl() argument
252 u32 offset = IPA_REG_ENDP_INIT_CTRL_N_OFFSET(endpoint->endpoint_id); in ipa_endpoint_init_ctrl()
253 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_init_ctrl()
266 mask = endpoint->toward_ipa ? ENDP_DELAY_FMASK : ENDP_SUSPEND_FMASK; in ipa_endpoint_init_ctrl()
281 ipa_endpoint_program_delay(struct ipa_endpoint *endpoint, bool enable) in ipa_endpoint_program_delay() argument
286 if (endpoint->ipa->version != IPA_VERSION_4_2) in ipa_endpoint_program_delay()
287 (void)ipa_endpoint_init_ctrl(endpoint, enable); in ipa_endpoint_program_delay()
290 static bool ipa_endpoint_aggr_active(struct ipa_endpoint *endpoint) in ipa_endpoint_aggr_active() argument
292 u32 mask = BIT(endpoint->endpoint_id); in ipa_endpoint_aggr_active()
293 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_aggr_active()
304 static void ipa_endpoint_force_close(struct ipa_endpoint *endpoint) in ipa_endpoint_force_close() argument
306 u32 mask = BIT(endpoint->endpoint_id); in ipa_endpoint_force_close()
307 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_force_close()
322 static void ipa_endpoint_suspend_aggr(struct ipa_endpoint *endpoint) in ipa_endpoint_suspend_aggr() argument
324 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_suspend_aggr()
326 if (!endpoint->data->aggregation) in ipa_endpoint_suspend_aggr()
330 if (!ipa_endpoint_aggr_active(endpoint)) in ipa_endpoint_suspend_aggr()
334 ipa_endpoint_force_close(endpoint); in ipa_endpoint_suspend_aggr()
341 ipa_endpoint_program_suspend(struct ipa_endpoint *endpoint, bool enable) in ipa_endpoint_program_suspend() argument
345 if (endpoint->ipa->version != IPA_VERSION_3_5_1) in ipa_endpoint_program_suspend()
350 suspended = ipa_endpoint_init_ctrl(endpoint, enable); in ipa_endpoint_program_suspend()
357 ipa_endpoint_suspend_aggr(endpoint); in ipa_endpoint_program_suspend()
372 struct ipa_endpoint *endpoint = &ipa->endpoint[endpoint_id]; in ipa_endpoint_modem_pause_all() local
374 if (endpoint->ee_id != GSI_EE_MODEM) in ipa_endpoint_modem_pause_all()
378 if (endpoint->toward_ipa) in ipa_endpoint_modem_pause_all()
379 ipa_endpoint_program_delay(endpoint, enable); in ipa_endpoint_modem_pause_all()
381 (void)ipa_endpoint_program_suspend(endpoint, enable); in ipa_endpoint_modem_pause_all()
407 struct ipa_endpoint *endpoint; in ipa_endpoint_modem_exception_reset_all() local
413 endpoint = &ipa->endpoint[endpoint_id]; in ipa_endpoint_modem_exception_reset_all()
414 if (!(endpoint->ee_id == GSI_EE_MODEM && endpoint->toward_ipa)) in ipa_endpoint_modem_exception_reset_all()
434 static void ipa_endpoint_init_cfg(struct ipa_endpoint *endpoint) in ipa_endpoint_init_cfg() argument
436 u32 offset = IPA_REG_ENDP_INIT_CFG_N_OFFSET(endpoint->endpoint_id); in ipa_endpoint_init_cfg()
440 if (endpoint->data->checksum) { in ipa_endpoint_init_cfg()
441 if (endpoint->toward_ipa) { in ipa_endpoint_init_cfg()
461 iowrite32(val, endpoint->ipa->reg_virt + offset); in ipa_endpoint_init_cfg()
485 static void ipa_endpoint_init_hdr(struct ipa_endpoint *endpoint) in ipa_endpoint_init_hdr() argument
487 u32 offset = IPA_REG_ENDP_INIT_HDR_N_OFFSET(endpoint->endpoint_id); in ipa_endpoint_init_hdr()
490 if (endpoint->data->qmap) { in ipa_endpoint_init_hdr()
494 if (endpoint->toward_ipa && endpoint->data->checksum) in ipa_endpoint_init_hdr()
499 if (!endpoint->toward_ipa) { in ipa_endpoint_init_hdr()
520 iowrite32(val, endpoint->ipa->reg_virt + offset); in ipa_endpoint_init_hdr()
523 static void ipa_endpoint_init_hdr_ext(struct ipa_endpoint *endpoint) in ipa_endpoint_init_hdr_ext() argument
525 u32 offset = IPA_REG_ENDP_INIT_HDR_EXT_N_OFFSET(endpoint->endpoint_id); in ipa_endpoint_init_hdr_ext()
526 u32 pad_align = endpoint->data->rx.pad_align; in ipa_endpoint_init_hdr_ext()
537 if (endpoint->data->qmap && !endpoint->toward_ipa) { in ipa_endpoint_init_hdr_ext()
545 if (!endpoint->toward_ipa) in ipa_endpoint_init_hdr_ext()
548 iowrite32(val, endpoint->ipa->reg_virt + offset); in ipa_endpoint_init_hdr_ext()
552 static void ipa_endpoint_init_hdr_metadata_mask(struct ipa_endpoint *endpoint) in ipa_endpoint_init_hdr_metadata_mask() argument
554 u32 endpoint_id = endpoint->endpoint_id; in ipa_endpoint_init_hdr_metadata_mask()
558 if (endpoint->toward_ipa) in ipa_endpoint_init_hdr_metadata_mask()
564 if (endpoint->data->qmap) in ipa_endpoint_init_hdr_metadata_mask()
567 iowrite32(val, endpoint->ipa->reg_virt + offset); in ipa_endpoint_init_hdr_metadata_mask()
570 static void ipa_endpoint_init_mode(struct ipa_endpoint *endpoint) in ipa_endpoint_init_mode() argument
572 u32 offset = IPA_REG_ENDP_INIT_MODE_N_OFFSET(endpoint->endpoint_id); in ipa_endpoint_init_mode()
575 if (!endpoint->toward_ipa) in ipa_endpoint_init_mode()
578 if (endpoint->data->dma_mode) { in ipa_endpoint_init_mode()
579 enum ipa_endpoint_name name = endpoint->data->dma_endpoint; in ipa_endpoint_init_mode()
582 dma_endpoint_id = endpoint->ipa->name_map[name]->endpoint_id; in ipa_endpoint_init_mode()
591 iowrite32(val, endpoint->ipa->reg_virt + offset); in ipa_endpoint_init_mode()
606 static void ipa_endpoint_init_aggr(struct ipa_endpoint *endpoint) in ipa_endpoint_init_aggr() argument
608 u32 offset = IPA_REG_ENDP_INIT_AGGR_N_OFFSET(endpoint->endpoint_id); in ipa_endpoint_init_aggr()
611 if (endpoint->data->aggregation) { in ipa_endpoint_init_aggr()
612 if (!endpoint->toward_ipa) { in ipa_endpoint_init_aggr()
629 if (endpoint->data->rx.aggr_close_eof) in ipa_endpoint_init_aggr()
644 iowrite32(val, endpoint->ipa->reg_virt + offset); in ipa_endpoint_init_aggr()
700 static void ipa_endpoint_init_hol_block_timer(struct ipa_endpoint *endpoint, in ipa_endpoint_init_hol_block_timer() argument
703 u32 endpoint_id = endpoint->endpoint_id; in ipa_endpoint_init_hol_block_timer()
704 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_init_hol_block_timer()
715 ipa_endpoint_init_hol_block_enable(struct ipa_endpoint *endpoint, bool enable) in ipa_endpoint_init_hol_block_enable() argument
717 u32 endpoint_id = endpoint->endpoint_id; in ipa_endpoint_init_hol_block_enable()
723 iowrite32(val, endpoint->ipa->reg_virt + offset); in ipa_endpoint_init_hol_block_enable()
731 struct ipa_endpoint *endpoint = &ipa->endpoint[i]; in ipa_endpoint_modem_hol_block_clear_all() local
733 if (endpoint->toward_ipa || endpoint->ee_id != GSI_EE_MODEM) in ipa_endpoint_modem_hol_block_clear_all()
736 ipa_endpoint_init_hol_block_enable(endpoint, false); in ipa_endpoint_modem_hol_block_clear_all()
737 ipa_endpoint_init_hol_block_timer(endpoint, 0); in ipa_endpoint_modem_hol_block_clear_all()
738 ipa_endpoint_init_hol_block_enable(endpoint, true); in ipa_endpoint_modem_hol_block_clear_all()
742 static void ipa_endpoint_init_deaggr(struct ipa_endpoint *endpoint) in ipa_endpoint_init_deaggr() argument
744 u32 offset = IPA_REG_ENDP_INIT_DEAGGR_N_OFFSET(endpoint->endpoint_id); in ipa_endpoint_init_deaggr()
747 if (!endpoint->toward_ipa) in ipa_endpoint_init_deaggr()
755 iowrite32(val, endpoint->ipa->reg_virt + offset); in ipa_endpoint_init_deaggr()
758 static void ipa_endpoint_init_seq(struct ipa_endpoint *endpoint) in ipa_endpoint_init_seq() argument
760 u32 offset = IPA_REG_ENDP_INIT_SEQ_N_OFFSET(endpoint->endpoint_id); in ipa_endpoint_init_seq()
761 u32 seq_type = endpoint->seq_type; in ipa_endpoint_init_seq()
764 if (!endpoint->toward_ipa) in ipa_endpoint_init_seq()
774 iowrite32(val, endpoint->ipa->reg_virt + offset); in ipa_endpoint_init_seq()
784 int ipa_endpoint_skb_tx(struct ipa_endpoint *endpoint, struct sk_buff *skb) in ipa_endpoint_skb_tx() argument
795 if (1 + nr_frags > endpoint->trans_tre_max) { in ipa_endpoint_skb_tx()
801 trans = ipa_endpoint_trans_alloc(endpoint, 1 + nr_frags); in ipa_endpoint_skb_tx()
820 static void ipa_endpoint_status(struct ipa_endpoint *endpoint) in ipa_endpoint_status() argument
822 u32 endpoint_id = endpoint->endpoint_id; in ipa_endpoint_status()
823 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_status()
829 if (endpoint->data->status_enable) { in ipa_endpoint_status()
831 if (endpoint->toward_ipa) { in ipa_endpoint_status()
835 name = endpoint->data->tx.status_endpoint; in ipa_endpoint_status()
849 static int ipa_endpoint_replenish_one(struct ipa_endpoint *endpoint) in ipa_endpoint_replenish_one() argument
862 trans = ipa_endpoint_trans_alloc(endpoint, 1); in ipa_endpoint_replenish_one()
875 if (++endpoint->replenish_ready == IPA_REPLENISH_BATCH) { in ipa_endpoint_replenish_one()
877 endpoint->replenish_ready = 0; in ipa_endpoint_replenish_one()
901 static void ipa_endpoint_replenish(struct ipa_endpoint *endpoint, u32 count) in ipa_endpoint_replenish() argument
906 if (!test_bit(IPA_REPLENISH_ENABLED, endpoint->replenish_flags)) { in ipa_endpoint_replenish()
908 atomic_add(count, &endpoint->replenish_saved); in ipa_endpoint_replenish()
913 if (test_and_set_bit(IPA_REPLENISH_ACTIVE, endpoint->replenish_flags)) { in ipa_endpoint_replenish()
915 atomic_add(count, &endpoint->replenish_backlog); in ipa_endpoint_replenish()
919 while (atomic_dec_not_zero(&endpoint->replenish_backlog)) in ipa_endpoint_replenish()
920 if (ipa_endpoint_replenish_one(endpoint)) in ipa_endpoint_replenish()
923 clear_bit(IPA_REPLENISH_ACTIVE, endpoint->replenish_flags); in ipa_endpoint_replenish()
926 atomic_add(count, &endpoint->replenish_backlog); in ipa_endpoint_replenish()
931 clear_bit(IPA_REPLENISH_ACTIVE, endpoint->replenish_flags); in ipa_endpoint_replenish()
934 backlog = atomic_add_return(count + 1, &endpoint->replenish_backlog); in ipa_endpoint_replenish()
942 gsi = &endpoint->ipa->gsi; in ipa_endpoint_replenish()
943 if (backlog == gsi_channel_tre_max(gsi, endpoint->channel_id)) in ipa_endpoint_replenish()
944 schedule_delayed_work(&endpoint->replenish_work, in ipa_endpoint_replenish()
948 static void ipa_endpoint_replenish_enable(struct ipa_endpoint *endpoint) in ipa_endpoint_replenish_enable() argument
950 struct gsi *gsi = &endpoint->ipa->gsi; in ipa_endpoint_replenish_enable()
954 set_bit(IPA_REPLENISH_ENABLED, endpoint->replenish_flags); in ipa_endpoint_replenish_enable()
955 while ((saved = atomic_xchg(&endpoint->replenish_saved, 0))) in ipa_endpoint_replenish_enable()
956 atomic_add(saved, &endpoint->replenish_backlog); in ipa_endpoint_replenish_enable()
959 max_backlog = gsi_channel_tre_max(gsi, endpoint->channel_id); in ipa_endpoint_replenish_enable()
960 if (atomic_read(&endpoint->replenish_backlog) == max_backlog) in ipa_endpoint_replenish_enable()
961 ipa_endpoint_replenish(endpoint, 0); in ipa_endpoint_replenish_enable()
964 static void ipa_endpoint_replenish_disable(struct ipa_endpoint *endpoint) in ipa_endpoint_replenish_disable() argument
968 clear_bit(IPA_REPLENISH_ENABLED, endpoint->replenish_flags); in ipa_endpoint_replenish_disable()
969 while ((backlog = atomic_xchg(&endpoint->replenish_backlog, 0))) in ipa_endpoint_replenish_disable()
970 atomic_add(backlog, &endpoint->replenish_saved); in ipa_endpoint_replenish_disable()
976 struct ipa_endpoint *endpoint; in ipa_endpoint_replenish_work() local
978 endpoint = container_of(dwork, struct ipa_endpoint, replenish_work); in ipa_endpoint_replenish_work()
980 ipa_endpoint_replenish(endpoint, 0); in ipa_endpoint_replenish_work()
983 static void ipa_endpoint_skb_copy(struct ipa_endpoint *endpoint, in ipa_endpoint_skb_copy() argument
996 if (endpoint->netdev) in ipa_endpoint_skb_copy()
997 ipa_modem_skb_rx(endpoint->netdev, skb); in ipa_endpoint_skb_copy()
1002 static bool ipa_endpoint_skb_build(struct ipa_endpoint *endpoint, in ipa_endpoint_skb_build() argument
1008 if (!endpoint->netdev) in ipa_endpoint_skb_build()
1020 ipa_modem_skb_rx(endpoint->netdev, skb); in ipa_endpoint_skb_build()
1041 static bool ipa_endpoint_status_skip(struct ipa_endpoint *endpoint, in ipa_endpoint_status_skip() argument
1052 if (endpoint_id != endpoint->endpoint_id) in ipa_endpoint_status_skip()
1073 static void ipa_endpoint_status_parse(struct ipa_endpoint *endpoint, in ipa_endpoint_status_parse() argument
1086 dev_err(&endpoint->ipa->pdev->dev, in ipa_endpoint_status_parse()
1093 if (ipa_endpoint_status_skip(endpoint, status)) { in ipa_endpoint_status_parse()
1106 align = endpoint->data->rx.pad_align ? : 1; in ipa_endpoint_status_parse()
1109 if (endpoint->data->checksum) in ipa_endpoint_status_parse()
1122 ipa_endpoint_skb_copy(endpoint, data2, len2, extra); in ipa_endpoint_status_parse()
1132 static void ipa_endpoint_tx_complete(struct ipa_endpoint *endpoint, in ipa_endpoint_tx_complete() argument
1138 static void ipa_endpoint_rx_complete(struct ipa_endpoint *endpoint, in ipa_endpoint_rx_complete() argument
1143 ipa_endpoint_replenish(endpoint, 1); in ipa_endpoint_rx_complete()
1150 if (endpoint->data->status_enable) in ipa_endpoint_rx_complete()
1151 ipa_endpoint_status_parse(endpoint, page, trans->len); in ipa_endpoint_rx_complete()
1152 else if (ipa_endpoint_skb_build(endpoint, page, trans->len)) in ipa_endpoint_rx_complete()
1156 void ipa_endpoint_trans_complete(struct ipa_endpoint *endpoint, in ipa_endpoint_trans_complete() argument
1159 if (endpoint->toward_ipa) in ipa_endpoint_trans_complete()
1160 ipa_endpoint_tx_complete(endpoint, trans); in ipa_endpoint_trans_complete()
1162 ipa_endpoint_rx_complete(endpoint, trans); in ipa_endpoint_trans_complete()
1165 void ipa_endpoint_trans_release(struct ipa_endpoint *endpoint, in ipa_endpoint_trans_release() argument
1168 if (endpoint->toward_ipa) { in ipa_endpoint_trans_release()
1169 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_trans_release()
1172 if (endpoint != ipa->name_map[IPA_ENDPOINT_AP_COMMAND_TX]) { in ipa_endpoint_trans_release()
1215 static int ipa_endpoint_reset_rx_aggr(struct ipa_endpoint *endpoint) in ipa_endpoint_reset_rx_aggr() argument
1217 struct device *dev = &endpoint->ipa->pdev->dev; in ipa_endpoint_reset_rx_aggr()
1218 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_reset_rx_aggr()
1239 ipa_endpoint_force_close(endpoint); in ipa_endpoint_reset_rx_aggr()
1246 gsi_channel_reset(gsi, endpoint->channel_id, false); in ipa_endpoint_reset_rx_aggr()
1249 suspended = ipa_endpoint_program_suspend(endpoint, false); in ipa_endpoint_reset_rx_aggr()
1252 ret = gsi_channel_start(gsi, endpoint->channel_id); in ipa_endpoint_reset_rx_aggr()
1256 ret = gsi_trans_read_byte(gsi, endpoint->channel_id, addr); in ipa_endpoint_reset_rx_aggr()
1263 if (!ipa_endpoint_aggr_active(endpoint)) in ipa_endpoint_reset_rx_aggr()
1269 if (ipa_endpoint_aggr_active(endpoint)) in ipa_endpoint_reset_rx_aggr()
1271 endpoint->endpoint_id); in ipa_endpoint_reset_rx_aggr()
1273 gsi_trans_read_byte_done(gsi, endpoint->channel_id); in ipa_endpoint_reset_rx_aggr()
1275 ret = gsi_channel_stop(gsi, endpoint->channel_id); in ipa_endpoint_reset_rx_aggr()
1285 gsi_channel_reset(gsi, endpoint->channel_id, legacy); in ipa_endpoint_reset_rx_aggr()
1292 (void)gsi_channel_stop(gsi, endpoint->channel_id); in ipa_endpoint_reset_rx_aggr()
1295 (void)ipa_endpoint_program_suspend(endpoint, true); in ipa_endpoint_reset_rx_aggr()
1303 static void ipa_endpoint_reset(struct ipa_endpoint *endpoint) in ipa_endpoint_reset() argument
1305 u32 channel_id = endpoint->channel_id; in ipa_endpoint_reset()
1306 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_reset()
1318 special = !endpoint->toward_ipa && endpoint->data->aggregation; in ipa_endpoint_reset()
1319 if (special && ipa_endpoint_aggr_active(endpoint)) in ipa_endpoint_reset()
1320 ret = ipa_endpoint_reset_rx_aggr(endpoint); in ipa_endpoint_reset()
1327 ret, endpoint->channel_id, endpoint->endpoint_id); in ipa_endpoint_reset()
1330 static void ipa_endpoint_program(struct ipa_endpoint *endpoint) in ipa_endpoint_program() argument
1332 if (endpoint->toward_ipa) in ipa_endpoint_program()
1333 ipa_endpoint_program_delay(endpoint, false); in ipa_endpoint_program()
1335 (void)ipa_endpoint_program_suspend(endpoint, false); in ipa_endpoint_program()
1336 ipa_endpoint_init_cfg(endpoint); in ipa_endpoint_program()
1337 ipa_endpoint_init_hdr(endpoint); in ipa_endpoint_program()
1338 ipa_endpoint_init_hdr_ext(endpoint); in ipa_endpoint_program()
1339 ipa_endpoint_init_hdr_metadata_mask(endpoint); in ipa_endpoint_program()
1340 ipa_endpoint_init_mode(endpoint); in ipa_endpoint_program()
1341 ipa_endpoint_init_aggr(endpoint); in ipa_endpoint_program()
1342 ipa_endpoint_init_deaggr(endpoint); in ipa_endpoint_program()
1343 ipa_endpoint_init_seq(endpoint); in ipa_endpoint_program()
1344 ipa_endpoint_status(endpoint); in ipa_endpoint_program()
1347 int ipa_endpoint_enable_one(struct ipa_endpoint *endpoint) in ipa_endpoint_enable_one() argument
1349 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_enable_one()
1353 ret = gsi_channel_start(gsi, endpoint->channel_id); in ipa_endpoint_enable_one()
1357 ret, endpoint->toward_ipa ? 'T' : 'R', in ipa_endpoint_enable_one()
1358 endpoint->channel_id, endpoint->endpoint_id); in ipa_endpoint_enable_one()
1362 if (!endpoint->toward_ipa) { in ipa_endpoint_enable_one()
1364 endpoint->endpoint_id); in ipa_endpoint_enable_one()
1365 ipa_endpoint_replenish_enable(endpoint); in ipa_endpoint_enable_one()
1368 ipa->enabled |= BIT(endpoint->endpoint_id); in ipa_endpoint_enable_one()
1373 void ipa_endpoint_disable_one(struct ipa_endpoint *endpoint) in ipa_endpoint_disable_one() argument
1375 u32 mask = BIT(endpoint->endpoint_id); in ipa_endpoint_disable_one()
1376 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_disable_one()
1385 if (!endpoint->toward_ipa) { in ipa_endpoint_disable_one()
1386 ipa_endpoint_replenish_disable(endpoint); in ipa_endpoint_disable_one()
1388 endpoint->endpoint_id); in ipa_endpoint_disable_one()
1392 ret = gsi_channel_stop(gsi, endpoint->channel_id); in ipa_endpoint_disable_one()
1396 endpoint->endpoint_id); in ipa_endpoint_disable_one()
1399 void ipa_endpoint_suspend_one(struct ipa_endpoint *endpoint) in ipa_endpoint_suspend_one() argument
1401 struct device *dev = &endpoint->ipa->pdev->dev; in ipa_endpoint_suspend_one()
1402 struct gsi *gsi = &endpoint->ipa->gsi; in ipa_endpoint_suspend_one()
1406 if (!(endpoint->ipa->enabled & BIT(endpoint->endpoint_id))) in ipa_endpoint_suspend_one()
1409 if (!endpoint->toward_ipa) { in ipa_endpoint_suspend_one()
1410 ipa_endpoint_replenish_disable(endpoint); in ipa_endpoint_suspend_one()
1411 (void)ipa_endpoint_program_suspend(endpoint, true); in ipa_endpoint_suspend_one()
1415 stop_channel = endpoint->ipa->version != IPA_VERSION_3_5_1; in ipa_endpoint_suspend_one()
1416 ret = gsi_channel_suspend(gsi, endpoint->channel_id, stop_channel); in ipa_endpoint_suspend_one()
1419 endpoint->channel_id); in ipa_endpoint_suspend_one()
1422 void ipa_endpoint_resume_one(struct ipa_endpoint *endpoint) in ipa_endpoint_resume_one() argument
1424 struct device *dev = &endpoint->ipa->pdev->dev; in ipa_endpoint_resume_one()
1425 struct gsi *gsi = &endpoint->ipa->gsi; in ipa_endpoint_resume_one()
1429 if (!(endpoint->ipa->enabled & BIT(endpoint->endpoint_id))) in ipa_endpoint_resume_one()
1432 if (!endpoint->toward_ipa) in ipa_endpoint_resume_one()
1433 (void)ipa_endpoint_program_suspend(endpoint, false); in ipa_endpoint_resume_one()
1436 start_channel = endpoint->ipa->version != IPA_VERSION_3_5_1; in ipa_endpoint_resume_one()
1437 ret = gsi_channel_resume(gsi, endpoint->channel_id, start_channel); in ipa_endpoint_resume_one()
1440 endpoint->channel_id); in ipa_endpoint_resume_one()
1441 else if (!endpoint->toward_ipa) in ipa_endpoint_resume_one()
1442 ipa_endpoint_replenish_enable(endpoint); in ipa_endpoint_resume_one()
1471 static void ipa_endpoint_setup_one(struct ipa_endpoint *endpoint) in ipa_endpoint_setup_one() argument
1473 struct gsi *gsi = &endpoint->ipa->gsi; in ipa_endpoint_setup_one()
1474 u32 channel_id = endpoint->channel_id; in ipa_endpoint_setup_one()
1477 if (endpoint->ee_id != GSI_EE_AP) in ipa_endpoint_setup_one()
1480 endpoint->trans_tre_max = gsi_channel_trans_tre_max(gsi, channel_id); in ipa_endpoint_setup_one()
1481 if (!endpoint->toward_ipa) { in ipa_endpoint_setup_one()
1485 clear_bit(IPA_REPLENISH_ENABLED, endpoint->replenish_flags); in ipa_endpoint_setup_one()
1486 clear_bit(IPA_REPLENISH_ACTIVE, endpoint->replenish_flags); in ipa_endpoint_setup_one()
1487 atomic_set(&endpoint->replenish_saved, in ipa_endpoint_setup_one()
1488 gsi_channel_tre_max(gsi, endpoint->channel_id)); in ipa_endpoint_setup_one()
1489 atomic_set(&endpoint->replenish_backlog, 0); in ipa_endpoint_setup_one()
1490 INIT_DELAYED_WORK(&endpoint->replenish_work, in ipa_endpoint_setup_one()
1494 ipa_endpoint_program(endpoint); in ipa_endpoint_setup_one()
1496 endpoint->ipa->set_up |= BIT(endpoint->endpoint_id); in ipa_endpoint_setup_one()
1499 static void ipa_endpoint_teardown_one(struct ipa_endpoint *endpoint) in ipa_endpoint_teardown_one() argument
1501 endpoint->ipa->set_up &= ~BIT(endpoint->endpoint_id); in ipa_endpoint_teardown_one()
1503 if (!endpoint->toward_ipa) in ipa_endpoint_teardown_one()
1504 cancel_delayed_work_sync(&endpoint->replenish_work); in ipa_endpoint_teardown_one()
1506 ipa_endpoint_reset(endpoint); in ipa_endpoint_teardown_one()
1519 ipa_endpoint_setup_one(&ipa->endpoint[endpoint_id]); in ipa_endpoint_setup()
1532 ipa_endpoint_teardown_one(&ipa->endpoint[endpoint_id]); in ipa_endpoint_teardown()
1579 struct ipa_endpoint *endpoint; in ipa_endpoint_config() local
1584 endpoint = &ipa->endpoint[endpoint_id]; in ipa_endpoint_config()
1585 if ((endpoint_id < rx_base) != !!endpoint->toward_ipa) { in ipa_endpoint_config()
1603 struct ipa_endpoint *endpoint; in ipa_endpoint_init_one() local
1605 endpoint = &ipa->endpoint[data->endpoint_id]; in ipa_endpoint_init_one()
1608 ipa->channel_map[data->channel_id] = endpoint; in ipa_endpoint_init_one()
1609 ipa->name_map[name] = endpoint; in ipa_endpoint_init_one()
1611 endpoint->ipa = ipa; in ipa_endpoint_init_one()
1612 endpoint->ee_id = data->ee_id; in ipa_endpoint_init_one()
1613 endpoint->seq_type = data->endpoint.seq_type; in ipa_endpoint_init_one()
1614 endpoint->channel_id = data->channel_id; in ipa_endpoint_init_one()
1615 endpoint->endpoint_id = data->endpoint_id; in ipa_endpoint_init_one()
1616 endpoint->toward_ipa = data->toward_ipa; in ipa_endpoint_init_one()
1617 endpoint->data = &data->endpoint.config; in ipa_endpoint_init_one()
1619 ipa->initialized |= BIT(endpoint->endpoint_id); in ipa_endpoint_init_one()
1622 void ipa_endpoint_exit_one(struct ipa_endpoint *endpoint) in ipa_endpoint_exit_one() argument
1624 endpoint->ipa->initialized &= ~BIT(endpoint->endpoint_id); in ipa_endpoint_exit_one()
1626 memset(endpoint, 0, sizeof(*endpoint)); in ipa_endpoint_exit_one()
1638 ipa_endpoint_exit_one(&ipa->endpoint[endpoint_id]); in ipa_endpoint_exit()
1663 if (data->endpoint.filter_support) in ipa_endpoint_init()