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

Commit e2be1f22 authored by Surabhi Vishnoi's avatar Surabhi Vishnoi Committed by Gerrit - the friendly Code Review server
Browse files

wlan: Add changes in SSR sequence due to rpmsg migration

Currently, wcnss_close_channel is called in module unload time,
but it needs to be called during SSR also in case of rpmsg otherwise
driver_reinit will fail as rpmsg channel endpoint is not valid.

To avoid failure during SSR reinit, close the channel during driver
shutdown and open the channel during SSR reinit again.

Change-Id: I31a05976ce03402707af743047eda3493b8ca903
CRs-Fixed:
parent 5d7bb7b6
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -603,13 +603,5 @@ void vos_reset_recovery_reason(void);
 */
VOS_STATUS vos_smd_open(const char *szname, WCTS_ControlBlockType* wcts_cb);

/**
 * wcts_state_open - open WCTS state, equivalent to SMD_EVENT_OPEN event
 * wcts_cb: WCTS control block
 *
 * Return: None
 */
void wcts_state_open(WCTS_ControlBlockType* wcts_cb);

void wlan_unregister_driver(void);
#endif // if !defined __VOS_NVITEM_H
+0 −2
Original line number Diff line number Diff line
@@ -3976,8 +3976,6 @@ VOS_STATUS vos_smd_open(const char *szname, WCTS_ControlBlockType* wcts_cb)
		return VOS_STATUS_E_INVAL;
	}

	wcts_state_open(wcts_cb);

	wcnss_register_driver(&driver_ops, wcts_cb);

	return VOS_STATUS_SUCCESS;
+6 −0
Original line number Diff line number Diff line
@@ -2793,6 +2793,7 @@ WDI_Shutdown
      WDI_ASSERT(0);
   }
   if ( closeTransport )
   {
      /* Close control transport, called from module unload */
@@ -2800,6 +2801,11 @@ WDI_Shutdown
   }
   else
   {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
      /* Need to close SMD channel in case of SSR also when rpmsg is used */
      wcts_close_channel(gWDICb.wctsHandle);
#endif
      /* Riva is crashed then SMD is already closed so cleaning all 
         the pending messages in the transport queue  */
      WCTS_ClearPendingQueue(gWDICb.wctsHandle);
+8 −0
Original line number Diff line number Diff line
@@ -357,5 +357,13 @@ enum wcnss_driver_state;
 * @return status
 */
int WCTS_driver_state_process(void *priv, enum wcnss_driver_state state);

/**
 * wcts_close_channel() - api to close the smd channel
 * @wctsHandle: transport handle
 *
 * @return none
 */
void wcts_close_channel(WCTS_HandleType wctsHandle);
#endif
#endif /* #ifndef WLAN_QCT_WDI_CTS_H */
+13 −13
Original line number Diff line number Diff line
@@ -520,17 +520,6 @@ int WCTS_smd_resp_process(struct rpmsg_device *rpdev,
	return 0;
}

void wcts_state_open(WCTS_ControlBlockType* wcts_cb)
{
    wpt_msg                 *palMsg;

   gWdiSmdStats.smd_event_open++;
   palMsg = &wcts_cb->wctsOpenMsg;

   /* serialize this event */
   wpalPostCtrlMsg(WDI_GET_PAL_CTX(), palMsg);
}

int WCTS_driver_state_process(void *priv, enum wcnss_driver_state state)
{
	WCTS_ControlBlockType* wcts_cb = (WCTS_ControlBlockType*) priv;
@@ -747,6 +736,10 @@ WCTS_OpenTransport
                   "WCTS_OpenTransport: Invalid magic.");
           return NULL;
       }
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
	/* Need to open smd channel in case of SSR in rpmsg */
	smdstatus = vos_smd_open(szName, pWCTSCb);
#endif
       pWCTSCb->wctsState = WCTS_STATE_OPEN;

       pWCTSCb->wctsNotifyCB((WCTS_HandleType)pWCTSCb,
@@ -834,7 +827,14 @@ WCTS_OpenTransport
}/*WCTS_OpenTransport*/


#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
void wcts_close_channel(WCTS_HandleType wcts_handle)
{
	WCTS_ControlBlockType* wcts_cb = (WCTS_ControlBlockType*) wcts_handle;

	wcnss_close_channel(wcts_cb->wctsChannel);
}
#endif
/**
 @brief    This function is used by the DAL Core to close the
           Control Transport when its services are no longer
@@ -913,7 +913,7 @@ WCTS_CloseTransport
      msleep(50);
   }
#else
   wcnss_close_channel(pWCTSCb->wctsChannel);
   wcts_close_channel(wctsHandle);
   wlan_unregister_driver();
#endif