Lines Matching full:event

19  * struct brcmf_fweh_queue_item - event item on event queue.
22 * @code: event code.
23 * @ifidx: interface index related to this event.
25 * @emsg: common parameters of the firmware event message.
27 * @data: event specific data part of the firmware event.
51 /* array for mapping code to event name */
58 * brcmf_fweh_event_name() - returns name for given event code.
79 * brcmf_fweh_queue_event() - create and queue event.
81 * @fweh: firmware event handling info.
82 * @event: event queue entry.
85 struct brcmf_fweh_queue_item *event) in brcmf_fweh_queue_event() argument
90 list_add_tail(&event->q, &fweh->event_q); in brcmf_fweh_queue_event()
107 /* handle the event if valid interface and handler */ in brcmf_fweh_call_event_handler()
111 bphy_err(drvr, "unhandled event %d ignored\n", code); in brcmf_fweh_call_event_handler()
119 * brcmf_fweh_handle_if_event() - handle IF event.
122 * @emsg: event message object.
123 * @data: event object.
133 brcmf_dbg(EVENT, "action: %u ifidx: %u bsscfgidx: %u flags: %u role: %u\n", in brcmf_fweh_handle_if_event()
137 /* The P2P Device interface event must not be ignored contrary to what in brcmf_fweh_handle_if_event()
147 brcmf_dbg(EVENT, "event can be ignored\n"); in brcmf_fweh_handle_if_event()
158 brcmf_dbg(EVENT, "adding %s (%pM)\n", emsg->ifname, in brcmf_fweh_handle_if_event()
180 /* Default handling in case no-one waits for this event */ in brcmf_fweh_handle_if_event()
187 * brcmf_fweh_dequeue_event() - get event from the queue.
189 * @fweh: firmware event handling info.
194 struct brcmf_fweh_queue_item *event = NULL; in brcmf_fweh_dequeue_event() local
199 event = list_first_entry(&fweh->event_q, in brcmf_fweh_dequeue_event()
201 list_del(&event->q); in brcmf_fweh_dequeue_event()
205 return event; in brcmf_fweh_dequeue_event()
209 * brcmf_fweh_event_worker() - firmware event worker.
218 struct brcmf_fweh_queue_item *event; in brcmf_fweh_event_worker() local
226 while ((event = brcmf_fweh_dequeue_event(fweh))) { in brcmf_fweh_event_worker()
227 brcmf_dbg(EVENT, "event %s (%u) ifidx %u bsscfg %u addr %pM\n", in brcmf_fweh_event_worker()
228 brcmf_fweh_event_name(event->code), event->code, in brcmf_fweh_event_worker()
229 event->emsg.ifidx, event->emsg.bsscfgidx, in brcmf_fweh_event_worker()
230 event->emsg.addr); in brcmf_fweh_event_worker()
232 /* convert event message */ in brcmf_fweh_event_worker()
233 emsg_be = &event->emsg; in brcmf_fweh_event_worker()
236 emsg.event_code = event->code; in brcmf_fweh_event_worker()
246 brcmf_dbg(EVENT, " version %u flags %u status %u reason %u\n", in brcmf_fweh_event_worker()
248 brcmf_dbg_hex_dump(BRCMF_EVENT_ON(), event->data, in brcmf_fweh_event_worker()
250 "event payload, len=%d\n", emsg.datalen); in brcmf_fweh_event_worker()
252 /* special handling of interface event */ in brcmf_fweh_event_worker()
253 if (event->code == BRCMF_E_IF) { in brcmf_fweh_event_worker()
254 brcmf_fweh_handle_if_event(drvr, &emsg, event->data); in brcmf_fweh_event_worker()
258 if (event->code == BRCMF_E_TDLS_PEER_EVENT) in brcmf_fweh_event_worker()
262 err = brcmf_fweh_call_event_handler(drvr, ifp, event->code, in brcmf_fweh_event_worker()
263 &emsg, event->data); in brcmf_fweh_event_worker()
265 bphy_err(drvr, "event handler failed (%d)\n", in brcmf_fweh_event_worker()
266 event->code); in brcmf_fweh_event_worker()
270 kfree(event); in brcmf_fweh_event_worker()
286 * brcmf_fweh_attach() - initialize firmware event handling.
299 * brcmf_fweh_detach() - cleanup firmware event handling.
316 * brcmf_fweh_register() - register handler for given event code.
319 * @code: event code.
320 * @handler: handler for the given event code.
326 bphy_err(drvr, "event code %d already registered\n", code); in brcmf_fweh_register()
330 brcmf_dbg(TRACE, "event handler registered for %s\n", in brcmf_fweh_register()
339 * @code: event code.
344 brcmf_dbg(TRACE, "event handler cleared for %s\n", in brcmf_fweh_unregister()
363 brcmf_dbg(EVENT, "enable event %s\n", in brcmf_fweh_activate_events()
369 /* want to handle IF event as well */ in brcmf_fweh_activate_events()
370 brcmf_dbg(EVENT, "enable event IF\n"); in brcmf_fweh_activate_events()
382 * brcmf_fweh_process_event() - process skb as firmware event.
385 * @event_packet: event packet to process.
388 * If the packet buffer contains a firmware event message it will
389 * dispatch the event to a registered handler (using worker).
397 struct brcmf_fweh_queue_item *event; in brcmf_fweh_process_event() local
401 /* get event info */ in brcmf_fweh_process_event()
416 event = kzalloc(sizeof(*event) + datalen, gfp); in brcmf_fweh_process_event()
417 if (!event) in brcmf_fweh_process_event()
420 event->code = code; in brcmf_fweh_process_event()
421 event->ifidx = event_packet->msg.ifidx; in brcmf_fweh_process_event()
423 /* use memcpy to get aligned event message */ in brcmf_fweh_process_event()
424 memcpy(&event->emsg, &event_packet->msg, sizeof(event->emsg)); in brcmf_fweh_process_event()
425 memcpy(event->data, data, datalen); in brcmf_fweh_process_event()
426 event->datalen = datalen; in brcmf_fweh_process_event()
427 memcpy(event->ifaddr, event_packet->eth.h_dest, ETH_ALEN); in brcmf_fweh_process_event()
429 brcmf_fweh_queue_event(fweh, event); in brcmf_fweh_process_event()