[PATCH 1/7] ipa: remove bogus driver_name parameter from ipa_client_create

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

pablo at gnumonks.org pablo at gnumonks.org
Fri Sep 9 00:36:55 UTC 2011


From: Pablo Neira Ayuso <pablo at gnumonks.org>

This parameter is not required since the line that we pass as
parameter already has one driver attached.
---
 include/osmocom/abis/ipa.h |    2 +-
 src/input/hsl.c            |    2 +-
 src/input/ipa.c            |    8 ++------
 src/input/ipaccess.c       |    4 ++--
 src/ipa_proxy.c            |    2 +-
 5 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/include/osmocom/abis/ipa.h b/include/osmocom/abis/ipa.h
index 1a10ba9..1c6be15 100644
--- a/include/osmocom/abis/ipa.h
+++ b/include/osmocom/abis/ipa.h
@@ -54,7 +54,7 @@ struct ipa_client_link {
 	void				*data;
 };
 
-struct ipa_client_link *ipa_client_link_create(void *ctx, struct e1inp_ts *ts, const char *driver_name, int priv_nr, const char *addr, uint16_t port, int (*connect)(struct ipa_client_link *link), int (*read_cb)(struct ipa_client_link *link, struct msgb *msgb), int (*write_cb)(struct ipa_client_link *link), void *data);
+struct ipa_client_link *ipa_client_link_create(void *ctx, struct e1inp_ts *ts, int priv_nr, const char *addr, uint16_t port, int (*connect)(struct ipa_client_link *link), int (*read_cb)(struct ipa_client_link *link, struct msgb *msgb), int (*write_cb)(struct ipa_client_link *link), void *data);
 void ipa_client_link_destroy(struct ipa_client_link *link);
 
 int ipa_client_write_default_cb(struct ipa_client_link *link);
diff --git a/src/input/hsl.c b/src/input/hsl.c
index 60eea17..040dbce 100644
--- a/src/input/hsl.c
+++ b/src/input/hsl.c
@@ -507,7 +507,7 @@ static int hsl_line_update(struct e1inp_line *line)
 
 		link = ipa_client_link_create(tall_hsl_ctx,
 					      &line->ts[E1INP_SIGN_OML-1],
-					      "hsl", E1INP_SIGN_OML,
+					      E1INP_SIGN_OML,
 					      line->ops->cfg.ipa.addr,
 					      HSL_TCP_PORT,
 					      hsl_bts_connect,
diff --git a/src/input/ipa.c b/src/input/ipa.c
index b9bde68..83863f5 100644
--- a/src/input/ipa.c
+++ b/src/input/ipa.c
@@ -205,7 +205,7 @@ static int ipa_client_fd_cb(struct osmo_fd *ofd, unsigned int what)
 static void ipa_link_timer_cb(void *data);
 
 struct ipa_client_link *
-ipa_client_link_create(void *ctx, struct e1inp_ts *ts, const char *driver_name,
+ipa_client_link_create(void *ctx, struct e1inp_ts *ts,
 		       int priv_nr, const char *addr, uint16_t port,
 		       int (*connect_cb)(struct ipa_client_link *link),
 		       int (*read_cb)(struct ipa_client_link *link,
@@ -220,14 +220,10 @@ ipa_client_link_create(void *ctx, struct e1inp_ts *ts, const char *driver_name,
 		return NULL;
 
 	if (ts) {
-		struct e1inp_driver *driver;
-
-		driver = e1inp_driver_find(driver_name);
-		if (driver == NULL) {
+		if (ts->line->driver == NULL) {
 			talloc_free(ipa_link);
 			return NULL;
 		}
-		ts->line->driver = driver;
 		ipa_link->ofd = &ts->driver.ipaccess.fd;
 	} else {
 		ipa_link->ofd = talloc_zero(ctx, struct osmo_fd);
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index ea04e8d..3163a8c 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -881,7 +881,7 @@ static int ipaccess_line_update(struct e1inp_line *line)
 
 		link = ipa_client_link_create(tall_ipa_ctx,
 					      &line->ts[E1INP_SIGN_OML-1],
-					      "ipa", E1INP_SIGN_OML,
+					      E1INP_SIGN_OML,
 					      line->ops->cfg.ipa.addr,
 					      IPA_TCP_PORT_OML,
 					      NULL,
@@ -902,7 +902,7 @@ static int ipaccess_line_update(struct e1inp_line *line)
 		}
 		rsl_link = ipa_client_link_create(tall_ipa_ctx,
 						  &line->ts[E1INP_SIGN_RSL-1],
-						  "ipa", E1INP_SIGN_RSL,
+						  E1INP_SIGN_RSL,
 						  line->ops->cfg.ipa.addr,
 						  IPA_TCP_PORT_RSL,
 						  NULL,
diff --git a/src/ipa_proxy.c b/src/ipa_proxy.c
index 53da996..dadfd2f 100644
--- a/src/ipa_proxy.c
+++ b/src/ipa_proxy.c
@@ -185,7 +185,7 @@ ipa_sock_src_accept_cb(struct ipa_server_link *link, int fd)
 
 	LOGP(DLINP, LOGL_NOTICE, "now trying to connect to destination\n");
 
-	conn->dst = ipa_client_link_create(NULL, NULL, NULL, 0,
+	conn->dst = ipa_client_link_create(NULL, NULL, 0,
 					   route->shared->dst.inst->net.addr,
 					   route->shared->dst.inst->net.port,
 					   NULL,
-- 
1.7.2.5





More information about the OpenBSC mailing list