Lines Matching +full:align +full:- +full:size
20 [IEEE80211_RADIOTAP_TSFT] = { .align = 8, .size = 8, },
21 [IEEE80211_RADIOTAP_FLAGS] = { .align = 1, .size = 1, },
22 [IEEE80211_RADIOTAP_RATE] = { .align = 1, .size = 1, },
23 [IEEE80211_RADIOTAP_CHANNEL] = { .align = 2, .size = 4, },
24 [IEEE80211_RADIOTAP_FHSS] = { .align = 2, .size = 2, },
25 [IEEE80211_RADIOTAP_DBM_ANTSIGNAL] = { .align = 1, .size = 1, },
26 [IEEE80211_RADIOTAP_DBM_ANTNOISE] = { .align = 1, .size = 1, },
27 [IEEE80211_RADIOTAP_LOCK_QUALITY] = { .align = 2, .size = 2, },
28 [IEEE80211_RADIOTAP_TX_ATTENUATION] = { .align = 2, .size = 2, },
29 [IEEE80211_RADIOTAP_DB_TX_ATTENUATION] = { .align = 2, .size = 2, },
30 [IEEE80211_RADIOTAP_DBM_TX_POWER] = { .align = 1, .size = 1, },
31 [IEEE80211_RADIOTAP_ANTENNA] = { .align = 1, .size = 1, },
32 [IEEE80211_RADIOTAP_DB_ANTSIGNAL] = { .align = 1, .size = 1, },
33 [IEEE80211_RADIOTAP_DB_ANTNOISE] = { .align = 1, .size = 1, },
34 [IEEE80211_RADIOTAP_RX_FLAGS] = { .align = 2, .size = 2, },
35 [IEEE80211_RADIOTAP_TX_FLAGS] = { .align = 2, .size = 2, },
36 [IEEE80211_RADIOTAP_RTS_RETRIES] = { .align = 1, .size = 1, },
37 [IEEE80211_RADIOTAP_DATA_RETRIES] = { .align = 1, .size = 1, },
38 [IEEE80211_RADIOTAP_MCS] = { .align = 1, .size = 3, },
39 [IEEE80211_RADIOTAP_AMPDU_STATUS] = { .align = 4, .size = 8, },
40 [IEEE80211_RADIOTAP_VHT] = { .align = 2, .size = 12, },
41 [IEEE80211_RADIOTAP_TIMESTAMP] = { .align = 8, .size = 12, },
53 * ieee80211_radiotap_iterator_init - radiotap parser iterator initialization
66 * call __ieee80211_radiotap_iterator_init() to init a semi-opaque iterator
70 * -ENOENT if there are no more args to parse, or -EINVAL if there is a problem.
77 * You can find the CPU-endian total radiotap header length in
78 * iterator->max_length after executing ieee80211_radiotap_iterator_init()
97 return -EINVAL; in ieee80211_radiotap_iterator_init()
100 if (radiotap_header->it_version) in ieee80211_radiotap_iterator_init()
101 return -EINVAL; in ieee80211_radiotap_iterator_init()
104 if (max_length < get_unaligned_le16(&radiotap_header->it_len)) in ieee80211_radiotap_iterator_init()
105 return -EINVAL; in ieee80211_radiotap_iterator_init()
107 iterator->_rtheader = radiotap_header; in ieee80211_radiotap_iterator_init()
108 iterator->_max_length = get_unaligned_le16(&radiotap_header->it_len); in ieee80211_radiotap_iterator_init()
109 iterator->_arg_index = 0; in ieee80211_radiotap_iterator_init()
110 iterator->_bitmap_shifter = get_unaligned_le32(&radiotap_header->it_present); in ieee80211_radiotap_iterator_init()
111 iterator->_arg = (uint8_t *)radiotap_header + sizeof(*radiotap_header); in ieee80211_radiotap_iterator_init()
112 iterator->_next_ns_data = NULL; in ieee80211_radiotap_iterator_init()
113 iterator->_reset_on_ext = 0; in ieee80211_radiotap_iterator_init()
114 …iterator->_next_bitmap = (le32 *) (((u8 *) radiotap_header) + offsetof(struct ieee80211_radiotap_h… in ieee80211_radiotap_iterator_init()
115 iterator->_next_bitmap++; in ieee80211_radiotap_iterator_init()
116 iterator->_vns = vns; in ieee80211_radiotap_iterator_init()
117 iterator->current_namespace = &radiotap_ns; in ieee80211_radiotap_iterator_init()
118 iterator->is_radiotap_ns = 1; in ieee80211_radiotap_iterator_init()
120 iterator->n_overrides = 0; in ieee80211_radiotap_iterator_init()
121 iterator->overrides = NULL; in ieee80211_radiotap_iterator_init()
126 if (iterator->_bitmap_shifter & BIT(IEEE80211_RADIOTAP_EXT)) { in ieee80211_radiotap_iterator_init()
127 if ((unsigned long)iterator->_arg - in ieee80211_radiotap_iterator_init()
128 (unsigned long)iterator->_rtheader + sizeof(uint32_t) > in ieee80211_radiotap_iterator_init()
129 (unsigned long)iterator->_max_length) in ieee80211_radiotap_iterator_init()
130 return -EINVAL; in ieee80211_radiotap_iterator_init()
131 while (get_unaligned_le32(iterator->_arg) & in ieee80211_radiotap_iterator_init()
133 iterator->_arg += sizeof(uint32_t); in ieee80211_radiotap_iterator_init()
141 if ((unsigned long)iterator->_arg - in ieee80211_radiotap_iterator_init()
142 (unsigned long)iterator->_rtheader + in ieee80211_radiotap_iterator_init()
144 (unsigned long)iterator->_max_length) in ieee80211_radiotap_iterator_init()
145 return -EINVAL; in ieee80211_radiotap_iterator_init()
148 iterator->_arg += sizeof(uint32_t); in ieee80211_radiotap_iterator_init()
157 iterator->this_arg = iterator->_arg; in ieee80211_radiotap_iterator_init()
158 iterator->this_arg_index = 0; in ieee80211_radiotap_iterator_init()
159 iterator->this_arg_size = 0; in ieee80211_radiotap_iterator_init()
171 iterator->current_namespace = NULL; in find_ns()
173 if (!iterator->_vns) in find_ns()
176 for (i = 0; i < iterator->_vns->n_ns; i++) { in find_ns()
177 if (iterator->_vns->ns[i].oui != oui) in find_ns()
179 if (iterator->_vns->ns[i].subns != subns) in find_ns()
182 iterator->current_namespace = &iterator->_vns->ns[i]; in find_ns()
189 int *align, int *size) in find_override() argument
193 if (!iterator->overrides) in find_override()
196 for (i = 0; i < iterator->n_overrides; i++) { in find_override()
197 if (iterator->_arg_index == iterator->overrides[i].field) { in find_override()
198 *align = iterator->overrides[i].align; in find_override()
199 *size = iterator->overrides[i].size; in find_override()
200 if (!*align) /* erroneous override */ in find_override()
212 * ieee80211_radiotap_iterator_next - return next radiotap parser iterator arg
216 * -ENOENT if there are no more args or -EINVAL
225 * little-endian format whatever the endianness of your CPU.
239 int pad, align, size, subns; in ieee80211_radiotap_iterator_next() local
243 if ((iterator->_arg_index % 32) == IEEE80211_RADIOTAP_EXT && in ieee80211_radiotap_iterator_next()
244 !(iterator->_bitmap_shifter & 1)) in ieee80211_radiotap_iterator_next()
245 return -ENOENT; in ieee80211_radiotap_iterator_next()
247 if (!(iterator->_bitmap_shifter & 1)) in ieee80211_radiotap_iterator_next()
250 /* get alignment/size of data */ in ieee80211_radiotap_iterator_next()
251 switch (iterator->_arg_index % 32) { in ieee80211_radiotap_iterator_next()
254 align = 1; in ieee80211_radiotap_iterator_next()
255 size = 0; in ieee80211_radiotap_iterator_next()
258 align = 2; in ieee80211_radiotap_iterator_next()
259 size = 6; in ieee80211_radiotap_iterator_next()
263 if (find_override(iterator, &align, &size)) { in ieee80211_radiotap_iterator_next()
267 if (!iterator->current_namespace || in ieee80211_radiotap_iterator_next()
268 iterator->_arg_index >= iterator->current_namespace->n_bits) { in ieee80211_radiotap_iterator_next()
269 if (iterator->current_namespace == &radiotap_ns) in ieee80211_radiotap_iterator_next()
270 return -ENOENT; in ieee80211_radiotap_iterator_next()
271 align = 0; in ieee80211_radiotap_iterator_next()
273 align = iterator->current_namespace->align_size[iterator->_arg_index].align; in ieee80211_radiotap_iterator_next()
274 size = iterator->current_namespace->align_size[iterator->_arg_index].size; in ieee80211_radiotap_iterator_next()
276 if (!align) { in ieee80211_radiotap_iterator_next()
278 iterator->_arg = iterator->_next_ns_data; in ieee80211_radiotap_iterator_next()
280 iterator->current_namespace = NULL; in ieee80211_radiotap_iterator_next()
298 pad = ((unsigned long)iterator->_arg - in ieee80211_radiotap_iterator_next()
299 (unsigned long)iterator->_rtheader) & (align - 1); in ieee80211_radiotap_iterator_next()
302 iterator->_arg += align - pad; in ieee80211_radiotap_iterator_next()
304 if (iterator->_arg_index % 32 == IEEE80211_RADIOTAP_VENDOR_NAMESPACE) { in ieee80211_radiotap_iterator_next()
307 if ((unsigned long)iterator->_arg + size - in ieee80211_radiotap_iterator_next()
308 (unsigned long)iterator->_rtheader > in ieee80211_radiotap_iterator_next()
309 (unsigned long)iterator->_max_length) in ieee80211_radiotap_iterator_next()
310 return -EINVAL; in ieee80211_radiotap_iterator_next()
312 oui = (*iterator->_arg << 16) | in ieee80211_radiotap_iterator_next()
313 (*(iterator->_arg + 1) << 8) | in ieee80211_radiotap_iterator_next()
314 *(iterator->_arg + 2); in ieee80211_radiotap_iterator_next()
315 subns = *(iterator->_arg + 3); in ieee80211_radiotap_iterator_next()
319 vnslen = get_unaligned_le16(iterator->_arg + 4); in ieee80211_radiotap_iterator_next()
320 iterator->_next_ns_data = iterator->_arg + size + vnslen; in ieee80211_radiotap_iterator_next()
321 if (!iterator->current_namespace) in ieee80211_radiotap_iterator_next()
322 size += vnslen; in ieee80211_radiotap_iterator_next()
329 iterator->this_arg_index = iterator->_arg_index; in ieee80211_radiotap_iterator_next()
330 iterator->this_arg = iterator->_arg; in ieee80211_radiotap_iterator_next()
331 iterator->this_arg_size = size; in ieee80211_radiotap_iterator_next()
333 /* internally move on the size of this arg */ in ieee80211_radiotap_iterator_next()
334 iterator->_arg += size; in ieee80211_radiotap_iterator_next()
343 if ((unsigned long)iterator->_arg - in ieee80211_radiotap_iterator_next()
344 (unsigned long)iterator->_rtheader > in ieee80211_radiotap_iterator_next()
345 (unsigned long)iterator->_max_length) in ieee80211_radiotap_iterator_next()
346 return -EINVAL; in ieee80211_radiotap_iterator_next()
349 switch (iterator->_arg_index % 32) { in ieee80211_radiotap_iterator_next()
351 iterator->_reset_on_ext = 1; in ieee80211_radiotap_iterator_next()
353 iterator->is_radiotap_ns = 0; in ieee80211_radiotap_iterator_next()
360 iterator->this_arg_index = in ieee80211_radiotap_iterator_next()
362 if (!iterator->current_namespace) in ieee80211_radiotap_iterator_next()
366 iterator->_reset_on_ext = 1; in ieee80211_radiotap_iterator_next()
367 iterator->current_namespace = &radiotap_ns; in ieee80211_radiotap_iterator_next()
368 iterator->is_radiotap_ns = 1; in ieee80211_radiotap_iterator_next()
373 * -- move to next u32 bitmap in ieee80211_radiotap_iterator_next()
375 iterator->_bitmap_shifter = in ieee80211_radiotap_iterator_next()
376 get_unaligned_le32(iterator->_next_bitmap); in ieee80211_radiotap_iterator_next()
377 iterator->_next_bitmap++; in ieee80211_radiotap_iterator_next()
378 if (iterator->_reset_on_ext) in ieee80211_radiotap_iterator_next()
379 iterator->_arg_index = 0; in ieee80211_radiotap_iterator_next()
381 iterator->_arg_index++; in ieee80211_radiotap_iterator_next()
382 iterator->_reset_on_ext = 0; in ieee80211_radiotap_iterator_next()
388 iterator->_bitmap_shifter >>= 1; in ieee80211_radiotap_iterator_next()
389 iterator->_arg_index++; in ieee80211_radiotap_iterator_next()