Lines Matching refs:fwevt

177 static void mpi3mr_fwevt_get(struct mpi3mr_fwevt *fwevt)  in mpi3mr_fwevt_get()  argument
179 kref_get(&fwevt->ref_count); in mpi3mr_fwevt_get()
188 static void mpi3mr_fwevt_put(struct mpi3mr_fwevt *fwevt) in mpi3mr_fwevt_put() argument
190 kref_put(&fwevt->ref_count, mpi3mr_fwevt_free); in mpi3mr_fwevt_put()
204 struct mpi3mr_fwevt *fwevt; in mpi3mr_alloc_fwevt() local
206 fwevt = kzalloc(sizeof(*fwevt) + len, GFP_ATOMIC); in mpi3mr_alloc_fwevt()
207 if (!fwevt) in mpi3mr_alloc_fwevt()
210 kref_init(&fwevt->ref_count); in mpi3mr_alloc_fwevt()
211 return fwevt; in mpi3mr_alloc_fwevt()
224 struct mpi3mr_fwevt *fwevt) in mpi3mr_fwevt_add_to_list() argument
233 mpi3mr_fwevt_get(fwevt); in mpi3mr_fwevt_add_to_list()
234 INIT_LIST_HEAD(&fwevt->list); in mpi3mr_fwevt_add_to_list()
235 list_add_tail(&fwevt->list, &mrioc->fwevt_list); in mpi3mr_fwevt_add_to_list()
236 INIT_WORK(&fwevt->work, mpi3mr_fwevt_worker); in mpi3mr_fwevt_add_to_list()
238 mpi3mr_fwevt_get(fwevt); in mpi3mr_fwevt_add_to_list()
239 queue_work(mrioc->fwevt_worker_thread, &fwevt->work); in mpi3mr_fwevt_add_to_list()
253 struct mpi3mr_fwevt *fwevt) in mpi3mr_fwevt_del_from_list() argument
258 if (!list_empty(&fwevt->list)) { in mpi3mr_fwevt_del_from_list()
259 list_del_init(&fwevt->list); in mpi3mr_fwevt_del_from_list()
264 mpi3mr_fwevt_put(fwevt); in mpi3mr_fwevt_del_from_list()
281 struct mpi3mr_fwevt *fwevt = NULL; in mpi3mr_dequeue_fwevt() local
285 fwevt = list_first_entry(&mrioc->fwevt_list, in mpi3mr_dequeue_fwevt()
287 list_del_init(&fwevt->list); in mpi3mr_dequeue_fwevt()
292 mpi3mr_fwevt_put(fwevt); in mpi3mr_dequeue_fwevt()
296 return fwevt; in mpi3mr_dequeue_fwevt()
305 static void mpi3mr_cancel_work(struct mpi3mr_fwevt *fwevt) in mpi3mr_cancel_work() argument
314 if (cancel_work_sync(&fwevt->work)) { in mpi3mr_cancel_work()
319 mpi3mr_fwevt_put(fwevt); in mpi3mr_cancel_work()
324 mpi3mr_fwevt_put(fwevt); in mpi3mr_cancel_work()
339 struct mpi3mr_fwevt *fwevt = NULL; in mpi3mr_cleanup_fwevt_list() local
345 while ((fwevt = mpi3mr_dequeue_fwevt(mrioc))) in mpi3mr_cleanup_fwevt_list()
346 mpi3mr_cancel_work(fwevt); in mpi3mr_cleanup_fwevt_list()
349 fwevt = mrioc->current_event; in mpi3mr_cleanup_fwevt_list()
358 if (current_work() == &fwevt->work || fwevt->pending_at_sml) { in mpi3mr_cleanup_fwevt_list()
359 fwevt->discard = 1; in mpi3mr_cleanup_fwevt_list()
363 mpi3mr_cancel_work(fwevt); in mpi3mr_cleanup_fwevt_list()
381 struct mpi3mr_fwevt *fwevt; in mpi3mr_queue_qd_reduction_event() local
392 fwevt = mpi3mr_alloc_fwevt(sz); in mpi3mr_queue_qd_reduction_event()
393 if (!fwevt) { in mpi3mr_queue_qd_reduction_event()
397 *(struct mpi3mr_throttle_group_info **)fwevt->event_data = tg; in mpi3mr_queue_qd_reduction_event()
398 fwevt->mrioc = mrioc; in mpi3mr_queue_qd_reduction_event()
399 fwevt->event_id = MPI3MR_DRIVER_EVENT_TG_QD_REDUCTION; in mpi3mr_queue_qd_reduction_event()
400 fwevt->send_ack = 0; in mpi3mr_queue_qd_reduction_event()
401 fwevt->process_evt = 1; in mpi3mr_queue_qd_reduction_event()
402 fwevt->evt_ctx = 0; in mpi3mr_queue_qd_reduction_event()
403 fwevt->event_data_size = sz; in mpi3mr_queue_qd_reduction_event()
408 mpi3mr_fwevt_add_to_list(mrioc, fwevt); in mpi3mr_queue_qd_reduction_event()
1286 struct mpi3mr_fwevt *fwevt) in mpi3mr_devstatuschg_evt_bh() argument
1292 (struct mpi3_event_data_device_status_change *)fwevt->event_data; in mpi3mr_devstatuschg_evt_bh()
1466 struct mpi3mr_fwevt *fwevt) in mpi3mr_encldev_add_chg_evt_bh() argument
1473 encl_pg0 = (struct mpi3_enclosure_page0 *) fwevt->event_data; in mpi3mr_encldev_add_chg_evt_bh()
1474 added = (fwevt->event_id == MPI3_EVENT_ENCL_DEVICE_ADDED) ? 1 : 0; in mpi3mr_encldev_add_chg_evt_bh()
1597 struct mpi3mr_fwevt *fwevt) in mpi3mr_sastopochg_evt_bh() argument
1600 (struct mpi3_event_data_sas_topology_change_list *)fwevt->event_data; in mpi3mr_sastopochg_evt_bh()
1630 if (fwevt->discard) in mpi3mr_sastopochg_evt_bh()
1776 struct mpi3mr_fwevt *fwevt) in mpi3mr_pcietopochg_evt_bh() argument
1779 (struct mpi3_event_data_pcie_topology_change_list *)fwevt->event_data; in mpi3mr_pcietopochg_evt_bh()
1788 if (fwevt->discard) in mpi3mr_pcietopochg_evt_bh()
1826 struct mpi3mr_fwevt *fwevt) in mpi3mr_logdata_evt_bh() argument
1828 mpi3mr_app_save_logdata(mrioc, fwevt->event_data, in mpi3mr_logdata_evt_bh()
1829 fwevt->event_data_size); in mpi3mr_logdata_evt_bh()
1897 struct mpi3mr_fwevt *fwevt) in mpi3mr_fwevt_bh() argument
1903 mpi3mr_fwevt_del_from_list(mrioc, fwevt); in mpi3mr_fwevt_bh()
1904 mrioc->current_event = fwevt; in mpi3mr_fwevt_bh()
1912 fwevt->event_id); in mpi3mr_fwevt_bh()
1916 if (!fwevt->process_evt) in mpi3mr_fwevt_bh()
1919 switch (fwevt->event_id) { in mpi3mr_fwevt_bh()
1922 dev_pg0 = (struct mpi3_device_page0 *)fwevt->event_data; in mpi3mr_fwevt_bh()
1943 dev_pg0 = (struct mpi3_device_page0 *)fwevt->event_data; in mpi3mr_fwevt_bh()
1951 mpi3mr_devstatuschg_evt_bh(mrioc, fwevt); in mpi3mr_fwevt_bh()
1957 mpi3mr_encldev_add_chg_evt_bh(mrioc, fwevt); in mpi3mr_fwevt_bh()
1963 mpi3mr_sastopochg_evt_bh(mrioc, fwevt); in mpi3mr_fwevt_bh()
1968 mpi3mr_pcietopochg_evt_bh(mrioc, fwevt); in mpi3mr_fwevt_bh()
1973 mpi3mr_logdata_evt_bh(mrioc, fwevt); in mpi3mr_fwevt_bh()
1980 tg = *(struct mpi3mr_throttle_group_info **)fwevt->event_data; in mpi3mr_fwevt_bh()
2011 if (fwevt->send_ack) in mpi3mr_fwevt_bh()
2012 mpi3mr_process_event_ack(mrioc, fwevt->event_id, in mpi3mr_fwevt_bh()
2013 fwevt->evt_ctx); in mpi3mr_fwevt_bh()
2016 mpi3mr_fwevt_put(fwevt); in mpi3mr_fwevt_bh()
2030 struct mpi3mr_fwevt *fwevt = container_of(work, struct mpi3mr_fwevt, in mpi3mr_fwevt_worker() local
2032 mpi3mr_fwevt_bh(fwevt->mrioc, fwevt); in mpi3mr_fwevt_worker()
2037 mpi3mr_fwevt_put(fwevt); in mpi3mr_fwevt_worker()
2800 struct mpi3mr_fwevt *fwevt = NULL; in mpi3mr_add_event_wait_for_device_refresh() local
2802 fwevt = mpi3mr_alloc_fwevt(0); in mpi3mr_add_event_wait_for_device_refresh()
2803 if (!fwevt) { in mpi3mr_add_event_wait_for_device_refresh()
2809 fwevt->mrioc = mrioc; in mpi3mr_add_event_wait_for_device_refresh()
2810 fwevt->event_id = MPI3_EVENT_WAIT_FOR_DEVICES_TO_REFRESH; in mpi3mr_add_event_wait_for_device_refresh()
2811 fwevt->send_ack = 0; in mpi3mr_add_event_wait_for_device_refresh()
2812 fwevt->process_evt = 1; in mpi3mr_add_event_wait_for_device_refresh()
2813 fwevt->evt_ctx = 0; in mpi3mr_add_event_wait_for_device_refresh()
2814 fwevt->event_data_size = 0; in mpi3mr_add_event_wait_for_device_refresh()
2815 mpi3mr_fwevt_add_to_list(mrioc, fwevt); in mpi3mr_add_event_wait_for_device_refresh()
2833 struct mpi3mr_fwevt *fwevt = NULL; in mpi3mr_os_handle_events() local
2912 fwevt = mpi3mr_alloc_fwevt(sz); in mpi3mr_os_handle_events()
2913 if (!fwevt) { in mpi3mr_os_handle_events()
2919 memcpy(fwevt->event_data, event_reply->event_data, sz); in mpi3mr_os_handle_events()
2920 fwevt->mrioc = mrioc; in mpi3mr_os_handle_events()
2921 fwevt->event_id = evt_type; in mpi3mr_os_handle_events()
2922 fwevt->send_ack = ack_req; in mpi3mr_os_handle_events()
2923 fwevt->process_evt = process_evt_bh; in mpi3mr_os_handle_events()
2924 fwevt->evt_ctx = le32_to_cpu(event_reply->event_context); in mpi3mr_os_handle_events()
2925 mpi3mr_fwevt_add_to_list(mrioc, fwevt); in mpi3mr_os_handle_events()