Browse Source

dbus: Remove wpas_dbus_callbacks abstraction

This callback structure was specific to the new D-Bus API which makes
it more or less pointless. It is just simpler to call the notification
functions directly. More proper design could be to use a generic
mechanism for registering notification callbacks into notify.c, but
that is not yet available and should not be designed just based on a
single user.
Jouni Malinen 15 years ago
parent
commit
52bdd880a3
3 changed files with 189 additions and 213 deletions
  1. 32 82
      wpa_supplicant/dbus/dbus_new.c
  2. 134 55
      wpa_supplicant/dbus/dbus_new.h
  3. 23 76
      wpa_supplicant/notify.c

+ 32 - 82
wpa_supplicant/dbus/dbus_new.c

@@ -146,8 +146,7 @@ static void wpas_dbus_signal_interface_removed(struct wpa_supplicant *wpa_s)
  *
  * Notify listeners about finishing a scan
  */
-static void wpas_dbus_signal_scan_done(struct wpa_supplicant *wpa_s,
-				       int success)
+void wpas_dbus_signal_scan_done(struct wpa_supplicant *wpa_s, int success)
 {
 	struct wpas_dbus_priv *iface;
 	DBusMessage *_signal;
@@ -338,8 +337,8 @@ static void wpas_dbus_signal_blob(struct wpa_supplicant *wpa_s,
  *
  * Notify listeners about adding a new blob
  */
-static void wpas_dbus_signal_blob_added(struct wpa_supplicant *wpa_s,
-					const char *name)
+void wpas_dbus_signal_blob_added(struct wpa_supplicant *wpa_s,
+				 const char *name)
 {
 	wpas_dbus_signal_blob(wpa_s, name, "BlobAdded");
 }
@@ -352,8 +351,8 @@ static void wpas_dbus_signal_blob_added(struct wpa_supplicant *wpa_s,
  *
  * Notify listeners about removing blob
  */
-static void wpas_dbus_signal_blob_removed(struct wpa_supplicant *wpa_s,
-					  const char *name)
+void wpas_dbus_signal_blob_removed(struct wpa_supplicant *wpa_s,
+				   const char *name)
 {
 	wpas_dbus_signal_blob(wpa_s, name, "BlobRemoved");
 }
@@ -474,8 +473,7 @@ static void wpas_dbus_signal_network_removed(struct wpa_supplicant *wpa_s,
  *
  * Notify listeners about selecting a network
  */
-static void wpas_dbus_signal_network_selected(struct wpa_supplicant *wpa_s,
-					      int id)
+void wpas_dbus_signal_network_selected(struct wpa_supplicant *wpa_s, int id)
 {
 	wpas_dbus_signal_network(wpa_s, id, "NetworkSelected", FALSE);
 }
@@ -489,9 +487,9 @@ static void wpas_dbus_signal_network_selected(struct wpa_supplicant *wpa_s,
  *
  * Notify listeners that wpa_supplicant has changed state
  */
-static void wpas_dbus_signal_state_changed(struct wpa_supplicant *wpa_s,
-					   enum wpa_states new_state,
-					   enum wpa_states old_state)
+void wpas_dbus_signal_state_changed(struct wpa_supplicant *wpa_s,
+				    enum wpa_states new_state,
+				    enum wpa_states old_state)
 {
 	struct wpas_dbus_priv *iface;
 	DBusMessage *_signal = NULL;
@@ -585,8 +583,8 @@ out:
  * Sends PropertyChanged signals containing new value of Enabled property
  * for specified network
  */
-static void wpas_dbus_signal_network_enabled_changed(
-	struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
+void wpas_dbus_signal_network_enabled_changed(struct wpa_supplicant *wpa_s,
+					      struct wpa_ssid *ssid)
 {
 
 	struct network_handler_args args = {wpa_s, ssid};
@@ -612,7 +610,7 @@ static void wpas_dbus_signal_network_enabled_changed(
  *
  * Sends Event dbus signal with name "success" and empty dict as arguments
  */
-static void wpas_dbus_signal_wps_event_success(struct wpa_supplicant *wpa_s)
+void wpas_dbus_signal_wps_event_success(struct wpa_supplicant *wpa_s)
 {
 
 	DBusMessage *_signal = NULL;
@@ -665,8 +663,8 @@ out:
  * Sends Event dbus signal with name "fail" and dictionary containing
  * "msg field with fail message number (int32) as arguments
  */
-static void wpas_dbus_signal_wps_event_fail(struct wpa_supplicant *wpa_s,
-					    struct wps_event_fail *fail)
+void wpas_dbus_signal_wps_event_fail(struct wpa_supplicant *wpa_s,
+				     struct wps_event_fail *fail)
 {
 
 	DBusMessage *_signal = NULL;
@@ -720,8 +718,8 @@ out:
  * Sends Event dbus signal with name "m2d" and dictionary containing
  * fields of wps_event_m2d structure.
  */
-static void wpas_dbus_signal_wps_event_m2d(struct wpa_supplicant *wpa_s,
-					   struct wps_event_m2d *m2d)
+void wpas_dbus_signal_wps_event_m2d(struct wpa_supplicant *wpa_s,
+				    struct wps_event_m2d *m2d)
 {
 
 	DBusMessage *_signal = NULL;
@@ -798,8 +796,8 @@ out:
  *
  * Sends signal with credentials in directory argument
  */
-static void wpas_dbus_signal_wps_cred(struct wpa_supplicant *wpa_s,
-				      const struct wps_credential *cred)
+void wpas_dbus_signal_wps_cred(struct wpa_supplicant *wpa_s,
+			       const struct wps_credential *cred)
 {
 	DBusMessage *_signal = NULL;
 	DBusMessageIter iter, dict_iter;
@@ -915,8 +913,8 @@ nomem:
  * Sends ProertyChanged signals with path, interface and arguments
  * depending on which property has changed.
  */
-static void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
-					  enum wpas_dbus_prop property)
+void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
+				   enum wpas_dbus_prop property)
 {
 	WPADBusPropertyAccessor getter;
 	char *iface;
@@ -969,7 +967,7 @@ static void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
  *
  * Sends ProertyChanged signals informing that debug level has changed.
  */
-static void wpas_dbus_signal_debug_level_changed(struct wpa_global *global)
+void wpas_dbus_signal_debug_level_changed(struct wpa_global *global)
 {
 	wpa_dbus_signal_property_changed(global->dbus,
 					 (WPADBusPropertyAccessor)
@@ -986,7 +984,7 @@ static void wpas_dbus_signal_debug_level_changed(struct wpa_global *global)
  *
  * Sends ProertyChanged signals informing that debug timestamp has changed.
  */
-static void wpas_dbus_signal_debug_timestamp_changed(struct wpa_global *global)
+void wpas_dbus_signal_debug_timestamp_changed(struct wpa_global *global)
 {
 	wpa_dbus_signal_property_changed(global->dbus,
 					 (WPADBusPropertyAccessor)
@@ -1003,7 +1001,7 @@ static void wpas_dbus_signal_debug_timestamp_changed(struct wpa_global *global)
  *
  * Sends ProertyChanged signals informing that debug show_keys has changed.
  */
-static void wpas_dbus_signal_debug_show_keys_changed(struct wpa_global *global)
+void wpas_dbus_signal_debug_show_keys_changed(struct wpa_global *global)
 {
 	wpa_dbus_signal_property_changed(global->dbus,
 					 (WPADBusPropertyAccessor)
@@ -1249,8 +1247,8 @@ static const struct wpas_dbus_signal wpas_dbus_network_signals[] = {
  *
  * Registers network representing object with dbus
  */
-static int wpas_dbus_register_network(struct wpa_supplicant *wpa_s,
-				      struct wpa_ssid *ssid)
+int wpas_dbus_register_network(struct wpa_supplicant *wpa_s,
+			       struct wpa_ssid *ssid)
 {
 	struct wpas_dbus_priv *ctrl_iface;
 	struct wpa_dbus_object_desc *obj_desc;
@@ -1322,7 +1320,7 @@ err:
  *
  * Unregisters network representing object from dbus
  */
-static int wpas_dbus_unregister_network(struct wpa_supplicant *wpa_s, int nid)
+int wpas_dbus_unregister_network(struct wpa_supplicant *wpa_s, int nid)
 {
 	struct wpas_dbus_priv *ctrl_iface;
 	char *net_obj_path;
@@ -1429,8 +1427,8 @@ static const struct wpas_dbus_signal wpas_dbus_bss_signals[] = {
  *
  * Unregisters BSS representing object from dbus
  */
-static int wpas_dbus_unregister_bss(struct wpa_supplicant *wpa_s,
-				    u8 bssid[ETH_ALEN], unsigned int id)
+int wpas_dbus_unregister_bss(struct wpa_supplicant *wpa_s,
+			     u8 bssid[ETH_ALEN], unsigned int id)
 {
 	struct wpas_dbus_priv *ctrl_iface;
 	char *bss_obj_path;
@@ -1476,8 +1474,8 @@ static int wpas_dbus_unregister_bss(struct wpa_supplicant *wpa_s,
  *
  * Registers BSS representing object with dbus
  */
-static int wpas_dbus_register_bss(struct wpa_supplicant *wpa_s,
-				  u8 bssid[ETH_ALEN], unsigned int id)
+int wpas_dbus_register_bss(struct wpa_supplicant *wpa_s,
+			   u8 bssid[ETH_ALEN], unsigned int id)
 {
 	struct wpas_dbus_priv *ctrl_iface;
 	struct wpa_dbus_object_desc *obj_desc;
@@ -1764,7 +1762,7 @@ static const struct wpas_dbus_signal wpas_dbus_interface_signals[] = {
 };
 
 
-static int wpas_dbus_register_interface(struct wpa_supplicant *wpa_s)
+int wpas_dbus_register_interface(struct wpa_supplicant *wpa_s)
 {
 
 	struct wpa_dbus_object_desc *obj_desc = NULL;
@@ -1819,7 +1817,7 @@ err:
 }
 
 
-static int wpas_dbus_unregister_interface(struct wpa_supplicant *wpa_s)
+int wpas_dbus_unregister_interface(struct wpa_supplicant *wpa_s)
 {
 	struct wpas_dbus_priv *ctrl_iface;
 
@@ -1845,54 +1843,6 @@ static int wpas_dbus_unregister_interface(struct wpa_supplicant *wpa_s)
 }
 
 
-static struct wpas_dbus_callbacks callbacks =
-{
-	.signal_interface_added = wpas_dbus_signal_interface_added,
-	.signal_interface_removed = wpas_dbus_signal_interface_removed,
-
-	.register_interface = wpas_dbus_register_interface,
-	.unregister_interface = wpas_dbus_unregister_interface,
-
-	.signal_scan_done = wpas_dbus_signal_scan_done,
-
-	.signal_blob_added = wpas_dbus_signal_blob_added,
-	.signal_blob_removed = wpas_dbus_signal_blob_removed,
-
-	.signal_network_selected = wpas_dbus_signal_network_selected,
-
-	.signal_state_changed = wpas_dbus_signal_state_changed,
-	.register_network = wpas_dbus_register_network,
-	.unregister_network = wpas_dbus_unregister_network,
-
-	.signal_network_enabled_changed =
-	wpas_dbus_signal_network_enabled_changed,
-
-	.register_bss = wpas_dbus_register_bss,
-	.unregister_bss = wpas_dbus_unregister_bss,
-
-	.signal_prop_changed = wpas_dbus_signal_prop_changed,
-
-	.signal_debug_level_changed = wpas_dbus_signal_debug_level_changed,
-	.signal_debug_timestamp_changed =
-	wpas_dbus_signal_debug_timestamp_changed,
-	.signal_debug_show_keys_changed =
-	wpas_dbus_signal_debug_show_keys_changed,
-
-#ifdef CONFIG_WPS
-	.signal_wps_event_success = wpas_dbus_signal_wps_event_success,
-	.signal_wps_event_fail = wpas_dbus_signal_wps_event_fail,
-	.signal_wps_event_m2d = wpas_dbus_signal_wps_event_m2d,
-	.signal_wps_credentials = wpas_dbus_signal_wps_cred,
-#endif /* CONFIG_WPS */
-};
-
-
-struct wpas_dbus_callbacks * wpas_dbus_get_callbacks(void)
-{
-	return &callbacks;
-}
-
-
 /**
  * wpas_dbus_get_path - Get an interface's dbus path
  * @wpa_s: %wpa_supplicant interface structure

+ 134 - 55
wpa_supplicant/dbus/dbus_new.h

@@ -31,58 +31,6 @@ enum wpas_dbus_prop {
 	WPAS_DBUS_PROP_CURRENT_NETWORK,
 };
 
-struct wpas_dbus_callbacks {
-	void (*signal_interface_added)(struct wpa_supplicant *wpa_s);
-	void (*signal_interface_removed)(struct wpa_supplicant *wpa_s);
-
-	int (*register_interface)(struct wpa_supplicant *wpa_s);
-	int (*unregister_interface)(struct wpa_supplicant *wpa_s);
-
-	void (*signal_scan_done)(struct wpa_supplicant *wpa_s, int success);
-
-	void (*signal_blob_added)(struct wpa_supplicant *wpa_s,
-				  const char *name);
-	void (*signal_blob_removed)(struct wpa_supplicant *wpa_s,
-				    const char *name);
-
-	void (*signal_network_selected)(struct wpa_supplicant *wpa_s, int id);
-
-	void (*signal_state_changed)(struct wpa_supplicant *wpa_s,
-				     enum wpa_states new_state,
-				     enum wpa_states old_state);
-
-	int (*register_network)(struct wpa_supplicant *wpa_s,
-				struct wpa_ssid *ssid);
-	int (*unregister_network)(struct wpa_supplicant *wpa_s,
-				  int nid);
-
-	void (*signal_network_enabled_changed)(struct wpa_supplicant *wpa_s,
-					       struct wpa_ssid *ssid);
-
-	int (*register_bss)(struct wpa_supplicant *wpa_s, u8 bssid[ETH_ALEN],
-			    unsigned int id);
-	int (*unregister_bss)(struct wpa_supplicant *wpa_s,
-			      u8 bssid[ETH_ALEN], unsigned int id);
-
-	void (*signal_prop_changed)(struct wpa_supplicant *wpa_s,
-				    enum wpas_dbus_prop property);
-
-	void (*signal_debug_level_changed)(struct wpa_global *global);
-	void (*signal_debug_timestamp_changed)(struct wpa_global *global);
-	void (*signal_debug_show_keys_changed)(struct wpa_global *global);
-
-	void (*signal_wps_event_success)(struct wpa_supplicant *wpa_s);
-	void (*signal_wps_event_fail)(struct wpa_supplicant *wpa_s,
-				      struct wps_event_fail *fail);
-	void (*signal_wps_event_m2d)(struct wpa_supplicant *wpa_s,
-				     struct wps_event_m2d *m2d);
-	void (*signal_wps_credentials)(struct wpa_supplicant *wpa_s,
-				       const struct wps_credential *cred);
-};
-
-
-#ifdef CONFIG_CTRL_IFACE_DBUS_NEW
-
 #define WPAS_DBUS_OBJECT_PATH_MAX 150
 
 #define WPAS_DBUS_NEW_SERVICE		"fi.w1.wpa_supplicant1"
@@ -121,17 +69,148 @@ struct wpas_dbus_callbacks {
 #define WPAS_DBUS_ERROR_BLOB_UNKNOWN \
 	WPAS_DBUS_NEW_IFACE_INTERFACE ".BlobUnknown"
 
-struct wpas_dbus_callbacks * wpas_dbus_get_callbacks(void);
+
+#ifdef CONFIG_CTRL_IFACE_DBUS_NEW
+
 const char * wpas_dbus_get_path(struct wpa_supplicant *wpa_s);
 
 int wpas_dbus_ctrl_iface_init(struct wpas_dbus_priv *priv);
 void wpas_dbus_ctrl_iface_deinit(struct wpas_dbus_priv *iface);
 
+int wpas_dbus_register_interface(struct wpa_supplicant *wpa_s);
+int wpas_dbus_unregister_interface(struct wpa_supplicant *wpa_s);
+void wpas_dbus_signal_state_changed(struct wpa_supplicant *wpa_s,
+				    enum wpa_states new_state,
+				    enum wpa_states old_state);
+void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
+				   enum wpas_dbus_prop property);
+void wpas_dbus_signal_network_enabled_changed(struct wpa_supplicant *wpa_s,
+					      struct wpa_ssid *ssid);
+void wpas_dbus_signal_network_selected(struct wpa_supplicant *wpa_s, int id);
+void wpas_dbus_signal_scan_done(struct wpa_supplicant *wpa_s, int success);
+void wpas_dbus_signal_wps_cred(struct wpa_supplicant *wpa_s,
+			       const struct wps_credential *cred);
+void wpas_dbus_signal_wps_event_m2d(struct wpa_supplicant *wpa_s,
+				    struct wps_event_m2d *m2d);
+void wpas_dbus_signal_wps_event_fail(struct wpa_supplicant *wpa_s,
+				     struct wps_event_fail *fail);
+void wpas_dbus_signal_wps_event_success(struct wpa_supplicant *wpa_s);
+int wpas_dbus_register_network(struct wpa_supplicant *wpa_s,
+			       struct wpa_ssid *ssid);
+int wpas_dbus_unregister_network(struct wpa_supplicant *wpa_s, int nid);
+int wpas_dbus_unregister_bss(struct wpa_supplicant *wpa_s,
+			     u8 bssid[ETH_ALEN], unsigned int id);
+int wpas_dbus_register_bss(struct wpa_supplicant *wpa_s,
+			   u8 bssid[ETH_ALEN], unsigned int id);
+void wpas_dbus_signal_blob_added(struct wpa_supplicant *wpa_s,
+				 const char *name);
+void wpas_dbus_signal_blob_removed(struct wpa_supplicant *wpa_s,
+				   const char *name);
+void wpas_dbus_signal_debug_level_changed(struct wpa_global *global);
+void wpas_dbus_signal_debug_timestamp_changed(struct wpa_global *global);
+void wpas_dbus_signal_debug_show_keys_changed(struct wpa_global *global);
+
 #else /* CONFIG_CTRL_IFACE_DBUS_NEW */
 
-static inline struct wpas_dbus_callbacks * wpas_dbus_get_callbacks(void)
+static inline int wpas_dbus_register_interface(struct wpa_supplicant *wpa_s)
+{
+	return 0;
+}
+
+static inline int wpas_dbus_unregister_interface(struct wpa_supplicant *wpa_s)
+{
+	return 0;
+}
+
+#define wpas_dbus_signal_state_changed(w, n, o) do { } while (0)
+
+static inline void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
+						 enum wpas_dbus_prop property)
+{
+}
+
+static inline void wpas_dbus_signal_network_enabled_changed(
+	struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
+{
+}
+
+static inline void wpas_dbus_signal_network_selected(
+	struct wpa_supplicant *wpa_s, int id)
+{
+}
+
+static inline void wpas_dbus_signal_scan_done(struct wpa_supplicant *wpa_s,
+					      int success)
+{
+}
+
+static inline void wpas_dbus_signal_wps_cred(struct wpa_supplicant *wpa_s,
+					     const struct wps_credential *cred)
+{
+}
+
+static inline void wpas_dbus_signal_wps_event_m2d(struct wpa_supplicant *wpa_s,
+						  struct wps_event_m2d *m2d)
+{
+}
+
+static inline void wpas_dbus_signal_wps_event_fail(
+	struct wpa_supplicant *wpa_s, struct wps_event_fail *fail)
+{
+}
+
+static inline void wpas_dbus_signal_wps_event_success(
+	struct wpa_supplicant *wpa_s)
+{
+}
+
+static inline int wpas_dbus_register_network(struct wpa_supplicant *wpa_s,
+					     struct wpa_ssid *ssid)
+{
+	return 0;
+}
+
+static inline int wpas_dbus_unregister_network(struct wpa_supplicant *wpa_s,
+					       int nid)
+{
+	return 0;
+}
+
+static inline int wpas_dbus_unregister_bss(struct wpa_supplicant *wpa_s,
+					   u8 bssid[ETH_ALEN], unsigned int id)
+{
+	return 0;
+}
+
+static inline int wpas_dbus_register_bss(struct wpa_supplicant *wpa_s,
+					 u8 bssid[ETH_ALEN], unsigned int id)
+{
+	return 0;
+}
+
+static inline void wpas_dbus_signal_blob_added(struct wpa_supplicant *wpa_s,
+					       const char *name)
+{
+}
+
+static inline void wpas_dbus_signal_blob_removed(struct wpa_supplicant *wpa_s,
+						 const char *name)
+{
+}
+
+static inline void wpas_dbus_signal_debug_level_changed(
+	struct wpa_global *global)
+{
+}
+
+static inline void wpas_dbus_signal_debug_timestamp_changed(
+	struct wpa_global *global)
+{
+}
+
+static inline void wpas_dbus_signal_debug_show_keys_changed(
+	struct wpa_global *global)
 {
-	return NULL;
 }
 
 #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */

+ 23 - 76
wpa_supplicant/notify.c

@@ -49,29 +49,23 @@ void wpas_notify_supplicant_deinitialized(struct wpa_global *global)
 
 int wpas_notify_iface_added(struct wpa_supplicant *wpa_s)
 {
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
-
 	if (wpas_dbus_register_iface(wpa_s))
 		return -1;
 
-	if (cbs && cbs->register_interface(wpa_s))
+	if (wpas_dbus_register_interface(wpa_s))
 		return -1;
 
 	return 0;
 }
 
 
-
 void wpas_notify_iface_removed(struct wpa_supplicant *wpa_s)
 {
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
-
 	/* unregister interface in old DBus ctrl iface */
 	wpas_dbus_unregister_iface(wpa_s);
 
 	/* unregister interface in new DBus ctrl iface */
-	if (cbs)
-		cbs->unregister_interface(wpa_s);
+	wpas_dbus_unregister_interface(wpa_s);
 }
 
 
@@ -79,77 +73,59 @@ void wpas_notify_state_changed(struct wpa_supplicant *wpa_s,
 			       enum wpa_states new_state,
 			       enum wpa_states old_state)
 {
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
-
 	/* notify the old DBus API */
 	wpa_supplicant_dbus_notify_state_change(wpa_s, new_state,
 						old_state);
 
 	/* notify the new DBus API */
-	if (cbs)
-		cbs->signal_state_changed(wpa_s, new_state, old_state);
+	wpas_dbus_signal_state_changed(wpa_s, new_state, old_state);
 }
 
 
 void wpas_notify_network_changed(struct wpa_supplicant *wpa_s)
 {
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
-	if (cbs)
-		cbs->signal_prop_changed(wpa_s,
-					 WPAS_DBUS_PROP_CURRENT_NETWORK);
+	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_CURRENT_NETWORK);
 }
 
 
 void wpas_notify_ap_scan_changed(struct wpa_supplicant *wpa_s)
 {
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
-	if (cbs)
-		cbs->signal_prop_changed(wpa_s, WPAS_DBUS_PROP_AP_SCAN);
+	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_AP_SCAN);
 }
 
 
 void wpas_notify_bssid_changed(struct wpa_supplicant *wpa_s)
 {
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
-	if (cbs)
-		cbs->signal_prop_changed(wpa_s, WPAS_DBUS_PROP_CURRENT_BSS);
+	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_CURRENT_BSS);
 }
 
 
 void wpas_notify_network_enabled_changed(struct wpa_supplicant *wpa_s,
 					 struct wpa_ssid *ssid)
 {
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
-	if (cbs)
-		cbs->signal_network_enabled_changed(wpa_s, ssid);
+	wpas_dbus_signal_network_enabled_changed(wpa_s, ssid);
 }
 
 
 void wpas_notify_network_selected(struct wpa_supplicant *wpa_s,
 				  struct wpa_ssid *ssid)
 {
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
-	if (cbs)
-		cbs->signal_network_selected(wpa_s, ssid->id);
+	wpas_dbus_signal_network_selected(wpa_s, ssid->id);
 }
 
 
 void wpas_notify_scanning(struct wpa_supplicant *wpa_s)
 {
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
 	/* notify the old DBus API */
 	wpa_supplicant_dbus_notify_scanning(wpa_s);
 	/* notify the new DBus API */
-	if (cbs)
-		cbs->signal_prop_changed(wpa_s, WPAS_DBUS_PROP_SCANNING);
+	wpas_dbus_signal_prop_changed(wpa_s, WPAS_DBUS_PROP_SCANNING);
 }
 
 
 void wpas_notify_scan_done(struct wpa_supplicant *wpa_s, int success)
 {
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
-	if (cbs)
-		cbs->signal_scan_done(wpa_s, success);
+	wpas_dbus_signal_scan_done(wpa_s, success);
 }
 
 
@@ -166,15 +142,10 @@ void wpas_notify_wps_credential(struct wpa_supplicant *wpa_s,
 				const struct wps_credential *cred)
 {
 #ifdef CONFIG_WPS
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
-#endif /* CONFIG_WPS */
-
 	/* notify the old DBus API */
 	wpa_supplicant_dbus_notify_wps_cred(wpa_s, cred);
 	/* notify the new DBus API */
-#ifdef CONFIG_WPS
-	if (cbs)
-		cbs->signal_wps_credentials(wpa_s, cred);
+	wpas_dbus_signal_wps_cred(wpa_s, cred);
 #endif /* CONFIG_WPS */
 }
 
@@ -183,9 +154,7 @@ void wpas_notify_wps_event_m2d(struct wpa_supplicant *wpa_s,
 			       struct wps_event_m2d *m2d)
 {
 #ifdef CONFIG_WPS
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
-	if (cbs)
-		cbs->signal_wps_event_m2d(wpa_s, m2d);
+	wpas_dbus_signal_wps_event_m2d(wpa_s, m2d);
 #endif /* CONFIG_WPS */
 }
 
@@ -194,9 +163,7 @@ void wpas_notify_wps_event_fail(struct wpa_supplicant *wpa_s,
 				struct wps_event_fail *fail)
 {
 #ifdef CONFIG_WPS
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
-	if (cbs)
-		cbs->signal_wps_event_fail(wpa_s, fail);
+	wpas_dbus_signal_wps_event_fail(wpa_s, fail);
 #endif /* CONFIG_WPS */
 }
 
@@ -204,9 +171,7 @@ void wpas_notify_wps_event_fail(struct wpa_supplicant *wpa_s,
 void wpas_notify_wps_event_success(struct wpa_supplicant *wpa_s)
 {
 #ifdef CONFIG_WPS
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
-	if (cbs)
-		cbs->signal_wps_event_success(wpa_s);
+	wpas_dbus_signal_wps_event_success(wpa_s);
 #endif /* CONFIG_WPS */
 }
 
@@ -214,27 +179,21 @@ void wpas_notify_wps_event_success(struct wpa_supplicant *wpa_s)
 void wpas_notify_network_added(struct wpa_supplicant *wpa_s,
 			       struct wpa_ssid *ssid)
 {
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
-	if (wpa_s->global->dbus && cbs)
-		cbs->register_network(wpa_s, ssid);
+	wpas_dbus_register_network(wpa_s, ssid);
 }
 
 
 void wpas_notify_network_removed(struct wpa_supplicant *wpa_s,
 				 struct wpa_ssid *ssid)
 {
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
-	if (wpa_s->global->dbus && cbs)
-		cbs->unregister_network(wpa_s, ssid->id);
+	wpas_dbus_unregister_network(wpa_s, ssid->id);
 }
 
 
 void wpas_notify_bss_added(struct wpa_supplicant *wpa_s,
 			   u8 bssid[], unsigned int id)
 {
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
-	if (cbs)
-		cbs->register_bss(wpa_s, bssid, id);
+	wpas_dbus_register_bss(wpa_s, bssid, id);
 	wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_BSS_ADDED "%u " MACSTR,
 		     id, MAC2STR(bssid));
 }
@@ -243,9 +202,7 @@ void wpas_notify_bss_added(struct wpa_supplicant *wpa_s,
 void wpas_notify_bss_removed(struct wpa_supplicant *wpa_s,
 			     u8 bssid[], unsigned int id)
 {
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
-	if (cbs)
-		cbs->unregister_bss(wpa_s, bssid, id);
+	wpas_dbus_unregister_bss(wpa_s, bssid, id);
 	wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_BSS_REMOVED "%u " MACSTR,
 		     id, MAC2STR(bssid));
 }
@@ -253,39 +210,29 @@ void wpas_notify_bss_removed(struct wpa_supplicant *wpa_s,
 
 void wpas_notify_blob_added(struct wpa_supplicant *wpa_s, const char *name)
 {
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
-	if (cbs)
-		cbs->signal_blob_added(wpa_s, name);
+	wpas_dbus_signal_blob_added(wpa_s, name);
 }
 
 
 void wpas_notify_blob_removed(struct wpa_supplicant *wpa_s, const char *name)
 {
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
-	if (cbs)
-		cbs->signal_blob_removed(wpa_s, name);
+	wpas_dbus_signal_blob_removed(wpa_s, name);
 }
 
 
 void wpas_notify_debug_level_changed(struct wpa_global *global)
 {
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
-	if (cbs)
-		cbs->signal_debug_level_changed(global);
+	wpas_dbus_signal_debug_level_changed(global);
 }
 
 
 void wpas_notify_debug_timestamp_changed(struct wpa_global *global)
 {
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
-	if (cbs)
-		cbs->signal_debug_timestamp_changed(global);
+	wpas_dbus_signal_debug_timestamp_changed(global);
 }
 
 
 void wpas_notify_debug_show_keys_changed(struct wpa_global *global)
 {
-	struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
-	if (cbs)
-		cbs->signal_debug_show_keys_changed(global);
+	wpas_dbus_signal_debug_show_keys_changed(global);
 }