Change in osmocom-bb[master]: layer23/sap_interface.c: avoid using 'osmo' prefix

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/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Jan 7 15:39:53 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/12465 )

Change subject: layer23/sap_interface.c: avoid using 'osmo' prefix
......................................................................

layer23/sap_interface.c: avoid using 'osmo' prefix

The 'osmo' prefix is usually used by libosmo-* symbols.

Change-Id: Id37d8553c2f2c20012fb1b729967b92a9a03f612
---
M src/host/layer23/include/osmocom/bb/common/osmocom_data.h
M src/host/layer23/include/osmocom/bb/common/sap_interface.h
M src/host/layer23/src/common/sap_interface.c
M src/host/layer23/src/common/sim.c
M src/host/layer23/src/mobile/app_mobile.c
5 files changed, 18 insertions(+), 18 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/host/layer23/include/osmocom/bb/common/osmocom_data.h b/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
index 486c36d..a3ecc92 100644
--- a/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
+++ b/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
@@ -23,7 +23,7 @@
 #include <osmocom/bb/common/l1ctl.h>
 
 struct osmosap_entity {
-	osmosap_cb_t msg_handler;
+	sap_cb_t msg_handler;
 	uint8_t sap_state;
 	uint16_t max_msg_size;
 };
diff --git a/src/host/layer23/include/osmocom/bb/common/sap_interface.h b/src/host/layer23/include/osmocom/bb/common/sap_interface.h
index 270c565..5332982 100644
--- a/src/host/layer23/include/osmocom/bb/common/sap_interface.h
+++ b/src/host/layer23/include/osmocom/bb/common/sap_interface.h
@@ -1,14 +1,14 @@
 #pragma once
 
-typedef int (*osmosap_cb_t)(struct msgb *msg, struct osmocom_ms *ms);
+typedef int (*sap_cb_t)(struct msgb *msg, struct osmocom_ms *ms);
 
 int sap_open(struct osmocom_ms *ms);
 int sap_close(struct osmocom_ms *ms);
-int osmosap_send_apdu(struct osmocom_ms *ms, uint8_t *data, uint16_t length);
-int osmosap_register_handler(struct osmocom_ms *ms, osmosap_cb_t cb);
-int osmosap_init(struct osmocom_ms *ms);
+int sap_send_apdu(struct osmocom_ms *ms, uint8_t *data, uint16_t length);
+int sap_register_handler(struct osmocom_ms *ms, sap_cb_t cb);
+int sap_init(struct osmocom_ms *ms);
 
-enum osmosap_state {
+enum sap_state {
 	SAP_SOCKET_ERROR,
 	SAP_NOT_CONNECTED,
 	SAP_IDLE,
@@ -18,7 +18,7 @@
 };
 
 /* Table 5.1: Message Overview */
-enum osmosap_msg_type {
+enum sap_msg_type {
 	SAP_CONNECT_REQ = 0x00,
 	SAP_CONNECT_RESP = 0x01,
 	SAP_DISCONNECT_REQ = 0x02,
@@ -43,7 +43,7 @@
 };
 
 /* Table 5.15: List of Parameter IDs */
-enum osmosap_param_type {
+enum sap_param_type {
 	SAP_MAX_MSG_SIZE = 0x00,
 	SAP_CONNECTION_STATUS = 0x01,
 	SAP_RESULT_CODE = 0x02,
diff --git a/src/host/layer23/src/common/sap_interface.c b/src/host/layer23/src/common/sap_interface.c
index ab683f9..e3be3fb 100644
--- a/src/host/layer23/src/common/sap_interface.c
+++ b/src/host/layer23/src/common/sap_interface.c
@@ -159,7 +159,7 @@
 	return msg;
 }
 
-static int osmosap_send(struct osmocom_ms *ms, struct msgb *msg)
+static int sap_send(struct osmocom_ms *ms, struct msgb *msg)
 {
 	if(ms->sap_entity.sap_state == SAP_NOT_CONNECTED)
 		sap_connect(ms);
@@ -299,7 +299,7 @@
 	if(!msg)
 		return;
 
-	osmosap_send(ms, msg);
+	sap_send(ms, msg);
 	ms->sap_entity.sap_state = SAP_PROCESSING_ATR_REQUEST;
 }
 
@@ -463,7 +463,7 @@
 	if(!msg)
 		return;
 
-	osmosap_send(ms, msg);
+	sap_send(ms, msg);
 
 	ms->sap_entity.sap_state = SAP_CONNECTION_UNDER_NEGOTIATION;
 }
@@ -480,7 +480,7 @@
 	if(!msg)
 		return;
 
-	osmosap_send(ms, msg);
+	sap_send(ms, msg);
 
 	ms->sap_entity.sap_state = SAP_NOT_CONNECTED;
 }
@@ -504,7 +504,7 @@
 	if(!msg)
 		return -ENOMEM;
 
-	rc = osmosap_send(ms, msg);
+	rc = sap_send(ms, msg);
 	if (rc)
 		return rc;
 
@@ -551,7 +551,7 @@
 }
 
 /* same signature as in L1CTL, so it can be called from sim.c */
