aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-11-04 06:18:11 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-11-09 16:05:49 -0500
commit665c93a93e35cafcd8c84073824f1ef1b19f0a7d (patch)
treef466c5d30e1afd4e8201c916523574d563530785 /net
parent6096de7fd4eeda305e114e7d74e6f47404590425 (diff)
mac80211: add support for control port protocol in AP mode
This will allow us to support dynamic WEP with 802.1X properly in mac80211 by not encrypting outgoing and accepting unencrypted incoming frames. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/cfg.c21
-rw-r--r--net/mac80211/iface.c13
2 files changed, 32 insertions, 2 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 65b72ae2b4e0..1f1056172ef1 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -594,6 +594,8 @@ static int ieee80211_add_beacon(struct wiphy *wiphy, struct net_device *dev,
594{ 594{
595 struct ieee80211_sub_if_data *sdata; 595 struct ieee80211_sub_if_data *sdata;
596 struct beacon_data *old; 596 struct beacon_data *old;
597 struct ieee80211_sub_if_data *vlan;
598 int ret;
597 599
598 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 600 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
599 601
@@ -601,7 +603,24 @@ static int ieee80211_add_beacon(struct wiphy *wiphy, struct net_device *dev,
601 if (old) 603 if (old)
602 return -EALREADY; 604 return -EALREADY;
603 605
604 return ieee80211_config_beacon(sdata, params); 606 ret = ieee80211_config_beacon(sdata, params);
607 if (ret)
608 return ret;
609
610 /*
611 * Apply control port protocol, this allows us to
612 * not encrypt dynamic WEP control frames.
613 */
614 sdata->control_port_protocol = params->crypto.control_port_ethertype;
615 sdata->control_port_no_encrypt = params->crypto.control_port_no_encrypt;
616 list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list) {
617 vlan->control_port_protocol =
618 params->crypto.control_port_ethertype;
619 vlan->control_port_no_encrypt =
620 params->crypto.control_port_no_encrypt;
621 }
622
623 return 0;
605} 624}
606 625
607static int ieee80211_set_beacon(struct wiphy *wiphy, struct net_device *dev, 626static int ieee80211_set_beacon(struct wiphy *wiphy, struct net_device *dev,
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 4ee624c543cb..b7bc4b7b80af 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -188,11 +188,22 @@ static int ieee80211_do_open(struct net_device *dev, bool coming_up)
188 if (!is_valid_ether_addr(sdata->u.wds.remote_addr)) 188 if (!is_valid_ether_addr(sdata->u.wds.remote_addr))
189 return -ENOLINK; 189 return -ENOLINK;
190 break; 190 break;
191 case NL80211_IFTYPE_AP_VLAN: 191 case NL80211_IFTYPE_AP_VLAN: {
192 struct ieee80211_sub_if_data *master;
193
192 if (!sdata->bss) 194 if (!sdata->bss)
193 return -ENOLINK; 195 return -ENOLINK;
196
194 list_add(&sdata->u.vlan.list, &sdata->bss->vlans); 197 list_add(&sdata->u.vlan.list, &sdata->bss->vlans);
198
199 master = container_of(sdata->bss,
200 struct ieee80211_sub_if_data, u.ap);
201 sdata->control_port_protocol =
202 master->control_port_protocol;
203 sdata->control_port_no_encrypt =
204 master->control_port_no_encrypt;
195 break; 205 break;
206 }
196 case NL80211_IFTYPE_AP: 207 case NL80211_IFTYPE_AP:
197 sdata->bss = &sdata->u.ap; 208 sdata->bss = &sdata->u.ap;
198 break; 209 break;