diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/rtl8187_dev.c | 45 | ||||
-rw-r--r-- | drivers/net/wireless/rtl8187_rtl8225.c | 8 |
2 files changed, 41 insertions, 12 deletions
diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c index 991d65c27088..cd839bcb6d78 100644 --- a/drivers/net/wireless/rtl8187_dev.c +++ b/drivers/net/wireless/rtl8187_dev.c | |||
@@ -911,9 +911,45 @@ static int rtl8187_config_interface(struct ieee80211_hw *dev, | |||
911 | return 0; | 911 | return 0; |
912 | } | 912 | } |
913 | 913 | ||
914 | static void rtl8187_conf_erp(struct rtl8187_priv *priv, bool use_short_slot) | 914 | static void rtl8187_conf_erp(struct rtl8187_priv *priv, bool use_short_slot, |
915 | bool use_short_preamble) | ||
915 | { | 916 | { |
916 | if (!priv->is_rtl8187b) { | 917 | if (priv->is_rtl8187b) { |
918 | u8 difs, eifs, slot_time; | ||
919 | u16 ack_timeout; | ||
920 | |||
921 | if (use_short_slot) { | ||
922 | slot_time = 0x9; | ||
923 | difs = 0x1c; | ||
924 | eifs = 0x53; | ||
925 | } else { | ||
926 | slot_time = 0x14; | ||
927 | difs = 0x32; | ||
928 | eifs = 0x5b; | ||
929 | } | ||
930 | rtl818x_iowrite8(priv, &priv->map->SIFS, 0xa); | ||
931 | rtl818x_iowrite8(priv, &priv->map->SLOT, slot_time); | ||
932 | rtl818x_iowrite8(priv, &priv->map->DIFS, difs); | ||
933 | |||
934 | /* | ||
935 | * BRSR+1 on 8187B is in fact EIFS register | ||
936 | * Value in units of 4 us | ||
937 | */ | ||
938 | rtl818x_iowrite8(priv, (u8 *)&priv->map->BRSR + 1, eifs); | ||
939 | |||
940 | /* | ||
941 | * For 8187B, CARRIER_SENSE_COUNTER is in fact ack timeout | ||
942 | * register. In units of 4 us like eifs register | ||
943 | * ack_timeout = ack duration + plcp + difs + preamble | ||
944 | */ | ||
945 | ack_timeout = 112 + 48 + difs; | ||
946 | if (use_short_preamble) | ||
947 | ack_timeout += 72; | ||
948 | else | ||
949 | ack_timeout += 144; | ||
950 | rtl818x_iowrite8(priv, &priv->map->CARRIER_SENSE_COUNTER, | ||
951 | DIV_ROUND_UP(ack_timeout, 4)); | ||
952 | } else { | ||
917 | rtl818x_iowrite8(priv, &priv->map->SIFS, 0x22); | 953 | rtl818x_iowrite8(priv, &priv->map->SIFS, 0x22); |
918 | if (use_short_slot) { | 954 | if (use_short_slot) { |
919 | rtl818x_iowrite8(priv, &priv->map->SLOT, 0x9); | 955 | rtl818x_iowrite8(priv, &priv->map->SLOT, 0x9); |
@@ -936,8 +972,9 @@ static void rtl8187_bss_info_changed(struct ieee80211_hw *dev, | |||
936 | { | 972 | { |
937 | struct rtl8187_priv *priv = dev->priv; | 973 | struct rtl8187_priv *priv = dev->priv; |
938 | 974 | ||
939 | if (changed & BSS_CHANGED_ERP_SLOT) | 975 | if (changed & (BSS_CHANGED_ERP_SLOT | BSS_CHANGED_ERP_PREAMBLE)) |
940 | rtl8187_conf_erp(priv, info->use_short_slot); | 976 | rtl8187_conf_erp(priv, info->use_short_slot, |
977 | info->use_short_preamble); | ||
941 | } | 978 | } |
942 | 979 | ||
943 | static void rtl8187_configure_filter(struct ieee80211_hw *dev, | 980 | static void rtl8187_configure_filter(struct ieee80211_hw *dev, |
diff --git a/drivers/net/wireless/rtl8187_rtl8225.c b/drivers/net/wireless/rtl8187_rtl8225.c index 1bae89903410..b999f87ed150 100644 --- a/drivers/net/wireless/rtl8187_rtl8225.c +++ b/drivers/net/wireless/rtl8187_rtl8225.c | |||
@@ -885,14 +885,6 @@ static void rtl8225z2_b_rf_init(struct ieee80211_hw *dev) | |||
885 | for (i = 0; i < ARRAY_SIZE(rtl8225z2_ofdm); i++) | 885 | for (i = 0; i < ARRAY_SIZE(rtl8225z2_ofdm); i++) |
886 | rtl8225_write_phy_ofdm(dev, i, rtl8225z2_ofdm[i]); | 886 | rtl8225_write_phy_ofdm(dev, i, rtl8225z2_ofdm[i]); |
887 | 887 | ||
888 | rtl818x_iowrite8(priv, &priv->map->SIFS, 0x22); | ||
889 | rtl818x_iowrite8(priv, &priv->map->SLOT, 9); | ||
890 | rtl818x_iowrite8(priv, (u8 *)0xFFF0, 28); | ||
891 | rtl818x_iowrite8(priv, (u8 *)0xFFF4, 28); | ||
892 | rtl818x_iowrite8(priv, (u8 *)0xFFF8, 28); | ||
893 | rtl818x_iowrite8(priv, (u8 *)0xFFFC, 28); | ||
894 | rtl818x_iowrite8(priv, (u8 *)0xFF2D, 0x5B); | ||
895 | rtl818x_iowrite8(priv, (u8 *)0xFF79, 0x5B); | ||
896 | rtl818x_iowrite32(priv, (__le32 *)0xFFF0, (7 << 12) | (3 << 8) | 28); | 888 | rtl818x_iowrite32(priv, (__le32 *)0xFFF0, (7 << 12) | (3 << 8) | 28); |
897 | rtl818x_iowrite32(priv, (__le32 *)0xFFF4, (7 << 12) | (3 << 8) | 28); | 889 | rtl818x_iowrite32(priv, (__le32 *)0xFFF4, (7 << 12) | (3 << 8) | 28); |
898 | rtl818x_iowrite32(priv, (__le32 *)0xFFF8, (7 << 12) | (3 << 8) | 28); | 890 | rtl818x_iowrite32(priv, (__le32 *)0xFFF8, (7 << 12) | (3 << 8) | 28); |