-int osmosap_send_apdu(struct osmocom_ms *ms, uint8_t *data, uint16_t length)
+int sap_send_apdu(struct osmocom_ms *ms, uint8_t *data, uint16_t length)
 {
 	//LOGP(DSAP, LOGL_ERROR, "Received the following APDU from sim.c: %s\n" ,
 	//     osmo_hexdump(data, length));
@@ -559,7 +559,7 @@
 }
 
 /* register message handler for messages that are sent from L2->L3 */
-int osmosap_register_handler(struct osmocom_ms *ms, osmosap_cb_t cb)
+int sap_register_handler(struct osmocom_ms *ms, sap_cb_t cb)
 {
 	ms->sap_entity.msg_handler = cb;
 
@@ -567,7 +567,7 @@
 }
 
 /* init */
-int osmosap_init(struct osmocom_ms *ms)
+int sap_init(struct osmocom_ms *ms)
 {
 	struct osmosap_entity *sap = &ms->sap_entity;
 
diff --git a/src/host/layer23/src/common/sim.c b/src/host/layer23/src/common/sim.c
index 9d14cd3..a63ae2a 100644
--- a/src/host/layer23/src/common/sim.c
+++ b/src/host/layer23/src/common/sim.c
@@ -205,7 +205,7 @@
 	 * it makes more sense to do it here then in L1CTL */
 	if (ms->subscr.sim_type == GSM_SIM_TYPE_SAP) {
 		LOGP(DSIM, LOGL_INFO, "Using SAP backend\n");
-		rc = osmosap_send_apdu(ms, data, length);
+		rc = sap_send_apdu(ms, data, length);
 	} else {
 		LOGP(DSIM, LOGL_INFO, "Using built-in SIM reader\n");
 		rc = l1ctl_tx_sim_req(ms, data, length);
diff --git a/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c
index a2c02c0..27e1d9b 100644
--- a/src/host/layer23/src/mobile/app_mobile.c
+++ b/src/host/layer23/src/mobile/app_mobile.c
@@ -200,7 +200,7 @@
 	lapdm_channel_set_l1(&ms->lapdm_channel, l1ctl_ph_prim_cb, ms);
 
 	/* init SAP client before SIM card starts up */
-	osmosap_init(ms);
+	sap_init(ms);
 
 	gsm_sim_init(ms);
 	gsm48_cc_init(ms);

-- 
To view, visit https://gerrit.osmocom.org/12465
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id37d8553c2f2c20012fb1b729967b92a9a03f612
Gerrit-Change-Number: 12465
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190107/f6cf0d15/attachment.htm>


More information about the gerrit-log mailing list