Commit f1ab27a2 authored by Lubomir Rintel's avatar Lubomir Rintel 🥕

setting-wireless: allow Mesh mode

parent f249956c
......@@ -757,7 +757,13 @@ static gboolean
verify (NMSetting *setting, NMConnection *connection, GError **error)
{
NMSettingWirelessPrivate *priv = NM_SETTING_WIRELESS_GET_PRIVATE (setting);
const char *valid_modes[] = { NM_SETTING_WIRELESS_MODE_INFRA, NM_SETTING_WIRELESS_MODE_ADHOC, NM_SETTING_WIRELESS_MODE_AP, NULL };
const char *valid_modes[] = {
NM_SETTING_WIRELESS_MODE_INFRA,
NM_SETTING_WIRELESS_MODE_ADHOC,
NM_SETTING_WIRELESS_MODE_AP,
NM_SETTING_WIRELESS_MODE_MESH,
NULL
};
const char *valid_bands[] = { "a", "bg", NULL };
guint i;
gsize length;
......
......@@ -122,6 +122,13 @@ typedef enum { /*< flags >*/
*/
#define NM_SETTING_WIRELESS_MODE_INFRA "infrastructure"
/**
* NM_SETTING_WIRELESS_MODE_MESH:
*
* Indicates that the connection should create a mesh point.
*/
#define NM_SETTING_WIRELESS_MODE_MESH "mesh"
/**
* NMSettingWirelessPowersave:
* @NM_SETTING_WIRELESS_POWERSAVE_DEFAULT: use the default value
......
......@@ -199,6 +199,9 @@ nl80211_iface_info_handler (struct nl_msg *msg, void *arg)
case NL80211_IFTYPE_STATION:
info->mode = NM_802_11_MODE_INFRA;
break;
case NL80211_IFTYPE_MESH_POINT:
info->mode = NM_802_11_MODE_MESH;
break;
}
return NL_SKIP;
......@@ -241,6 +244,9 @@ wifi_nl80211_set_mode (NMWifiUtils *data, const NM80211Mode mode)
case NM_802_11_MODE_AP:
NLA_PUT_U32 (msg, NL80211_ATTR_IFTYPE, NL80211_IFTYPE_AP);
break;
case NM_802_11_MODE_MESH:
NLA_PUT_U32 (msg, NL80211_ATTR_IFTYPE, NL80211_IFTYPE_MESH_POINT);
break;
default:
g_assert_not_reached ();
}
......@@ -892,10 +898,11 @@ static int nl80211_wiphy_info_handler (struct nl_msg *msg, void *arg)
int i;
nla_for_each_nested (nl_mode, tb[NL80211_ATTR_SUPPORTED_IFTYPES], i) {
if (nla_type (nl_mode) == NL80211_IFTYPE_AP)
info->caps |= NM_WIFI_DEVICE_CAP_AP;
else if (nla_type (nl_mode) == NL80211_IFTYPE_ADHOC)
info->caps |= NM_WIFI_DEVICE_CAP_ADHOC;
switch (nla_type (nl_mode)) {
case NL80211_IFTYPE_AP: info->caps |= NM_WIFI_DEVICE_CAP_AP; break;
case NL80211_IFTYPE_ADHOC: info->caps |= NM_WIFI_DEVICE_CAP_ADHOC; break;
case NL80211_IFTYPE_MESH_POINT: info->caps |= NM_WIFI_DEVICE_CAP_MESH; break;
}
}
}
......
......@@ -89,7 +89,8 @@ nm_wifi_utils_set_mode (NMWifiUtils *data, const NM80211Mode mode)
g_return_val_if_fail (data != NULL, FALSE);
g_return_val_if_fail ( (mode == NM_802_11_MODE_INFRA)
|| (mode == NM_802_11_MODE_AP)
|| (mode == NM_802_11_MODE_ADHOC), FALSE);
|| (mode == NM_802_11_MODE_ADHOC)
|| (mode == NM_802_11_MODE_MESH), FALSE);
klass = NM_WIFI_UTILS_GET_CLASS (data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment