mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 14:49:24 +01:00
test-runner: allow disabling of iftype/cipher
Two new hardware configuration keys were added: [radX] iftype_disable=station,ap,adhoc,p2p_client,p2p_go,mesh_point cipher_disable=wep40,wep104,tkip,ccmp,bip Any of the above values are supported and can be disabled.
This commit is contained in:
parent
2d173e5f24
commit
f038c11205
@ -754,21 +754,35 @@ struct hwsim_radio_params {
|
|||||||
unsigned int channels;
|
unsigned int channels;
|
||||||
bool p2p_device;
|
bool p2p_device;
|
||||||
bool use_chanctx;
|
bool use_chanctx;
|
||||||
|
char *iftype_disable;
|
||||||
|
char *cipher_disable;
|
||||||
};
|
};
|
||||||
|
|
||||||
static int create_hwsim_radio(const char *radio_name,
|
static int create_hwsim_radio(const char *radio_name,
|
||||||
struct hwsim_radio_params *params)
|
struct hwsim_radio_params *params)
|
||||||
{
|
{
|
||||||
char *argv[7];
|
char *argv[10];
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
int idx = 0;
|
||||||
|
|
||||||
/*TODO add the rest of params*/
|
/*TODO add the rest of params*/
|
||||||
argv[0] = BIN_HWSIM;
|
argv[idx++] = BIN_HWSIM;
|
||||||
argv[1] = "--create";
|
argv[idx++] = "--create";
|
||||||
argv[2] = "--name";
|
argv[idx++] = "--name";
|
||||||
argv[3] = (char *) radio_name;
|
argv[idx++] = (char *) radio_name;
|
||||||
argv[4] = "--nointerface";
|
argv[idx++] = "--nointerface";
|
||||||
argv[5] = NULL;
|
|
||||||
|
if (params->iftype_disable) {
|
||||||
|
argv[idx++] = "--iftype-disable";
|
||||||
|
argv[idx++] = params->iftype_disable;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params->cipher_disable) {
|
||||||
|
argv[idx++] = "--cipher-disable";
|
||||||
|
argv[idx++] = params->cipher_disable;
|
||||||
|
}
|
||||||
|
|
||||||
|
argv[idx] = NULL;
|
||||||
|
|
||||||
pid = execute_program(argv, true, check_verbosity(BIN_HWSIM));
|
pid = execute_program(argv, true, check_verbosity(BIN_HWSIM));
|
||||||
if (pid < 0)
|
if (pid < 0)
|
||||||
@ -1085,6 +1099,8 @@ error_exit:
|
|||||||
#define HW_CONFIG_PHY_CHANNELS "channels"
|
#define HW_CONFIG_PHY_CHANNELS "channels"
|
||||||
#define HW_CONFIG_PHY_CHANCTX "use_chanctx"
|
#define HW_CONFIG_PHY_CHANCTX "use_chanctx"
|
||||||
#define HW_CONFIG_PHY_P2P "p2p_device"
|
#define HW_CONFIG_PHY_P2P "p2p_device"
|
||||||
|
#define HW_CONFIG_PHY_IFTYPE_DISABLE "iftype_disable"
|
||||||
|
#define HW_CONFIG_PHY_CIPHER_DISABLE "cipher_disable"
|
||||||
|
|
||||||
#define HW_MIN_NUM_RADIOS 1
|
#define HW_MIN_NUM_RADIOS 1
|
||||||
|
|
||||||
@ -1143,6 +1159,13 @@ static bool configure_hw_radios(struct l_settings *hw_settings,
|
|||||||
¶ms.use_chanctx))
|
¶ms.use_chanctx))
|
||||||
params.use_chanctx = true;
|
params.use_chanctx = true;
|
||||||
|
|
||||||
|
params.iftype_disable = l_settings_get_string(hw_settings,
|
||||||
|
wiphy->name,
|
||||||
|
HW_CONFIG_PHY_IFTYPE_DISABLE);
|
||||||
|
params.cipher_disable = l_settings_get_string(hw_settings,
|
||||||
|
wiphy->name,
|
||||||
|
HW_CONFIG_PHY_CIPHER_DISABLE);
|
||||||
|
|
||||||
create:
|
create:
|
||||||
wiphy->id = create_hwsim_radio(wiphy->name, ¶ms);
|
wiphy->id = create_hwsim_radio(wiphy->name, ¶ms);
|
||||||
wiphy->can_ap = true;
|
wiphy->can_ap = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user