qcacmn: Update scheduler_msg callback type
This fixes a CFI failure in callback assignment. Currently, the callbacks in scheduler_msg are void function pointers. Update them to have a defined type as scheduler_msg_process_fn_t to catch type mismatch during compilation. Other changes to conform to this new type include: 1. Cast callback to qdf_mc_timer_callback_t when referencing, and back when assigning 2. Cast wlan_serialization_generic_timer_cb to take fit into scheduler_msg 3. Cast target_if_vdev_mgr_rsp_timer_cb to fit into scheduler_msg Change-Id: I052bc54826d377ae92f5bcc80ca08afb6f5e01e3 CRs-fixed: 2719975
This commit is contained in:
@@ -55,6 +55,10 @@ typedef enum {
|
|||||||
SYS_MSG_ID_UMAC_STOP,
|
SYS_MSG_ID_UMAC_STOP,
|
||||||
} SYS_MSG_ID;
|
} SYS_MSG_ID;
|
||||||
|
|
||||||
|
struct scheduler_msg;
|
||||||
|
typedef QDF_STATUS (*scheduler_msg_process_fn_t)(struct scheduler_msg *msg);
|
||||||
|
typedef void (*hdd_suspend_callback)(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct scheduler_msg: scheduler message structure
|
* struct scheduler_msg: scheduler message structure
|
||||||
* @type: message type
|
* @type: message type
|
||||||
@@ -82,8 +86,8 @@ struct scheduler_msg {
|
|||||||
uint16_t reserved;
|
uint16_t reserved;
|
||||||
uint32_t bodyval;
|
uint32_t bodyval;
|
||||||
void *bodyptr;
|
void *bodyptr;
|
||||||
void *callback;
|
scheduler_msg_process_fn_t callback;
|
||||||
void *flush_callback;
|
scheduler_msg_process_fn_t flush_callback;
|
||||||
qdf_list_node_t node;
|
qdf_list_node_t node;
|
||||||
#ifdef WLAN_SCHED_HISTORY_SIZE
|
#ifdef WLAN_SCHED_HISTORY_SIZE
|
||||||
QDF_MODULE_ID queue_id;
|
QDF_MODULE_ID queue_id;
|
||||||
@@ -101,9 +105,6 @@ struct scheduler_msg {
|
|||||||
*/
|
*/
|
||||||
void sched_history_print(void);
|
void sched_history_print(void);
|
||||||
|
|
||||||
typedef QDF_STATUS (*scheduler_msg_process_fn_t) (struct scheduler_msg *msg);
|
|
||||||
typedef void (*hdd_suspend_callback)(void);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* scheduler_init() - initialize control path scheduler
|
* scheduler_init() - initialize control path scheduler
|
||||||
*
|
*
|
||||||
|
@@ -464,7 +464,10 @@ QDF_STATUS scheduler_timer_q_mq_handler(struct scheduler_msg *msg)
|
|||||||
if (msg->reserved != SYS_MSG_COOKIE || msg->type != SYS_MSG_ID_MC_TIMER)
|
if (msg->reserved != SYS_MSG_COOKIE || msg->type != SYS_MSG_ID_MC_TIMER)
|
||||||
return sched_ctx->legacy_sys_handler(msg);
|
return sched_ctx->legacy_sys_handler(msg);
|
||||||
|
|
||||||
timer_callback = msg->callback;
|
/* scheduler_msg_process_fn_t and qdf_mc_timer_callback_t have
|
||||||
|
* different parameters and return type
|
||||||
|
*/
|
||||||
|
timer_callback = (qdf_mc_timer_callback_t)msg->callback;
|
||||||
QDF_BUG(timer_callback);
|
QDF_BUG(timer_callback);
|
||||||
if (!timer_callback)
|
if (!timer_callback)
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
@@ -641,7 +644,7 @@ void scheduler_mc_timer_callback(qdf_mc_timer_t *timer)
|
|||||||
/* serialize to scheduler controller thread */
|
/* serialize to scheduler controller thread */
|
||||||
msg.type = SYS_MSG_ID_MC_TIMER;
|
msg.type = SYS_MSG_ID_MC_TIMER;
|
||||||
msg.reserved = SYS_MSG_COOKIE;
|
msg.reserved = SYS_MSG_COOKIE;
|
||||||
msg.callback = callback;
|
msg.callback = (scheduler_msg_process_fn_t)callback;
|
||||||
msg.bodyptr = user_data;
|
msg.bodyptr = user_data;
|
||||||
msg.bodyval = 0;
|
msg.bodyval = 0;
|
||||||
|
|
||||||
|
@@ -158,10 +158,10 @@ QDF_STATUS target_if_vdev_mgr_wmi_event_unregister(
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* target_if_vdev_mgr_rsp_timer_cb() - function to handle vdev related timeouts
|
* target_if_vdev_mgr_rsp_timer_cb() - function to handle vdev related timeouts
|
||||||
* @vdev_rsp: pointer to vdev response timer
|
* @arg: pointer to argument
|
||||||
*
|
*
|
||||||
* Return: none
|
* Return: none
|
||||||
*/
|
*/
|
||||||
void target_if_vdev_mgr_rsp_timer_cb(struct vdev_response_timer *vdev_rsp);
|
void target_if_vdev_mgr_rsp_timer_cb(void *arg);
|
||||||
|
|
||||||
#endif /* __TARGET_IF_VDEV_MGR_RX_OPS_H__ */
|
#endif /* __TARGET_IF_VDEV_MGR_RX_OPS_H__ */
|
||||||
|
@@ -47,7 +47,7 @@ void target_if_vdev_mgr_handle_recovery(struct wlan_objmgr_psoc *psoc,
|
|||||||
wlan_psoc_get_id(psoc), vdev_id);
|
wlan_psoc_get_id(psoc), vdev_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void target_if_vdev_mgr_rsp_timer_cb(struct vdev_response_timer *vdev_rsp)
|
void target_if_vdev_mgr_rsp_timer_cb(void *arg)
|
||||||
{
|
{
|
||||||
struct wlan_objmgr_psoc *psoc;
|
struct wlan_objmgr_psoc *psoc;
|
||||||
struct wlan_lmac_if_mlme_rx_ops *rx_ops;
|
struct wlan_lmac_if_mlme_rx_ops *rx_ops;
|
||||||
@@ -55,6 +55,7 @@ void target_if_vdev_mgr_rsp_timer_cb(struct vdev_response_timer *vdev_rsp)
|
|||||||
struct vdev_stop_response stop_rsp = {0};
|
struct vdev_stop_response stop_rsp = {0};
|
||||||
struct vdev_delete_response del_rsp = {0};
|
struct vdev_delete_response del_rsp = {0};
|
||||||
struct peer_delete_all_response peer_del_all_rsp = {0};
|
struct peer_delete_all_response peer_del_all_rsp = {0};
|
||||||
|
struct vdev_response_timer *vdev_rsp = arg;
|
||||||
enum qdf_hang_reason recovery_reason;
|
enum qdf_hang_reason recovery_reason;
|
||||||
uint8_t vdev_id;
|
uint8_t vdev_id;
|
||||||
uint16_t rsp_pos = RESPONSE_BIT_MAX;
|
uint16_t rsp_pos = RESPONSE_BIT_MAX;
|
||||||
@@ -199,8 +200,16 @@ target_if_vdev_mgr_rsp_cb_mc_ctx(void *arg)
|
|||||||
|
|
||||||
msg.type = SYS_MSG_ID_MC_TIMER;
|
msg.type = SYS_MSG_ID_MC_TIMER;
|
||||||
msg.reserved = SYS_MSG_COOKIE;
|
msg.reserved = SYS_MSG_COOKIE;
|
||||||
msg.callback = target_if_vdev_mgr_rsp_timer_cb;
|
|
||||||
msg.bodyptr = vdev_rsp;
|
/* msg.callback will explicitly cast back to qdf_mc_timer_callback_t
|
||||||
|
* in scheduler_timer_q_mq_handler.
|
||||||
|
* but in future we do not want to introduce more this kind of
|
||||||
|
* typecast by properly using QDF MC timer for MCC from get go in
|
||||||
|
* common code.
|
||||||
|
*/
|
||||||
|
msg.callback =
|
||||||
|
(scheduler_msg_process_fn_t)target_if_vdev_mgr_rsp_timer_cb;
|
||||||
|
msg.bodyptr = arg;
|
||||||
msg.bodyval = 0;
|
msg.bodyval = 0;
|
||||||
msg.flush_callback = target_if_vdev_mgr_rsp_flush_cb;
|
msg.flush_callback = target_if_vdev_mgr_rsp_flush_cb;
|
||||||
|
|
||||||
|
@@ -586,7 +586,15 @@ wlan_serialization_timer_cb_mc_ctx(void *arg)
|
|||||||
|
|
||||||
msg.type = SYS_MSG_ID_MC_TIMER;
|
msg.type = SYS_MSG_ID_MC_TIMER;
|
||||||
msg.reserved = SYS_MSG_COOKIE;
|
msg.reserved = SYS_MSG_COOKIE;
|
||||||
msg.callback = wlan_serialization_generic_timer_cb;
|
|
||||||
|
/* msg.callback will explicitly cast back to qdf_mc_timer_callback_t
|
||||||
|
* in scheduler_timer_q_mq_handler.
|
||||||
|
* but in future we do not want to introduce more this kind of
|
||||||
|
* typecast by properly using QDF MC timer for MCC from get go in
|
||||||
|
* common code.
|
||||||
|
*/
|
||||||
|
msg.callback =
|
||||||
|
(scheduler_msg_process_fn_t)wlan_serialization_generic_timer_cb;
|
||||||
msg.bodyptr = arg;
|
msg.bodyptr = arg;
|
||||||
msg.bodyval = 0;
|
msg.bodyval = 0;
|
||||||
msg.flush_callback = wlan_serialization_mc_flush_noop;
|
msg.flush_callback = wlan_serialization_mc_flush_noop;
|
||||||
|
Reference in New Issue
Block a user