Re: [PATCH] dbus: Add AbortScan method to abort ongoing scan

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2017-04-10 at 15:29 +0530, Saurav Babu wrote:
> Signed-off-by: Saurav Babu <saurav.babu@xxxxxxxxxxx>
> ---
>  wpa_supplicant/dbus/dbus_new.c          |  6 ++++++
>  wpa_supplicant/dbus/dbus_new_handlers.c | 20 ++++++++++++++++++++
>  wpa_supplicant/dbus/dbus_new_handlers.h |  3 +++
>  3 files changed, 29 insertions(+)

Looks OK to me, but...

> diff --git a/wpa_supplicant/dbus/dbus_new.c
> b/wpa_supplicant/dbus/dbus_new.c
> index 0c355f7..64bcfdb 100644
> --- a/wpa_supplicant/dbus/dbus_new.c
> +++ b/wpa_supplicant/dbus/dbus_new.c
> @@ -3119,6 +3119,12 @@ static const struct wpa_dbus_method_desc
> wpas_dbus_interface_methods[] = {
>  	  }
>  	},
>  #endif /* CONFIG_NO_CONFIG_WRITE */
> +	{ "AbortScan", WPAS_DBUS_NEW_IFACE_INTERFACE,
> +	  (WPADBusMethodHandler) wpas_dbus_handler_abort_scan,
> +	  {
> +		  END_ARGS
> +	  }
> +	},
>  	{ NULL, NULL, NULL, { END_ARGS } }
>  };
>  
> diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c
> b/wpa_supplicant/dbus/dbus_new_handlers.c
> index 56e6aab..961e324 100644
> --- a/wpa_supplicant/dbus/dbus_new_handlers.c
> +++ b/wpa_supplicant/dbus/dbus_new_handlers.c
> @@ -1419,6 +1419,26 @@ out:
>  }
>  
>  
> +/*
> + * wpas_dbus_handler_abort_scan - Request an ongoing scan to be
> aborted
> + * @message: Pointer to incoming dbus message
> + * @wpa_s: wpa_supplicant structure for a network interface
> + * Returns: No Scan in progress DBus error message if no ongoing
> scan
> + * or NULL otherwise.
> + *
> + * Handler function for "AbortScan" method call of network
> interface.
> + */
> +DBusMessage * wpas_dbus_handler_abort_scan(DBusMessage *message,
> +					   struct wpa_supplicant
> *wpa_s)
> +{
> +	if (wpas_abort_ongoing_scan(wpa_s) < 0)
> +		return dbus_message_new_error(message,
> WPAS_DBUS_ERROR_IFACE_SCAN_ERROR,
> +									
>   "No Scan in progress");

There are other errors than "no scan in progress" that
wpas_abort_ongoing_scan() could return.  So perhaps just modify this to
be "Abort failed or no scan in progress"?

Dan

> +
> +	return NULL;
> +}
> +
> +
>  /**
>   * wpas_dbus_handler_signal_poll - Request immediate signal
> properties
>   * @message: Pointer to incoming dbus message
> diff --git a/wpa_supplicant/dbus/dbus_new_handlers.h
> b/wpa_supplicant/dbus/dbus_new_handlers.h
> index 3b8f096..b4e198c 100644
> --- a/wpa_supplicant/dbus/dbus_new_handlers.h
> +++ b/wpa_supplicant/dbus/dbus_new_handlers.h
> @@ -74,6 +74,9 @@ DECLARE_ACCESSOR(wpas_dbus_setter_iface_global);
>  DBusMessage * wpas_dbus_handler_scan(DBusMessage *message,
>  				     struct wpa_supplicant *wpa_s);
>  
> +DBusMessage * wpas_dbus_handler_abort_scan(DBusMessage *message,
> +					    struct wpa_supplicant
> *wpa_s);
> +
>  DBusMessage * wpas_dbus_handler_signal_poll(DBusMessage *message,
>  					    struct wpa_supplicant
> *wpa_s);
>  

_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux