diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2008-10-31 12:52:39 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-10 15:17:34 -0500 |
commit | 35cc988a5620cea03fd97e96c530e1f259ef913b (patch) | |
tree | c334640f23b9ac766615762c9d591938949a67a1 /drivers/net/wireless/rtl8187_rtl8225.c | |
parent | 2f20596b50ee964715f9ad44d848802f0baba5d8 (diff) |
rtl8187: Remove OFDM delays
Routine rtl8225_write_phy_ofdm() calls rtl8225_write_phy(), which concludes
with a sleep of 1 msec; therefore a call to rtl8225_write_phy_ofdm()
immediately followed by an msleep(1) is not needed.
Signed-off-by: Larry Finger <Larry.Finger@larry.finger>
Tested-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Tested-by: Hin-Tak Leung <htl10@users.sourceforge.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rtl8187_rtl8225.c')
-rw-r--r-- | drivers/net/wireless/rtl8187_rtl8225.c | 168 |
1 files changed, 82 insertions, 86 deletions
diff --git a/drivers/net/wireless/rtl8187_rtl8225.c b/drivers/net/wireless/rtl8187_rtl8225.c index 85965e0ec75a..7ae7b84111f8 100644 --- a/drivers/net/wireless/rtl8187_rtl8225.c +++ b/drivers/net/wireless/rtl8187_rtl8225.c | |||
@@ -375,50 +375,48 @@ static void rtl8225_rf_init(struct ieee80211_hw *dev) | |||
375 | 375 | ||
376 | for (i = 0; i < ARRAY_SIZE(rtl8225_agc); i++) { | 376 | for (i = 0; i < ARRAY_SIZE(rtl8225_agc); i++) { |
377 | rtl8225_write_phy_ofdm(dev, 0xB, rtl8225_agc[i]); | 377 | rtl8225_write_phy_ofdm(dev, 0xB, rtl8225_agc[i]); |
378 | msleep(1); | ||
379 | rtl8225_write_phy_ofdm(dev, 0xA, 0x80 + i); | 378 | rtl8225_write_phy_ofdm(dev, 0xA, 0x80 + i); |
380 | msleep(1); | ||
381 | } | 379 | } |
382 | 380 | ||
383 | msleep(1); | 381 | msleep(1); |
384 | 382 | ||
385 | rtl8225_write_phy_ofdm(dev, 0x00, 0x01); msleep(1); | 383 | rtl8225_write_phy_ofdm(dev, 0x00, 0x01); |
386 | rtl8225_write_phy_ofdm(dev, 0x01, 0x02); msleep(1); | 384 | rtl8225_write_phy_ofdm(dev, 0x01, 0x02); |
387 | rtl8225_write_phy_ofdm(dev, 0x02, 0x42); msleep(1); | 385 | rtl8225_write_phy_ofdm(dev, 0x02, 0x42); |
388 | rtl8225_write_phy_ofdm(dev, 0x03, 0x00); msleep(1); | 386 | rtl8225_write_phy_ofdm(dev, 0x03, 0x00); |
389 | rtl8225_write_phy_ofdm(dev, 0x04, 0x00); msleep(1); | 387 | rtl8225_write_phy_ofdm(dev, 0x04, 0x00); |
390 | rtl8225_write_phy_ofdm(dev, 0x05, 0x00); msleep(1); | 388 | rtl8225_write_phy_ofdm(dev, 0x05, 0x00); |
391 | rtl8225_write_phy_ofdm(dev, 0x06, 0x40); msleep(1); | 389 | rtl8225_write_phy_ofdm(dev, 0x06, 0x40); |
392 | rtl8225_write_phy_ofdm(dev, 0x07, 0x00); msleep(1); | 390 | rtl8225_write_phy_ofdm(dev, 0x07, 0x00); |
393 | rtl8225_write_phy_ofdm(dev, 0x08, 0x40); msleep(1); | 391 | rtl8225_write_phy_ofdm(dev, 0x08, 0x40); |
394 | rtl8225_write_phy_ofdm(dev, 0x09, 0xfe); msleep(1); | 392 | rtl8225_write_phy_ofdm(dev, 0x09, 0xfe); |
395 | rtl8225_write_phy_ofdm(dev, 0x0a, 0x09); msleep(1); | 393 | rtl8225_write_phy_ofdm(dev, 0x0a, 0x09); |
396 | rtl8225_write_phy_ofdm(dev, 0x0b, 0x80); msleep(1); | 394 | rtl8225_write_phy_ofdm(dev, 0x0b, 0x80); |
397 | rtl8225_write_phy_ofdm(dev, 0x0c, 0x01); msleep(1); | 395 | rtl8225_write_phy_ofdm(dev, 0x0c, 0x01); |
398 | rtl8225_write_phy_ofdm(dev, 0x0e, 0xd3); msleep(1); | 396 | rtl8225_write_phy_ofdm(dev, 0x0e, 0xd3); |
399 | rtl8225_write_phy_ofdm(dev, 0x0f, 0x38); msleep(1); | 397 | rtl8225_write_phy_ofdm(dev, 0x0f, 0x38); |
400 | rtl8225_write_phy_ofdm(dev, 0x10, 0x84); msleep(1); | 398 | rtl8225_write_phy_ofdm(dev, 0x10, 0x84); |
401 | rtl8225_write_phy_ofdm(dev, 0x11, 0x06); msleep(1); | 399 | rtl8225_write_phy_ofdm(dev, 0x11, 0x06); |
402 | rtl8225_write_phy_ofdm(dev, 0x12, 0x20); msleep(1); | 400 | rtl8225_write_phy_ofdm(dev, 0x12, 0x20); |
403 | rtl8225_write_phy_ofdm(dev, 0x13, 0x20); msleep(1); | 401 | rtl8225_write_phy_ofdm(dev, 0x13, 0x20); |
404 | rtl8225_write_phy_ofdm(dev, 0x14, 0x00); msleep(1); | 402 | rtl8225_write_phy_ofdm(dev, 0x14, 0x00); |
405 | rtl8225_write_phy_ofdm(dev, 0x15, 0x40); msleep(1); | 403 | rtl8225_write_phy_ofdm(dev, 0x15, 0x40); |
406 | rtl8225_write_phy_ofdm(dev, 0x16, 0x00); msleep(1); | 404 | rtl8225_write_phy_ofdm(dev, 0x16, 0x00); |
407 | rtl8225_write_phy_ofdm(dev, 0x17, 0x40); msleep(1); | 405 | rtl8225_write_phy_ofdm(dev, 0x17, 0x40); |
408 | rtl8225_write_phy_ofdm(dev, 0x18, 0xef); msleep(1); | 406 | rtl8225_write_phy_ofdm(dev, 0x18, 0xef); |
409 | rtl8225_write_phy_ofdm(dev, 0x19, 0x19); msleep(1); | 407 | rtl8225_write_phy_ofdm(dev, 0x19, 0x19); |
410 | rtl8225_write_phy_ofdm(dev, 0x1a, 0x20); msleep(1); | 408 | rtl8225_write_phy_ofdm(dev, 0x1a, 0x20); |
411 | rtl8225_write_phy_ofdm(dev, 0x1b, 0x76); msleep(1); | 409 | rtl8225_write_phy_ofdm(dev, 0x1b, 0x76); |
412 | rtl8225_write_phy_ofdm(dev, 0x1c, 0x04); msleep(1); | 410 | rtl8225_write_phy_ofdm(dev, 0x1c, 0x04); |
413 | rtl8225_write_phy_ofdm(dev, 0x1e, 0x95); msleep(1); | 411 | rtl8225_write_phy_ofdm(dev, 0x1e, 0x95); |
414 | rtl8225_write_phy_ofdm(dev, 0x1f, 0x75); msleep(1); | 412 | rtl8225_write_phy_ofdm(dev, 0x1f, 0x75); |
415 | rtl8225_write_phy_ofdm(dev, 0x20, 0x1f); msleep(1); | 413 | rtl8225_write_phy_ofdm(dev, 0x20, 0x1f); |
416 | rtl8225_write_phy_ofdm(dev, 0x21, 0x27); msleep(1); | 414 | rtl8225_write_phy_ofdm(dev, 0x21, 0x27); |
417 | rtl8225_write_phy_ofdm(dev, 0x22, 0x16); msleep(1); | 415 | rtl8225_write_phy_ofdm(dev, 0x22, 0x16); |
418 | rtl8225_write_phy_ofdm(dev, 0x24, 0x46); msleep(1); | 416 | rtl8225_write_phy_ofdm(dev, 0x24, 0x46); |
419 | rtl8225_write_phy_ofdm(dev, 0x25, 0x20); msleep(1); | 417 | rtl8225_write_phy_ofdm(dev, 0x25, 0x20); |
420 | rtl8225_write_phy_ofdm(dev, 0x26, 0x90); msleep(1); | 418 | rtl8225_write_phy_ofdm(dev, 0x26, 0x90); |
421 | rtl8225_write_phy_ofdm(dev, 0x27, 0x88); msleep(1); | 419 | rtl8225_write_phy_ofdm(dev, 0x27, 0x88); |
422 | 420 | ||
423 | rtl8225_write_phy_ofdm(dev, 0x0d, rtl8225_gain[2 * 4]); | 421 | rtl8225_write_phy_ofdm(dev, 0x0d, rtl8225_gain[2 * 4]); |
424 | rtl8225_write_phy_ofdm(dev, 0x1b, rtl8225_gain[2 * 4 + 2]); | 422 | rtl8225_write_phy_ofdm(dev, 0x1b, rtl8225_gain[2 * 4 + 2]); |
@@ -459,7 +457,7 @@ static void rtl8225_rf_init(struct ieee80211_hw *dev) | |||
459 | 457 | ||
460 | /* RX antenna default to A */ | 458 | /* RX antenna default to A */ |
461 | rtl8225_write_phy_cck(dev, 0x10, 0x9b); msleep(1); /* B: 0xDB */ | 459 | rtl8225_write_phy_cck(dev, 0x10, 0x9b); msleep(1); /* B: 0xDB */ |
462 | rtl8225_write_phy_ofdm(dev, 0x26, 0x90); msleep(1); /* B: 0x10 */ | 460 | rtl8225_write_phy_ofdm(dev, 0x26, 0x90); /* B: 0x10 */ |
463 | 461 | ||
464 | rtl818x_iowrite8(priv, &priv->map->TX_ANTENNA, 0x03); /* B: 0x00 */ | 462 | rtl818x_iowrite8(priv, &priv->map->TX_ANTENNA, 0x03); /* B: 0x00 */ |
465 | msleep(1); | 463 | msleep(1); |
@@ -736,53 +734,51 @@ static void rtl8225z2_rf_init(struct ieee80211_hw *dev) | |||
736 | 734 | ||
737 | for (i = 0; i < ARRAY_SIZE(rtl8225_agc); i++) { | 735 | for (i = 0; i < ARRAY_SIZE(rtl8225_agc); i++) { |
738 | rtl8225_write_phy_ofdm(dev, 0xB, rtl8225_agc[i]); | 736 | rtl8225_write_phy_ofdm(dev, 0xB, rtl8225_agc[i]); |
739 | msleep(1); | ||
740 | rtl8225_write_phy_ofdm(dev, 0xA, 0x80 + i); | 737 | rtl8225_write_phy_ofdm(dev, 0xA, 0x80 + i); |
741 | msleep(1); | ||
742 | } | 738 | } |
743 | 739 | ||
744 | msleep(1); | 740 | msleep(1); |
745 | 741 | ||
746 | rtl8225_write_phy_ofdm(dev, 0x00, 0x01); msleep(1); | 742 | rtl8225_write_phy_ofdm(dev, 0x00, 0x01); |
747 | rtl8225_write_phy_ofdm(dev, 0x01, 0x02); msleep(1); | 743 | rtl8225_write_phy_ofdm(dev, 0x01, 0x02); |
748 | rtl8225_write_phy_ofdm(dev, 0x02, 0x42); msleep(1); | 744 | rtl8225_write_phy_ofdm(dev, 0x02, 0x42); |
749 | rtl8225_write_phy_ofdm(dev, 0x03, 0x00); msleep(1); | 745 | rtl8225_write_phy_ofdm(dev, 0x03, 0x00); |
750 | rtl8225_write_phy_ofdm(dev, 0x04, 0x00); msleep(1); | 746 | rtl8225_write_phy_ofdm(dev, 0x04, 0x00); |
751 | rtl8225_write_phy_ofdm(dev, 0x05, 0x00); msleep(1); | 747 | rtl8225_write_phy_ofdm(dev, 0x05, 0x00); |
752 | rtl8225_write_phy_ofdm(dev, 0x06, 0x40); msleep(1); | 748 | rtl8225_write_phy_ofdm(dev, 0x06, 0x40); |
753 | rtl8225_write_phy_ofdm(dev, 0x07, 0x00); msleep(1); | 749 | rtl8225_write_phy_ofdm(dev, 0x07, 0x00); |
754 | rtl8225_write_phy_ofdm(dev, 0x08, 0x40); msleep(1); | 750 | rtl8225_write_phy_ofdm(dev, 0x08, 0x40); |
755 | rtl8225_write_phy_ofdm(dev, 0x09, 0xfe); msleep(1); | 751 | rtl8225_write_phy_ofdm(dev, 0x09, 0xfe); |
756 | rtl8225_write_phy_ofdm(dev, 0x0a, 0x08); msleep(1); | 752 | rtl8225_write_phy_ofdm(dev, 0x0a, 0x08); |
757 | rtl8225_write_phy_ofdm(dev, 0x0b, 0x80); msleep(1); | 753 | rtl8225_write_phy_ofdm(dev, 0x0b, 0x80); |
758 | rtl8225_write_phy_ofdm(dev, 0x0c, 0x01); msleep(1); | 754 | rtl8225_write_phy_ofdm(dev, 0x0c, 0x01); |
759 | rtl8225_write_phy_ofdm(dev, 0x0d, 0x43); | 755 | rtl8225_write_phy_ofdm(dev, 0x0d, 0x43); |
760 | rtl8225_write_phy_ofdm(dev, 0x0e, 0xd3); msleep(1); | 756 | rtl8225_write_phy_ofdm(dev, 0x0e, 0xd3); |
761 | rtl8225_write_phy_ofdm(dev, 0x0f, 0x38); msleep(1); | 757 | rtl8225_write_phy_ofdm(dev, 0x0f, 0x38); |
762 | rtl8225_write_phy_ofdm(dev, 0x10, 0x84); msleep(1); | 758 | rtl8225_write_phy_ofdm(dev, 0x10, 0x84); |
763 | rtl8225_write_phy_ofdm(dev, 0x11, 0x07); msleep(1); | 759 | rtl8225_write_phy_ofdm(dev, 0x11, 0x07); |
764 | rtl8225_write_phy_ofdm(dev, 0x12, 0x20); msleep(1); | 760 | rtl8225_write_phy_ofdm(dev, 0x12, 0x20); |
765 | rtl8225_write_phy_ofdm(dev, 0x13, 0x20); msleep(1); | 761 | rtl8225_write_phy_ofdm(dev, 0x13, 0x20); |
766 | rtl8225_write_phy_ofdm(dev, 0x14, 0x00); msleep(1); | 762 | rtl8225_write_phy_ofdm(dev, 0x14, 0x00); |
767 | rtl8225_write_phy_ofdm(dev, 0x15, 0x40); msleep(1); | 763 | rtl8225_write_phy_ofdm(dev, 0x15, 0x40); |
768 | rtl8225_write_phy_ofdm(dev, 0x16, 0x00); msleep(1); | 764 | rtl8225_write_phy_ofdm(dev, 0x16, 0x00); |
769 | rtl8225_write_phy_ofdm(dev, 0x17, 0x40); msleep(1); | 765 | rtl8225_write_phy_ofdm(dev, 0x17, 0x40); |
770 | rtl8225_write_phy_ofdm(dev, 0x18, 0xef); msleep(1); | 766 | rtl8225_write_phy_ofdm(dev, 0x18, 0xef); |
771 | rtl8225_write_phy_ofdm(dev, 0x19, 0x19); msleep(1); | 767 | rtl8225_write_phy_ofdm(dev, 0x19, 0x19); |
772 | rtl8225_write_phy_ofdm(dev, 0x1a, 0x20); msleep(1); | 768 | rtl8225_write_phy_ofdm(dev, 0x1a, 0x20); |
773 | rtl8225_write_phy_ofdm(dev, 0x1b, 0x15); msleep(1); | 769 | rtl8225_write_phy_ofdm(dev, 0x1b, 0x15); |
774 | rtl8225_write_phy_ofdm(dev, 0x1c, 0x04); msleep(1); | 770 | rtl8225_write_phy_ofdm(dev, 0x1c, 0x04); |
775 | rtl8225_write_phy_ofdm(dev, 0x1d, 0xc5); msleep(1); | 771 | rtl8225_write_phy_ofdm(dev, 0x1d, 0xc5); |
776 | rtl8225_write_phy_ofdm(dev, 0x1e, 0x95); msleep(1); | 772 | rtl8225_write_phy_ofdm(dev, 0x1e, 0x95); |
777 | rtl8225_write_phy_ofdm(dev, 0x1f, 0x75); msleep(1); | 773 | rtl8225_write_phy_ofdm(dev, 0x1f, 0x75); |
778 | rtl8225_write_phy_ofdm(dev, 0x20, 0x1f); msleep(1); | 774 | rtl8225_write_phy_ofdm(dev, 0x20, 0x1f); |
779 | rtl8225_write_phy_ofdm(dev, 0x21, 0x17); msleep(1); | 775 | rtl8225_write_phy_ofdm(dev, 0x21, 0x17); |
780 | rtl8225_write_phy_ofdm(dev, 0x22, 0x16); msleep(1); | 776 | rtl8225_write_phy_ofdm(dev, 0x22, 0x16); |
781 | rtl8225_write_phy_ofdm(dev, 0x23, 0x80); msleep(1); //FIXME: not needed? | 777 | rtl8225_write_phy_ofdm(dev, 0x23, 0x80); |
782 | rtl8225_write_phy_ofdm(dev, 0x24, 0x46); msleep(1); | 778 | rtl8225_write_phy_ofdm(dev, 0x24, 0x46); |
783 | rtl8225_write_phy_ofdm(dev, 0x25, 0x00); msleep(1); | 779 | rtl8225_write_phy_ofdm(dev, 0x25, 0x00); |
784 | rtl8225_write_phy_ofdm(dev, 0x26, 0x90); msleep(1); | 780 | rtl8225_write_phy_ofdm(dev, 0x26, 0x90); |
785 | rtl8225_write_phy_ofdm(dev, 0x27, 0x88); msleep(1); | 781 | rtl8225_write_phy_ofdm(dev, 0x27, 0x88); |
786 | 782 | ||
787 | rtl8225_write_phy_ofdm(dev, 0x0b, rtl8225z2_gain_bg[4 * 3]); | 783 | rtl8225_write_phy_ofdm(dev, 0x0b, rtl8225z2_gain_bg[4 * 3]); |
788 | rtl8225_write_phy_ofdm(dev, 0x1b, rtl8225z2_gain_bg[4 * 3 + 1]); | 784 | rtl8225_write_phy_ofdm(dev, 0x1b, rtl8225z2_gain_bg[4 * 3 + 1]); |
@@ -823,7 +819,7 @@ static void rtl8225z2_rf_init(struct ieee80211_hw *dev) | |||
823 | 819 | ||
824 | /* RX antenna default to A */ | 820 | /* RX antenna default to A */ |
825 | rtl8225_write_phy_cck(dev, 0x10, 0x9b); msleep(1); /* B: 0xDB */ | 821 | rtl8225_write_phy_cck(dev, 0x10, 0x9b); msleep(1); /* B: 0xDB */ |
826 | rtl8225_write_phy_ofdm(dev, 0x26, 0x90); msleep(1); /* B: 0x10 */ | 822 | rtl8225_write_phy_ofdm(dev, 0x26, 0x90); /* B: 0x10 */ |
827 | 823 | ||
828 | rtl818x_iowrite8(priv, &priv->map->TX_ANTENNA, 0x03); /* B: 0x00 */ | 824 | rtl818x_iowrite8(priv, &priv->map->TX_ANTENNA, 0x03); /* B: 0x00 */ |
829 | msleep(1); | 825 | msleep(1); |
@@ -889,10 +885,10 @@ static void rtl8225z2_b_rf_init(struct ieee80211_hw *dev) | |||
889 | rtl818x_iowrite32(priv, (__le32 *)0xFFFC, (7 << 12) | (3 << 8) | 28); | 885 | rtl818x_iowrite32(priv, (__le32 *)0xFFFC, (7 << 12) | (3 << 8) | 28); |
890 | rtl818x_iowrite8(priv, &priv->map->ACM_CONTROL, 0); | 886 | rtl818x_iowrite8(priv, &priv->map->ACM_CONTROL, 0); |
891 | 887 | ||
892 | rtl8225_write_phy_ofdm(dev, 0x97, 0x46); msleep(1); | 888 | rtl8225_write_phy_ofdm(dev, 0x97, 0x46); |
893 | rtl8225_write_phy_ofdm(dev, 0xa4, 0xb6); msleep(1); | 889 | rtl8225_write_phy_ofdm(dev, 0xa4, 0xb6); |
894 | rtl8225_write_phy_ofdm(dev, 0x85, 0xfc); msleep(1); | 890 | rtl8225_write_phy_ofdm(dev, 0x85, 0xfc); |
895 | rtl8225_write_phy_cck(dev, 0xc1, 0x88); msleep(1); | 891 | rtl8225_write_phy_cck(dev, 0xc1, 0x88); |
896 | } | 892 | } |
897 | 893 | ||
898 | static void rtl8225_rf_stop(struct ieee80211_hw *dev) | 894 | static void rtl8225_rf_stop(struct ieee80211_hw *dev) |