mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-18 22:38:32 +03:00
Compare commits
11 Commits
laforge/rp
...
lynxis/pre
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c79b582000 | ||
|
|
504c0fab50 | ||
|
|
2fd8d3c18c | ||
|
|
d405133672 | ||
|
|
69deee859f | ||
|
|
3fbed27b7a | ||
|
|
b0d66ebfb0 | ||
|
|
26517d89de | ||
|
|
6d2d1eeb36 | ||
|
|
651987ae62 | ||
|
|
ec157679d6 |
1
.github/FUNDING.yml
vendored
Normal file
1
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
open_collective: osmocom
|
||||
15
README.md
15
README.md
@@ -13,12 +13,17 @@ stack and host software.
|
||||
Supported Hardware
|
||||
------------------
|
||||
|
||||
* Osmocom SIMtrace 1.x with SAM3 controller
|
||||
** this is open hardware and schematics / PCB design is published
|
||||
* sysmocom sysmoQMOD (with 4 Modems, 4 SIM slots and 2 SAM3)
|
||||
** this is a proprietary device, publicly available from sysmocom
|
||||
* Osmocom [SIMtrace2](https://osmocom.org/projects/simtrace2/wiki) with SAM3 controller
|
||||
* this is open hardware and schematics / PCB design is published
|
||||
* pre-built hardware available from [sysmocom webshop](https://shop.sysmocom.de/SIMtrace2-Hardware-Kit/simtrace2-kit)
|
||||
* Osmocom [ngff-cardem](https://osmocom.org/projects/ngff-cardem/wiki) M.2/NGFF modem carrier with SAM3 controller
|
||||
* this is open hardware and schematics / PCB design is published
|
||||
* pre-built hardware available from [sysmocom webshoo](https://shop.sysmocom.de/M.2-modem-carrier-with-remote-SIM-tracing/ngff-cardem-kit-external)
|
||||
* sysmocom [sysmoQMOD](https://sysmocom.de/products/lab/sysmoqmod/index.html) (with 4 Modems, 4 SIM slots and 2 SAM3)
|
||||
* this is a proprietary device, publicly available from sysmocom
|
||||
* hardware evaluation kit available from [sysmocom webshop](https://shop.sysmocom.de/sysmoQMOD-evaluation-kit/sysmoQMOD-evk)
|
||||
* sysmocom OWHW (with 2 Modems and 1 SAM3 onboard)
|
||||
** this is not publicly available hardware, but still supported
|
||||
* this is not publicly available hardware, but still supported
|
||||
|
||||
This Repository
|
||||
---------------
|
||||
|
||||
@@ -8,3 +8,5 @@
|
||||
# If any interfaces have been removed or changed since the last public release: c:r:0.
|
||||
#library what description / commit summary line
|
||||
simtrace2 API/ABI change osmo_st2_transport new member
|
||||
simtrace2 API/ABI change cardemu_usb_msg_config new member
|
||||
simtrace2 API/ABI change add function osmo_st2_cardem_request_config2()
|
||||
|
||||
@@ -58,6 +58,7 @@ local hf_pts_resp = ProtoField.bytes("usb_simtrace.pts_resp", "PTS response")
|
||||
|
||||
local hf_cemu_cfg_features = ProtoField.uint32("usb_simtrace.cemu_cfg.features.status_irq", "CardEm Features", base.HEX)
|
||||
local hf_cemu_cfg_slot_mux_nr = ProtoField.uint32("usb_simtrace.cemu_cfg.features.slot_mux_nr", "CardEm Slot Mux Nr", base.DEC)
|
||||
local hf_cemu_cfg_presence_polarity = ProtoField.uint8("usb_simtrace.cemu_cfg.features.presence_polarity", "Sim presence polarity", base.DEC)
|
||||
|
||||
local card_insert_types = {
|
||||
[0x00] = "not inserted",
|
||||
@@ -71,6 +72,9 @@ local CEMU_STATUS_F_RCEMU_ACTIVE = ProtoField.uint32("usb_simtrace.CEMU_STATUS.
|
||||
local CEMU_STATUS_F_CARD_INSERT = ProtoField.uint32("usb_simtrace.CEMU_STATUS.F_CARD_INSERT", "CARD_INSERT", base.HEX_DEC, NULL, 0x00000008)
|
||||
local CEMU_STATUS_F_RESET_ACTIVE = ProtoField.uint32("usb_simtrace.CEMU_STATUS.F_RESET_ACTIVE", "RESET_ACTIVE", base.HEX_DEC, NULL, 0x00000010)
|
||||
|
||||
local CEMU_CONFIG_PRES_POL_PRES_H = ProtoField.uint32("usb_simtrace.CEMU_CONFIG.PRES_POL_PRES_H", "PRESENCE_HIGH", base.HEX_DEC, NULL, 0x00000001)
|
||||
local CEMU_CONFIG_PRES_POL_VALID = ProtoField.uint32("usb_simtrace.CEMU_CONFIG.PRES_POL_VALID", "PRESENCE_VALID", base.HEX_DEC, NULL, 0x00000002)
|
||||
|
||||
local modem_reset_types = {
|
||||
[0x00] = "de-assert",
|
||||
[0x01] = "assert",
|
||||
@@ -89,9 +93,10 @@ usb_simtrace_protocol.fields = {
|
||||
msgtype, seqnr, slotnr, reserved, payloadlen, payload,
|
||||
pb_and_rx, pb_and_tx, final, tpdu_hdr, rxtxdatalen, rxtxdata,
|
||||
CEMU_STATUS_F_VCC_PRESENT, CEMU_STATUS_F_CLK_ACTIVE, CEMU_STATUS_F_RCEMU_ACTIVE, CEMU_STATUS_F_CARD_INSERT, CEMU_STATUS_F_RESET_ACTIVE,
|
||||
CEMU_CONFIG_PRES_POL_PRES_H, CEMU_CONFIG_PRES_POL_VALID,
|
||||
modem_reset_status, modem_reset_len,
|
||||
hf_pts_len, hf_pts_req, hf_pts_resp,
|
||||
hf_cemu_cfg_features, hf_cemu_cfg_slot_mux_nr,
|
||||
hf_cemu_cfg_features, hf_cemu_cfg_slot_mux_nr, hf_cemu_cfg_presence_polarity,
|
||||
hf_cemu_cardinsert, hf_modem_sim_select,
|
||||
}
|
||||
|
||||
@@ -214,7 +219,15 @@ function dissect_cemu_config(payload_data, pinfo, tree)
|
||||
local subtree = tree:add(usb_simtrace_protocol, payload_data, "Card Emu Config")
|
||||
|
||||
subtree:add(hf_cemu_cfg_features, payload_data(0,4));
|
||||
subtree:add(hf_cemu_cfg_slot_mux_nr, payload_data(4,1));
|
||||
if payload_data:len() >= 4 then
|
||||
subtree:add(hf_cemu_cfg_slot_mux_nr, payload_data(4,1));
|
||||
end
|
||||
if payload_data:len() >= 5 then
|
||||
local pres = payload_data(5,1):le_uint();
|
||||
subtree:add(hf_cemu_cfg_presence_polarity, payload_data(5,1));
|
||||
headerSubtree:add(CEMU_CONFIG_PRES_POL_PRES_H, pres)
|
||||
headerSubtree:add(CEMU_CONFIG_PRES_POL_VALID, pres)
|
||||
end
|
||||
end
|
||||
|
||||
function dissect_modem_sim_sel(payload_data, pinfo, tree)
|
||||
|
||||
@@ -146,8 +146,8 @@ int board_override_enter_dfu(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const Pin deton = {PIO_PA13, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT};
|
||||
static const Pin detoff = {PIO_PA13, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT};
|
||||
static const Pin deton = {PIO_PA13, PIOA, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT};
|
||||
static const Pin detoff = {PIO_PA13, PIOA, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT};
|
||||
|
||||
void board_set_card_insert(struct cardem_inst *ci, bool card_insert)
|
||||
{
|
||||
|
||||
@@ -124,4 +124,8 @@ extern void mode_cardemu_usart1_irq(void);
|
||||
void Timer_Init( void );
|
||||
void TC0_Counter_Reset( void );
|
||||
|
||||
/* Sim presence pins */
|
||||
bool mode_cardemu_get_prensence_pol(uint8_t instance);
|
||||
void mode_cardemu_set_prensence_pol(uint8_t instance, bool high);
|
||||
|
||||
#endif /* SIMTRACE_H */
|
||||
|
||||
@@ -261,12 +261,21 @@ struct cardemu_usb_msg_error {
|
||||
/* enable/disable the generation of DO_STATUS on IRQ endpoint */
|
||||
#define CEMU_FEAT_F_STATUS_IRQ 0x00000001
|
||||
|
||||
#define CEMU_CONFIG_PRES_POL_PRES_L 0x00
|
||||
#define CEMU_CONFIG_PRES_POL_PRES_H 0x01
|
||||
#define CEMU_CONFIG_PRES_POL_VALID 0x02
|
||||
|
||||
/* SIMTRACE_MSGT_BD_CEMU_CONFIG */
|
||||
struct cardemu_usb_msg_config {
|
||||
/* bit-mask of CEMU_FEAT_F flags */
|
||||
uint32_t features;
|
||||
/* the selected slot number (if an external mux is present) */
|
||||
uint8_t slot_mux_nr;
|
||||
/* Sim presence pin polarity. Bit 1 is valid bit. Bit 0 gpio value when sim present.
|
||||
* When sim is present, set sim_present gpio to high -> 0x03
|
||||
* When sim is present, set sim_present gpio to low -> 0x02
|
||||
*/
|
||||
uint8_t pres_pol;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/***********************************************************************
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "trace.h"
|
||||
#include "iso7816_fidi.h"
|
||||
#include "card_emu.h"
|
||||
#include "simtrace.h"
|
||||
#include "simtrace_prot.h"
|
||||
#include "usb_buf.h"
|
||||
#include <osmocom/core/linuxlist.h>
|
||||
@@ -1096,7 +1097,7 @@ static void card_emu_report_config(struct card_handle *ch)
|
||||
#else
|
||||
cfg->slot_mux_nr = 0;
|
||||
#endif
|
||||
|
||||
cfg->pres_pol = mode_cardemu_get_prensence_pol(ch->num) | CEMU_CONFIG_PRES_POL_VALID;
|
||||
|
||||
usb_buf_upd_len_and_submit(msg);
|
||||
}
|
||||
@@ -1270,6 +1271,11 @@ int card_emu_set_config(struct card_handle *ch, const struct cardemu_usb_msg_con
|
||||
}
|
||||
#endif
|
||||
|
||||
if (scfg_len >= sizeof(uint32_t)+sizeof(uint8_t)+sizeof(uint8_t)) {
|
||||
if (scfg->pres_pol & CEMU_CONFIG_PRES_POL_VALID)
|
||||
mode_cardemu_set_prensence_pol(ch->num, scfg->pres_pol & CEMU_CONFIG_PRES_POL_PRES_H);
|
||||
}
|
||||
|
||||
/* send back a report of our current configuration */
|
||||
card_emu_report_config(ch);
|
||||
|
||||
|
||||
@@ -79,7 +79,10 @@ struct cardem_inst {
|
||||
uint8_t ep_out;
|
||||
uint8_t ep_in;
|
||||
uint8_t ep_int;
|
||||
/*! Pin to set when SIM is present/inserted (SIM presence pin). */
|
||||
const Pin pin_insert;
|
||||
/*! Invert the Pin polarity. When not inverted, the SIM pin_insert will be High, when a SIM is present. */
|
||||
bool pin_insert_inverted;
|
||||
#ifdef DETECT_VCC_BY_ADC
|
||||
uint32_t vcc_uv;
|
||||
#endif
|
||||
@@ -113,7 +116,10 @@ struct cardem_inst cardem_inst[] = {
|
||||
.ep_int = SIMTRACE_CARDEM_USB_EP_USIM1_INT,
|
||||
#ifdef PIN_SET_USIM1_PRES
|
||||
.pin_insert = PIN_SET_USIM1_PRES,
|
||||
#endif
|
||||
#endif /* PIN_SET_USIM1_PRES */
|
||||
#ifdef PIN_SET_USIM1_PRES_INVERTED
|
||||
.pin_insert_inverted = true,
|
||||
#endif /* PIN_SET_USIM1_PRES_INVERTED */
|
||||
},
|
||||
#ifdef CARDEMU_SECOND_UART
|
||||
{
|
||||
@@ -128,7 +134,10 @@ struct cardem_inst cardem_inst[] = {
|
||||
.ep_int = SIMTRACE_CARDEM_USB_EP_USIM2_INT,
|
||||
#ifdef PIN_SET_USIM2_PRES
|
||||
.pin_insert = PIN_SET_USIM2_PRES,
|
||||
#endif
|
||||
#endif /* PIN_SET_USIM2_PRES */
|
||||
#ifdef PIN_SET_USIM2_PRES_INVERTED
|
||||
.pin_insert_inverted = true,
|
||||
#endif /* PIN_SET_USIM2_PRES_INVERTED */
|
||||
},
|
||||
#endif
|
||||
};
|
||||
@@ -700,7 +709,7 @@ static void process_card_insert(struct cardem_inst *ci, bool card_insert)
|
||||
TRACE_INFO("%u: set card_insert to %s\r\n", ci->num, card_insert ? "INSERTED" : "REMOVED");
|
||||
|
||||
#ifdef HAVE_BOARD_CARDINSERT
|
||||
board_set_card_insert(ci, card_insert);
|
||||
board_set_card_insert(ci, card_insert ^ ci->pin_insert_inverted);
|
||||
#else
|
||||
if (!ci->pin_insert.pio) {
|
||||
TRACE_INFO("%u: skipping unsupported card_insert to %s\r\n",
|
||||
@@ -708,7 +717,7 @@ static void process_card_insert(struct cardem_inst *ci, bool card_insert)
|
||||
return;
|
||||
}
|
||||
|
||||
if (card_insert)
|
||||
if (card_insert ^ ci->pin_insert_inverted)
|
||||
PIO_Set(&ci->pin_insert);
|
||||
else
|
||||
PIO_Clear(&ci->pin_insert);
|
||||
@@ -962,3 +971,25 @@ void mode_cardemu_run(void)
|
||||
process_any_usb_commands(queue, ci);
|
||||
}
|
||||
}
|
||||
|
||||
void mode_cardemu_set_prensence_pol(uint8_t instance, bool high)
|
||||
{
|
||||
struct cardem_inst *ci;
|
||||
|
||||
if (instance >= ARRAY_SIZE(cardem_inst))
|
||||
return;
|
||||
|
||||
ci = &cardem_inst[instance];
|
||||
ci->pin_insert_inverted = !high;
|
||||
}
|
||||
|
||||
bool mode_cardemu_get_prensence_pol(uint8_t instance)
|
||||
{
|
||||
struct cardem_inst *ci;
|
||||
|
||||
if (instance >= ARRAY_SIZE(cardem_inst))
|
||||
return false;
|
||||
|
||||
ci = &cardem_inst[instance];
|
||||
return !ci->pin_insert_inverted;
|
||||
}
|
||||
|
||||
@@ -100,5 +100,4 @@ AC_OUTPUT(
|
||||
src/Makefile
|
||||
lib/Makefile
|
||||
contrib/Makefile
|
||||
contrib/simtrace2.spec
|
||||
Makefile)
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
#
|
||||
# spec file for package simtrace2
|
||||
#
|
||||
# Copyright (c) 2021 SUSE LLC
|
||||
# Copyright (c) 2018-2021, Martin Hauke <mardnh@gmx.de>
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
%define sover 1
|
||||
Name: simtrace2
|
||||
Version: @VERSION@
|
||||
Release: 0
|
||||
Summary: Osmocom SIMtrace host utility
|
||||
License: GPL-2.0-or-later
|
||||
Group: Productivity/Telephony/Utilities
|
||||
URL: https://osmocom.org/projects/simtrace2/wiki
|
||||
Source: %{name}-%{version}.tar.xz
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
BuildRequires: libtool
|
||||
BuildRequires: pkgconfig
|
||||
BuildRequires: pkgconfig(libosmocore) >= 1.4.0
|
||||
BuildRequires: pkgconfig(libosmosim) >= 1.4.0
|
||||
BuildRequires: pkgconfig(libosmousb) >= 1.4.0
|
||||
BuildRequires: pkgconfig(libpcsclite)
|
||||
BuildRequires: pkgconfig(libusb-1.0)
|
||||
|
||||
%description
|
||||
Osmocom SIMtrace 2 is a software and hardware system for passively
|
||||
tracing SIM-ME communication between the SIM card and the mobile phone,
|
||||
and remote SIM operation.
|
||||
|
||||
This package contains SIMtrace 2 host utility.
|
||||
|
||||
%package -n libosmo-simtrace2-%{sover}
|
||||
Summary: Driver functions for Osmocom SIMtrace2 and compatible firmware
|
||||
Group: System/Libraries
|
||||
|
||||
%description -n libosmo-simtrace2-%{sover}
|
||||
This library contains core "driver" functionality to interface with the
|
||||
Osmocom SIMtrace2 (and compatible) USB device firmware. It enables
|
||||
applications to implement SIM card / smart card tracing as well as
|
||||
SIM / smart card emulation functions.
|
||||
|
||||
%package -n libosmo-simtrace2-devel
|
||||
Summary: Development files for the Osmocom SIMtrace2 library
|
||||
Group: Development/Libraries/C and C++
|
||||
Requires: libosmo-simtrace2-%{sover} = %{version}
|
||||
|
||||
%description -n libosmo-simtrace2-devel
|
||||
Osmocom SIMtrace2 (and compatible) USB device firmware. It enables
|
||||
applications to implement SIM card / smart card tracing as well as
|
||||
SIM / smart card emulation functions.
|
||||
|
||||
This subpackage contains libraries and header files for developing
|
||||
applications that want to make use of libosmo-simtrace2.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
cd host
|
||||
echo "%{version}" >.tarball-version
|
||||
autoreconf -fiv
|
||||
%configure --disable-static
|
||||
%make_build
|
||||
|
||||
%install
|
||||
%make_install -C host
|
||||
install -Dm0644 host/contrib/99-simtrace2.rules %{buildroot}/%{_udevrulesdir}/99-simtrace2.rules
|
||||
find %{buildroot} -type f -name "*.la" -delete -print
|
||||
|
||||
%post -n libosmo-simtrace2-%{sover} -p /sbin/ldconfig
|
||||
%postun -n libosmo-simtrace2-%{sover} -p /sbin/ldconfig
|
||||
|
||||
%files
|
||||
%license host/COPYING
|
||||
%doc README.md
|
||||
%{_bindir}/simtrace2-cardem-pcsc
|
||||
%{_bindir}/simtrace2-list
|
||||
%{_bindir}/simtrace2-sniff
|
||||
%{_bindir}/simtrace2-tool
|
||||
%{_udevrulesdir}/99-simtrace2.rules
|
||||
|
||||
%files -n libosmo-simtrace2-%{sover}
|
||||
%{_libdir}/libosmo-simtrace2.so.%{sover}*
|
||||
|
||||
%files -n libosmo-simtrace2-devel
|
||||
%dir %{_includedir}/osmocom/
|
||||
%dir %{_includedir}/osmocom/simtrace2/
|
||||
%{_includedir}/osmocom/simtrace2/*.h
|
||||
%{_libdir}/libosmo-simtrace2.so
|
||||
%{_libdir}/pkgconfig/libosmo-simtrace2.pc
|
||||
|
||||
%changelog
|
||||
@@ -41,6 +41,8 @@ struct osmo_st2_cardem_inst {
|
||||
void *priv;
|
||||
};
|
||||
|
||||
struct cardemu_usb_msg_config;
|
||||
|
||||
int osmo_st2_slot_tx_msg(struct osmo_st2_slot *slot, struct msgb *msg,
|
||||
uint8_t msg_class, uint8_t msg_type);
|
||||
|
||||
@@ -53,7 +55,7 @@ int osmo_st2_cardem_request_sw_tx(struct osmo_st2_cardem_inst *ci, const uint8_t
|
||||
int osmo_st2_cardem_request_set_atr(struct osmo_st2_cardem_inst *ci, const uint8_t *atr,
|
||||
unsigned int atr_len);
|
||||
int osmo_st2_cardem_request_config(struct osmo_st2_cardem_inst *ci, uint32_t features);
|
||||
|
||||
int osmo_st2_cardem_request_config2(struct osmo_st2_cardem_inst *ci, const struct cardemu_usb_msg_config *config);
|
||||
|
||||
int osmo_st2_modem_reset_pulse(struct osmo_st2_slot *slot, uint16_t duration_ms);
|
||||
int osmo_st2_modem_reset_active(struct osmo_st2_slot *slot);
|
||||
|
||||
@@ -272,6 +272,21 @@ int osmo_st2_cardem_request_config(struct osmo_st2_cardem_inst *ci, uint32_t fea
|
||||
return osmo_st2_slot_tx_msg(ci->slot, msg, SIMTRACE_MSGC_CARDEM, SIMTRACE_MSGT_BD_CEMU_CONFIG);
|
||||
}
|
||||
|
||||
/* user_cfg is in host byte order. */
|
||||
int osmo_st2_cardem_request_config2(struct osmo_st2_cardem_inst *ci, const struct cardemu_usb_msg_config *user_cfg)
|
||||
{
|
||||
struct msgb *msg = st_msgb_alloc();
|
||||
struct cardemu_usb_msg_config *tx_cfg;
|
||||
|
||||
tx_cfg = (struct cardemu_usb_msg_config *) msgb_put(msg, sizeof(*tx_cfg));
|
||||
|
||||
LOGSLOT(ci->slot, LOGL_NOTICE, "<= %s(features=%08x)\n", __func__, tx_cfg->features);
|
||||
memcpy(tx_cfg, user_cfg, sizeof(*tx_cfg));
|
||||
osmo_store32le(user_cfg->features, &tx_cfg->features);
|
||||
|
||||
return osmo_st2_slot_tx_msg(ci->slot, msg, SIMTRACE_MSGC_CARDEM, SIMTRACE_MSGT_BD_CEMU_CONFIG);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* Modem Control protocol
|
||||
***********************************************************************/
|
||||
|
||||
@@ -413,6 +413,7 @@ static void print_help(void)
|
||||
"\t-S\t--usb-altsetting ALTSETTING_ID\n"
|
||||
"\t-A\t--usb-address\tADDRESS\n"
|
||||
"\t-H\t--usb-path\tPATH\n"
|
||||
"\t-Z\t--set-sim-presence\t<0/1>\n"
|
||||
"\n"
|
||||
);
|
||||
}
|
||||
@@ -431,6 +432,7 @@ static const struct option opts[] = {
|
||||
{ "usb-altsetting", 1, 0, 'S' },
|
||||
{ "usb-address", 1, 0, 'A' },
|
||||
{ "usb-path", 1, 0, 'H' },
|
||||
{ "set-sim-presence", 1, 0, 'Z' },
|
||||
{ NULL, 0, 0, 0 }
|
||||
};
|
||||
|
||||
@@ -487,6 +489,7 @@ int main(int argc, char **argv)
|
||||
char *path = NULL;
|
||||
struct osim_reader_hdl *reader;
|
||||
struct osim_card_hdl *card;
|
||||
struct cardemu_usb_msg_config cardem_config = { .features = CEMU_FEAT_F_STATUS_IRQ };
|
||||
|
||||
print_welcome();
|
||||
|
||||
@@ -509,7 +512,7 @@ int main(int argc, char **argv)
|
||||
while (1) {
|
||||
int option_index = 0;
|
||||
|
||||
c = getopt_long(argc, argv, "hi:V:P:C:I:S:A:H:akn:t:", opts, &option_index);
|
||||
c = getopt_long(argc, argv, "hi:V:P:C:I:S:A:H:akn:t:Z:", opts, &option_index);
|
||||
if (c == -1)
|
||||
break;
|
||||
switch (c) {
|
||||
@@ -553,6 +556,10 @@ int main(int argc, char **argv)
|
||||
case 'H':
|
||||
path = optarg;
|
||||
break;
|
||||
case 'Z':
|
||||
cardem_config.pres_pol = atoi(optarg) ? CEMU_CONFIG_PRES_POL_PRES_H : 0;
|
||||
cardem_config.pres_pol |= CEMU_CONFIG_PRES_POL_VALID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -636,7 +643,7 @@ int main(int argc, char **argv)
|
||||
allocate_and_submit_in(ci);
|
||||
|
||||
/* request firmware to generate STATUS on IRQ endpoint */
|
||||
osmo_st2_cardem_request_config(ci, CEMU_FEAT_F_STATUS_IRQ);
|
||||
osmo_st2_cardem_request_config2(ci, &cardem_config);
|
||||
|
||||
/* simulate card-insert to modem (owhw, not qmod) */
|
||||
osmo_st2_cardem_request_card_insert(ci, true);
|
||||
|
||||
Reference in New Issue
Block a user