Skip to content

Commit f212935

Browse files
jmberglinvjw
authored andcommitted
cfg80211: managed mode wext compatibility
This adds code to make it possible to use the cfg80211 connect() API with wireless extensions, and because the previous patch added emulation of that API with auth() and assoc(), by extension also supports wext on that. At the same time, removes code from mac80211 for wext, but doesn't yet clean up mac80211's mlme code more. Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent 6829c87 commit f212935

10 files changed

Lines changed: 625 additions & 338 deletions

File tree

‎include/net/cfg80211.h‎

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1253,8 +1253,14 @@ struct wireless_dev {
12531253
#ifdef CONFIG_WIRELESS_EXT
12541254
/* wext data */
12551255
struct {
1256-
struct cfg80211_ibss_params ibss;
1256+
union {
1257+
struct cfg80211_ibss_params ibss;
1258+
struct cfg80211_connect_params connect;
1259+
};
1260+
u8 *ie;
1261+
size_t ie_len;
12571262
u8 bssid[ETH_ALEN];
1263+
u8 ssid[IEEE80211_MAX_SSID_LEN];
12581264
s8 default_key, default_mgmt_key;
12591265
} wext;
12601266
#endif
@@ -1535,6 +1541,34 @@ int cfg80211_ibss_wext_giwap(struct net_device *dev,
15351541
struct iw_request_info *info,
15361542
struct sockaddr *ap_addr, char *extra);
15371543

1544+
int cfg80211_mgd_wext_siwfreq(struct net_device *dev,
1545+
struct iw_request_info *info,
1546+
struct iw_freq *freq, char *extra);
1547+
int cfg80211_mgd_wext_giwfreq(struct net_device *dev,
1548+
struct iw_request_info *info,
1549+
struct iw_freq *freq, char *extra);
1550+
int cfg80211_mgd_wext_siwessid(struct net_device *dev,
1551+
struct iw_request_info *info,
1552+
struct iw_point *data, char *ssid);
1553+
int cfg80211_mgd_wext_giwessid(struct net_device *dev,
1554+
struct iw_request_info *info,
1555+
struct iw_point *data, char *ssid);
1556+
int cfg80211_mgd_wext_siwap(struct net_device *dev,
1557+
struct iw_request_info *info,
1558+
struct sockaddr *ap_addr, char *extra);
1559+
int cfg80211_mgd_wext_giwap(struct net_device *dev,
1560+
struct iw_request_info *info,
1561+
struct sockaddr *ap_addr, char *extra);
1562+
int cfg80211_wext_siwgenie(struct net_device *dev,
1563+
struct iw_request_info *info,
1564+
struct iw_point *data, char *extra);
1565+
int cfg80211_wext_siwauth(struct net_device *dev,
1566+
struct iw_request_info *info,
1567+
struct iw_param *data, char *extra);
1568+
int cfg80211_wext_giwauth(struct net_device *dev,
1569+
struct iw_request_info *info,
1570+
struct iw_param *data, char *extra);
1571+
15381572
struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy,
15391573
struct iw_freq *freq);
15401574

‎net/mac80211/mlme.c‎

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -870,70 +870,6 @@ static u32 ieee80211_handle_bss_capability(struct ieee80211_sub_if_data *sdata,
870870
return changed;
871871
}
872872

873-
static void ieee80211_sta_send_apinfo(struct ieee80211_sub_if_data *sdata)
874-
{
875-
union iwreq_data wrqu;
876-
877-
memset(&wrqu, 0, sizeof(wrqu));
878-
if (sdata->u.mgd.flags & IEEE80211_STA_ASSOCIATED)
879-
memcpy(wrqu.ap_addr.sa_data, sdata->u.mgd.bssid, ETH_ALEN);
880-
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
881-
wireless_send_event(sdata->dev, SIOCGIWAP, &wrqu, NULL);
882-
}
883-
884-
static void ieee80211_sta_send_associnfo(struct ieee80211_sub_if_data *sdata)
885-
{
886-
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
887-
char *buf;
888-
size_t len;
889-
int i;
890-
union iwreq_data wrqu;
891-
892-
if (!ifmgd->assocreq_ies && !ifmgd->assocresp_ies)
893-
return;
894-
895-
buf = kmalloc(50 + 2 * (ifmgd->assocreq_ies_len +
896-
ifmgd->assocresp_ies_len), GFP_KERNEL);
897-
if (!buf)
898-
return;
899-
900-
len = sprintf(buf, "ASSOCINFO(");
901-
if (ifmgd->assocreq_ies) {
902-
len += sprintf(buf + len, "ReqIEs=");
903-
for (i = 0; i < ifmgd->assocreq_ies_len; i++) {
904-
len += sprintf(buf + len, "%02x",
905-
ifmgd->assocreq_ies[i]);
906-
}
907-
}
908-
if (ifmgd->assocresp_ies) {
909-
if (ifmgd->assocreq_ies)
910-
len += sprintf(buf + len, " ");
911-
len += sprintf(buf + len, "RespIEs=");
912-
for (i = 0; i < ifmgd->assocresp_ies_len; i++) {
913-
len += sprintf(buf + len, "%02x",
914-
ifmgd->assocresp_ies[i]);
915-
}
916-
}
917-
len += sprintf(buf + len, ")");
918-
919-
if (len > IW_CUSTOM_MAX) {
920-
len = sprintf(buf, "ASSOCRESPIE=");
921-
for (i = 0; i < ifmgd->assocresp_ies_len; i++) {
922-
len += sprintf(buf + len, "%02x",
923-
ifmgd->assocresp_ies[i]);
924-
}
925-
}
926-
927-
if (len <= IW_CUSTOM_MAX) {
928-
memset(&wrqu, 0, sizeof(wrqu));
929-
wrqu.data.length = len;
930-
wireless_send_event(sdata->dev, IWEVCUSTOM, &wrqu, buf);
931-
}
932-
933-
kfree(buf);
934-
}
935-
936-
937873
static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
938874
u32 bss_info_changed)
939875
{
@@ -966,7 +902,6 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
966902

967903
ifmgd->flags |= IEEE80211_STA_PREV_BSSID_SET;
968904
memcpy(ifmgd->prev_bssid, sdata->u.mgd.bssid, ETH_ALEN);
969-
ieee80211_sta_send_associnfo(sdata);
970905

971906
ifmgd->last_probe = jiffies;
972907
ieee80211_led_assoc(local, 1);
@@ -993,8 +928,6 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
993928

994929
netif_tx_start_all_queues(sdata->dev);
995930
netif_carrier_on(sdata->dev);
996-
997-
ieee80211_sta_send_apinfo(sdata);
998931
}
999932

1000933
static void ieee80211_direct_probe(struct ieee80211_sub_if_data *sdata)
@@ -1147,8 +1080,6 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
11471080
changed |= BSS_CHANGED_ASSOC;
11481081
sdata->vif.bss_conf.assoc = false;
11491082

1150-
ieee80211_sta_send_apinfo(sdata);
1151-
11521083
if (self_disconnected || reason == WLAN_REASON_DISASSOC_STA_HAS_LEFT) {
11531084
ifmgd->state = IEEE80211_STA_MLME_DISABLED;
11541085
ieee80211_rx_bss_remove(sdata, ifmgd->bssid,

0 commit comments

Comments
 (0)