[PATCH 2/3] mgcp: Synchronize conn mode bits and output enabled flags

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

Holger Hans Peter Freyther holger at freyther.de
Mon Jan 20 07:18:00 UTC 2014


On Thu, Jan 16, 2014 at 04:50:40PM +0100, Jacob Erlbeck wrote:

Good Morning!

> +#define CONN_UNMODIFIED (0x1000)
> +
> +static void test_values(void)
> +{
> +	/* Check that NONE disables all output */
> +	OSMO_ASSERT((MGCP_CONN_NONE & MGCP_CONN_RECV_SEND) == 0)
> +
> +	/* Check that LOOPBACK enables all output */
> +	OSMO_ASSERT((MGCP_CONN_LOOPBACK & MGCP_CONN_RECV_SEND) ==
> +		    MGCP_CONN_RECV_SEND)
> +}

I think osmo_static_assert would work here too? I am applying your
patches as is though.

> -			if (endp->conn_mode != -1)
> +			if ((endp->conn_mode & CONN_UNMODIFIED) == 0)
>  				printf("Connection mode: %d, "
>  				       "BTS output %sabled, NET output %sabled\n",
>  				       endp->conn_mode,

In the next step we could change the test output to illustrate the
tri-state from on/off and not modified to previous test?

> +			endp->conn_mode = MGCP_CONN_NONE | CONN_UNMODIFIED;
> +			endp->net_end.output_enabled = 0;
> +			endp->bts_end.output_enabled = 0;

do we still need these flags? Or only because of the above printf?





More information about the OpenBSC mailing list