mirror of
https://github.com/albfan/miraclecast.git
synced 2025-02-14 19:21:55 +00:00
add option --use-dev to miracle-wifid to workaround the 'no ifname' issue
This commit is contained in:
parent
a9266e5055
commit
3886dcb7c7
4 changed files with 27 additions and 1 deletions
|
@ -132,6 +132,16 @@ void link_free(struct link *l)
|
|||
free(l);
|
||||
}
|
||||
|
||||
void link_use_dev(struct link *l)
|
||||
{
|
||||
l->use_dev = true;
|
||||
}
|
||||
|
||||
bool link_is_using_dev(struct link *l)
|
||||
{
|
||||
return l->use_dev;
|
||||
}
|
||||
|
||||
void link_set_managed(struct link *l, bool set)
|
||||
{
|
||||
int r;
|
||||
|
|
|
@ -2147,7 +2147,7 @@ static int supplicant_global_fn(struct wpas *w,
|
|||
}
|
||||
|
||||
/* ignore events on the global-iface, we only listen on dev-iface */
|
||||
if(wpas_message_get_ifname(m)) {
|
||||
if(link_is_using_dev(s->l) && wpas_message_get_ifname(m)) {
|
||||
supplicant_event(s, m);
|
||||
}
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
|
||||
const char *interface_name = NULL;
|
||||
unsigned int arg_wpa_loglevel = LOG_NOTICE;
|
||||
bool use_dev = false;
|
||||
|
||||
/*
|
||||
* Manager Handling
|
||||
|
@ -102,6 +103,9 @@ static void manager_add_udev_link(struct manager *m,
|
|||
|
||||
link_set_friendly_name(l, m->friendly_name);
|
||||
|
||||
if(use_dev)
|
||||
link_use_dev(l);
|
||||
|
||||
#ifdef RELY_UDEV
|
||||
if (udev_device_has_tag(d, "miracle")) {
|
||||
#else
|
||||
|
@ -457,6 +461,7 @@ static int help(void)
|
|||
" -i --interface Choose the interface to use\n"
|
||||
"\n"
|
||||
" --wpa-loglevel <lvl wpa_supplicant log-level\n"
|
||||
" --use-dev enable workaround for 'no ifname' issue\n"
|
||||
, program_invocation_short_name);
|
||||
/*
|
||||
* 80-char barrier:
|
||||
|
@ -474,6 +479,8 @@ static int parse_argv(int argc, char *argv[])
|
|||
ARG_LOG_TIME,
|
||||
|
||||
ARG_WPA_LOGLEVEL,
|
||||
|
||||
ARG_USE_DEV,
|
||||
};
|
||||
static const struct option options[] = {
|
||||
{ "help", no_argument, NULL, 'h' },
|
||||
|
@ -483,6 +490,7 @@ static int parse_argv(int argc, char *argv[])
|
|||
|
||||
{ "wpa-loglevel", required_argument, NULL, ARG_WPA_LOGLEVEL },
|
||||
{ "interface", required_argument, NULL, 'i' },
|
||||
{ "use-dev", no_argument, NULL, ARG_USE_DEV },
|
||||
{}
|
||||
};
|
||||
int c;
|
||||
|
@ -503,6 +511,9 @@ static int parse_argv(int argc, char *argv[])
|
|||
case ARG_LOG_TIME:
|
||||
log_init_time();
|
||||
break;
|
||||
case ARG_USE_DEV:
|
||||
use_dev = true;
|
||||
break;
|
||||
|
||||
case ARG_WPA_LOGLEVEL:
|
||||
arg_wpa_loglevel = log_parse_arg(optarg);
|
||||
|
|
|
@ -135,6 +135,7 @@ struct link {
|
|||
|
||||
bool managed : 1;
|
||||
bool public : 1;
|
||||
bool use_dev : 1;
|
||||
};
|
||||
|
||||
#define link_from_htable(_l) \
|
||||
|
@ -153,6 +154,10 @@ int link_new(struct manager *m,
|
|||
struct link **out);
|
||||
void link_free(struct link *l);
|
||||
|
||||
/* workaround for the 'no ifname' issue */
|
||||
void link_use_dev(struct link *l);
|
||||
bool link_is_using_dev(struct link *l);
|
||||
|
||||
void link_set_managed(struct link *l, bool set);
|
||||
int link_renamed(struct link *l, const char *ifname);
|
||||
|
||||
|
|
Loading…
Reference in a new issue