All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] simauth: remove driver API definitions from simauth include
@ 2017-11-09 17:52 James Prestwood
  2017-11-09 17:52 ` [PATCH 2/3] simauth: remove driver code from core simauth atom James Prestwood
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: James Prestwood @ 2017-11-09 17:52 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2085 bytes --]

---
 include/sim-auth.h | 38 +-------------------------------------
 1 file changed, 1 insertion(+), 37 deletions(-)

diff --git a/include/sim-auth.h b/include/sim-auth.h
index ccaa7f2..9f25cfa 100644
--- a/include/sim-auth.h
+++ b/include/sim-auth.h
@@ -32,44 +32,8 @@ extern "C" {
 
 struct ofono_sim_auth;
 
-typedef void (*ofono_sim_list_apps_cb_t)(const struct ofono_error *error,
-					const unsigned char *dataobj,
-					int len, void *data);
+struct ofono_sim_auth *ofono_sim_auth_create(struct ofono_modem *modem);
 
-typedef void (*ofono_sim_open_channel_cb_t)(const struct ofono_error *error,
-		int session_id, void *data);
-
-typedef void (*ofono_sim_close_channel_cb_t)(const struct ofono_error *error,
-		void *data);
-
-typedef void (*ofono_logical_access_cb_t)(const struct ofono_error *error,
-		const uint8_t *resp, uint16_t len, void *data);
-
-struct ofono_sim_auth_driver {
-	const char *name;
-	int (*probe)(struct ofono_sim_auth *sa, unsigned int vendor,
-			void *data);
-	void (*remove)(struct ofono_sim_auth *sa);
-
-	void (*list_apps)(struct ofono_sim_auth *sa,
-			ofono_sim_list_apps_cb_t cb, void *data);
-	void (*open_channel)(struct ofono_sim_auth *sa, const uint8_t *aid,
-			ofono_sim_open_channel_cb_t cb, void *data);
-	void (*close_channel)(struct ofono_sim_auth *sa, int session_id,
-			ofono_sim_close_channel_cb_t cb, void *data);
-	void (*logical_access)(struct ofono_sim_auth *sa,
-			int session_id, const uint8_t *pdu, uint16_t len,
-			ofono_logical_access_cb_t cb, void *data);
-};
-
-int ofono_sim_auth_driver_register(const struct ofono_sim_auth_driver *d);
-void ofono_sim_auth_driver_unregister(const struct ofono_sim_auth_driver *d);
-
-struct ofono_sim_auth *ofono_sim_auth_create(struct ofono_modem *modem,
-						unsigned int vendor,
-						const char *driver, void *data);
-
-void ofono_sim_auth_register(struct ofono_sim_auth *sa);
 void ofono_sim_auth_remove(struct ofono_sim_auth *sa);
 
 void ofono_sim_auth_set_data(struct ofono_sim_auth *sa, void *data);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] simauth: remove driver code from core simauth atom
  2017-11-09 17:52 [PATCH 1/3] simauth: remove driver API definitions from simauth include James Prestwood
@ 2017-11-09 17:52 ` James Prestwood
  2017-11-09 17:52 ` [PATCH 3/3] plugins: updated plugins using simauth module James Prestwood
  2017-11-09 17:56 ` [PATCH 1/3] simauth: remove driver API definitions from simauth include Denis Kenzior
  2 siblings, 0 replies; 4+ messages in thread
From: James Prestwood @ 2017-11-09 17:52 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 2552 bytes --]

---
 src/sim-auth.c | 49 +++++--------------------------------------------
 1 file changed, 5 insertions(+), 44 deletions(-)

diff --git a/src/sim-auth.c b/src/sim-auth.c
index f5ae7b6..b2c205d 100644
--- a/src/sim-auth.c
+++ b/src/sim-auth.c
@@ -39,8 +39,6 @@
 
 #define SIM_AUTH_MAX_RANDS	3
 
-static GSList *g_drivers = NULL;
-
 /*
  * Temporary handle used for the command authentication sequence.
  */
@@ -136,25 +134,6 @@ static void free_apps(struct ofono_sim_auth *sa)
 	g_slist_free(sa->aid_objects);
 }
 
-int ofono_sim_auth_driver_register(const struct ofono_sim_auth_driver *d)
-{
-	DBG("driver: %p, name: %s", d, d->name);
-
-	if (d->probe == NULL)
-		return -EINVAL;
-
-	g_drivers = g_slist_prepend(g_drivers, (void *) d);
-
-	return 0;
-}
-
-void ofono_sim_auth_driver_unregister(const struct ofono_sim_auth_driver *d)
-{
-	DBG("driver: %p, name: %s", d, d->name);
-
-	g_drivers = g_slist_remove(g_drivers, (void *) d);
-}
-
 static void sim_auth_unregister(struct ofono_atom *atom)
 {
 	struct ofono_sim_auth *sa = __ofono_atom_get_data(atom);
@@ -173,21 +152,14 @@ static void sim_auth_remove(struct ofono_atom *atom)
 	if (sa == NULL)
 		return;
 
-	if (sa->driver && sa->driver->remove)
-		sa->driver->remove(sa);
-
 	g_free(sa);
 }
 
-struct ofono_sim_auth *ofono_sim_auth_create(struct ofono_modem *modem,
-						unsigned int vendor,
-						const char *driver, void *data)
+static void sim_auth_register(struct ofono_sim_auth *sa);
+
+struct ofono_sim_auth *ofono_sim_auth_create(struct ofono_modem *modem)
 {
 	struct ofono_sim_auth *sa;
-	GSList *l;
-
-	if (driver == NULL)
-		return NULL;
 
 	sa = g_new0(struct ofono_sim_auth, 1);
 
@@ -197,18 +169,7 @@ struct ofono_sim_auth *ofono_sim_auth_create(struct ofono_modem *modem,
 	sa->atom = __ofono_modem_add_atom(modem, OFONO_ATOM_TYPE_SIM_AUTH,
 						sim_auth_remove, sa);
 
-	for (l = g_drivers; l; l = l->next) {
-		const struct ofono_sim_auth_driver *drv = l->data;
-
-		if (g_strcmp0(drv->name, driver))
-			continue;
-
-		if (drv->probe(sa, vendor, data) < 0)
-			continue;
-
-		sa->driver = drv;
-		break;
-	}
+	sim_auth_register(sa);
 
 	return sa;
 }
@@ -725,7 +686,7 @@ static char *build_nai(const char *imsi)
 	return nai;
 }
 
-void ofono_sim_auth_register(struct ofono_sim_auth *sa)
+static void sim_auth_register(struct ofono_sim_auth *sa)
 {
 	DBusConnection *conn = ofono_dbus_get_connection();
 	const char *path = __ofono_atom_get_path(sa->atom);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] plugins: updated plugins using simauth module
  2017-11-09 17:52 [PATCH 1/3] simauth: remove driver API definitions from simauth include James Prestwood
  2017-11-09 17:52 ` [PATCH 2/3] simauth: remove driver code from core simauth atom James Prestwood
@ 2017-11-09 17:52 ` James Prestwood
  2017-11-09 17:56 ` [PATCH 1/3] simauth: remove driver API definitions from simauth include Denis Kenzior
  2 siblings, 0 replies; 4+ messages in thread
From: James Prestwood @ 2017-11-09 17:52 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1701 bytes --]

The simauth creation API changed to not take the driver structure
---
 plugins/mbm.c      | 2 +-
 plugins/phonesim.c | 2 +-
 plugins/xmm7xxx.c  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/plugins/mbm.c b/plugins/mbm.c
index fa0088c..b787aeb 100644
--- a/plugins/mbm.c
+++ b/plugins/mbm.c
@@ -452,7 +452,7 @@ static void mbm_post_sim(struct ofono_modem *modem)
 	ofono_radio_settings_create(modem, 0, "stemodem", data->modem_port);
 
 	ofono_sms_create(modem, 0, "atmodem", data->modem_port);
-	ofono_sim_auth_create(modem, 0, "atmodem", data->modem_port);
+	ofono_sim_auth_create(modem);
 }
 
 static void mbm_post_online(struct ofono_modem *modem)
diff --git a/plugins/phonesim.c b/plugins/phonesim.c
index 3af2c46..bbbcbb3 100644
--- a/plugins/phonesim.c
+++ b/plugins/phonesim.c
@@ -861,7 +861,7 @@ static void phonesim_post_sim(struct ofono_modem *modem)
 		ofono_sms_create(modem, 0, "atmodem", data->chat);
 
 	ofono_radio_settings_create(modem, 0, "phonesim", data->chat);
-	ofono_sim_auth_create(modem, 0, "atmodem", data->chat);
+	ofono_sim_auth_create(modem);
 }
 
 static void phonesim_post_online(struct ofono_modem *modem)
diff --git a/plugins/xmm7xxx.c b/plugins/xmm7xxx.c
index a2582df..9f0ae8f 100644
--- a/plugins/xmm7xxx.c
+++ b/plugins/xmm7xxx.c
@@ -325,7 +325,7 @@ static void xmm7xxx_post_sim(struct ofono_modem *modem)
 
 	ofono_lte_create(modem, "atmodem", data->chat);
 	ofono_radio_settings_create(modem, 0, "xmm7modem", data->chat);
-	ofono_sim_auth_create(modem, 0, "atmodem", data->chat);
+	ofono_sim_auth_create(modem);
 }
 
 static void xmm7xxx_post_online(struct ofono_modem *modem)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] simauth: remove driver API definitions from simauth include
  2017-11-09 17:52 [PATCH 1/3] simauth: remove driver API definitions from simauth include James Prestwood
  2017-11-09 17:52 ` [PATCH 2/3] simauth: remove driver code from core simauth atom James Prestwood
  2017-11-09 17:52 ` [PATCH 3/3] plugins: updated plugins using simauth module James Prestwood
@ 2017-11-09 17:56 ` Denis Kenzior
  2 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2017-11-09 17:56 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 245 bytes --]

Hi James,

On 11/09/2017 11:52 AM, James Prestwood wrote:
> ---
>   include/sim-auth.h | 38 +-------------------------------------
>   1 file changed, 1 insertion(+), 37 deletions(-)
> 

All three applied, thanks.

Regards,
-Denis


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-09 17:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-09 17:52 [PATCH 1/3] simauth: remove driver API definitions from simauth include James Prestwood
2017-11-09 17:52 ` [PATCH 2/3] simauth: remove driver code from core simauth atom James Prestwood
2017-11-09 17:52 ` [PATCH 3/3] plugins: updated plugins using simauth module James Prestwood
2017-11-09 17:56 ` [PATCH 1/3] simauth: remove driver API definitions from simauth include Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.