72 #include <linux/slab.h>
73 #include <linux/module.h>
102 static struct uwbd_event uwbd_urc_events[] = {
105 .name =
"IE_RECEIVED"
109 .name =
"BEACON_RECEIVED"
113 .name =
"BEACON_SIZE_CHANGE"
117 .name =
"BPOIE_CHANGE"
121 .name =
"BP_SLOT_CHANGE"
125 .name =
"DRP_AVAILABILITY_CHANGE"
133 .name =
"DEV_ADDR_CONFLICT",
149 .uwbd_events = uwbd_urc_events,
154 static const struct uwbd_event uwbd_message_handlers[] = {
187 type = evt->
notif.rceb->bEventType;
189 context = evt->
notif.rceb->bEventContext;
191 if (type >=
ARRAY_SIZE(uwbd_urc_evt_type_handlers))
193 type_table = &uwbd_urc_evt_type_handlers[
type];
196 if (event >= type_table->
size)
202 result = (*handler)(
evt);
206 "UWBD: event 0x%02x/%04x/%02x, handling failed: %d\n",
207 type, event, context, result);
211 static void uwbd_event_handle_message(
struct uwb_event *evt)
229 static void uwbd_event_handle(
struct uwb_event *evt)
239 should_keep = uwbd_event_handle_urc(evt);
240 if (should_keep <= 0)
244 uwbd_event_handle_message(evt);
277 !list_empty(&rc->
uwbd.event_list)
285 if (!list_empty(&rc->
uwbd.event_list)) {
290 spin_unlock_irqrestore(&rc->
uwbd.event_list_lock, flags);
293 uwbd_event_handle(evt);
339 if (rc->
uwbd.pid != 0) {
343 __uwb_rc_put(evt->
rc);
348 spin_unlock_irqrestore(&rc->
uwbd.event_list_lock, flags);
356 spin_lock_irq(&rc->
uwbd.event_list_lock);
366 spin_unlock_irq(&rc->
uwbd.event_list_lock);