diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2007-12-27 01:43:16 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 15:08:56 -0800 |
commit | 743b84d2fc87cc19ca1c1cd2a821225caba862b0 (patch) | |
tree | 0687790c9c6d1dd53ba033eff84c010f857b43cb /drivers/net/wireless/ipw2200.c | |
parent | 7698d6977a62bbc6ed3b9d0d0230f2213a3b2f9d (diff) | |
download | lwn-743b84d2fc87cc19ca1c1cd2a821225caba862b0.tar.gz lwn-743b84d2fc87cc19ca1c1cd2a821225caba862b0.zip |
ipw2200 fix: struct ieee80211_radiotap_header is little-endian
some places in driver forget conversions
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ipw2200.c')
-rw-r--r-- | drivers/net/wireless/ipw2200.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index 97a6ff50eb80..5f4d39c9ece4 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c @@ -7759,11 +7759,11 @@ static void ipw_handle_data_packet_monitor(struct ipw_priv *priv, ipw_rt->rt_hdr.it_version = PKTHDR_RADIOTAP_VERSION; ipw_rt->rt_hdr.it_pad = 0; /* always good to zero */ - ipw_rt->rt_hdr.it_len = sizeof(struct ipw_rt_hdr); /* total header+data */ + ipw_rt->rt_hdr.it_len = cpu_to_le16(sizeof(struct ipw_rt_hdr)); /* total header+data */ /* Big bitfield of all the fields we provide in radiotap */ - ipw_rt->rt_hdr.it_present = - ((1 << IEEE80211_RADIOTAP_TSFT) | + ipw_rt->rt_hdr.it_present = cpu_to_le32( + (1 << IEEE80211_RADIOTAP_TSFT) | (1 << IEEE80211_RADIOTAP_FLAGS) | (1 << IEEE80211_RADIOTAP_RATE) | (1 << IEEE80211_RADIOTAP_CHANNEL) | @@ -7973,14 +7973,14 @@ static void ipw_handle_promiscuous_rx(struct ipw_priv *priv, ipw_rt->rt_hdr.it_version = PKTHDR_RADIOTAP_VERSION; ipw_rt->rt_hdr.it_pad = 0; /* always good to zero */ - ipw_rt->rt_hdr.it_len = sizeof(*ipw_rt); /* total header+data */ + ipw_rt->rt_hdr.it_len = cpu_to_le16(sizeof(*ipw_rt)); /* total header+data */ /* Set the size of the skb to the size of the frame */ - skb_put(skb, ipw_rt->rt_hdr.it_len + len); + skb_put(skb, sizeof(*ipw_rt) + len); /* Big bitfield of all the fields we provide in radiotap */ - ipw_rt->rt_hdr.it_present = - ((1 << IEEE80211_RADIOTAP_TSFT) | + ipw_rt->rt_hdr.it_present = cpu_to_le32( + (1 << IEEE80211_RADIOTAP_TSFT) | (1 << IEEE80211_RADIOTAP_FLAGS) | (1 << IEEE80211_RADIOTAP_RATE) | (1 << IEEE80211_RADIOTAP_CHANNEL) | @@ -10436,7 +10436,7 @@ static void ipw_handle_promiscuous_tx(struct ipw_priv *priv, rt_hdr->it_version = PKTHDR_RADIOTAP_VERSION; rt_hdr->it_pad = 0; rt_hdr->it_present = 0; /* after all, it's just an idea */ - rt_hdr->it_present |= (1 << IEEE80211_RADIOTAP_CHANNEL); + rt_hdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_CHANNEL); *(u16*)skb_put(dst, sizeof(u16)) = cpu_to_le16( ieee80211chan2mhz(priv->channel)); @@ -10453,7 +10453,7 @@ static void ipw_handle_promiscuous_tx(struct ipw_priv *priv, cpu_to_le16(IEEE80211_CHAN_OFDM | IEEE80211_CHAN_2GHZ); - rt_hdr->it_len = dst->len; + rt_hdr->it_len = cpu_to_le16(dst->len); skb_copy_from_linear_data(src, skb_put(dst, len), len); |