James Tavares has uploaded this change for review. ( https://gerrit.osmocom.org/c/simtrace2/+/26865 )
Change subject: firmware: bugfix: disable cardemu comms in local SIM mode
......................................................................
firmware: bugfix: disable cardemu comms in local SIM mode
This change prevents contention on the ISO7816 bus by disabling the card emulation state machine when the SIM switch is in the local mode. Without this change, the card emulation firmware can clobber ISO7816 communications and cause contention with certain (but not all) SIM cards.
Changes:
- Add 'enabled' flag to cardemu instance that is set/cleared by usb_command_sim_select() (the only place where sim switch occurs).
- Flag is initialized as false (disabled) by default, to match local SIM mode default.
- When card emulation is disabled, force SIM VCC to be "OFF", SIM RESET as "not in RESET", and drop bytes bytes received on the ISO7816 interface (but do service buffers).
Change-Id: I4010f988712eac4a6af8568ccd60062f9de62449
---
M firmware/libcommon/source/mode_cardemu.c
1 file changed, 31 insertions(+), 13 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/65/26865/1
diff --git a/firmware/libcommon/source/mode_cardemu.c b/firmware/libcommon/source/mode_cardemu.c
index 8e4acf9..00a062e 100644
--- a/firmware/libcommon/source/mode_cardemu.c
+++ b/firmware/libcommon/source/mode_cardemu.c
@@ -83,10 +83,21 @@
#ifdef DETECT_VCC_BY_ADC
uint32_t vcc_uv;
#endif
+
+ /*! real-time state of VCC I/O line, irrespective of enabled flag */
bool vcc_active;
+
+ /*! last VCC state we reported to the card emu state machine (conditioned by enabled flag) */
bool vcc_active_last;
+
+ /*! real-time state of RST I/O line, irrespective of enabled flag */
bool rst_active;
+
+ /*! last RST state we reported to the card emu state machine (conditioned by enabled flag) */
bool rst_active_last;
+
+ /*! flag indicating whether this instance should perform card emulation, or not */
+ bool enabled;
};
struct cardem_inst cardem_inst[] = {
@@ -505,19 +516,25 @@
#endif /* DETECT_VCC_BY_ADC */
-/* called from main loop; dispatches card I/O state changes to card_emu from main loop */
+/**
+ * called from main loop; dispatches card I/O state changes to card_emu from main loop.
+ * NOTE: conditions I/O state on the ci->enabled flag; if the instance is disabled, we assume VCC is
+ * disabled and the device is not in reset
+ */
static void process_io_statechg(struct cardem_inst *ci)
{
- if (ci->vcc_active != ci->vcc_active_last) {
- card_emu_io_statechg(ci->ch, CARD_IO_VCC, ci->vcc_active);
+ const bool vcc_active = ci->vcc_active && ci->enabled;
+ if (vcc_active != ci->vcc_active_last) {
+ card_emu_io_statechg(ci->ch, CARD_IO_VCC, vcc_active);
/* FIXME do this for real */
- card_emu_io_statechg(ci->ch, CARD_IO_CLK, ci->vcc_active);
- ci->vcc_active_last = ci->vcc_active;
+ card_emu_io_statechg(ci->ch, CARD_IO_CLK, vcc_active);
+ ci->vcc_active_last = vcc_active;
}
- if (ci->rst_active != ci->rst_active_last) {
- card_emu_io_statechg(ci->ch, CARD_IO_RST, ci->rst_active);
- ci->rst_active_last = ci->rst_active;
+ const bool rst_active = ci->rst_active && ci->enabled;
+ if (rst_active != ci->rst_active_last) {
+ card_emu_io_statechg(ci->ch, CARD_IO_RST, rst_active);
+ ci->rst_active_last = rst_active;
}
}
@@ -764,10 +781,8 @@
if (msgb_l2len(msg) < sizeof(*mss))
return -1;
- if (mss->remote_sim)
- sim_switch_use_physical(ci->num, 0);
- else
- sim_switch_use_physical(ci->num, 1);
+ ci->enabled = mss->remote_sim ? true : false;
+ sim_switch_use_physical(ci->num, !ci->enabled);
return 0;
}
@@ -911,7 +926,10 @@
}
uint8_t byte = rbuf_read(&ci->rb);
__enable_irq();
- card_emu_process_rx_byte(ci->ch, byte);
+
+ if (ci->enabled) {
+ card_emu_process_rx_byte(ci->ch, byte);
+ }
//TRACE_ERROR("%uRx%02x\r\n", i, byte);
}
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/26865
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I4010f988712eac4a6af8568ccd60062f9de62449
Gerrit-Change-Number: 26865
Gerrit-PatchSet: 1
Gerrit-Owner: James Tavares <jtavares(a)kvh.com>
Gerrit-MessageType: newchange
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/26797 )
Change subject: running.adoc: explain MGW configuration
......................................................................
running.adoc: explain MGW configuration
OsmoHNBGW now requires a co-located OsmoMGW instance. Lets add add some
info on how to configure it.
Change-Id: Id47f4f365cee78ce28d1534c4e3e98a59bdb0621
Related: OS#5152
---
M doc/manuals/chapters/running.adoc
1 file changed, 16 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/97/26797/1
diff --git a/doc/manuals/chapters/running.adoc b/doc/manuals/chapters/running.adoc
index f40027a..5d3422e 100644
--- a/doc/manuals/chapters/running.adoc
+++ b/doc/manuals/chapters/running.adoc
@@ -117,3 +117,19 @@
local-ip 10.9.8.7
local-port 29169
----
+
+==== Configure co-located media gateway
+
+OsmoHNBGW requires a co-located OsmoMGW instace. The purpose of the co-located
+media gateway is to relay the RTP traffic between hNodeB and core network. The
+configuration is done under the hnbgw node along with iucs and iups.
+
+An example configuration for OsmoHNBGW's MGCP client:
+
+----
+hnbgw
+ mgcp
+ mgw remote-ip 127.0.0.1
+ mgw remote-port 2427
+ mgw reset-endpoint rtpbridge/*
+----
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/26797
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Id47f4f365cee78ce28d1534c4e3e98a59bdb0621
Gerrit-Change-Number: 26797
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: laforge.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/27016 )
Change subject: Allow configuration of interfaces/lines via VTY
......................................................................
Patch Set 6: Code-Review+1
(1 comment)
File src/usb.c:
https://gerrit.osmocom.org/c/osmo-e1d/+/27016/comment/112a59ae_5803b92c
PS6, Line 565: /* try to find the matching interface config create by the vty */
created by
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/27016
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: I89b57b688b68901f87d9683ab9294772ee747d77
Gerrit-Change-Number: 27016
Gerrit-PatchSet: 6
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: tnt <tnt(a)246tNt.com>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Mon, 31 Jan 2022 19:13:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment