Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 533dd1b0 authored by Harvey Harrison's avatar Harvey Harrison Committed by Linus Torvalds
Browse files

wireless: use get/put_unaligned_* helpers



Signed-off-by: default avatarHarvey Harrison <harvey.harrison@gmail.com>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: Michael Buesch <mb@bu3sch.de>
Cc: Daniel Drake <dsd@gentoo.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6caf52a4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3657,7 +3657,7 @@ void mpi_receive_802_11 (struct airo_info *ai)
	ptr += hdrlen;
	if (hdrlen == 24)
		ptr += 6;
	gap = le16_to_cpu(get_unaligned((__le16 *)ptr));
	gap = get_unaligned_le16(ptr);
	ptr += sizeof(__le16);
	if (gap) {
		if (gap <= 8)
+2 −6
Original line number Diff line number Diff line
@@ -58,10 +58,6 @@
#include "reg.h"
#include "debug.h"

/* unaligned little endian access */
#define LE_READ_2(_p) (le16_to_cpu(get_unaligned((__le16 *)(_p))))
#define LE_READ_4(_p) (le32_to_cpu(get_unaligned((__le32 *)(_p))))

enum {
	ATH_LED_TX,
	ATH_LED_RX,
@@ -2909,9 +2905,9 @@ static void ath5k_configure_filter(struct ieee80211_hw *hw,
			if (!mclist)
				break;
			/* calculate XOR of eight 6-bit values */
			val = LE_READ_4(mclist->dmi_addr + 0);
			val = get_unaligned_le32(mclist->dmi_addr + 0);
			pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
			val = LE_READ_4(mclist->dmi_addr + 3);
			val = get_unaligned_le32(mclist->dmi_addr + 3);
			pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
			pos &= 0x3f;
			mfilt[pos / 32] |= (1 << (pos % 32));
+1 −1
Original line number Diff line number Diff line
@@ -2171,7 +2171,7 @@ static int b43_write_initvals(struct b43_wldev *dev,
				goto err_format;
			array_size -= sizeof(iv->data.d32);

			value = be32_to_cpu(get_unaligned(&iv->data.d32));
			value = get_unaligned_be32(&iv->data.d32);
			b43_write32(dev, offset, value);

			iv = (const struct b43_iv *)((const uint8_t *)iv +
+1 −1
Original line number Diff line number Diff line
@@ -1720,7 +1720,7 @@ static int b43legacy_write_initvals(struct b43legacy_wldev *dev,
				goto err_format;
			array_size -= sizeof(iv->data.d32);

			value = be32_to_cpu(get_unaligned(&iv->data.d32));
			value = get_unaligned_be32(&iv->data.d32);
			b43legacy_write32(dev, offset, value);

			iv = (const struct b43legacy_iv *)((const uint8_t *)iv +
+14 −18
Original line number Diff line number Diff line
@@ -554,40 +554,36 @@ static void iwl3945_add_radiotap(struct iwl3945_priv *priv,
	iwl3945_rt->rt_hdr.it_pad = 0;

	/* total header + data */
	put_unaligned(cpu_to_le16(sizeof(*iwl3945_rt)),
		      &iwl3945_rt->rt_hdr.it_len);
	put_unaligned_le16(sizeof(*iwl3945_rt), &iwl3945_rt->rt_hdr.it_len);

	/* Indicate all the fields we add to the radiotap header */
	put_unaligned(cpu_to_le32((1 << IEEE80211_RADIOTAP_TSFT) |
	put_unaligned_le32((1 << IEEE80211_RADIOTAP_TSFT) |
			   (1 << IEEE80211_RADIOTAP_FLAGS) |
			   (1 << IEEE80211_RADIOTAP_RATE) |
			   (1 << IEEE80211_RADIOTAP_CHANNEL) |
			   (1 << IEEE80211_RADIOTAP_DBM_ANTSIGNAL) |
			   (1 << IEEE80211_RADIOTAP_DBM_ANTNOISE) |
				  (1 << IEEE80211_RADIOTAP_ANTENNA)),
			   (1 << IEEE80211_RADIOTAP_ANTENNA),
			&iwl3945_rt->rt_hdr.it_present);

	/* Zero the flags, we'll add to them as we go */
	iwl3945_rt->rt_flags = 0;

	put_unaligned(cpu_to_le64(tsf), &iwl3945_rt->rt_tsf);
	put_unaligned_le64(tsf, &iwl3945_rt->rt_tsf);

	iwl3945_rt->rt_dbmsignal = signal;
	iwl3945_rt->rt_dbmnoise = noise;

	/* Convert the channel frequency and set the flags */
	put_unaligned(cpu_to_le16(stats->freq), &iwl3945_rt->rt_channelMHz);
	put_unaligned_le16(stats->freq, &iwl3945_rt->rt_channelMHz);
	if (!(phy_flags_hw & RX_RES_PHY_FLAGS_BAND_24_MSK))
		put_unaligned(cpu_to_le16(IEEE80211_CHAN_OFDM |
					  IEEE80211_CHAN_5GHZ),
		put_unaligned_le16(IEEE80211_CHAN_OFDM | IEEE80211_CHAN_5GHZ,
			      &iwl3945_rt->rt_chbitmask);
	else if (phy_flags_hw & RX_RES_PHY_FLAGS_MOD_CCK_MSK)
		put_unaligned(cpu_to_le16(IEEE80211_CHAN_CCK |
					  IEEE80211_CHAN_2GHZ),
		put_unaligned_le16(IEEE80211_CHAN_CCK | IEEE80211_CHAN_2GHZ,
			      &iwl3945_rt->rt_chbitmask);
	else	/* 802.11g */
		put_unaligned(cpu_to_le16(IEEE80211_CHAN_OFDM |
					  IEEE80211_CHAN_2GHZ),
		put_unaligned_le16(IEEE80211_CHAN_OFDM | IEEE80211_CHAN_2GHZ,
			      &iwl3945_rt->rt_chbitmask);

	if (rate == -1)
Loading