Lines Matching full:event

20  * struct brcmf_fweh_queue_item - event item on event queue.
23 * @code: event code.
24 * @ifidx: interface index related to this event.
26 * @emsg: common parameters of the firmware event message.
28 * @data: event specific data part of the firmware event.
52 /* array for mapping code to event name */
59 * brcmf_fweh_event_name() - returns name for given event code.
80 * brcmf_fweh_queue_event() - create and queue event.
82 * @fweh: firmware event handling info.
83 * @event: event queue entry.
86 struct brcmf_fweh_queue_item *event) in brcmf_fweh_queue_event() argument
91 list_add_tail(&event->q, &fweh->event_q); in brcmf_fweh_queue_event()
108 /* handle the event if valid interface and handler */ in brcmf_fweh_call_event_handler()
120 * brcmf_fweh_handle_if_event() - handle IF event.
123 * @emsg: event message object.
124 * @data: event object.
134 brcmf_dbg(EVENT, "action: %u ifidx: %u bsscfgidx: %u flags: %u role: %u\n", in brcmf_fweh_handle_if_event()
138 /* The P2P Device interface event must not be ignored contrary to what in brcmf_fweh_handle_if_event()
148 brcmf_dbg(EVENT, "event can be ignored\n"); in brcmf_fweh_handle_if_event()
159 brcmf_dbg(EVENT, "adding %s (%pM)\n", emsg->ifname, in brcmf_fweh_handle_if_event()
181 /* Default handling in case no-one waits for this event */ in brcmf_fweh_handle_if_event()
227 * brcmf_fweh_dequeue_event() - get event from the queue.
229 * @fweh: firmware event handling info.
234 struct brcmf_fweh_queue_item *event = NULL; in brcmf_fweh_dequeue_event() local
239 event = list_first_entry(&fweh->event_q, in brcmf_fweh_dequeue_event()
241 list_del(&event->q); in brcmf_fweh_dequeue_event()
245 return event; in brcmf_fweh_dequeue_event()
249 * brcmf_fweh_event_worker() - firmware event worker.
258 struct brcmf_fweh_queue_item *event; in brcmf_fweh_event_worker() local
266 while ((event = brcmf_fweh_dequeue_event(fweh))) { in brcmf_fweh_event_worker()
269 brcmf_fweh_map_fwevt_code(fweh, event->code, &code); in brcmf_fweh_event_worker()
270 brcmf_dbg(EVENT, "event %s (%u:%u) ifidx %u bsscfg %u addr %pM\n", in brcmf_fweh_event_worker()
271 brcmf_fweh_event_name(code), code, event->code, in brcmf_fweh_event_worker()
272 event->emsg.ifidx, event->emsg.bsscfgidx, in brcmf_fweh_event_worker()
273 event->emsg.addr); in brcmf_fweh_event_worker()
274 if (event->emsg.bsscfgidx >= BRCMF_MAX_IFS) { in brcmf_fweh_event_worker()
276 event->emsg.bsscfgidx); in brcmf_fweh_event_worker()
280 /* convert event message */ in brcmf_fweh_event_worker()
281 emsg_be = &event->emsg; in brcmf_fweh_event_worker()
294 brcmf_dbg(EVENT, " version %u flags %u status %u reason %u\n", in brcmf_fweh_event_worker()
296 brcmf_dbg_hex_dump(BRCMF_EVENT_ON(), event->data, in brcmf_fweh_event_worker()
298 "event payload, len=%d\n", emsg.datalen); in brcmf_fweh_event_worker()
300 /* special handling of interface event */ in brcmf_fweh_event_worker()
301 if (event->code == BRCMF_E_IF) { in brcmf_fweh_event_worker()
302 brcmf_fweh_handle_if_event(drvr, &emsg, event->data); in brcmf_fweh_event_worker()
306 if (event->code == BRCMF_E_TDLS_PEER_EVENT) in brcmf_fweh_event_worker()
310 err = brcmf_fweh_call_event_handler(drvr, ifp, event->code, in brcmf_fweh_event_worker()
311 &emsg, event->data); in brcmf_fweh_event_worker()
313 bphy_err(drvr, "event handler failed (%d)\n", in brcmf_fweh_event_worker()
314 event->code); in brcmf_fweh_event_worker()
318 kfree(event); in brcmf_fweh_event_worker()
334 * brcmf_fweh_attach() - initialize firmware event handling.
362 * brcmf_fweh_detach() - cleanup firmware event handling.
384 * brcmf_fweh_register() - register handler for given event code.
387 * @code: event code.
388 * @handler: handler for the given event code.
399 bphy_err(drvr, "event code %d already registered\n", code); in brcmf_fweh_register()
404 brcmf_dbg(TRACE, "event handler registered for %s\n", in brcmf_fweh_register()
413 * @code: event code.
420 brcmf_dbg(TRACE, "event handler cleared for %s\n", in brcmf_fweh_unregister()
441 brcmf_dbg(EVENT, "enable event %s\n", in brcmf_fweh_activate_events()
447 /* want to handle IF event as well */ in brcmf_fweh_activate_events()
448 brcmf_dbg(EVENT, "enable event IF\n"); in brcmf_fweh_activate_events()
460 * brcmf_fweh_process_event() - process skb as firmware event.
463 * @event_packet: event packet to process.
467 * If the packet buffer contains a firmware event message it will
468 * dispatch the event to a registered handler (using worker).
476 struct brcmf_fweh_queue_item *event; in brcmf_fweh_process_event() local
480 /* get event info */ in brcmf_fweh_process_event()
495 event = kzalloc(struct_size(event, data, datalen), gfp); in brcmf_fweh_process_event()
496 if (!event) in brcmf_fweh_process_event()
499 event->code = fwevt_idx; in brcmf_fweh_process_event()
500 event->datalen = datalen; in brcmf_fweh_process_event()
501 event->ifidx = event_packet->msg.ifidx; in brcmf_fweh_process_event()
503 /* use memcpy to get aligned event message */ in brcmf_fweh_process_event()
504 memcpy(&event->emsg, &event_packet->msg, sizeof(event->emsg)); in brcmf_fweh_process_event()
505 memcpy(event->data, data, datalen); in brcmf_fweh_process_event()
506 memcpy(event->ifaddr, event_packet->eth.h_dest, ETH_ALEN); in brcmf_fweh_process_event()
508 brcmf_fweh_queue_event(fweh, event); in brcmf_fweh_process_event()