summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/host/layer23/include/osmocom/bb/common/osmocom_data.h2
-rw-r--r--src/host/layer23/include/osmocom/bb/common/sap_interface.h14
-rw-r--r--src/host/layer23/src/common/sap_interface.c16
-rw-r--r--src/host/layer23/src/common/sim.c2
-rw-r--r--src/host/layer23/src/mobile/app_mobile.c2
5 files changed, 18 insertions, 18 deletions
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 486c36d0..a3ecc92c 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 @@ struct osmocom_ms;
#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 270c5655..5332982b 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 @@ enum osmosap_state {
};
/* 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 @@ enum osmosap_msg_type {
};
/* 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 ab683f9d..e3be3fb6 100644
--- a/src/host/layer23/src/common/sap_interface.c
+++ b/src/host/layer23/src/common/sap_interface.c
@@ -159,7 +159,7 @@ static struct msgb *sap_create_msg(uint8_t id, uint8_t num_params, struct sap_pa
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 @@ static void sap_atr(struct osmocom_ms *ms)
if(!msg)
return;
- osmosap_send(ms, msg);
+ sap_send(ms, msg);
ms->sap_entity.sap_state = SAP_PROCESSING_ATR_REQUEST;
}
@@ -463,7 +463,7 @@ static void sap_connect(struct osmocom_ms *ms)
if(!msg)
return;
- osmosap_send(ms, msg);
+ sap_send(ms, msg);
ms->sap_entity.sap_state = SAP_CONNECTION_UNDER_NEGOTIATION;
}
@@ -480,7 +480,7 @@ static void sap_disconnect(struct osmocom_ms *ms)
if(!msg)
return;
- osmosap_send(ms, msg);
+ sap_send(ms, msg);
ms->sap_entity.sap_state = SAP_NOT_CONNECTED;
}
@@ -504,7 +504,7 @@ static int sap_apdu(struct osmocom_ms *ms, uint8_t *data, uint16_t len)
if(!msg)
return -ENOMEM;
- rc = osmosap_send(ms, msg);
+ rc = sap_send(ms, msg);
if (rc)
return rc;
@@ -551,7 +551,7 @@ int sap_close(struct osmocom_ms *ms)
}
/* 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 @@ int osmosap_send_apdu(struct osmocom_ms *ms, uint8_t *data, uint16_t length)
}
/* 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 @@ int osmosap_register_handler(struct osmocom_ms *ms, osmosap_cb_t cb)
}
/* 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 9d14cd30..a63ae2a7 100644
--- a/src/host/layer23/src/common/sim.c
+++ b/src/host/layer23/src/common/sim.c
@@ -205,7 +205,7 @@ static int sim_apdu_send(struct osmocom_ms *ms, uint8_t *data, uint16_t length)
* 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 a2c02c06..27e1d9b4 100644
--- a/src/host/layer23/src/mobile/app_mobile.c
+++ b/src/host/layer23/src/mobile/app_mobile.c
@@ -200,7 +200,7 @@ static int mobile_init(struct osmocom_ms *ms)
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);