Search Linux Wireless

Re: [PATCH] fix for endian bug in rtl8187

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 13 June 2007 15:59, Kasper F. Brandt wrote:
> Hello
>
> The following patch fixes a bug in the mac80211 rtl8187 driver that
> would prevent it from initializing the hardware correctly on
> big-endian machines.
>
Thanks for finding this!

I used a slightly different approach to fixing this in the attached patch, but 
it's the same idea.

This applies to wireless-dev, but should be applied to the driver in 
wireless-2.6 also.

-Michael Wu
rtl8187: fix endianness issue in rtl8225 register writing

From: Michael Wu <flamingice@xxxxxxxxxxxx>

I failed to notice that a u16 was being passed to the hardware.
This fixes it.

Thanks to Kasper F. Brandt for finding this!

Signed-off-by: Michael Wu <flamingice@xxxxxxxxxxxx>
---

 .../wireless/mac80211/rtl818x/rtl8187_rtl8225.c    |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mac80211/rtl818x/rtl8187_rtl8225.c b/drivers/net/wireless/mac80211/rtl818x/rtl8187_rtl8225.c
index c3f5bf5..97fdff7 100644
--- a/drivers/net/wireless/mac80211/rtl818x/rtl8187_rtl8225.c
+++ b/drivers/net/wireless/mac80211/rtl818x/rtl8187_rtl8225.c
@@ -66,7 +66,7 @@ static void rtl8225_write_bitbang(struct ieee80211_hw *dev, u8 addr, u16 data)
 	msleep(2);
 }
 
-static void rtl8225_write_8051(struct ieee80211_hw *dev, u8 addr, u16 data)
+static void rtl8225_write_8051(struct ieee80211_hw *dev, u8 addr, __le16 data)
 {
 	struct rtl8187_priv *priv = dev->priv;
 	u16 reg80, reg82, reg84;
@@ -105,7 +105,7 @@ void rtl8225_write(struct ieee80211_hw *dev, u8 addr, u16 data)
 	struct rtl8187_priv *priv = dev->priv;
 
 	if (priv->asic_rev)
-		rtl8225_write_8051(dev, addr, data);
+		rtl8225_write_8051(dev, addr, cpu_to_le16(data));
 	else
 		rtl8225_write_bitbang(dev, addr, data);
 }

Attachment: pgpclmTNMhhTh.pgp
Description: PGP signature


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux