37 #include <linux/errno.h>
38 #include <linux/module.h>
39 #include <linux/device.h>
40 #include <linux/bitmap.h>
125 uwb_mas_bm_copy_le(rc->
drp_avail.ie.bmp, &avail);
141 unsigned long get_val(
u8 *array,
size_t itr,
size_t len)
143 unsigned long val = 0;
144 size_t top = itr + len;
146 BUG_ON(len >
sizeof(val));
150 val |= array[top - 1];
153 val <<= 8 * (
sizeof(
val) - len);
202 void buffer_to_bmp(
unsigned long *bmp_itr,
void *
_buffer,
210 while (itr < buffer_size) {
211 len = buffer_size - itr >=
sizeof(
val) ?
212 sizeof(val) : buffer_size - itr;
213 val = get_val(buffer, itr, len);
214 bmp_itr[itr /
sizeof(
val)] = val;
227 int uwbd_evt_get_drp_avail(
struct uwb_event *
evt,
unsigned long *bmp)
234 if (evt->
notif.size <
sizeof(*drp_evt)) {
235 dev_err(dev,
"DRP Availability Change: Not enough "
236 "data to decode event [%zu bytes, %zu "
237 "needed]\n", evt->
notif.size,
sizeof(*drp_evt));
277 result = uwbd_evt_get_drp_avail(evt, bmp);