rtl8180: add ERP configuration for rtl8187se
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rtl818x / rtl8180 / dev.c
index 80618525ac783aa7d72574a23edbb574263057ef..6f9da01a90964ce1c3f0c15433fa05446cb1f2ea 100644 (file)
@@ -1336,13 +1336,17 @@ static void rtl8180_conf_erp(struct ieee80211_hw *dev,
        /* from reference code. set ack timeout reg = eifs reg */
        rtl818x_iowrite8(priv, &priv->map->CARRIER_SENSE_COUNTER, hw_eifs);
 
-       /* rtl8187/rtl8185 HW bug. After EIFS is elapsed,
-        * the HW still wait for DIFS.
-        * HW uses 4uS units for EIFS.
-        */
-       hw_eifs = DIV_ROUND_UP(eifs - difs, 4);
+       if (priv->chip_family == RTL818X_CHIP_FAMILY_RTL8187SE)
+               rtl818x_iowrite8(priv, &priv->map->EIFS_8187SE, hw_eifs);
+       else if (priv->chip_family == RTL818X_CHIP_FAMILY_RTL8185) {
+               /* rtl8187/rtl8185 HW bug. After EIFS is elapsed,
+                * the HW still wait for DIFS.
+                * HW uses 4uS units for EIFS.
+                */
+               hw_eifs = DIV_ROUND_UP(eifs - difs, 4);
 
-       rtl818x_iowrite8(priv, &priv->map->EIFS, hw_eifs);
+               rtl818x_iowrite8(priv, &priv->map->EIFS, hw_eifs);
+       }
 }
 
 static void rtl8180_bss_info_changed(struct ieee80211_hw *dev,