kernel/kernel-4.6.5-revert-rtlifi-usleep.patch

80 lines
1.8 KiB
Diff
Raw Normal View History

@@ -, +, @@
---
drivers/net/wireless/realtek/rtlwifi/core.c | 44 +++++++++++++++++++++--------
1 file changed, 32 insertions(+), 12 deletions(-)
--- a/drivers/net/wireless/realtek/rtlwifi/core.c
+++ a/drivers/net/wireless/realtek/rtlwifi/core.c
@@ -54,39 +54,59 @@ EXPORT_SYMBOL(channel5g_80m);
void rtl_addr_delay(u32 addr)
{
if (addr == 0xfe)
- msleep(50);
+ mdelay(50);
else if (addr == 0xfd)
- msleep(5);
+ mdelay(5);
else if (addr == 0xfc)
- msleep(1);
+ mdelay(1);
else if (addr == 0xfb)
- usleep_range(50, 100);
+ udelay(50);
else if (addr == 0xfa)
- usleep_range(5, 10);
+ udelay(5);
else if (addr == 0xf9)
- usleep_range(1, 2);
+ udelay(1);
}
EXPORT_SYMBOL(rtl_addr_delay);
void rtl_rfreg_delay(struct ieee80211_hw *hw, enum radio_path rfpath, u32 addr,
u32 mask, u32 data)
{
- if (addr >= 0xf9 && addr <= 0xfe) {
- rtl_addr_delay(addr);
+ if (addr == 0xfe) {
+ mdelay(50);
+ } else if (addr == 0xfd) {
+ mdelay(5);
+ } else if (addr == 0xfc) {
+ mdelay(1);
+ } else if (addr == 0xfb) {
+ udelay(50);
+ } else if (addr == 0xfa) {
+ udelay(5);
+ } else if (addr == 0xf9) {
+ udelay(1);
} else {
rtl_set_rfreg(hw, rfpath, addr, mask, data);
- usleep_range(1, 2);
+ udelay(1);
}
}
EXPORT_SYMBOL(rtl_rfreg_delay);
void rtl_bb_delay(struct ieee80211_hw *hw, u32 addr, u32 data)
{
- if (addr >= 0xf9 && addr <= 0xfe) {
- rtl_addr_delay(addr);
+ if (addr == 0xfe) {
+ mdelay(50);
+ } else if (addr == 0xfd) {
+ mdelay(5);
+ } else if (addr == 0xfc) {
+ mdelay(1);
+ } else if (addr == 0xfb) {
+ udelay(50);
+ } else if (addr == 0xfa) {
+ udelay(5);
+ } else if (addr == 0xf9) {
+ udelay(1);
} else {
rtl_set_bbreg(hw, addr, MASKDWORD, data);
- usleep_range(1, 2);
+ udelay(1);
}
}
EXPORT_SYMBOL(rtl_bb_delay);
--