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->it_optional; in ieee80211_radiotap_iterator_init()
119 iterator->_reset_on_ext = 0; in ieee80211_radiotap_iterator_init()
120 iterator->_next_bitmap = radiotap_header->it_optional; in ieee80211_radiotap_iterator_init()
121 iterator->_vns = vns; in ieee80211_radiotap_iterator_init()
122 iterator->current_namespace = &radiotap_ns; in ieee80211_radiotap_iterator_init()
123 iterator->is_radiotap_ns = 1; in ieee80211_radiotap_iterator_init()
127 if (iterator->_bitmap_shifter & (BIT(IEEE80211_RADIOTAP_EXT))) { in ieee80211_radiotap_iterator_init()
128 if ((unsigned long)iterator->_arg - in ieee80211_radiotap_iterator_init()
129 (unsigned long)iterator->_rtheader + sizeof(uint32_t) > in ieee80211_radiotap_iterator_init()
130 (unsigned long)iterator->_max_length) in ieee80211_radiotap_iterator_init()
132 while (get_unaligned_le32(iterator->_arg) & in ieee80211_radiotap_iterator_init()
134 iterator->_arg += sizeof(uint32_t); in ieee80211_radiotap_iterator_init()
142 if ((unsigned long)iterator->_arg - in ieee80211_radiotap_iterator_init()
143 (unsigned long)iterator->_rtheader + in ieee80211_radiotap_iterator_init()
145 (unsigned long)iterator->_max_length) in ieee80211_radiotap_iterator_init()
149 iterator->_arg += sizeof(uint32_t); in ieee80211_radiotap_iterator_init()
158 iterator->this_arg = iterator->_arg; in ieee80211_radiotap_iterator_init()
166 static void find_ns(struct ieee80211_radiotap_iterator *iterator, in find_ns() argument
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()
213 struct ieee80211_radiotap_iterator *iterator) in ieee80211_radiotap_iterator_next() argument
221 if ((iterator->_arg_index % 32) == IEEE80211_RADIOTAP_EXT && in ieee80211_radiotap_iterator_next()
222 !(iterator->_bitmap_shifter & 1)) in ieee80211_radiotap_iterator_next()
225 if (!(iterator->_bitmap_shifter & 1)) in ieee80211_radiotap_iterator_next()
229 switch (iterator->_arg_index % 32) { in ieee80211_radiotap_iterator_next()
240 if (!iterator->current_namespace || in ieee80211_radiotap_iterator_next()
241 iterator->_arg_index >= iterator->current_namespace->n_bits) { in ieee80211_radiotap_iterator_next()
242 if (iterator->current_namespace == &radiotap_ns) in ieee80211_radiotap_iterator_next()
246 align = iterator->current_namespace->align_size[iterator->_arg_index].align; in ieee80211_radiotap_iterator_next()
247 size = iterator->current_namespace->align_size[iterator->_arg_index].size; in ieee80211_radiotap_iterator_next()
251 iterator->_arg = iterator->_next_ns_data; in ieee80211_radiotap_iterator_next()
253 iterator->current_namespace = NULL; in ieee80211_radiotap_iterator_next()
271 pad = ((unsigned long)iterator->_arg - in ieee80211_radiotap_iterator_next()
272 (unsigned long)iterator->_rtheader) & (align - 1); in ieee80211_radiotap_iterator_next()
275 iterator->_arg += align - pad; in ieee80211_radiotap_iterator_next()
277 if (iterator->_arg_index % 32 == IEEE80211_RADIOTAP_VENDOR_NAMESPACE) { in ieee80211_radiotap_iterator_next()
280 if ((unsigned long)iterator->_arg + size - in ieee80211_radiotap_iterator_next()
281 (unsigned long)iterator->_rtheader > in ieee80211_radiotap_iterator_next()
282 (unsigned long)iterator->_max_length) in ieee80211_radiotap_iterator_next()
285 oui = (*iterator->_arg << 16) | in ieee80211_radiotap_iterator_next()
286 (*(iterator->_arg + 1) << 8) | in ieee80211_radiotap_iterator_next()
287 *(iterator->_arg + 2); in ieee80211_radiotap_iterator_next()
288 subns = *(iterator->_arg + 3); in ieee80211_radiotap_iterator_next()
290 find_ns(iterator, oui, subns); in ieee80211_radiotap_iterator_next()
292 vnslen = get_unaligned_le16(iterator->_arg + 4); in ieee80211_radiotap_iterator_next()
293 iterator->_next_ns_data = iterator->_arg + size + vnslen; in ieee80211_radiotap_iterator_next()
294 if (!iterator->current_namespace) in ieee80211_radiotap_iterator_next()
302 iterator->this_arg_index = iterator->_arg_index; in ieee80211_radiotap_iterator_next()
303 iterator->this_arg = iterator->_arg; in ieee80211_radiotap_iterator_next()
304 iterator->this_arg_size = size; in ieee80211_radiotap_iterator_next()
307 iterator->_arg += size; in ieee80211_radiotap_iterator_next()
316 if ((unsigned long)iterator->_arg - in ieee80211_radiotap_iterator_next()
317 (unsigned long)iterator->_rtheader > in ieee80211_radiotap_iterator_next()
318 (unsigned long)iterator->_max_length) in ieee80211_radiotap_iterator_next()
322 switch (iterator->_arg_index % 32) { in ieee80211_radiotap_iterator_next()
324 iterator->_reset_on_ext = 1; in ieee80211_radiotap_iterator_next()
326 iterator->is_radiotap_ns = 0; in ieee80211_radiotap_iterator_next()
333 iterator->this_arg_index = in ieee80211_radiotap_iterator_next()
335 if (!iterator->current_namespace) in ieee80211_radiotap_iterator_next()
339 iterator->_reset_on_ext = 1; in ieee80211_radiotap_iterator_next()
340 iterator->current_namespace = &radiotap_ns; in ieee80211_radiotap_iterator_next()
341 iterator->is_radiotap_ns = 1; in ieee80211_radiotap_iterator_next()
348 iterator->_bitmap_shifter = in ieee80211_radiotap_iterator_next()
349 get_unaligned_le32(iterator->_next_bitmap); in ieee80211_radiotap_iterator_next()
350 iterator->_next_bitmap++; in ieee80211_radiotap_iterator_next()
351 if (iterator->_reset_on_ext) in ieee80211_radiotap_iterator_next()
352 iterator->_arg_index = 0; in ieee80211_radiotap_iterator_next()
354 iterator->_arg_index++; in ieee80211_radiotap_iterator_next()
355 iterator->_reset_on_ext = 0; in ieee80211_radiotap_iterator_next()
361 iterator->_bitmap_shifter >>= 1; in ieee80211_radiotap_iterator_next()
362 iterator->_arg_index++; in ieee80211_radiotap_iterator_next()