summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/p54/txrx.c
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@googlemail.com>2011-08-25 23:47:35 +0200
committerJohn W. Linville <linville@tuxdriver.com>2011-08-29 15:25:29 -0400
commit1cda0fd6096355ad4b0d99b691c2f9ca3198d745 (patch)
tree5b0e4fbfe3b7e3893b258046a92b2f6066f0ae74 /drivers/net/wireless/p54/txrx.c
parent397e5d5b93ba99ad3dc56f1e294f487e77d2daa8 (diff)
p54: Use do_div for 64-bit division to fix 32-bit kernels
Use the do_div macro for 64-bit division. Otherwise, the module will reference __udivdi3 under 32-bit kernels, which is not allowed in kernel space. Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/p54/txrx.c')
-rw-r--r--drivers/net/wireless/p54/txrx.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c
index 44a3bd4b0f4..2b97a89e7ff 100644
--- a/drivers/net/wireless/p54/txrx.c
+++ b/drivers/net/wireless/p54/txrx.c
@@ -19,6 +19,7 @@
#include <linux/init.h>
#include <linux/firmware.h>
#include <linux/etherdevice.h>
+#include <asm/div64.h>
#include <net/mac80211.h>
@@ -582,10 +583,13 @@ static void p54_rx_stats(struct p54_common *priv, struct sk_buff *skb)
if (chan) {
struct survey_info *survey = &priv->survey[chan->hw_value];
survey->noise = clamp_t(s8, priv->noise, -128, 127);
- survey->channel_time = priv->survey_raw.active / 1024;
- survey->channel_time_tx = priv->survey_raw.tx / 1024;
- survey->channel_time_busy = priv->survey_raw.cca / 1024 +
- survey->channel_time_tx;
+ survey->channel_time = priv->survey_raw.active;
+ survey->channel_time_tx = priv->survey_raw.tx;
+ survey->channel_time_busy = priv->survey_raw.tx +
+ priv->survey_raw.cca;
+ do_div(survey->channel_time, 1024);
+ do_div(survey->channel_time_tx, 1024);
+ do_div(survey->channel_time_busy, 1024);
}
tmp = p54_find_and_unlink_skb(priv, hdr->req_id);