lib/fw.c
/**
 * @brief Toggle the active firmware partition for the main or configuration
 *	images.
 * @param[in] dev        Switchtec device handle
 * @param[in] toggle_fw  Set to 1 to toggle the main FW image
 * @param[in] toggle_cfg Set to 1 to toggle the config FW image
 * @return 0 on success, error code on failure
 */
@brief Toggle the active firmware partition for the main or configuration
images.
@param[in] dev        Switchtec device handle
@param[in] toggle_fw  Set to 1 to toggle the main FW image
@param[in] toggle_cfg Set to 1 to toggle the config FW image
@return 0 on success, error code on failure
@brief Toggle the active firmware partition for the main or configuration images . @param [ in ] dev Switchtec device handle @param [ in ] toggle_fw Set to 1 to toggle the main FW image @param [ in ] toggle_cfg Set to 1 to toggle the config FW image @return 0 on success error code on failure
int switchtec_fw_toggle_active_partition(struct switchtec_dev *dev,
					 int toggle_fw, int toggle_cfg)
{
	struct {
		uint8_t subcmd;
		uint8_t toggle_fw;
		uint8_t toggle_cfg;
	} cmd;
	cmd.subcmd = MRPC_FWDNLD_TOGGLE;
	cmd.toggle_fw = !!toggle_fw;
	cmd.toggle_cfg = !!toggle_cfg;
	return switchtec_cmd(dev, MRPC_FWDNLD, &cmd, sizeof(cmd),
			     NULL, 0);
}
int switchtec_fw_toggle_active_partition ( struct switchtec_dev * dev , int toggle_fw , int toggle_cfg ) { struct { uint8_t subcmd ; uint8_t toggle_fw ; uint8_t toggle_cfg ; } cmd ; cmd . subcmd = MRPC_FWDNLD_TOGGLE ; cmd . toggle_fw = ! ! toggle_fw ; cmd . toggle_cfg = ! ! toggle_cfg ; return switchtec_cmd ( dev , MRPC_FWDNLD , & cmd , sizeof ( cmd ) , NULL , 0 ) ; }
@brief Toggle the active firmware partition for the main or configuration
      images.
@brief Toggle the active firmware partition for the main or configuration images .