mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-13 03:30:35 +01:00
merge: branch 'remove_csme'
platform: remove CSME related code https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1573
This commit is contained in:
commit
16f667bf2d
13 changed files with 8 additions and 356 deletions
|
|
@ -649,7 +649,6 @@ src_libnm_platform_libnm_platform_la_SOURCES = \
|
|||
\
|
||||
src/linux-headers/ethtool.h \
|
||||
src/linux-headers/mptcp.h \
|
||||
src/linux-headers/nl80211-vnd-intel.h \
|
||||
src/linux-headers/nl802154.h \
|
||||
\
|
||||
src/nm-compat-headers/linux/if_addr.h \
|
||||
|
|
|
|||
|
|
@ -66,7 +66,6 @@ typedef struct {
|
|||
bool user_enabled : 1;
|
||||
bool sw_enabled : 1;
|
||||
bool hw_enabled : 1;
|
||||
bool os_owner : 1;
|
||||
} RfkillRadioState;
|
||||
|
||||
#define AUTOCONNECT_RESET_RETRIES_TIMER_SEC 300
|
||||
|
|
@ -2893,9 +2892,6 @@ _rfkill_radio_state_get_enabled(const RfkillRadioState *rstate, gboolean check_c
|
|||
{
|
||||
gboolean enabled;
|
||||
|
||||
/* If the device is not owned by the os, hw_enabled will be FALSE, hence
|
||||
* we don't need to consider os_owner here.
|
||||
*/
|
||||
enabled = rstate->user_enabled && rstate->hw_enabled;
|
||||
if (check_changeable)
|
||||
enabled &= rstate->sw_enabled;
|
||||
|
|
@ -2912,7 +2908,6 @@ _rfkill_radio_state_set_from_manager(NMManager *self, NMRfkillType rtype, Rfkill
|
|||
case NM_RFKILL_STATE_UNAVAILABLE:
|
||||
rstate->sw_enabled = TRUE;
|
||||
rstate->hw_enabled = TRUE;
|
||||
rstate->os_owner = TRUE;
|
||||
|
||||
/* A rfkill-type is available when there is a compatible
|
||||
* killswitch or a compatible device. */
|
||||
|
|
@ -2928,26 +2923,16 @@ _rfkill_radio_state_set_from_manager(NMManager *self, NMRfkillType rtype, Rfkill
|
|||
rstate->available = TRUE;
|
||||
rstate->sw_enabled = TRUE;
|
||||
rstate->hw_enabled = TRUE;
|
||||
rstate->os_owner = TRUE;
|
||||
return;
|
||||
case NM_RFKILL_STATE_SOFT_BLOCKED:
|
||||
rstate->available = TRUE;
|
||||
rstate->sw_enabled = FALSE;
|
||||
rstate->hw_enabled = TRUE;
|
||||
rstate->os_owner = TRUE;
|
||||
return;
|
||||
case NM_RFKILL_STATE_HARD_BLOCKED:
|
||||
rstate->available = TRUE;
|
||||
rstate->sw_enabled = FALSE;
|
||||
rstate->hw_enabled = FALSE;
|
||||
/* In case the OS doesn't own the NIC, we would be in NM_RFKILL_STATE_HARD_BLOCKED */
|
||||
rstate->os_owner = TRUE;
|
||||
return;
|
||||
case NM_RFKILL_STATE_HARD_BLOCKED_OS_NOT_OWNER:
|
||||
rstate->available = TRUE;
|
||||
rstate->sw_enabled = FALSE;
|
||||
rstate->hw_enabled = FALSE;
|
||||
rstate->os_owner = FALSE;
|
||||
return;
|
||||
}
|
||||
nm_assert_not_reached();
|
||||
|
|
@ -3011,12 +2996,11 @@ _rfkill_update_one_type(NMManager *self, NMRfkillType rtype)
|
|||
|
||||
/* Print out all states affecting device enablement */
|
||||
_LOGD(LOGD_RFKILL,
|
||||
"rfkill: %s available %d hw-enabled %d sw-enabled %d os-owner %d",
|
||||
"rfkill: %s available %d hw-enabled %d sw-enabled %d",
|
||||
nm_rfkill_type_to_string(rtype),
|
||||
rstate->available,
|
||||
rstate->hw_enabled,
|
||||
rstate->sw_enabled,
|
||||
rstate->os_owner);
|
||||
rstate->sw_enabled);
|
||||
|
||||
/* Log new killswitch state */
|
||||
new_rfkilled = rstate->hw_enabled && rstate->sw_enabled;
|
||||
|
|
@ -7354,14 +7338,12 @@ do_sleep_wake(NMManager *self, gboolean sleeping_changed)
|
|||
gboolean enabled = _rfkill_radio_state_get_enabled(rstate, TRUE);
|
||||
|
||||
_LOGD(LOGD_RFKILL,
|
||||
"rfkill: %s %s devices (hw_enabled %d, sw_enabled %d, user_enabled %d, "
|
||||
"os_owner %d)",
|
||||
"rfkill: %s %s devices (hw_enabled %d, sw_enabled %d, user_enabled %d)",
|
||||
enabled ? "enabling" : "disabling",
|
||||
nm_rfkill_type_to_string(rtype),
|
||||
rstate->hw_enabled,
|
||||
rstate->sw_enabled,
|
||||
rstate->user_enabled,
|
||||
rstate->os_owner);
|
||||
rstate->user_enabled);
|
||||
if (nm_device_get_rfkill_type(device) == rtype)
|
||||
nm_device_set_enabled(device, enabled);
|
||||
}
|
||||
|
|
@ -8846,13 +8828,11 @@ nm_manager_init(NMManager *self)
|
|||
.user_enabled = TRUE,
|
||||
.sw_enabled = FALSE,
|
||||
.hw_enabled = TRUE,
|
||||
.os_owner = TRUE,
|
||||
};
|
||||
priv->radio_states[NM_RFKILL_TYPE_WWAN] = (RfkillRadioState){
|
||||
.user_enabled = TRUE,
|
||||
.sw_enabled = FALSE,
|
||||
.hw_enabled = TRUE,
|
||||
.os_owner = TRUE,
|
||||
};
|
||||
|
||||
priv->sleeping = FALSE;
|
||||
|
|
|
|||
|
|
@ -106,8 +106,6 @@ nm_rfkill_state_to_string(NMRfkillState state)
|
|||
return "soft-blocked";
|
||||
case NM_RFKILL_STATE_HARD_BLOCKED:
|
||||
return "hard-blocked";
|
||||
case NM_RFKILL_STATE_HARD_BLOCKED_OS_NOT_OWNER:
|
||||
return "hard-blocked-os-not-owner";
|
||||
}
|
||||
return nm_assert_unreachable_val("unknown");
|
||||
}
|
||||
|
|
@ -171,7 +169,7 @@ killswitch_destroy(Killswitch *ks)
|
|||
}
|
||||
|
||||
static NMRfkillState
|
||||
sysfs_state_to_nm_state(int sysfs_state, int sysfs_reason)
|
||||
sysfs_state_to_nm_state(int sysfs_state)
|
||||
{
|
||||
switch (sysfs_state) {
|
||||
case 0:
|
||||
|
|
@ -179,11 +177,6 @@ sysfs_state_to_nm_state(int sysfs_state, int sysfs_reason)
|
|||
case 1:
|
||||
return NM_RFKILL_STATE_UNBLOCKED;
|
||||
case 2:
|
||||
/* sysfs reason is a bitmap, in case we have both reasons (SIGNAL and NOT_OWNER), we want
|
||||
* to consider the device as not owned.
|
||||
*/
|
||||
if (sysfs_reason & 2)
|
||||
return NM_RFKILL_STATE_HARD_BLOCKED_OS_NOT_OWNER;
|
||||
return NM_RFKILL_STATE_HARD_BLOCKED;
|
||||
default:
|
||||
nm_log_warn(LOGD_RFKILL, "unhandled rfkill state %d", sysfs_state);
|
||||
|
|
@ -214,7 +207,6 @@ recheck_killswitches(NMRfkillManager *self)
|
|||
struct udev_device *device;
|
||||
NMRfkillState dev_state;
|
||||
int sysfs_state;
|
||||
int sysfs_reason;
|
||||
|
||||
device = udev_device_new_from_subsystem_sysname(nm_udev_client_get_udev(priv->udev_client),
|
||||
"rfkill",
|
||||
|
|
@ -227,24 +219,15 @@ recheck_killswitches(NMRfkillManager *self)
|
|||
G_MININT,
|
||||
G_MAXINT,
|
||||
-1);
|
||||
|
||||
sysfs_reason = _nm_utils_ascii_str_to_int64(
|
||||
udev_device_get_property_value(device, "RFKILL_HW_BLOCK_REASON"),
|
||||
16,
|
||||
G_MININT,
|
||||
G_MAXINT,
|
||||
1); /* defaults to SIGNAL in case the kernel does not support this */
|
||||
|
||||
dev_state = sysfs_state_to_nm_state(sysfs_state, sysfs_reason);
|
||||
dev_state = sysfs_state_to_nm_state(sysfs_state);
|
||||
|
||||
nm_log_dbg(LOGD_RFKILL,
|
||||
"%s rfkill%s switch %s state now %d/%s reason: 0x%x",
|
||||
"%s rfkill%s switch %s state now %d/%s",
|
||||
nm_rfkill_type_to_string(ks->rtype),
|
||||
ks->platform ? " platform" : "",
|
||||
ks->name,
|
||||
sysfs_state,
|
||||
nm_rfkill_state_to_string(dev_state),
|
||||
sysfs_reason);
|
||||
nm_rfkill_state_to_string(dev_state));
|
||||
|
||||
if (ks->platform == FALSE) {
|
||||
if (dev_state > poll_states[ks->rtype])
|
||||
|
|
|
|||
|
|
@ -12,13 +12,6 @@ typedef enum {
|
|||
NM_RFKILL_STATE_UNBLOCKED = 1,
|
||||
NM_RFKILL_STATE_SOFT_BLOCKED = 2,
|
||||
NM_RFKILL_STATE_HARD_BLOCKED = 3,
|
||||
/* NM_RFKILL_STATE_HARD_BLOCKED_OS_NOT_OWNER means that the CSME firmware
|
||||
* is currently controlling the device. This feature is implmented on Intel
|
||||
* wifi devices only.
|
||||
* The NetworkManager can get ownership on the device, but it requires to
|
||||
* first ask ownership through the iwlmei kernel module.
|
||||
*/
|
||||
NM_RFKILL_STATE_HARD_BLOCKED_OS_NOT_OWNER = 4,
|
||||
} NMRfkillState;
|
||||
|
||||
typedef enum {
|
||||
|
|
|
|||
|
|
@ -9551,22 +9551,6 @@ wifi_set_wake_on_wlan(NMPlatform *platform, int ifindex, _NMSettingWirelessWakeO
|
|||
return nm_wifi_utils_set_wake_on_wlan(wifi_data, wowl);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
wifi_get_csme_conn_info(NMPlatform *platform, int ifindex, NMPlatformCsmeConnInfo *out_conn_info)
|
||||
{
|
||||
WIFI_GET_WIFI_DATA_NETNS(wifi_data, platform, ifindex, FALSE);
|
||||
|
||||
return nm_wifi_utils_get_csme_conn_info(wifi_data, out_conn_info);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
wifi_get_device_from_csme(NMPlatform *platform, int ifindex)
|
||||
{
|
||||
WIFI_GET_WIFI_DATA_NETNS(wifi_data, platform, ifindex, FALSE);
|
||||
|
||||
return nm_wifi_utils_get_device_from_csme(wifi_data);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static gboolean
|
||||
|
|
@ -11446,8 +11430,6 @@ nm_linux_platform_class_init(NMLinuxPlatformClass *klass)
|
|||
platform_class->wifi_indicate_addressing_running = wifi_indicate_addressing_running;
|
||||
platform_class->wifi_get_wake_on_wlan = wifi_get_wake_on_wlan;
|
||||
platform_class->wifi_set_wake_on_wlan = wifi_set_wake_on_wlan;
|
||||
platform_class->wifi_get_csme_conn_info = wifi_get_csme_conn_info;
|
||||
platform_class->wifi_get_device_from_csme = wifi_get_device_from_csme;
|
||||
|
||||
platform_class->mesh_get_channel = mesh_get_channel;
|
||||
platform_class->mesh_set_channel = mesh_set_channel;
|
||||
|
|
|
|||
|
|
@ -3353,28 +3353,6 @@ nm_platform_wifi_set_wake_on_wlan(NMPlatform *self, int ifindex, _NMSettingWirel
|
|||
return klass->wifi_set_wake_on_wlan(self, ifindex, wowl);
|
||||
}
|
||||
|
||||
gboolean
|
||||
nm_platform_wifi_get_csme_conn_info(NMPlatform *self,
|
||||
int ifindex,
|
||||
NMPlatformCsmeConnInfo *out_conn_info)
|
||||
{
|
||||
_CHECK_SELF(self, klass, FALSE);
|
||||
|
||||
g_return_val_if_fail(ifindex > 0, FALSE);
|
||||
|
||||
return klass->wifi_get_csme_conn_info(self, ifindex, out_conn_info);
|
||||
}
|
||||
|
||||
gboolean
|
||||
nm_platform_wifi_get_device_from_csme(NMPlatform *self, int ifindex)
|
||||
{
|
||||
_CHECK_SELF(self, klass, FALSE);
|
||||
|
||||
g_return_val_if_fail(ifindex > 0, FALSE);
|
||||
|
||||
return klass->wifi_get_device_from_csme(self, ifindex);
|
||||
}
|
||||
|
||||
guint32
|
||||
nm_platform_mesh_get_channel(NMPlatform *self, int ifindex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1009,14 +1009,6 @@ typedef struct {
|
|||
|
||||
/*****************************************************************************/
|
||||
|
||||
typedef struct _NMPlatformCsmeConnInfo {
|
||||
guint8 ssid[32];
|
||||
guint32 channel;
|
||||
NMEtherAddr addr;
|
||||
guint8 sta_cipher;
|
||||
guint8 auth_mode;
|
||||
} NMPlatformCsmeConnInfo;
|
||||
|
||||
typedef enum {
|
||||
NM_PLATFORM_KERNEL_SUPPORT_TYPE_FRA_L3MDEV,
|
||||
NM_PLATFORM_KERNEL_SUPPORT_TYPE_FRA_UID_RANGE,
|
||||
|
|
@ -1242,10 +1234,6 @@ typedef struct {
|
|||
gboolean (*wifi_set_wake_on_wlan)(NMPlatform *self,
|
||||
int ifindex,
|
||||
_NMSettingWirelessWakeOnWLan wowl);
|
||||
gboolean (*wifi_get_csme_conn_info)(NMPlatform *self,
|
||||
int ifindex,
|
||||
NMPlatformCsmeConnInfo *out_conn_info);
|
||||
gboolean (*wifi_get_device_from_csme)(NMPlatform *self, int ifindex);
|
||||
|
||||
guint32 (*mesh_get_channel)(NMPlatform *self, int ifindex);
|
||||
gboolean (*mesh_set_channel)(NMPlatform *self, int ifindex, guint32 channel);
|
||||
|
|
@ -2146,10 +2134,6 @@ void nm_platform_wifi_indicate_addressing_running(NMPlatform *self, int ifindex,
|
|||
_NMSettingWirelessWakeOnWLan nm_platform_wifi_get_wake_on_wlan(NMPlatform *self, int ifindex);
|
||||
gboolean
|
||||
nm_platform_wifi_set_wake_on_wlan(NMPlatform *self, int ifindex, _NMSettingWirelessWakeOnWLan wowl);
|
||||
gboolean nm_platform_wifi_get_csme_conn_info(NMPlatform *self,
|
||||
int ifindex,
|
||||
NMPlatformCsmeConnInfo *out_conn_info);
|
||||
gboolean nm_platform_wifi_get_device_from_csme(NMPlatform *self, int ifindex);
|
||||
|
||||
guint32 nm_platform_mesh_get_channel(NMPlatform *self, int ifindex);
|
||||
gboolean nm_platform_mesh_set_channel(NMPlatform *self, int ifindex, guint32 channel);
|
||||
|
|
|
|||
|
|
@ -825,111 +825,6 @@ nla_put_failure:
|
|||
g_return_val_if_reached(FALSE);
|
||||
}
|
||||
|
||||
struct nl80211_csme_conn_info {
|
||||
NMWifiUtilsNl80211 *self;
|
||||
NMPlatformCsmeConnInfo *conn_info;
|
||||
};
|
||||
|
||||
static int
|
||||
nl80211_csme_conn_event_handler(const struct nl_msg *msg, void *arg)
|
||||
{
|
||||
struct nl80211_csme_conn_info *info = arg;
|
||||
NMPlatformCsmeConnInfo *out_conn_info = info->conn_info;
|
||||
NMWifiUtilsNl80211 *self = info->self;
|
||||
struct genlmsghdr *gnlh = (void *) nlmsg_data(nlmsg_hdr(msg));
|
||||
struct nlattr *tb[NL80211_ATTR_MAX + 1];
|
||||
struct nlattr *data;
|
||||
struct nlattr *attrs[NUM_IWL_MVM_VENDOR_ATTR];
|
||||
int err;
|
||||
|
||||
static const struct nla_policy iwl_vendor_policy[NUM_IWL_MVM_VENDOR_ATTR] = {
|
||||
[IWL_MVM_VENDOR_ATTR_AUTH_MODE] = {.type = NLA_U32},
|
||||
[IWL_MVM_VENDOR_ATTR_SSID] = {.type = NLA_UNSPEC, .maxlen = NM_IW_ESSID_MAX_SIZE},
|
||||
[IWL_MVM_VENDOR_ATTR_STA_CIPHER] = {.type = NLA_U32},
|
||||
[IWL_MVM_VENDOR_ATTR_CHANNEL_NUM] = {.type = NLA_U8},
|
||||
[IWL_MVM_VENDOR_ATTR_ADDR] = {.type = NLA_UNSPEC, .minlen = ETH_ALEN, .maxlen = ETH_ALEN},
|
||||
};
|
||||
|
||||
nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0), genlmsg_attrlen(gnlh, 0), NULL);
|
||||
data = tb[NL80211_ATTR_VENDOR_DATA];
|
||||
|
||||
*out_conn_info = (NMPlatformCsmeConnInfo){};
|
||||
|
||||
err = nla_parse_nested(attrs, MAX_IWL_MVM_VENDOR_ATTR, data, iwl_vendor_policy);
|
||||
if (err) {
|
||||
_LOGD("IWL_MVM_VENDOR_CMD_GET_CSME_CONN_INFO Failed to parse CSME connection info: %s",
|
||||
nm_strerror(err));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (attrs[IWL_MVM_VENDOR_ATTR_AUTH_MODE])
|
||||
out_conn_info->auth_mode = nla_get_u8(attrs[IWL_MVM_VENDOR_ATTR_AUTH_MODE]);
|
||||
|
||||
if (attrs[IWL_MVM_VENDOR_ATTR_SSID])
|
||||
memcpy(out_conn_info->ssid,
|
||||
nla_data(attrs[IWL_MVM_VENDOR_ATTR_SSID]),
|
||||
nla_len(attrs[IWL_MVM_VENDOR_ATTR_SSID]));
|
||||
|
||||
if (attrs[IWL_MVM_VENDOR_ATTR_STA_CIPHER])
|
||||
out_conn_info->sta_cipher = nla_get_u8(attrs[IWL_MVM_VENDOR_ATTR_STA_CIPHER]);
|
||||
|
||||
if (attrs[IWL_MVM_VENDOR_ATTR_CHANNEL_NUM])
|
||||
out_conn_info->channel = nla_get_u8(attrs[IWL_MVM_VENDOR_ATTR_CHANNEL_NUM]);
|
||||
|
||||
if (attrs[IWL_MVM_VENDOR_ATTR_ADDR])
|
||||
memcpy(&out_conn_info->addr,
|
||||
nla_data(attrs[IWL_MVM_VENDOR_ATTR_ADDR]),
|
||||
sizeof(out_conn_info->addr));
|
||||
|
||||
return NL_SKIP;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
wifi_nl80211_intel_vnd_get_csme_conn_info(NMWifiUtils *data, NMPlatformCsmeConnInfo *out_conn_info)
|
||||
{
|
||||
NMWifiUtilsNl80211 *self = (NMWifiUtilsNl80211 *) data;
|
||||
nm_auto_nlmsg struct nl_msg *msg = NULL;
|
||||
int err;
|
||||
struct nl80211_csme_conn_info conn_info = {
|
||||
.self = self,
|
||||
.conn_info = out_conn_info,
|
||||
};
|
||||
|
||||
msg = nl80211_alloc_msg(self, NL80211_CMD_VENDOR, 0);
|
||||
NLA_PUT_U32(msg, NL80211_ATTR_VENDOR_ID, INTEL_OUI);
|
||||
NLA_PUT_U32(msg, NL80211_ATTR_VENDOR_SUBCMD, IWL_MVM_VENDOR_CMD_GET_CSME_CONN_INFO);
|
||||
|
||||
err = nl80211_send_and_recv(self, msg, nl80211_csme_conn_event_handler, &conn_info);
|
||||
if (err < 0)
|
||||
_LOGD("IWL_MVM_VENDOR_CMD_GET_CSME_CONN_INFO request failed: %s", nm_strerror(err));
|
||||
|
||||
return err >= 0;
|
||||
|
||||
nla_put_failure:
|
||||
g_return_val_if_reached(FALSE);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
wifi_nl80211_intel_vnd_get_device_from_csme(NMWifiUtils *data)
|
||||
{
|
||||
NMWifiUtilsNl80211 *self = (NMWifiUtilsNl80211 *) data;
|
||||
nm_auto_nlmsg struct nl_msg *msg = NULL;
|
||||
int err;
|
||||
|
||||
msg = nl80211_alloc_msg(self, NL80211_CMD_VENDOR, 0);
|
||||
NLA_PUT_U32(msg, NL80211_ATTR_VENDOR_ID, INTEL_OUI);
|
||||
NLA_PUT_U32(msg, NL80211_ATTR_VENDOR_SUBCMD, IWL_MVM_VENDOR_CMD_HOST_GET_OWNERSHIP);
|
||||
|
||||
err = nl80211_send_and_recv(self, msg, NULL, NULL);
|
||||
if (err < 0)
|
||||
_LOGD("IWL_MVM_VENDOR_CMD_HOST_GET_OWNERSHIP request failed: %s", nm_strerror(err));
|
||||
|
||||
return err >= 0;
|
||||
|
||||
nla_put_failure:
|
||||
g_return_val_if_reached(FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
nm_wifi_utils_nl80211_init(NMWifiUtilsNl80211 *self)
|
||||
{}
|
||||
|
|
@ -954,8 +849,6 @@ nm_wifi_utils_nl80211_class_init(NMWifiUtilsNl80211Class *klass)
|
|||
wifi_utils_class->get_mesh_channel = wifi_nl80211_get_mesh_channel;
|
||||
wifi_utils_class->set_mesh_channel = wifi_nl80211_set_mesh_channel;
|
||||
wifi_utils_class->set_mesh_ssid = wifi_nl80211_set_mesh_ssid;
|
||||
wifi_utils_class->get_csme_conn_info = wifi_nl80211_intel_vnd_get_csme_conn_info;
|
||||
wifi_utils_class->get_device_from_csme = wifi_nl80211_intel_vnd_get_device_from_csme;
|
||||
}
|
||||
|
||||
NMWifiUtils *
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
#define __WIFI_UTILS_PRIVATE_H__
|
||||
|
||||
#include "nm-wifi-utils.h"
|
||||
#include "libnm-platform/nm-platform.h"
|
||||
|
||||
typedef struct {
|
||||
GObjectClass parent;
|
||||
|
|
@ -55,10 +54,6 @@ typedef struct {
|
|||
gboolean (*set_mesh_ssid)(NMWifiUtils *data, const guint8 *ssid, gsize len);
|
||||
|
||||
gboolean (*indicate_addressing_running)(NMWifiUtils *data, gboolean running);
|
||||
|
||||
gboolean (*get_csme_conn_info)(NMWifiUtils *data, NMPlatformCsmeConnInfo *out_conn_info);
|
||||
|
||||
gboolean (*get_device_from_csme)(NMWifiUtils *data);
|
||||
} NMWifiUtilsClass;
|
||||
|
||||
struct NMWifiUtils {
|
||||
|
|
|
|||
|
|
@ -157,28 +157,6 @@ nm_wifi_utils_is_wifi(int dirfd, const char *ifname)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
nm_wifi_utils_get_csme_conn_info(NMWifiUtils *data, NMPlatformCsmeConnInfo *out_conn_info)
|
||||
{
|
||||
NMWifiUtilsClass *klass;
|
||||
|
||||
g_return_val_if_fail(data != NULL, FALSE);
|
||||
|
||||
klass = NM_WIFI_UTILS_GET_CLASS(data);
|
||||
return klass->get_csme_conn_info ? klass->get_csme_conn_info(data, out_conn_info) : FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
nm_wifi_utils_get_device_from_csme(NMWifiUtils *data)
|
||||
{
|
||||
NMWifiUtilsClass *klass;
|
||||
|
||||
g_return_val_if_fail(data != NULL, FALSE);
|
||||
|
||||
klass = NM_WIFI_UTILS_GET_CLASS(data);
|
||||
return klass->get_device_from_csme ? klass->get_device_from_csme(data) : FALSE;
|
||||
}
|
||||
|
||||
/* OLPC Mesh-only functions */
|
||||
|
||||
guint32
|
||||
|
|
|
|||
|
|
@ -62,12 +62,6 @@ _NMSettingWirelessWakeOnWLan nm_wifi_utils_get_wake_on_wlan(NMWifiUtils *data);
|
|||
|
||||
gboolean nm_wifi_utils_set_wake_on_wlan(NMWifiUtils *data, _NMSettingWirelessWakeOnWLan wowl);
|
||||
|
||||
struct _NMPlatformCsmeConnInfo;
|
||||
gboolean nm_wifi_utils_get_csme_conn_info(NMWifiUtils *data,
|
||||
struct _NMPlatformCsmeConnInfo *out_conn_info);
|
||||
|
||||
gboolean nm_wifi_utils_get_device_from_csme(NMWifiUtils *data);
|
||||
|
||||
/* OLPC Mesh-only functions */
|
||||
guint32 nm_wifi_utils_get_mesh_channel(NMWifiUtils *data);
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@
|
|||
|
||||
#include "linux-headers/ethtool.h"
|
||||
#include "linux-headers/nl802154.h"
|
||||
#include "linux-headers/nl80211-vnd-intel.h"
|
||||
#include "linux-headers/mptcp.h"
|
||||
|
||||
#endif /* __NM_LINUX_COMPAT_H__ */
|
||||
|
|
|
|||
|
|
@ -1,106 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/*
|
||||
* Copyright (C) 2012-2014, 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2013-2015 Intel Mobile Communications GmbH
|
||||
* Copyright (C) 2016-2017 Intel Deutschland GmbH
|
||||
*/
|
||||
#ifndef __VENDOR_CMD_INTEL_H__
|
||||
#define __VENDOR_CMD_INTEL_H__
|
||||
|
||||
#define INTEL_OUI 0x001735
|
||||
|
||||
/**
|
||||
* enum iwl_mvm_vendor_cmd - supported vendor commands
|
||||
* @IWL_MVM_VENDOR_CMD_GET_CSME_CONN_INFO: reports CSME connection info.
|
||||
* @IWL_MVM_VENDOR_CMD_HOST_GET_OWNERSHIP: asks for ownership on the device.
|
||||
* This is useful when the CSME firmware owns the device and the kernel
|
||||
* wants to use it. In case the CSME firmware has no connection active the
|
||||
* kernel will manage on its own to get ownership of the device.
|
||||
* When the CSME firmware has an active connection, the user space
|
||||
* involvement is required. The kernel will assert the RFKILL signal with
|
||||
* the "device not owned" reason so that nobody can touch the device. Then
|
||||
* the user space can run the following flow to be able to get connected
|
||||
* to the very same AP the CSME firmware is currently connected to:
|
||||
*
|
||||
* 1) The user space (NetworkManager) boots and sees that the device is
|
||||
* in RFKILL because the host doesn't own the device
|
||||
* 2) The user space asks the kernel what AP the CSME firmware is
|
||||
* connected to (with %IWL_MVM_VENDOR_CMD_GET_CSME_CONN_INFO)
|
||||
* 3) The user space checks if it has a profile that matches the reply
|
||||
* from the CSME firmware
|
||||
* 4) The user space installs a network to the wpa_supplicant with a
|
||||
* specific BSSID and a specific frequency
|
||||
* 5) The user space prevents any type of full scan
|
||||
* 6) The user space asks iwlmei to request ownership on the device (with
|
||||
* this command)
|
||||
* 7) iwlmei requests ownership from the CSME firmware
|
||||
* 8) The CSME firmware grants ownership
|
||||
* 9) iwlmei tells iwlwifi to lift the RFKILL
|
||||
* 10) RFKILL OFF is reported to user space
|
||||
* 11) The host boots the device, loads the firwmare, and connects to a
|
||||
* specific BSSID without scanning including IP as fast as it can
|
||||
* 12) The host reports to the CSME firmware that there is a connection
|
||||
* 13) The TCP connection is preserved and the host has connectivity
|
||||
*
|
||||
* @IWL_MVM_VENDOR_CMD_ROAMING_FORBIDDEN_EVENT: notifies if roaming is allowed.
|
||||
* It contains a &IWL_MVM_VENDOR_ATTR_ROAMING_FORBIDDEN and a
|
||||
* &IWL_MVM_VENDOR_ATTR_VIF_ADDR attributes.
|
||||
*/
|
||||
|
||||
enum iwl_mvm_vendor_cmd {
|
||||
IWL_MVM_VENDOR_CMD_GET_CSME_CONN_INFO = 0x2d,
|
||||
IWL_MVM_VENDOR_CMD_HOST_GET_OWNERSHIP = 0x30,
|
||||
IWL_MVM_VENDOR_CMD_ROAMING_FORBIDDEN_EVENT = 0x32,
|
||||
};
|
||||
|
||||
enum iwl_vendor_auth_akm_mode {
|
||||
IWL_VENDOR_AUTH_OPEN,
|
||||
IWL_VENDOR_AUTH_RSNA = 0x6,
|
||||
IWL_VENDOR_AUTH_RSNA_PSK,
|
||||
IWL_VENDOR_AUTH_SAE = 0x9,
|
||||
IWL_VENDOR_AUTH_MAX,
|
||||
};
|
||||
|
||||
/**
|
||||
* enum iwl_mvm_vendor_attr - attributes used in vendor commands
|
||||
* @__IWL_MVM_VENDOR_ATTR_INVALID: attribute 0 is invalid
|
||||
* @IWL_MVM_VENDOR_ATTR_VIF_ADDR: interface MAC address
|
||||
* @IWL_MVM_VENDOR_ATTR_ADDR: MAC address
|
||||
* @IWL_MVM_VENDOR_ATTR_SSID: SSID (binary attribute, 0..32 octets)
|
||||
* @IWL_MVM_VENDOR_ATTR_STA_CIPHER: the cipher to use for the station with the
|
||||
* mac address specified in &IWL_MVM_VENDOR_ATTR_ADDR.
|
||||
* @IWL_MVM_VENDOR_ATTR_ROAMING_FORBIDDEN: u8 attribute. Indicates whether
|
||||
* roaming is forbidden or not. Value 1 means roaming is forbidden,
|
||||
* 0 mean roaming is allowed.
|
||||
* @IWL_MVM_VENDOR_ATTR_AUTH_MODE: u32 attribute. Authentication mode type
|
||||
* as specified in &enum iwl_vendor_auth_akm_mode.
|
||||
* @IWL_MVM_VENDOR_ATTR_CHANNEL_NUM: u8 attribute. Contains channel number.
|
||||
* @IWL_MVM_VENDOR_ATTR_BAND: u8 attribute.
|
||||
* 0 for 2.4 GHz band, 1 for 5.2GHz band and 2 for 6GHz band.
|
||||
* @IWL_MVM_VENDOR_ATTR_COLLOC_CHANNEL: u32 attribute. Channel number of
|
||||
* collocated AP. Relevant for 6GHz AP info.
|
||||
* @IWL_MVM_VENDOR_ATTR_COLLOC_ADDR: MAC address of a collocated AP.
|
||||
* Relevant for 6GHz AP info.
|
||||
*
|
||||
* @NUM_IWL_MVM_VENDOR_ATTR: number of vendor attributes
|
||||
* @MAX_IWL_MVM_VENDOR_ATTR: highest vendor attribute number
|
||||
|
||||
*/
|
||||
enum iwl_mvm_vendor_attr {
|
||||
__IWL_MVM_VENDOR_ATTR_INVALID = 0x00,
|
||||
IWL_MVM_VENDOR_ATTR_VIF_ADDR = 0x02,
|
||||
IWL_MVM_VENDOR_ATTR_ADDR = 0x0a,
|
||||
IWL_MVM_VENDOR_ATTR_SSID = 0x3d,
|
||||
IWL_MVM_VENDOR_ATTR_STA_CIPHER = 0x51,
|
||||
IWL_MVM_VENDOR_ATTR_ROAMING_FORBIDDEN = 0x64,
|
||||
IWL_MVM_VENDOR_ATTR_AUTH_MODE = 0x65,
|
||||
IWL_MVM_VENDOR_ATTR_CHANNEL_NUM = 0x66,
|
||||
IWL_MVM_VENDOR_ATTR_BAND = 0x69,
|
||||
IWL_MVM_VENDOR_ATTR_COLLOC_CHANNEL = 0x70,
|
||||
IWL_MVM_VENDOR_ATTR_COLLOC_ADDR = 0x71,
|
||||
|
||||
NUM_IWL_MVM_VENDOR_ATTR,
|
||||
MAX_IWL_MVM_VENDOR_ATTR = NUM_IWL_MVM_VENDOR_ATTR - 1,
|
||||
};
|
||||
|
||||
#endif /* __VENDOR_CMD_INTEL_H__ */
|
||||
Loading…
Add table
Reference in a new issue