Lines Matching refs:iterator
98 struct ieee80211_radiotap_iterator *iterator, in ieee80211_radiotap_iterator_init() argument
114 iterator->_rtheader = radiotap_header; in ieee80211_radiotap_iterator_init()
115 iterator->_max_length = get_unaligned_le16(&radiotap_header->it_len); in ieee80211_radiotap_iterator_init()
116 iterator->_arg_index = 0; in ieee80211_radiotap_iterator_init()
117 iterator->_bitmap_shifter = get_unaligned_le32(&radiotap_header->it_present); in ieee80211_radiotap_iterator_init()
118 iterator->_arg = (uint8_t *)radiotap_header + sizeof(*radiotap_header); in ieee80211_radiotap_iterator_init()
119 iterator->_reset_on_ext = 0; in ieee80211_radiotap_iterator_init()
120 iterator->_next_bitmap = &radiotap_header->it_present; in ieee80211_radiotap_iterator_init()
121 iterator->_next_bitmap++; in ieee80211_radiotap_iterator_init()
122 iterator->_vns = vns; in ieee80211_radiotap_iterator_init()
123 iterator->current_namespace = &radiotap_ns; in ieee80211_radiotap_iterator_init()
124 iterator->is_radiotap_ns = 1; in ieee80211_radiotap_iterator_init()
128 if (iterator->_bitmap_shifter & (1<<IEEE80211_RADIOTAP_EXT)) { in ieee80211_radiotap_iterator_init()
129 if ((unsigned long)iterator->_arg - in ieee80211_radiotap_iterator_init()
130 (unsigned long)iterator->_rtheader + sizeof(uint32_t) > in ieee80211_radiotap_iterator_init()
131 (unsigned long)iterator->_max_length) in ieee80211_radiotap_iterator_init()
133 while (get_unaligned_le32(iterator->_arg) & in ieee80211_radiotap_iterator_init()
135 iterator->_arg += sizeof(uint32_t); in ieee80211_radiotap_iterator_init()
143 if ((unsigned long)iterator->_arg - in ieee80211_radiotap_iterator_init()
144 (unsigned long)iterator->_rtheader + in ieee80211_radiotap_iterator_init()
146 (unsigned long)iterator->_max_length) in ieee80211_radiotap_iterator_init()
150 iterator->_arg += sizeof(uint32_t); in ieee80211_radiotap_iterator_init()
159 iterator->this_arg = iterator->_arg; in ieee80211_radiotap_iterator_init()
167 static void find_ns(struct ieee80211_radiotap_iterator *iterator, in find_ns() argument
172 iterator->current_namespace = NULL; in find_ns()
174 if (!iterator->_vns) in find_ns()
177 for (i = 0; i < iterator->_vns->n_ns; i++) { in find_ns()
178 if (iterator->_vns->ns[i].oui != oui) in find_ns()
180 if (iterator->_vns->ns[i].subns != subns) in find_ns()
183 iterator->current_namespace = &iterator->_vns->ns[i]; in find_ns()
214 struct ieee80211_radiotap_iterator *iterator) in ieee80211_radiotap_iterator_next() argument
222 if ((iterator->_arg_index % 32) == IEEE80211_RADIOTAP_EXT && in ieee80211_radiotap_iterator_next()
223 !(iterator->_bitmap_shifter & 1)) in ieee80211_radiotap_iterator_next()
226 if (!(iterator->_bitmap_shifter & 1)) in ieee80211_radiotap_iterator_next()
230 switch (iterator->_arg_index % 32) { in ieee80211_radiotap_iterator_next()
241 if (!iterator->current_namespace || in ieee80211_radiotap_iterator_next()
242 iterator->_arg_index >= iterator->current_namespace->n_bits) { in ieee80211_radiotap_iterator_next()
243 if (iterator->current_namespace == &radiotap_ns) in ieee80211_radiotap_iterator_next()
247 align = iterator->current_namespace->align_size[iterator->_arg_index].align; in ieee80211_radiotap_iterator_next()
248 size = iterator->current_namespace->align_size[iterator->_arg_index].size; in ieee80211_radiotap_iterator_next()
252 iterator->_arg = iterator->_next_ns_data; in ieee80211_radiotap_iterator_next()
254 iterator->current_namespace = NULL; in ieee80211_radiotap_iterator_next()
272 pad = ((unsigned long)iterator->_arg - in ieee80211_radiotap_iterator_next()
273 (unsigned long)iterator->_rtheader) & (align - 1); in ieee80211_radiotap_iterator_next()
276 iterator->_arg += align - pad; in ieee80211_radiotap_iterator_next()
278 if (iterator->_arg_index % 32 == IEEE80211_RADIOTAP_VENDOR_NAMESPACE) { in ieee80211_radiotap_iterator_next()
281 if ((unsigned long)iterator->_arg + size - in ieee80211_radiotap_iterator_next()
282 (unsigned long)iterator->_rtheader > in ieee80211_radiotap_iterator_next()
283 (unsigned long)iterator->_max_length) in ieee80211_radiotap_iterator_next()
286 oui = (*iterator->_arg << 16) | in ieee80211_radiotap_iterator_next()
287 (*(iterator->_arg + 1) << 8) | in ieee80211_radiotap_iterator_next()
288 *(iterator->_arg + 2); in ieee80211_radiotap_iterator_next()
289 subns = *(iterator->_arg + 3); in ieee80211_radiotap_iterator_next()
291 find_ns(iterator, oui, subns); in ieee80211_radiotap_iterator_next()
293 vnslen = get_unaligned_le16(iterator->_arg + 4); in ieee80211_radiotap_iterator_next()
294 iterator->_next_ns_data = iterator->_arg + size + vnslen; in ieee80211_radiotap_iterator_next()
295 if (!iterator->current_namespace) in ieee80211_radiotap_iterator_next()
303 iterator->this_arg_index = iterator->_arg_index; in ieee80211_radiotap_iterator_next()
304 iterator->this_arg = iterator->_arg; in ieee80211_radiotap_iterator_next()
305 iterator->this_arg_size = size; in ieee80211_radiotap_iterator_next()
308 iterator->_arg += size; in ieee80211_radiotap_iterator_next()
317 if ((unsigned long)iterator->_arg - in ieee80211_radiotap_iterator_next()
318 (unsigned long)iterator->_rtheader > in ieee80211_radiotap_iterator_next()
319 (unsigned long)iterator->_max_length) in ieee80211_radiotap_iterator_next()
323 switch (iterator->_arg_index % 32) { in ieee80211_radiotap_iterator_next()
325 iterator->_reset_on_ext = 1; in ieee80211_radiotap_iterator_next()
327 iterator->is_radiotap_ns = 0; in ieee80211_radiotap_iterator_next()
334 iterator->this_arg_index = in ieee80211_radiotap_iterator_next()
336 if (!iterator->current_namespace) in ieee80211_radiotap_iterator_next()
340 iterator->_reset_on_ext = 1; in ieee80211_radiotap_iterator_next()
341 iterator->current_namespace = &radiotap_ns; in ieee80211_radiotap_iterator_next()
342 iterator->is_radiotap_ns = 1; in ieee80211_radiotap_iterator_next()
349 iterator->_bitmap_shifter = in ieee80211_radiotap_iterator_next()
350 get_unaligned_le32(iterator->_next_bitmap); in ieee80211_radiotap_iterator_next()
351 iterator->_next_bitmap++; in ieee80211_radiotap_iterator_next()
352 if (iterator->_reset_on_ext) in ieee80211_radiotap_iterator_next()
353 iterator->_arg_index = 0; in ieee80211_radiotap_iterator_next()
355 iterator->_arg_index++; in ieee80211_radiotap_iterator_next()
356 iterator->_reset_on_ext = 0; in ieee80211_radiotap_iterator_next()
362 iterator->_bitmap_shifter >>= 1; in ieee80211_radiotap_iterator_next()
363 iterator->_arg_index++; in ieee80211_radiotap_iterator_next()