1 // SPDX-License-Identifier: GPL-2.0-only
4 * IE Received notification handling.
6 * Copyright (C) 2008 Cambridge Silicon Radio Ltd.
9 #include <linux/errno.h>
10 #include <linux/module.h>
11 #include <linux/device.h>
12 #include <linux/bitmap.h>
13 #include "uwb-internal.h"
16 * Process an incoming IE Received notification.
18 int uwbd_evt_handle_rc_ie_rcv(struct uwb_event
*evt
)
21 struct device
*dev
= &evt
->rc
->uwb_dev
.dev
;
22 struct uwb_rc_evt_ie_rcv
*iercv
;
24 /* Is there enough data to decode it? */
25 if (evt
->notif
.size
< sizeof(*iercv
)) {
26 dev_err(dev
, "IE Received notification: Not enough data to "
27 "decode (%zu vs %zu bytes needed)\n",
28 evt
->notif
.size
, sizeof(*iercv
));
31 iercv
= container_of(evt
->notif
.rceb
, struct uwb_rc_evt_ie_rcv
, rceb
);
33 dev_dbg(dev
, "IE received, element ID=%d\n", iercv
->IEData
[0]);
35 if (iercv
->IEData
[0] == UWB_RELINQUISH_REQUEST_IE
) {
36 dev_warn(dev
, "unhandled Relinquish Request IE\n");