Lines Matching refs:endpoint
249 if (data->endpoint.filter_support) { in ipa_endpoint_data_valid_one()
260 rx_config = &data->endpoint.config.rx; in ipa_endpoint_data_valid_one()
271 if (!data->endpoint.config.aggregation) { in ipa_endpoint_data_valid_one()
320 if (data->endpoint.config.tx.seq_rep_type) { in ipa_endpoint_data_valid_one()
327 if (data->endpoint.config.status_enable) { in ipa_endpoint_data_valid_one()
328 other_name = data->endpoint.config.tx.status_endpoint; in ipa_endpoint_data_valid_one()
356 if (!other_data->endpoint.config.status_enable) { in ipa_endpoint_data_valid_one()
365 if (data->endpoint.config.dma_mode) { in ipa_endpoint_data_valid_one()
366 other_name = data->endpoint.config.dma_endpoint; in ipa_endpoint_data_valid_one()
430 static struct gsi_trans *ipa_endpoint_trans_alloc(struct ipa_endpoint *endpoint, in ipa_endpoint_trans_alloc() argument
433 struct gsi *gsi = &endpoint->ipa->gsi; in ipa_endpoint_trans_alloc()
434 u32 channel_id = endpoint->channel_id; in ipa_endpoint_trans_alloc()
437 direction = endpoint->toward_ipa ? DMA_TO_DEVICE : DMA_FROM_DEVICE; in ipa_endpoint_trans_alloc()
447 ipa_endpoint_init_ctrl(struct ipa_endpoint *endpoint, bool suspend_delay) in ipa_endpoint_init_ctrl() argument
449 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_init_ctrl()
457 if (endpoint->toward_ipa) in ipa_endpoint_init_ctrl()
463 offset = reg_n_offset(reg, endpoint->endpoint_id); in ipa_endpoint_init_ctrl()
466 field_id = endpoint->toward_ipa ? ENDP_DELAY : ENDP_SUSPEND; in ipa_endpoint_init_ctrl()
482 ipa_endpoint_program_delay(struct ipa_endpoint *endpoint, bool enable) in ipa_endpoint_program_delay() argument
485 WARN_ON(endpoint->ipa->version >= IPA_VERSION_4_2); in ipa_endpoint_program_delay()
486 WARN_ON(!endpoint->toward_ipa); in ipa_endpoint_program_delay()
488 (void)ipa_endpoint_init_ctrl(endpoint, enable); in ipa_endpoint_program_delay()
491 static bool ipa_endpoint_aggr_active(struct ipa_endpoint *endpoint) in ipa_endpoint_aggr_active() argument
493 u32 endpoint_id = endpoint->endpoint_id; in ipa_endpoint_aggr_active()
494 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_aggr_active()
507 static void ipa_endpoint_force_close(struct ipa_endpoint *endpoint) in ipa_endpoint_force_close() argument
509 u32 endpoint_id = endpoint->endpoint_id; in ipa_endpoint_force_close()
511 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_force_close()
530 static void ipa_endpoint_suspend_aggr(struct ipa_endpoint *endpoint) in ipa_endpoint_suspend_aggr() argument
532 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_suspend_aggr()
534 if (!endpoint->config.aggregation) in ipa_endpoint_suspend_aggr()
538 if (!ipa_endpoint_aggr_active(endpoint)) in ipa_endpoint_suspend_aggr()
542 ipa_endpoint_force_close(endpoint); in ipa_endpoint_suspend_aggr()
549 ipa_endpoint_program_suspend(struct ipa_endpoint *endpoint, bool enable) in ipa_endpoint_program_suspend() argument
553 if (endpoint->ipa->version >= IPA_VERSION_4_0) in ipa_endpoint_program_suspend()
556 WARN_ON(endpoint->toward_ipa); in ipa_endpoint_program_suspend()
558 suspended = ipa_endpoint_init_ctrl(endpoint, enable); in ipa_endpoint_program_suspend()
565 ipa_endpoint_suspend_aggr(endpoint); in ipa_endpoint_program_suspend()
580 struct ipa_endpoint *endpoint = &ipa->endpoint[endpoint_id++]; in ipa_endpoint_modem_pause_all() local
582 if (endpoint->ee_id != GSI_EE_MODEM) in ipa_endpoint_modem_pause_all()
585 if (!endpoint->toward_ipa) in ipa_endpoint_modem_pause_all()
586 (void)ipa_endpoint_program_suspend(endpoint, enable); in ipa_endpoint_modem_pause_all()
588 ipa_endpoint_program_delay(endpoint, enable); in ipa_endpoint_modem_pause_all()
591 endpoint->channel_id, in ipa_endpoint_modem_pause_all()
615 struct ipa_endpoint *endpoint; in ipa_endpoint_modem_exception_reset_all() local
620 endpoint = &ipa->endpoint[endpoint_id]; in ipa_endpoint_modem_exception_reset_all()
621 if (!(endpoint->ee_id == GSI_EE_MODEM && endpoint->toward_ipa)) in ipa_endpoint_modem_exception_reset_all()
643 static void ipa_endpoint_init_cfg(struct ipa_endpoint *endpoint) in ipa_endpoint_init_cfg() argument
645 u32 endpoint_id = endpoint->endpoint_id; in ipa_endpoint_init_cfg()
646 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_init_cfg()
653 if (endpoint->config.checksum) { in ipa_endpoint_init_cfg()
656 if (endpoint->toward_ipa) { in ipa_endpoint_init_cfg()
680 static void ipa_endpoint_init_nat(struct ipa_endpoint *endpoint) in ipa_endpoint_init_nat() argument
682 u32 endpoint_id = endpoint->endpoint_id; in ipa_endpoint_init_nat()
683 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_init_nat()
687 if (!endpoint->toward_ipa) in ipa_endpoint_init_nat()
697 ipa_qmap_header_size(enum ipa_version version, struct ipa_endpoint *endpoint) in ipa_qmap_header_size() argument
702 if (!endpoint->config.checksum) in ipa_qmap_header_size()
707 if (endpoint->toward_ipa) in ipa_qmap_header_size()
782 static void ipa_endpoint_init_hdr(struct ipa_endpoint *endpoint) in ipa_endpoint_init_hdr() argument
784 u32 endpoint_id = endpoint->endpoint_id; in ipa_endpoint_init_hdr()
785 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_init_hdr()
790 if (endpoint->config.qmap) { in ipa_endpoint_init_hdr()
794 header_size = ipa_qmap_header_size(version, endpoint); in ipa_endpoint_init_hdr()
798 if (!endpoint->toward_ipa) { in ipa_endpoint_init_hdr()
826 static void ipa_endpoint_init_hdr_ext(struct ipa_endpoint *endpoint) in ipa_endpoint_init_hdr_ext() argument
828 u32 pad_align = endpoint->config.rx.pad_align; in ipa_endpoint_init_hdr_ext()
829 u32 endpoint_id = endpoint->endpoint_id; in ipa_endpoint_init_hdr_ext()
830 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_init_hdr_ext()
835 if (endpoint->config.qmap) { in ipa_endpoint_init_hdr_ext()
846 if (!endpoint->toward_ipa) { in ipa_endpoint_init_hdr_ext()
855 if (!endpoint->toward_ipa) in ipa_endpoint_init_hdr_ext()
863 if (endpoint->config.qmap && !endpoint->toward_ipa) { in ipa_endpoint_init_hdr_ext()
878 static void ipa_endpoint_init_hdr_metadata_mask(struct ipa_endpoint *endpoint) in ipa_endpoint_init_hdr_metadata_mask() argument
880 u32 endpoint_id = endpoint->endpoint_id; in ipa_endpoint_init_hdr_metadata_mask()
881 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_init_hdr_metadata_mask()
886 if (endpoint->toward_ipa) in ipa_endpoint_init_hdr_metadata_mask()
893 if (endpoint->config.qmap) in ipa_endpoint_init_hdr_metadata_mask()
899 static void ipa_endpoint_init_mode(struct ipa_endpoint *endpoint) in ipa_endpoint_init_mode() argument
901 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_init_mode()
906 if (!endpoint->toward_ipa) in ipa_endpoint_init_mode()
910 if (endpoint->config.dma_mode) { in ipa_endpoint_init_mode()
911 enum ipa_endpoint_name name = endpoint->config.dma_endpoint; in ipa_endpoint_init_mode()
921 offset = reg_n_offset(reg, endpoint->endpoint_id); in ipa_endpoint_init_mode()
993 static void ipa_endpoint_init_aggr(struct ipa_endpoint *endpoint) in ipa_endpoint_init_aggr() argument
995 u32 endpoint_id = endpoint->endpoint_id; in ipa_endpoint_init_aggr()
996 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_init_aggr()
1001 if (endpoint->config.aggregation) { in ipa_endpoint_init_aggr()
1002 if (!endpoint->toward_ipa) { in ipa_endpoint_init_aggr()
1007 rx_config = &endpoint->config.rx; in ipa_endpoint_init_aggr()
1107 static void ipa_endpoint_init_hol_block_timer(struct ipa_endpoint *endpoint, in ipa_endpoint_init_hol_block_timer() argument
1110 u32 endpoint_id = endpoint->endpoint_id; in ipa_endpoint_init_hol_block_timer()
1111 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_init_hol_block_timer()
1123 ipa_endpoint_init_hol_block_en(struct ipa_endpoint *endpoint, bool enable) in ipa_endpoint_init_hol_block_en() argument
1125 u32 endpoint_id = endpoint->endpoint_id; in ipa_endpoint_init_hol_block_en()
1126 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_init_hol_block_en()
1143 static void ipa_endpoint_init_hol_block_enable(struct ipa_endpoint *endpoint, in ipa_endpoint_init_hol_block_enable() argument
1146 ipa_endpoint_init_hol_block_timer(endpoint, microseconds); in ipa_endpoint_init_hol_block_enable()
1147 ipa_endpoint_init_hol_block_en(endpoint, true); in ipa_endpoint_init_hol_block_enable()
1150 static void ipa_endpoint_init_hol_block_disable(struct ipa_endpoint *endpoint) in ipa_endpoint_init_hol_block_disable() argument
1152 ipa_endpoint_init_hol_block_en(endpoint, false); in ipa_endpoint_init_hol_block_disable()
1160 struct ipa_endpoint *endpoint = &ipa->endpoint[endpoint_id++]; in ipa_endpoint_modem_hol_block_clear_all() local
1162 if (endpoint->toward_ipa || endpoint->ee_id != GSI_EE_MODEM) in ipa_endpoint_modem_hol_block_clear_all()
1165 ipa_endpoint_init_hol_block_disable(endpoint); in ipa_endpoint_modem_hol_block_clear_all()
1166 ipa_endpoint_init_hol_block_enable(endpoint, 0); in ipa_endpoint_modem_hol_block_clear_all()
1170 static void ipa_endpoint_init_deaggr(struct ipa_endpoint *endpoint) in ipa_endpoint_init_deaggr() argument
1172 u32 endpoint_id = endpoint->endpoint_id; in ipa_endpoint_init_deaggr()
1173 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_init_deaggr()
1177 if (!endpoint->toward_ipa) in ipa_endpoint_init_deaggr()
1189 static void ipa_endpoint_init_rsrc_grp(struct ipa_endpoint *endpoint) in ipa_endpoint_init_rsrc_grp() argument
1191 u32 resource_group = endpoint->config.resource_group; in ipa_endpoint_init_rsrc_grp()
1192 u32 endpoint_id = endpoint->endpoint_id; in ipa_endpoint_init_rsrc_grp()
1193 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_init_rsrc_grp()
1203 static void ipa_endpoint_init_seq(struct ipa_endpoint *endpoint) in ipa_endpoint_init_seq() argument
1205 u32 endpoint_id = endpoint->endpoint_id; in ipa_endpoint_init_seq()
1206 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_init_seq()
1210 if (!endpoint->toward_ipa) in ipa_endpoint_init_seq()
1216 val = reg_encode(reg, SEQ_TYPE, endpoint->config.tx.seq_type); in ipa_endpoint_init_seq()
1221 endpoint->config.tx.seq_rep_type); in ipa_endpoint_init_seq()
1233 int ipa_endpoint_skb_tx(struct ipa_endpoint *endpoint, struct sk_buff *skb) in ipa_endpoint_skb_tx() argument
1244 if (nr_frags > endpoint->skb_frag_max) { in ipa_endpoint_skb_tx()
1250 trans = ipa_endpoint_trans_alloc(endpoint, 1 + nr_frags); in ipa_endpoint_skb_tx()
1269 static void ipa_endpoint_status(struct ipa_endpoint *endpoint) in ipa_endpoint_status() argument
1271 u32 endpoint_id = endpoint->endpoint_id; in ipa_endpoint_status()
1272 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_status()
1277 if (endpoint->config.status_enable) { in ipa_endpoint_status()
1279 if (endpoint->toward_ipa) { in ipa_endpoint_status()
1283 name = endpoint->config.tx.status_endpoint; in ipa_endpoint_status()
1297 static int ipa_endpoint_replenish_one(struct ipa_endpoint *endpoint, in ipa_endpoint_replenish_one() argument
1306 buffer_size = endpoint->config.rx.buffer_size; in ipa_endpoint_replenish_one()
1335 static void ipa_endpoint_replenish(struct ipa_endpoint *endpoint) in ipa_endpoint_replenish() argument
1339 if (!test_bit(IPA_REPLENISH_ENABLED, endpoint->replenish_flags)) in ipa_endpoint_replenish()
1343 if (test_and_set_bit(IPA_REPLENISH_ACTIVE, endpoint->replenish_flags)) in ipa_endpoint_replenish()
1346 while ((trans = ipa_endpoint_trans_alloc(endpoint, 1))) { in ipa_endpoint_replenish()
1349 if (ipa_endpoint_replenish_one(endpoint, trans)) in ipa_endpoint_replenish()
1354 doorbell = !(++endpoint->replenish_count % IPA_REPLENISH_BATCH); in ipa_endpoint_replenish()
1358 clear_bit(IPA_REPLENISH_ACTIVE, endpoint->replenish_flags); in ipa_endpoint_replenish()
1364 clear_bit(IPA_REPLENISH_ACTIVE, endpoint->replenish_flags); in ipa_endpoint_replenish()
1372 if (gsi_channel_trans_idle(&endpoint->ipa->gsi, endpoint->channel_id)) in ipa_endpoint_replenish()
1373 schedule_delayed_work(&endpoint->replenish_work, in ipa_endpoint_replenish()
1377 static void ipa_endpoint_replenish_enable(struct ipa_endpoint *endpoint) in ipa_endpoint_replenish_enable() argument
1379 set_bit(IPA_REPLENISH_ENABLED, endpoint->replenish_flags); in ipa_endpoint_replenish_enable()
1382 if (gsi_channel_trans_idle(&endpoint->ipa->gsi, endpoint->channel_id)) in ipa_endpoint_replenish_enable()
1383 ipa_endpoint_replenish(endpoint); in ipa_endpoint_replenish_enable()
1386 static void ipa_endpoint_replenish_disable(struct ipa_endpoint *endpoint) in ipa_endpoint_replenish_disable() argument
1388 clear_bit(IPA_REPLENISH_ENABLED, endpoint->replenish_flags); in ipa_endpoint_replenish_disable()
1394 struct ipa_endpoint *endpoint; in ipa_endpoint_replenish_work() local
1396 endpoint = container_of(dwork, struct ipa_endpoint, replenish_work); in ipa_endpoint_replenish_work()
1398 ipa_endpoint_replenish(endpoint); in ipa_endpoint_replenish_work()
1401 static void ipa_endpoint_skb_copy(struct ipa_endpoint *endpoint, in ipa_endpoint_skb_copy() argument
1406 if (!endpoint->netdev) in ipa_endpoint_skb_copy()
1417 ipa_modem_skb_rx(endpoint->netdev, skb); in ipa_endpoint_skb_copy()
1420 static bool ipa_endpoint_skb_build(struct ipa_endpoint *endpoint, in ipa_endpoint_skb_build() argument
1423 u32 buffer_size = endpoint->config.rx.buffer_size; in ipa_endpoint_skb_build()
1427 if (!endpoint->netdev) in ipa_endpoint_skb_build()
1440 ipa_modem_skb_rx(endpoint->netdev, skb); in ipa_endpoint_skb_build()
1462 ipa_endpoint_status_skip(struct ipa_endpoint *endpoint, const void *data) in ipa_endpoint_status_skip() argument
1464 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_status_skip()
1473 if (endpoint_id != endpoint->endpoint_id) in ipa_endpoint_status_skip()
1480 ipa_endpoint_status_tag_valid(struct ipa_endpoint *endpoint, const void *data) in ipa_endpoint_status_tag_valid() argument
1484 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_status_tag_valid()
1511 ipa_endpoint_status_drop(struct ipa_endpoint *endpoint, const void *data) in ipa_endpoint_status_drop() argument
1514 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_status_drop()
1518 if (ipa_endpoint_status_tag_valid(endpoint, data)) in ipa_endpoint_status_drop()
1532 static void ipa_endpoint_status_parse(struct ipa_endpoint *endpoint, in ipa_endpoint_status_parse() argument
1535 u32 buffer_size = endpoint->config.rx.buffer_size; in ipa_endpoint_status_parse()
1538 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_status_parse()
1547 dev_err(&endpoint->ipa->pdev->dev, in ipa_endpoint_status_parse()
1555 if (!length || ipa_endpoint_status_skip(endpoint, data)) { in ipa_endpoint_status_parse()
1567 align = endpoint->config.rx.pad_align ? : 1; in ipa_endpoint_status_parse()
1569 if (endpoint->config.checksum) in ipa_endpoint_status_parse()
1572 if (!ipa_endpoint_status_drop(endpoint, data)) { in ipa_endpoint_status_parse()
1585 ipa_endpoint_skb_copy(endpoint, data2, length, extra); in ipa_endpoint_status_parse()
1594 void ipa_endpoint_trans_complete(struct ipa_endpoint *endpoint, in ipa_endpoint_trans_complete() argument
1599 if (endpoint->toward_ipa) in ipa_endpoint_trans_complete()
1607 if (endpoint->config.status_enable) in ipa_endpoint_trans_complete()
1608 ipa_endpoint_status_parse(endpoint, page, trans->len); in ipa_endpoint_trans_complete()
1609 else if (ipa_endpoint_skb_build(endpoint, page, trans->len)) in ipa_endpoint_trans_complete()
1612 ipa_endpoint_replenish(endpoint); in ipa_endpoint_trans_complete()
1615 void ipa_endpoint_trans_release(struct ipa_endpoint *endpoint, in ipa_endpoint_trans_release() argument
1618 if (endpoint->toward_ipa) { in ipa_endpoint_trans_release()
1619 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_trans_release()
1622 if (endpoint != ipa->name_map[IPA_ENDPOINT_AP_COMMAND_TX]) { in ipa_endpoint_trans_release()
1667 static int ipa_endpoint_reset_rx_aggr(struct ipa_endpoint *endpoint) in ipa_endpoint_reset_rx_aggr() argument
1669 struct device *dev = &endpoint->ipa->pdev->dev; in ipa_endpoint_reset_rx_aggr()
1670 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_reset_rx_aggr()
1690 ipa_endpoint_force_close(endpoint); in ipa_endpoint_reset_rx_aggr()
1697 gsi_channel_reset(gsi, endpoint->channel_id, false); in ipa_endpoint_reset_rx_aggr()
1700 suspended = ipa_endpoint_program_suspend(endpoint, false); in ipa_endpoint_reset_rx_aggr()
1703 ret = gsi_channel_start(gsi, endpoint->channel_id); in ipa_endpoint_reset_rx_aggr()
1707 ret = gsi_trans_read_byte(gsi, endpoint->channel_id, addr); in ipa_endpoint_reset_rx_aggr()
1714 if (!ipa_endpoint_aggr_active(endpoint)) in ipa_endpoint_reset_rx_aggr()
1720 if (ipa_endpoint_aggr_active(endpoint)) in ipa_endpoint_reset_rx_aggr()
1722 endpoint->endpoint_id); in ipa_endpoint_reset_rx_aggr()
1724 gsi_trans_read_byte_done(gsi, endpoint->channel_id); in ipa_endpoint_reset_rx_aggr()
1726 ret = gsi_channel_stop(gsi, endpoint->channel_id); in ipa_endpoint_reset_rx_aggr()
1735 gsi_channel_reset(gsi, endpoint->channel_id, true); in ipa_endpoint_reset_rx_aggr()
1742 (void)gsi_channel_stop(gsi, endpoint->channel_id); in ipa_endpoint_reset_rx_aggr()
1745 (void)ipa_endpoint_program_suspend(endpoint, true); in ipa_endpoint_reset_rx_aggr()
1753 static void ipa_endpoint_reset(struct ipa_endpoint *endpoint) in ipa_endpoint_reset() argument
1755 u32 channel_id = endpoint->channel_id; in ipa_endpoint_reset()
1756 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_reset()
1764 special = ipa->version < IPA_VERSION_4_0 && !endpoint->toward_ipa && in ipa_endpoint_reset()
1765 endpoint->config.aggregation; in ipa_endpoint_reset()
1766 if (special && ipa_endpoint_aggr_active(endpoint)) in ipa_endpoint_reset()
1767 ret = ipa_endpoint_reset_rx_aggr(endpoint); in ipa_endpoint_reset()
1774 ret, endpoint->channel_id, endpoint->endpoint_id); in ipa_endpoint_reset()
1777 static void ipa_endpoint_program(struct ipa_endpoint *endpoint) in ipa_endpoint_program() argument
1779 if (endpoint->toward_ipa) { in ipa_endpoint_program()
1786 if (endpoint->ipa->version < IPA_VERSION_4_2) in ipa_endpoint_program()
1787 ipa_endpoint_program_delay(endpoint, false); in ipa_endpoint_program()
1790 (void)ipa_endpoint_program_suspend(endpoint, false); in ipa_endpoint_program()
1792 ipa_endpoint_init_cfg(endpoint); in ipa_endpoint_program()
1793 ipa_endpoint_init_nat(endpoint); in ipa_endpoint_program()
1794 ipa_endpoint_init_hdr(endpoint); in ipa_endpoint_program()
1795 ipa_endpoint_init_hdr_ext(endpoint); in ipa_endpoint_program()
1796 ipa_endpoint_init_hdr_metadata_mask(endpoint); in ipa_endpoint_program()
1797 ipa_endpoint_init_mode(endpoint); in ipa_endpoint_program()
1798 ipa_endpoint_init_aggr(endpoint); in ipa_endpoint_program()
1799 if (!endpoint->toward_ipa) { in ipa_endpoint_program()
1800 if (endpoint->config.rx.holb_drop) in ipa_endpoint_program()
1801 ipa_endpoint_init_hol_block_enable(endpoint, 0); in ipa_endpoint_program()
1803 ipa_endpoint_init_hol_block_disable(endpoint); in ipa_endpoint_program()
1805 ipa_endpoint_init_deaggr(endpoint); in ipa_endpoint_program()
1806 ipa_endpoint_init_rsrc_grp(endpoint); in ipa_endpoint_program()
1807 ipa_endpoint_init_seq(endpoint); in ipa_endpoint_program()
1808 ipa_endpoint_status(endpoint); in ipa_endpoint_program()
1811 int ipa_endpoint_enable_one(struct ipa_endpoint *endpoint) in ipa_endpoint_enable_one() argument
1813 u32 endpoint_id = endpoint->endpoint_id; in ipa_endpoint_enable_one()
1814 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_enable_one()
1818 ret = gsi_channel_start(gsi, endpoint->channel_id); in ipa_endpoint_enable_one()
1822 ret, endpoint->toward_ipa ? 'T' : 'R', in ipa_endpoint_enable_one()
1823 endpoint->channel_id, endpoint_id); in ipa_endpoint_enable_one()
1827 if (!endpoint->toward_ipa) { in ipa_endpoint_enable_one()
1829 ipa_endpoint_replenish_enable(endpoint); in ipa_endpoint_enable_one()
1837 void ipa_endpoint_disable_one(struct ipa_endpoint *endpoint) in ipa_endpoint_disable_one() argument
1839 u32 endpoint_id = endpoint->endpoint_id; in ipa_endpoint_disable_one()
1840 struct ipa *ipa = endpoint->ipa; in ipa_endpoint_disable_one()
1847 __clear_bit(endpoint_id, endpoint->ipa->enabled); in ipa_endpoint_disable_one()
1849 if (!endpoint->toward_ipa) { in ipa_endpoint_disable_one()
1850 ipa_endpoint_replenish_disable(endpoint); in ipa_endpoint_disable_one()
1855 ret = gsi_channel_stop(gsi, endpoint->channel_id); in ipa_endpoint_disable_one()
1862 void ipa_endpoint_suspend_one(struct ipa_endpoint *endpoint) in ipa_endpoint_suspend_one() argument
1864 struct device *dev = &endpoint->ipa->pdev->dev; in ipa_endpoint_suspend_one()
1865 struct gsi *gsi = &endpoint->ipa->gsi; in ipa_endpoint_suspend_one()
1868 if (!test_bit(endpoint->endpoint_id, endpoint->ipa->enabled)) in ipa_endpoint_suspend_one()
1871 if (!endpoint->toward_ipa) { in ipa_endpoint_suspend_one()
1872 ipa_endpoint_replenish_disable(endpoint); in ipa_endpoint_suspend_one()
1873 (void)ipa_endpoint_program_suspend(endpoint, true); in ipa_endpoint_suspend_one()
1876 ret = gsi_channel_suspend(gsi, endpoint->channel_id); in ipa_endpoint_suspend_one()
1879 endpoint->channel_id); in ipa_endpoint_suspend_one()
1882 void ipa_endpoint_resume_one(struct ipa_endpoint *endpoint) in ipa_endpoint_resume_one() argument
1884 struct device *dev = &endpoint->ipa->pdev->dev; in ipa_endpoint_resume_one()
1885 struct gsi *gsi = &endpoint->ipa->gsi; in ipa_endpoint_resume_one()
1888 if (!test_bit(endpoint->endpoint_id, endpoint->ipa->enabled)) in ipa_endpoint_resume_one()
1891 if (!endpoint->toward_ipa) in ipa_endpoint_resume_one()
1892 (void)ipa_endpoint_program_suspend(endpoint, false); in ipa_endpoint_resume_one()
1894 ret = gsi_channel_resume(gsi, endpoint->channel_id); in ipa_endpoint_resume_one()
1897 endpoint->channel_id); in ipa_endpoint_resume_one()
1898 else if (!endpoint->toward_ipa) in ipa_endpoint_resume_one()
1899 ipa_endpoint_replenish_enable(endpoint); in ipa_endpoint_resume_one()
1926 static void ipa_endpoint_setup_one(struct ipa_endpoint *endpoint) in ipa_endpoint_setup_one() argument
1928 struct gsi *gsi = &endpoint->ipa->gsi; in ipa_endpoint_setup_one()
1929 u32 channel_id = endpoint->channel_id; in ipa_endpoint_setup_one()
1932 if (endpoint->ee_id != GSI_EE_AP) in ipa_endpoint_setup_one()
1935 endpoint->skb_frag_max = gsi->channel[channel_id].trans_tre_max - 1; in ipa_endpoint_setup_one()
1936 if (!endpoint->toward_ipa) { in ipa_endpoint_setup_one()
1940 clear_bit(IPA_REPLENISH_ENABLED, endpoint->replenish_flags); in ipa_endpoint_setup_one()
1941 clear_bit(IPA_REPLENISH_ACTIVE, endpoint->replenish_flags); in ipa_endpoint_setup_one()
1942 INIT_DELAYED_WORK(&endpoint->replenish_work, in ipa_endpoint_setup_one()
1946 ipa_endpoint_program(endpoint); in ipa_endpoint_setup_one()
1948 __set_bit(endpoint->endpoint_id, endpoint->ipa->set_up); in ipa_endpoint_setup_one()
1951 static void ipa_endpoint_teardown_one(struct ipa_endpoint *endpoint) in ipa_endpoint_teardown_one() argument
1953 __clear_bit(endpoint->endpoint_id, endpoint->ipa->set_up); in ipa_endpoint_teardown_one()
1955 if (!endpoint->toward_ipa) in ipa_endpoint_teardown_one()
1956 cancel_delayed_work_sync(&endpoint->replenish_work); in ipa_endpoint_teardown_one()
1958 ipa_endpoint_reset(endpoint); in ipa_endpoint_teardown_one()
1966 ipa_endpoint_setup_one(&ipa->endpoint[endpoint_id]); in ipa_endpoint_setup()
1974 ipa_endpoint_teardown_one(&ipa->endpoint[endpoint_id]); in ipa_endpoint_teardown()
2054 struct ipa_endpoint *endpoint; in ipa_endpoint_config() local
2069 endpoint = &ipa->endpoint[endpoint_id]; in ipa_endpoint_config()
2070 if (endpoint->toward_ipa) { in ipa_endpoint_config()
2092 struct ipa_endpoint *endpoint; in ipa_endpoint_init_one() local
2094 endpoint = &ipa->endpoint[data->endpoint_id]; in ipa_endpoint_init_one()
2097 ipa->channel_map[data->channel_id] = endpoint; in ipa_endpoint_init_one()
2098 ipa->name_map[name] = endpoint; in ipa_endpoint_init_one()
2100 endpoint->ipa = ipa; in ipa_endpoint_init_one()
2101 endpoint->ee_id = data->ee_id; in ipa_endpoint_init_one()
2102 endpoint->channel_id = data->channel_id; in ipa_endpoint_init_one()
2103 endpoint->endpoint_id = data->endpoint_id; in ipa_endpoint_init_one()
2104 endpoint->toward_ipa = data->toward_ipa; in ipa_endpoint_init_one()
2105 endpoint->config = data->endpoint.config; in ipa_endpoint_init_one()
2107 __set_bit(endpoint->endpoint_id, ipa->defined); in ipa_endpoint_init_one()
2110 static void ipa_endpoint_exit_one(struct ipa_endpoint *endpoint) in ipa_endpoint_exit_one() argument
2112 __clear_bit(endpoint->endpoint_id, endpoint->ipa->defined); in ipa_endpoint_exit_one()
2114 memset(endpoint, 0, sizeof(*endpoint)); in ipa_endpoint_exit_one()
2124 ipa_endpoint_exit_one(&ipa->endpoint[endpoint_id]); in ipa_endpoint_exit()
2171 if (data->endpoint.filter_support) in ipa_endpoint_init()