aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43/main.h
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2008-01-02 12:55:53 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-09 02:30:06 -0500
commitd987160b710c98997015832422a05e18d9f0f925 (patch)
treeecb389959d6c9678b77dc88976cc57466c235d79 /drivers/net/wireless/b43/main.h
parent9e8d6f8959c356d8294d45f11231331c3e1bcae6 (diff)
b43: Fix rxheader channel parsing
This patch fixes the parsing of the RX data header channel field. The current code parses the header incorrectly and passes a wrong channel number and frequency for each frame to mac80211. The FIXMEs added by this patch don't matter for now as the code where they live won't get executed anyway. They will be fixed later. Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/main.h')
-rw-r--r--drivers/net/wireless/b43/main.h20
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/net/wireless/b43/main.h b/drivers/net/wireless/b43/main.h
index 284d17da17d1..08e2e56e48f4 100644
--- a/drivers/net/wireless/b43/main.h
+++ b/drivers/net/wireless/b43/main.h
@@ -39,11 +39,11 @@
39#define PAD_BYTES(nr_bytes) P4D_BYTES( __LINE__ , (nr_bytes)) 39#define PAD_BYTES(nr_bytes) P4D_BYTES( __LINE__ , (nr_bytes))
40 40
41/* Lightweight function to convert a frequency (in Mhz) to a channel number. */ 41/* Lightweight function to convert a frequency (in Mhz) to a channel number. */
42static inline u8 b43_freq_to_channel_a(int freq) 42static inline u8 b43_freq_to_channel_5ghz(int freq)
43{ 43{
44 return ((freq - 5000) / 5); 44 return ((freq - 5000) / 5);
45} 45}
46static inline u8 b43_freq_to_channel_bg(int freq) 46static inline u8 b43_freq_to_channel_2ghz(int freq)
47{ 47{
48 u8 channel; 48 u8 channel;
49 49
@@ -54,19 +54,13 @@ static inline u8 b43_freq_to_channel_bg(int freq)
54 54
55 return channel; 55 return channel;
56} 56}
57static inline u8 b43_freq_to_channel(struct b43_wldev *dev, int freq)
58{
59 if (dev->phy.type == B43_PHYTYPE_A)
60 return b43_freq_to_channel_a(freq);
61 return b43_freq_to_channel_bg(freq);
62}
63 57
64/* Lightweight function to convert a channel number to a frequency (in Mhz). */ 58/* Lightweight function to convert a channel number to a frequency (in Mhz). */
65static inline int b43_channel_to_freq_a(u8 channel) 59static inline int b43_channel_to_freq_5ghz(u8 channel)
66{ 60{
67 return (5000 + (5 * channel)); 61 return (5000 + (5 * channel));
68} 62}
69static inline int b43_channel_to_freq_bg(u8 channel) 63static inline int b43_channel_to_freq_2ghz(u8 channel)
70{ 64{
71 int freq; 65 int freq;
72 66
@@ -77,12 +71,6 @@ static inline int b43_channel_to_freq_bg(u8 channel)
77 71
78 return freq; 72 return freq;
79} 73}
80static inline int b43_channel_to_freq(struct b43_wldev *dev, u8 channel)
81{
82 if (dev->phy.type == B43_PHYTYPE_A)
83 return b43_channel_to_freq_a(channel);
84 return b43_channel_to_freq_bg(channel);
85}
86 74
87static inline int b43_is_cck_rate(int rate) 75static inline int b43_is_cck_rate(int rate)
88{ 76{