|
@@ -233,6 +233,7 @@ static int rtl_op_add_interface(struct ieee80211_hw *hw,
|
|
|
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
|
|
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
|
|
|
int err = 0;
|
|
|
+ u8 retry_limit = 0x30;
|
|
|
|
|
|
if (mac->vif) {
|
|
|
RT_TRACE(rtlpriv, COMP_ERR, DBG_WARNING,
|
|
@@ -271,6 +272,7 @@ static int rtl_op_add_interface(struct ieee80211_hw *hw,
|
|
|
rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_BASIC_RATE,
|
|
|
(u8 *)(&mac->basic_rates));
|
|
|
|
|
|
+ retry_limit = 0x07;
|
|
|
break;
|
|
|
case NL80211_IFTYPE_P2P_GO:
|
|
|
mac->p2p = P2P_ROLE_GO;
|
|
@@ -287,6 +289,8 @@ static int rtl_op_add_interface(struct ieee80211_hw *hw,
|
|
|
mac->basic_rates = 0xff0;
|
|
|
rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_BASIC_RATE,
|
|
|
(u8 *)(&mac->basic_rates));
|
|
|
+
|
|
|
+ retry_limit = 0x07;
|
|
|
break;
|
|
|
case NL80211_IFTYPE_MESH_POINT:
|
|
|
RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
|
|
@@ -300,6 +304,8 @@ static int rtl_op_add_interface(struct ieee80211_hw *hw,
|
|
|
mac->basic_rates = 0xff0;
|
|
|
rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_BASIC_RATE,
|
|
|
(u8 *)(&mac->basic_rates));
|
|
|
+
|
|
|
+ retry_limit = 0x07;
|
|
|
break;
|
|
|
default:
|
|
|
pr_err("operation mode %d is not supported!\n",
|
|
@@ -321,6 +327,10 @@ static int rtl_op_add_interface(struct ieee80211_hw *hw,
|
|
|
memcpy(mac->mac_addr, vif->addr, ETH_ALEN);
|
|
|
rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_ETHER_ADDR, mac->mac_addr);
|
|
|
|
|
|
+ mac->retry_long = retry_limit;
|
|
|
+ mac->retry_short = retry_limit;
|
|
|
+ rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RETRY_LIMIT,
|
|
|
+ (u8 *)(&retry_limit));
|
|
|
out:
|
|
|
mutex_unlock(&rtlpriv->locks.conf_mutex);
|
|
|
return err;
|
|
@@ -645,10 +655,15 @@ static int rtl_op_config(struct ieee80211_hw *hw, u32 changed)
|
|
|
RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
|
|
|
"IEEE80211_CONF_CHANGE_RETRY_LIMITS %x\n",
|
|
|
hw->conf.long_frame_max_tx_count);
|
|
|
- mac->retry_long = hw->conf.long_frame_max_tx_count;
|
|
|
- mac->retry_short = hw->conf.long_frame_max_tx_count;
|
|
|
- rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RETRY_LIMIT,
|
|
|
+ /* brought up everything changes (changed == ~0) indicates first
|
|
|
+ * open, so use our default value instead of that of wiphy.
|
|
|
+ */
|
|
|
+ if (changed != ~0) {
|
|
|
+ mac->retry_long = hw->conf.long_frame_max_tx_count;
|
|
|
+ mac->retry_short = hw->conf.long_frame_max_tx_count;
|
|
|
+ rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RETRY_LIMIT,
|
|
|
(u8 *)(&hw->conf.long_frame_max_tx_count));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (changed & IEEE80211_CONF_CHANGE_CHANNEL &&
|