Loading Documentation/devicetree/bindings/mhi/msm_mhi.txt +7 −0 Original line number Diff line number Diff line Loading @@ -120,6 +120,13 @@ Main node properties: Value type: <u32> Definition: Segment size in bytes for each segment in bytes. - qcom,mhi-bb-required Usage: optional Value type: bool Definition: Determine whether MHI device require bounce buffer during active transfer. If true, during channel open host will pre-allocate transfer buffers. ======== Example: ======== Loading Documentation/devicetree/bindings/platform/msm/msm_rmnet_mhi.txt +49 −21 Original line number Diff line number Diff line MSM MHI RMNET interface device MHI RMNET provides a network interface over PCIe to transfer IP packets between modem and apps. Required properties: - compatible : "qcom,mhi-rmnet" - At least one of MHI channel - qcom,mhi-rx-channel : MHI channel number for incoming data - qcom,mhi-tx-channel : MHI channel number for outgoing data - Default MRU for interface MHI RMNET provides a network interface over PCIe to transfer IP packets between modem and apps. ============== Node Structure ============== Main node properties: - compatible Usage: required Value type: <string> Definition: "qcom,mhi-rmnet" - qcom,mhi-rx-channel Usage: optional if mhi-tx-channel is defined. Value type: <u32> Definition: MHI channel number for incoming data - qcom,mhi-tx-channel Usage: optional if mhi-rx-channel is defined. Value type: <u32> Definition: MHI channel number for outgoing data - qcom,mhi-mru - Alias id to identify interface instance Usage: required Value type: <u32> Definition: Default payload size for receive path. - qcom,mhi-max-mru Usage: optional Value type: <u32> Definition: Maximum payload interface support on receive path. If not defined MHI_MAX_MRU is used. - qcom,mhi-max-mtu Usage: optional Value type: <u32> Definition: Maximum payload interface support on transmit path. If not defined MHI_MAX_MTU is used. ======== Example: aliases { mhi_rmnet0 = &mhi_rmnet_0; }; ======== mhi_rmnet_0: qcom,mhi-rmnet@0 { compatible = "qcom,mhi-rmnet"; qcom,mhi-rx-channel = <101>; Loading drivers/net/ethernet/msm/msm_rmnet_mhi.c +33 −5 Original line number Diff line number Diff line /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -88,6 +88,8 @@ struct rmnet_mhi_private { struct sk_buff_head rx_buffers; atomic_t rx_pool_len; u32 mru; u32 max_mru; u32 max_mtu; struct napi_struct napi; gfp_t allocation_flags; uint32_t tx_buffers_max; Loading Loading @@ -583,7 +585,10 @@ static int rmnet_mhi_stop(struct net_device *dev) static int rmnet_mhi_change_mtu(struct net_device *dev, int new_mtu) { if (0 > new_mtu || MHI_MAX_MTU < new_mtu) struct rmnet_mhi_private *rmnet_mhi_ptr = *(struct rmnet_mhi_private **)netdev_priv(dev); if (0 > new_mtu || rmnet_mhi_ptr->max_mtu < new_mtu) return -EINVAL; dev->mtu = new_mtu; Loading Loading @@ -666,11 +671,12 @@ static int rmnet_mhi_ioctl_extended(struct net_device *dev, struct ifreq *ifr) switch (ext_cmd.extended_ioctl) { case RMNET_IOCTL_SET_MRU: if ((0 == ext_cmd.u.data) || (ext_cmd.u.data > MHI_MAX_MRU)) { if ((0 == ext_cmd.u.data) || (ext_cmd.u.data > rmnet_mhi_ptr->max_mru)) { rmnet_log(rmnet_mhi_ptr, MSG_CRITICAL, "Can't set MRU, value %u is invalid\n", ext_cmd.u.data); "Can't set MRU, value:%u is invalid max:%u\n", ext_cmd.u.data, rmnet_mhi_ptr->max_mru); return -EINVAL; } rmnet_log(rmnet_mhi_ptr, Loading Loading @@ -1183,6 +1189,26 @@ static int rmnet_mhi_probe(struct platform_device *pdev) goto probe_fail; } rc = of_property_read_u32(pdev->dev.of_node, "qcom,mhi-max-mru", &rmnet_mhi_ptr->max_mru); if (likely(rc)) { rmnet_log(rmnet_mhi_ptr, MSG_INFO, "max-mru not defined, setting to max %d\n", MHI_MAX_MRU); rmnet_mhi_ptr->max_mru = MHI_MAX_MRU; } rc = of_property_read_u32(pdev->dev.of_node, "qcom,mhi-max-mtu", &rmnet_mhi_ptr->max_mtu); if (likely(rc)) { rmnet_log(rmnet_mhi_ptr, MSG_INFO, "max-mtu not defined, setting to max %d\n", MHI_MAX_MTU); rmnet_mhi_ptr->max_mtu = MHI_MAX_MTU; } client_info.dev = &pdev->dev; client_info.node_name = "qcom,mhi"; client_info.mhi_client_cb = rmnet_mhi_cb; Loading @@ -1194,6 +1220,7 @@ static int rmnet_mhi_probe(struct platform_device *pdev) if (rc == 0) { rmnet_mhi_ptr->tx_channel = channel; client_info.chan = channel; client_info.max_payload = rmnet_mhi_ptr->max_mtu; rc = mhi_register_channel(&rmnet_mhi_ptr->tx_client_handle, &client_info); Loading @@ -1213,6 +1240,7 @@ static int rmnet_mhi_probe(struct platform_device *pdev) &channel); if (rc == 0) { rmnet_mhi_ptr->rx_channel = channel; client_info.max_payload = rmnet_mhi_ptr->max_mru; client_info.chan = channel; rc = mhi_register_channel(&rmnet_mhi_ptr->rx_client_handle, &client_info); Loading drivers/platform/msm/mhi/mhi.h +6 −1 Original line number Diff line number Diff line /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -348,6 +348,7 @@ struct mhi_ring { u32 msi_disable_cntr; u32 msi_enable_cntr; spinlock_t ring_lock; struct dma_pool *dma_pool; }; enum MHI_CMD_STATUS { Loading Loading @@ -446,9 +447,12 @@ struct mhi_state_work_queue { struct mhi_buf_info { dma_addr_t bb_p_addr; dma_addr_t pre_alloc_p_addr; void *bb_v_addr; void *pre_alloc_v_addr; void *client_buf; size_t buf_len; size_t pre_alloc_len; size_t filled_size; enum dma_data_direction dir; int bb_active; Loading Loading @@ -479,6 +483,7 @@ struct mhi_flags { u32 kill_threads; u32 ev_thread_stopped; u32 st_thread_stopped; bool bb_required; }; struct mhi_wait_queues { Loading drivers/platform/msm/mhi/mhi_iface.c +5 −1 Original line number Diff line number Diff line /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -456,6 +456,10 @@ static int mhi_plat_probe(struct platform_device *pdev) INIT_WORK(&bhi_ctxt->fw_load_work, bhi_firmware_download); } mhi_dev_ctxt->flags.bb_required = of_property_read_bool(pdev->dev.of_node, "qcom,mhi-bb-required"); mhi_dev_ctxt->plat_dev = pdev; platform_set_drvdata(pdev, mhi_dev_ctxt); Loading Loading
Documentation/devicetree/bindings/mhi/msm_mhi.txt +7 −0 Original line number Diff line number Diff line Loading @@ -120,6 +120,13 @@ Main node properties: Value type: <u32> Definition: Segment size in bytes for each segment in bytes. - qcom,mhi-bb-required Usage: optional Value type: bool Definition: Determine whether MHI device require bounce buffer during active transfer. If true, during channel open host will pre-allocate transfer buffers. ======== Example: ======== Loading
Documentation/devicetree/bindings/platform/msm/msm_rmnet_mhi.txt +49 −21 Original line number Diff line number Diff line MSM MHI RMNET interface device MHI RMNET provides a network interface over PCIe to transfer IP packets between modem and apps. Required properties: - compatible : "qcom,mhi-rmnet" - At least one of MHI channel - qcom,mhi-rx-channel : MHI channel number for incoming data - qcom,mhi-tx-channel : MHI channel number for outgoing data - Default MRU for interface MHI RMNET provides a network interface over PCIe to transfer IP packets between modem and apps. ============== Node Structure ============== Main node properties: - compatible Usage: required Value type: <string> Definition: "qcom,mhi-rmnet" - qcom,mhi-rx-channel Usage: optional if mhi-tx-channel is defined. Value type: <u32> Definition: MHI channel number for incoming data - qcom,mhi-tx-channel Usage: optional if mhi-rx-channel is defined. Value type: <u32> Definition: MHI channel number for outgoing data - qcom,mhi-mru - Alias id to identify interface instance Usage: required Value type: <u32> Definition: Default payload size for receive path. - qcom,mhi-max-mru Usage: optional Value type: <u32> Definition: Maximum payload interface support on receive path. If not defined MHI_MAX_MRU is used. - qcom,mhi-max-mtu Usage: optional Value type: <u32> Definition: Maximum payload interface support on transmit path. If not defined MHI_MAX_MTU is used. ======== Example: aliases { mhi_rmnet0 = &mhi_rmnet_0; }; ======== mhi_rmnet_0: qcom,mhi-rmnet@0 { compatible = "qcom,mhi-rmnet"; qcom,mhi-rx-channel = <101>; Loading
drivers/net/ethernet/msm/msm_rmnet_mhi.c +33 −5 Original line number Diff line number Diff line /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -88,6 +88,8 @@ struct rmnet_mhi_private { struct sk_buff_head rx_buffers; atomic_t rx_pool_len; u32 mru; u32 max_mru; u32 max_mtu; struct napi_struct napi; gfp_t allocation_flags; uint32_t tx_buffers_max; Loading Loading @@ -583,7 +585,10 @@ static int rmnet_mhi_stop(struct net_device *dev) static int rmnet_mhi_change_mtu(struct net_device *dev, int new_mtu) { if (0 > new_mtu || MHI_MAX_MTU < new_mtu) struct rmnet_mhi_private *rmnet_mhi_ptr = *(struct rmnet_mhi_private **)netdev_priv(dev); if (0 > new_mtu || rmnet_mhi_ptr->max_mtu < new_mtu) return -EINVAL; dev->mtu = new_mtu; Loading Loading @@ -666,11 +671,12 @@ static int rmnet_mhi_ioctl_extended(struct net_device *dev, struct ifreq *ifr) switch (ext_cmd.extended_ioctl) { case RMNET_IOCTL_SET_MRU: if ((0 == ext_cmd.u.data) || (ext_cmd.u.data > MHI_MAX_MRU)) { if ((0 == ext_cmd.u.data) || (ext_cmd.u.data > rmnet_mhi_ptr->max_mru)) { rmnet_log(rmnet_mhi_ptr, MSG_CRITICAL, "Can't set MRU, value %u is invalid\n", ext_cmd.u.data); "Can't set MRU, value:%u is invalid max:%u\n", ext_cmd.u.data, rmnet_mhi_ptr->max_mru); return -EINVAL; } rmnet_log(rmnet_mhi_ptr, Loading Loading @@ -1183,6 +1189,26 @@ static int rmnet_mhi_probe(struct platform_device *pdev) goto probe_fail; } rc = of_property_read_u32(pdev->dev.of_node, "qcom,mhi-max-mru", &rmnet_mhi_ptr->max_mru); if (likely(rc)) { rmnet_log(rmnet_mhi_ptr, MSG_INFO, "max-mru not defined, setting to max %d\n", MHI_MAX_MRU); rmnet_mhi_ptr->max_mru = MHI_MAX_MRU; } rc = of_property_read_u32(pdev->dev.of_node, "qcom,mhi-max-mtu", &rmnet_mhi_ptr->max_mtu); if (likely(rc)) { rmnet_log(rmnet_mhi_ptr, MSG_INFO, "max-mtu not defined, setting to max %d\n", MHI_MAX_MTU); rmnet_mhi_ptr->max_mtu = MHI_MAX_MTU; } client_info.dev = &pdev->dev; client_info.node_name = "qcom,mhi"; client_info.mhi_client_cb = rmnet_mhi_cb; Loading @@ -1194,6 +1220,7 @@ static int rmnet_mhi_probe(struct platform_device *pdev) if (rc == 0) { rmnet_mhi_ptr->tx_channel = channel; client_info.chan = channel; client_info.max_payload = rmnet_mhi_ptr->max_mtu; rc = mhi_register_channel(&rmnet_mhi_ptr->tx_client_handle, &client_info); Loading @@ -1213,6 +1240,7 @@ static int rmnet_mhi_probe(struct platform_device *pdev) &channel); if (rc == 0) { rmnet_mhi_ptr->rx_channel = channel; client_info.max_payload = rmnet_mhi_ptr->max_mru; client_info.chan = channel; rc = mhi_register_channel(&rmnet_mhi_ptr->rx_client_handle, &client_info); Loading
drivers/platform/msm/mhi/mhi.h +6 −1 Original line number Diff line number Diff line /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -348,6 +348,7 @@ struct mhi_ring { u32 msi_disable_cntr; u32 msi_enable_cntr; spinlock_t ring_lock; struct dma_pool *dma_pool; }; enum MHI_CMD_STATUS { Loading Loading @@ -446,9 +447,12 @@ struct mhi_state_work_queue { struct mhi_buf_info { dma_addr_t bb_p_addr; dma_addr_t pre_alloc_p_addr; void *bb_v_addr; void *pre_alloc_v_addr; void *client_buf; size_t buf_len; size_t pre_alloc_len; size_t filled_size; enum dma_data_direction dir; int bb_active; Loading Loading @@ -479,6 +483,7 @@ struct mhi_flags { u32 kill_threads; u32 ev_thread_stopped; u32 st_thread_stopped; bool bb_required; }; struct mhi_wait_queues { Loading
drivers/platform/msm/mhi/mhi_iface.c +5 −1 Original line number Diff line number Diff line /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -456,6 +456,10 @@ static int mhi_plat_probe(struct platform_device *pdev) INIT_WORK(&bhi_ctxt->fw_load_work, bhi_firmware_download); } mhi_dev_ctxt->flags.bb_required = of_property_read_bool(pdev->dev.of_node, "qcom,mhi-bb-required"); mhi_dev_ctxt->plat_dev = pdev; platform_set_drvdata(pdev, mhi_dev_ctxt); Loading