Skip to content

Commit 247c5ee

Browse files
yliu80lijinxia
authored andcommitted
IOC mediator: Send open channel command to activate CBC signal channel by default
To send open channel command after opening CBC signal channel successfully. For the latest IOC firmware, the IOC mediator needs to send open channel command to activate CBC signal channel. Otherwise, there will be no any signal data will be received. The open channel command is forward compatible that it would not impact for older IOC firmware. Signed-off-by: Yuan Liu <yuan1.liu@intel.com> Reviewed-by: Yu Wang <yu1.wang@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com>
1 parent 7491b83 commit 247c5ee

File tree

1 file changed

+20
-0
lines changed
  • devicemodel/hw/platform

1 file changed

+20
-0
lines changed

devicemodel/hw/platform/ioc.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,16 @@ typedef void* (*ioc_work)(void *arg);
124124
*/
125125
static char virtual_uart_path[32];
126126

127+
/*
128+
* To activate CBC signal channel(/dev/cbc-signals).
129+
* Need to send open channel command to CBC signal char device before receive
130+
* signal data.
131+
* NOTE: Only send open channel command, no need to send close channel since
132+
* close channel command would deactivate the signal channel for all UOS, so
133+
* there will be a SOS service to deactivate signal channel in the future.
134+
*/
135+
static uint8_t cbc_open_channel_command[] = {0xFD, 0x00, 0x00, 0x00};
136+
127137
/* IOC boot reason(for S5)
128138
* comes from DM command line parameters.
129139
*/
@@ -1365,6 +1375,16 @@ ioc_init(struct vmctx *ctx)
13651375
if (ioc_ch_init(ioc) != 0)
13661376
goto chl_err;
13671377

1378+
/*
1379+
* Make sure the CBC signal channel is activated after channel
1380+
* initialization is successful.
1381+
* TODO: Check firmware version before sending open channel command
1382+
* since the old IOC firmware needs not use open channel command to
1383+
* activate signal channel that is activated by default.
1384+
*/
1385+
if (ioc_ch_xmit(IOC_NATIVE_SIGNAL, cbc_open_channel_command,
1386+
sizeof(cbc_open_channel_command)) <= 0)
1387+
DPRINTF("%s", "ioc sends CBC open channel command failed\r\n");
13681388

13691389
/* Initlialize CBC rx/tx signal and group whitelists */
13701390
wlist_init_signal(cbc_rx_signal_table, ARRAY_SIZE(cbc_rx_signal_table),

0 commit comments

Comments
 (0)