Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c50f1bbb authored by Prasad Malisetty's avatar Prasad Malisetty
Browse files

msm: mhi_rmnet: set ifalias to unidentified_net_dev on error from MHI



Set the ifalias status to unidentified_net_dev to
indicate whether modem is connected or down

CRs-Fixed:2091838
Change-Id: Ic7bac3dd1a238540f828babe641d4f6669bc96b9
Signed-off-by: default avatarPrasad Malisetty <prasadm@codeaurora.org>
parent 232b0f15
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -958,6 +958,7 @@ static void rmnet_mhi_cb(struct mhi_cb_info *cb_info)
{
	struct rmnet_mhi_private *rmnet_mhi_ptr;
	struct mhi_result *result;
	char ifalias[IFALIASZ];
	int r = 0;

	if (!cb_info || !cb_info->result) {
@@ -979,9 +980,16 @@ static void rmnet_mhi_cb(struct mhi_cb_info *cb_info)
		 * as we set mhi_enabled = 0, we gurantee rest of
		 * driver will not touch any critical data.
		*/
		snprintf(ifalias, sizeof(ifalias), "%s", "unidentified_netdev");
		write_lock_irq(&rmnet_mhi_ptr->pm_lock);
		rmnet_mhi_ptr->mhi_enabled = 0;
		write_unlock_irq(&rmnet_mhi_ptr->pm_lock);
		/* Set unidentified_net_dev string to ifalias
		 * on error notification
		*/
		rtnl_lock();
		dev_set_alias(rmnet_mhi_ptr->dev, ifalias, strlen(ifalias));
		rtnl_unlock();

		if (cb_info->chan == rmnet_mhi_ptr->rx_channel) {
			rmnet_log(rmnet_mhi_ptr, MSG_INFO,