summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico Golde <nico@ngolde.de>2012-03-20 05:22:46 +0100
committerNico Golde <nico@ngolde.de>2012-03-20 05:22:46 +0100
commit8cbbb75bf5d87f4f1e3f7068dfbfd4a12bf73dc5 (patch)
tree80cbfa56c82fc1b6b897a57cc41a191ac3dbce6a
parent5446930c461990f9491ac88c02c84a18020c890e (diff)
[SAP] remove sap socket command from vty, instead rely on mobile instance configuration and initialize sap from app_mobile
-rw-r--r--src/host/layer23/src/common/sap_interface.c2
-rw-r--r--src/host/layer23/src/mobile/app_mobile.c2
-rw-r--r--src/host/layer23/src/mobile/settings.c2
-rw-r--r--src/host/layer23/src/mobile/vty_interface.c35
4 files changed, 7 insertions, 34 deletions
diff --git a/src/host/layer23/src/common/sap_interface.c b/src/host/layer23/src/common/sap_interface.c
index 1492cb1..1249ed7 100644
--- a/src/host/layer23/src/common/sap_interface.c
+++ b/src/host/layer23/src/common/sap_interface.c
@@ -584,7 +584,7 @@ int osmosap_init(struct osmocom_ms *ms)
if(ms->settings.sap_socket_path){
rc = sap_open(ms, ms->settings.sap_socket_path);
if (rc < 0) {
- fprintf(stderr, "Failed during sap_open(), no SIM reader\n");
+ fprintf(stderr, "Failed during sap_open(), no SAP-based SIM reader\n");
ms->sap_wq.bfd.fd = -1;
return rc;
}
diff --git a/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c
index 05e5415..cf0a41b 100644
--- a/src/host/layer23/src/mobile/app_mobile.c
+++ b/src/host/layer23/src/mobile/app_mobile.c
@@ -31,6 +31,7 @@
#include <osmocom/bb/common/lapdm.h>
#include <osmocom/bb/common/logging.h>
#include <osmocom/bb/common/gps.h>
+#include <osmocom/bb/common/sap_interface.h>
#include <osmocom/bb/mobile/gsm48_rr.h>
#include <osmocom/bb/mobile/vty.h>
#include <osmocom/bb/mobile/app_mobile.h>
@@ -161,6 +162,7 @@ int mobile_init(struct osmocom_ms *ms)
lapdm_init(&ms->l2_entity.lapdm_dcch, ms);
lapdm_init(&ms->l2_entity.lapdm_acch, ms);
+ osmosap_init(ms);
gsm_sim_init(ms);
gsm48_cc_init(ms);
gsm_subscr_init(ms);
diff --git a/src/host/layer23/src/mobile/settings.c b/src/host/layer23/src/mobile/settings.c
index 6e2338b..db22fd9 100644
--- a/src/host/layer23/src/mobile/settings.c
+++ b/src/host/layer23/src/mobile/settings.c
@@ -29,6 +29,7 @@
#include <osmocom/bb/common/networks.h>
static char *layer2_socket_path = "/tmp/osmocom_l2";
+static char *sap_socket_path = "/tmp/osmocom_sap";
int gsm_settings_init(struct osmocom_ms *ms)
{
@@ -36,6 +37,7 @@ int gsm_settings_init(struct osmocom_ms *ms)
struct gsm_support *sup = &ms->support;
strcpy(set->layer2_socket_path, layer2_socket_path);
+ strcpy(set->sap_socket_path, sap_socket_path);
/* IMEI */
sprintf(set->imei, "000000000000000");
diff --git a/src/host/layer23/src/mobile/vty_interface.c b/src/host/layer23/src/mobile/vty_interface.c
index 42d716b..597aa64 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -652,37 +652,6 @@ DEFUN(sim_lai, sim_lai_cmd, "sim lai MS_NAME MCC MNC LAC",
return CMD_SUCCESS;
}
-DEFUN(sim_sapsocket, sim_sapsocket_cmd, "sim sap-socket MS_NAME SOCKET_PATH",
- "SIM actions\nEnter SAP socket used instead of SIM driver for card\nName of MS (see \"show ms\")\n"
- "socket path")
-{
- struct osmocom_ms *ms;
- struct gsm_settings *set;
-
- ms = get_ms(argv[0], vty);
- if (!ms)
- return CMD_WARNING;
-
- if(!argv[1]){
- vty_out(vty, "You must specify a SAP socket path%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
-
-
- osmosap_sapsocket(ms, (char *)argv[1]);
- set = &ms->settings;
-
- if(access(set->sap_socket_path, F_OK) == 0){
- if(osmosap_init(ms) != 0){
- return CMD_WARNING;
- }
- } else {
- /* this is only so we can check the first byte to be null in l1ctl_tx_sim_req */
- set->sap_socket_path[0] = 0;
- }
-
- return CMD_SUCCESS;
-}
DEFUN(network_select, network_select_cmd, "network select MS_NAME MCC MNC",
"Select ...\nSelect Network\nName of MS (see \"show ms\")\n"
@@ -1088,7 +1057,8 @@ static void config_write_ms(struct vty *vty, struct osmocom_ms *ms)
vty_out(vty, "ms %s%s", ms->name, VTY_NEWLINE);
vty_out(vty, " layer2-socket %s%s", set->layer2_socket_path,
VTY_NEWLINE);
- vty_out(vty, " sap-socket %s%s", set->sap_socket_path, VTY_NEWLINE);
+ vty_out(vty, " sap-socket %s%s", set->sap_socket_path,
+ VTY_NEWLINE);
switch(set->sim_type) {
case GSM_SIM_TYPE_NONE:
vty_out(vty, " sim none%s", VTY_NEWLINE);
@@ -2328,7 +2298,6 @@ int ms_vty_init(void)
install_element(ENABLE_NODE, &sim_enable_pin_cmd);
install_element(ENABLE_NODE, &sim_change_pin_cmd);
install_element(ENABLE_NODE, &sim_unblock_pin_cmd);
- install_element(ENABLE_NODE, &sim_sapsocket_cmd);
install_element(ENABLE_NODE, &sim_lai_cmd);
install_element(ENABLE_NODE, &network_search_cmd);
install_element(ENABLE_NODE, &network_show_cmd);