aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtl818x
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-04-23 10:13:26 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-06 15:14:36 -0400
commit2d0ddec5b2b859f06116f631fc0ffe94fbceb556 (patch)
tree9bf3cdfcbbefcb34f5984e6d797f488ebe358196 /drivers/net/wireless/rtl818x
parent57c4d7b4c4986037be51476b8e3025d5ba18d8b8 (diff)
mac80211: unify config_interface and bss_info_changed
The config_interface method is a little strange, it contains the BSSID and beacon updates, while bss_info_changed contains most other BSS information for each interface. This patch removes config_interface and rolls all the information it previously passed to drivers into bss_info_changed. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rtl818x')
-rw-r--r--drivers/net/wireless/rtl818x/rtl8180_dev.c33
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187_dev.c48
2 files changed, 35 insertions, 46 deletions
diff --git a/drivers/net/wireless/rtl818x/rtl8180_dev.c b/drivers/net/wireless/rtl818x/rtl8180_dev.c
index 387c133ec0f2..7e65d7c31802 100644
--- a/drivers/net/wireless/rtl818x/rtl8180_dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8180_dev.c
@@ -702,30 +702,26 @@ static int rtl8180_config(struct ieee80211_hw *dev, u32 changed)
702 return 0; 702 return 0;
703} 703}
704 704
705static int rtl8180_config_interface(struct ieee80211_hw *dev,
706 struct ieee80211_vif *vif,
707 struct ieee80211_if_conf *conf)
708{
709 struct rtl8180_priv *priv = dev->priv;
710 int i;
711
712 for (i = 0; i < ETH_ALEN; i++)
713 rtl818x_iowrite8(priv, &priv->map->BSSID[i], conf->bssid[i]);
714
715 if (is_valid_ether_addr(conf->bssid))
716 rtl818x_iowrite8(priv, &priv->map->MSR, RTL818X_MSR_INFRA);
717 else
718 rtl818x_iowrite8(priv, &priv->map->MSR, RTL818X_MSR_NO_LINK);
719
720 return 0;
721}
722
723static void rtl8180_bss_info_changed(struct ieee80211_hw *dev, 705static void rtl8180_bss_info_changed(struct ieee80211_hw *dev,
724 struct ieee80211_vif *vif, 706 struct ieee80211_vif *vif,
725 struct ieee80211_bss_conf *info, 707 struct ieee80211_bss_conf *info,
726 u32 changed) 708 u32 changed)
727{ 709{
728 struct rtl8180_priv *priv = dev->priv; 710 struct rtl8180_priv *priv = dev->priv;
711 int i;
712
713 if (changed & BSS_CHANGED_BSSID) {
714 for (i = 0; i < ETH_ALEN; i++)
715 rtl818x_iowrite8(priv, &priv->map->BSSID[i],
716 info->bssid[i]);
717
718 if (is_valid_ether_addr(info->bssid))
719 rtl818x_iowrite8(priv, &priv->map->MSR,
720 RTL818X_MSR_INFRA);
721 else
722 rtl818x_iowrite8(priv, &priv->map->MSR,
723 RTL818X_MSR_NO_LINK);
724 }
729 725
730 if (changed & BSS_CHANGED_ERP_SLOT && priv->rf->conf_erp) 726 if (changed & BSS_CHANGED_ERP_SLOT && priv->rf->conf_erp)
731 priv->rf->conf_erp(dev, info); 727 priv->rf->conf_erp(dev, info);
@@ -770,7 +766,6 @@ static const struct ieee80211_ops rtl8180_ops = {
770 .add_interface = rtl8180_add_interface, 766 .add_interface = rtl8180_add_interface,
771 .remove_interface = rtl8180_remove_interface, 767 .remove_interface = rtl8180_remove_interface,
772 .config = rtl8180_config, 768 .config = rtl8180_config,
773 .config_interface = rtl8180_config_interface,
774 .bss_info_changed = rtl8180_bss_info_changed, 769 .bss_info_changed = rtl8180_bss_info_changed,
775 .configure_filter = rtl8180_configure_filter, 770 .configure_filter = rtl8180_configure_filter,
776}; 771};
diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c
index ac558da92aac..158827e50c55 100644
--- a/drivers/net/wireless/rtl818x/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c
@@ -1090,32 +1090,6 @@ static int rtl8187_config(struct ieee80211_hw *dev, u32 changed)
1090 return 0; 1090 return 0;
1091} 1091}
1092 1092
1093static int rtl8187_config_interface(struct ieee80211_hw *dev,
1094 struct ieee80211_vif *vif,
1095 struct ieee80211_if_conf *conf)
1096{
1097 struct rtl8187_priv *priv = dev->priv;
1098 int i;
1099 u8 reg;
1100
1101 mutex_lock(&priv->conf_mutex);
1102 for (i = 0; i < ETH_ALEN; i++)
1103 rtl818x_iowrite8(priv, &priv->map->BSSID[i], conf->bssid[i]);
1104
1105 if (is_valid_ether_addr(conf->bssid)) {
1106 reg = RTL818X_MSR_INFRA;
1107 if (priv->is_rtl8187b)
1108 reg |= RTL818X_MSR_ENEDCA;
1109 rtl818x_iowrite8(priv, &priv->map->MSR, reg);
1110 } else {
1111 reg = RTL818X_MSR_NO_LINK;
1112 rtl818x_iowrite8(priv, &priv->map->MSR, reg);
1113 }
1114
1115 mutex_unlock(&priv->conf_mutex);
1116 return 0;
1117}
1118
1119/* 1093/*
1120 * With 8187B, AC_*_PARAM clashes with FEMR definition in struct rtl818x_csr for 1094 * With 8187B, AC_*_PARAM clashes with FEMR definition in struct rtl818x_csr for
1121 * example. Thus we have to use raw values for AC_*_PARAM register addresses. 1095 * example. Thus we have to use raw values for AC_*_PARAM register addresses.
@@ -1193,6 +1167,27 @@ static void rtl8187_bss_info_changed(struct ieee80211_hw *dev,
1193 u32 changed) 1167 u32 changed)
1194{ 1168{
1195 struct rtl8187_priv *priv = dev->priv; 1169 struct rtl8187_priv *priv = dev->priv;
1170 int i;
1171 u8 reg;
1172
1173 if (changed & BSS_CHANGED_BSSID) {
1174 mutex_lock(&priv->conf_mutex);
1175 for (i = 0; i < ETH_ALEN; i++)
1176 rtl818x_iowrite8(priv, &priv->map->BSSID[i],
1177 info->bssid[i]);
1178
1179 if (is_valid_ether_addr(info->bssid)) {
1180 reg = RTL818X_MSR_INFRA;
1181 if (priv->is_rtl8187b)
1182 reg |= RTL818X_MSR_ENEDCA;
1183 rtl818x_iowrite8(priv, &priv->map->MSR, reg);
1184 } else {
1185 reg = RTL818X_MSR_NO_LINK;
1186 rtl818x_iowrite8(priv, &priv->map->MSR, reg);
1187 }
1188
1189 mutex_unlock(&priv->conf_mutex);
1190 }
1196 1191
1197 if (changed & (BSS_CHANGED_ERP_SLOT | BSS_CHANGED_ERP_PREAMBLE)) 1192 if (changed & (BSS_CHANGED_ERP_SLOT | BSS_CHANGED_ERP_PREAMBLE))
1198 rtl8187_conf_erp(priv, info->use_short_slot, 1193 rtl8187_conf_erp(priv, info->use_short_slot,
@@ -1274,7 +1269,6 @@ static const struct ieee80211_ops rtl8187_ops = {
1274 .add_interface = rtl8187_add_interface, 1269 .add_interface = rtl8187_add_interface,
1275 .remove_interface = rtl8187_remove_interface, 1270 .remove_interface = rtl8187_remove_interface,
1276 .config = rtl8187_config, 1271 .config = rtl8187_config,
1277 .config_interface = rtl8187_config_interface,
1278 .bss_info_changed = rtl8187_bss_info_changed, 1272 .bss_info_changed = rtl8187_bss_info_changed,
1279 .configure_filter = rtl8187_configure_filter, 1273 .configure_filter = rtl8187_configure_filter,
1280 .conf_tx = rtl8187_conf_tx 1274 .conf_tx = rtl8187_conf_tx