|
| void | out_stage_init (out_stage_t *st, const uint16_t *cfg, const uint16_t *slots) |
| | Start from the pages in force; NULL starts from the pages' defaults.
|
| uint8_t | out_stage_cfg_write (out_stage_t *st, uint8_t off, uint8_t n, const uint16_t *in) |
| | A window of BIND_CFG or BIND_OUT written: 0, or the link_nack_t outputs_chan_cfg_write() and outputs_slots_write() give for the same window, and then nothing of it is stored.
|
| uint8_t | out_stage_slots_write (out_stage_t *st, uint8_t off, uint8_t n, const uint16_t *in) |
| | A window of BIND_OUT written: 0, or the link_nack_t outputs_slots_write() gives for the same window, and then nothing of it is stored.
|
| static void | read_window (const uint16_t *regs, unsigned count, uint8_t off, uint8_t n, uint16_t *out) |
| | Copies n registers from off; an index at or past count reads 0.
|
| void | out_stage_cfg_read (const out_stage_t *st, uint8_t off, uint8_t n, uint16_t *out) |
| | Copies a window of the prepared CHAN_CFG page.
|
| void | out_stage_slots_read (const out_stage_t *st, uint8_t off, uint8_t n, uint16_t *out) |
| | Copies a window of the prepared OUTPUTS page.
|
| static uint16_t | crc_regs (uint16_t crc, const uint16_t *regs, unsigned count) |
| | Byte by byte, so the value does not depend on either processor's order.
|
| uint16_t | out_stage_crc (const uint16_t *cfg, const uint16_t *slots) |
| | The CRC a commit names: CRC-16/CCITT-FALSE (polynomial 0x1021, seed 0xFFFF, link_crc()) over the 32 CHAN_CFG registers and then the 32 OUTPUTS registers, each as its low byte and then its high byte.
|
| uint16_t | out_stage_held_crc (const out_stage_t *st) |
| | The same of what st holds; 0 for NULL.
|
| uint8_t | out_stage_commit (const out_stage_t *st, uint16_t crc, const uint16_t *cfg_in_force, const out_stage_ops_t *ops, void *ctx) |
| | A write of LINK_BD_COMMIT.
|
A binding prepared beside the one in force.
See out_stage.h.
SPDX-License-Identifier: MIT
| uint8_t out_stage_commit |
( |
const out_stage_t * | st, |
|
|
uint16_t | crc, |
|
|
const uint16_t * | cfg_in_force, |
|
|
const out_stage_ops_t * | ops, |
|
|
void * | ctx ) |
A write of LINK_BD_COMMIT.
LINK_NACK_BAD_VALUE, and nothing is called, when crc is not the CRC of what st holds. Otherwise the prepared CHAN_CFG page is taken, then the prepared OUTPUTS page. A refusal of the first changes nothing; a refusal of the second puts the bank and cfg_in_force, the CHAN_CFG page, back as they were before the commit. Either is returned as the reason. 0 when both are in force.
- Parameters
-
| st | The prepared pages. |
| crc | The CRC the host named in the commit. |
| cfg_in_force | The CHAN_CFG page in force, read before the takes. |
| ops | The callbacks that judge and store the pages. The pointers take_cfg, take_slots and put_cfg must be set. |
| ctx | Passed to each callback in ops unchanged. |
- Returns
- 0 when both pages are in force. The refusal of take_cfg or take_slots otherwise. LINK_NACK_BAD_VALUE when
st, cfg_in_force or ops is NULL, when one of the required callbacks is NULL, or when crc does not match.
| uint16_t out_stage_crc |
( |
const uint16_t * | cfg, |
|
|
const uint16_t * | slots ) |
The CRC a commit names: CRC-16/CCITT-FALSE (polynomial 0x1021, seed 0xFFFF, link_crc()) over the 32 CHAN_CFG registers and then the 32 OUTPUTS registers, each as its low byte and then its high byte.
The panel computes it over the pages it sent, the IOmcu over what it holds prepared.
- Parameters
-
| cfg | The CHAN_CFG page, LINK_CC_COUNT registers. |
| slots | The OUTPUTS page, LINK_OS_COUNT registers. |
- Returns
- The CRC-16 value. 0 when
cfg or slots is NULL.