mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
wireless: use get/put_unaligned_* helpers
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
5a433b3ad4
commit
ae7245cbf2
2 changed files with 8 additions and 10 deletions
|
@ -26,7 +26,7 @@ static inline u32 u32_field_get(u8 *preq_elem, int offset, bool ae)
|
||||||
{
|
{
|
||||||
if (ae)
|
if (ae)
|
||||||
offset += 6;
|
offset += 6;
|
||||||
return le32_to_cpu(get_unaligned((__le32 *) (preq_elem + offset)));
|
return get_unaligned_le32(preq_elem + offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* HWMP IE processing macros */
|
/* HWMP IE processing macros */
|
||||||
|
|
|
@ -59,23 +59,21 @@ int ieee80211_radiotap_iterator_init(
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* sanity check for allowed length and radiotap length field */
|
/* sanity check for allowed length and radiotap length field */
|
||||||
if (max_length < le16_to_cpu(get_unaligned(&radiotap_header->it_len)))
|
if (max_length < get_unaligned_le16(&radiotap_header->it_len))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
iterator->rtheader = radiotap_header;
|
iterator->rtheader = radiotap_header;
|
||||||
iterator->max_length = le16_to_cpu(get_unaligned(
|
iterator->max_length = get_unaligned_le16(&radiotap_header->it_len);
|
||||||
&radiotap_header->it_len));
|
|
||||||
iterator->arg_index = 0;
|
iterator->arg_index = 0;
|
||||||
iterator->bitmap_shifter = le32_to_cpu(get_unaligned(
|
iterator->bitmap_shifter = get_unaligned_le32(&radiotap_header->it_present);
|
||||||
&radiotap_header->it_present));
|
|
||||||
iterator->arg = (u8 *)radiotap_header + sizeof(*radiotap_header);
|
iterator->arg = (u8 *)radiotap_header + sizeof(*radiotap_header);
|
||||||
iterator->this_arg = NULL;
|
iterator->this_arg = NULL;
|
||||||
|
|
||||||
/* find payload start allowing for extended bitmap(s) */
|
/* find payload start allowing for extended bitmap(s) */
|
||||||
|
|
||||||
if (unlikely(iterator->bitmap_shifter & (1<<IEEE80211_RADIOTAP_EXT))) {
|
if (unlikely(iterator->bitmap_shifter & (1<<IEEE80211_RADIOTAP_EXT))) {
|
||||||
while (le32_to_cpu(get_unaligned((__le32 *)iterator->arg)) &
|
while (get_unaligned_le32(iterator->arg) &
|
||||||
(1<<IEEE80211_RADIOTAP_EXT)) {
|
(1 << IEEE80211_RADIOTAP_EXT)) {
|
||||||
iterator->arg += sizeof(u32);
|
iterator->arg += sizeof(u32);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -241,8 +239,8 @@ int ieee80211_radiotap_iterator_next(
|
||||||
if (iterator->bitmap_shifter & 1) {
|
if (iterator->bitmap_shifter & 1) {
|
||||||
/* b31 was set, there is more */
|
/* b31 was set, there is more */
|
||||||
/* move to next u32 bitmap */
|
/* move to next u32 bitmap */
|
||||||
iterator->bitmap_shifter = le32_to_cpu(
|
iterator->bitmap_shifter =
|
||||||
get_unaligned(iterator->next_bitmap));
|
get_unaligned_le32(iterator->next_bitmap);
|
||||||
iterator->next_bitmap++;
|
iterator->next_bitmap++;
|
||||||
} else
|
} else
|
||||||
/* no more bitmaps: end */
|
/* no more bitmaps: end */
|
||||||
|
|
Loading…
Reference in a new issue