?? TITLE := ' Hyper Channel DX: process_one_word_response ' ??
MODULE dxm$process_one_word_response;
?? RIGHT := 110 ??
{
{  This module contains the Hyper Channel DX one word PP response handler.
{
?? NEWTITLE := 'Global Declarations Referenced By This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc oss$mainframe_wired
*copyc dft$fs_pp_response
*copyc dft$one_word_response_handler
*copyc dxt$dx_pp_response
*copyc iot$pp_interface_table
*copyc syt$monitor_status
?? POP ??
*copyc tmp$check_taskid
*copyc tmp$set_task_ready
*copyc dfi$monitor_display
?? OLDTITLE ??
?? NEWTITLE := 'Global Declarations Declared By This Module', EJECT ??

  VAR
    dxv$one_word_response_handler: [XDCL, STATIC, #GATE, oss$mainframe_wired]
          dft$one_word_response_handler := ^dxp$process_hcdx_one_word_resp;

?? TITLE := 'convert_p_fs_resp_to_p_dx_resp', EJECT ??

  PROCEDURE [INLINE] convert_p_fs_resp_to_p_dx_resp
    (    p_fs_pp_response: ^dft$fs_pp_response;
     VAR p_dx_pp_response: ^dxt$dx_pp_response);

    { This procedure uses a variant record 'trick' to convert a variable of
    { type ^dft$fs_pp_response to one of type ^dxt$dx_pp_response.

    TYPE
      converter = record
        case (fs_pp_response, dx_pp_response) of
        = fs_pp_response =
          p_fs_pp_response: ^dft$fs_pp_response,
        = dx_pp_response =
          p_dx_pp_response: ^dxt$dx_pp_response,
        casend,
      recend;

    VAR
      converter_variable: converter;

    converter_variable.p_fs_pp_response := p_fs_pp_response;
    p_dx_pp_response := converter_variable.p_dx_pp_response;

  PROCEND convert_p_fs_resp_to_p_dx_resp;

?? TITLE := '    [XDCL] dxp$process_HCDX_one_word_resp', EJECT ??

  PROCEDURE [XDCL] dxp$process_hcdx_one_word_resp
    (    one_word_response_p: ^dft$fs_pp_response;
         pp_number: 1 .. ioc$pp_count;
     VAR status: syt$monitor_status);

{  This procedure executes in the Monitor and is called to process one word
{  responses from the Hyper Channel DX PP driver.
{
{  The Hyper Channel DX PP driver's one word response contains
{  response_flags record identical to the dft$fs_pp_response, however not
{  all of the response flags have meaning.
{
{   SPECIAL_RESPONSE - This flag is detected by iom$process_io_completions
{          and is used to indicate that a check should be made to determine
{          if the PP response is a "special response".
{
{   ONE_WORD_RESPONSE - This flag is detected by iom$process_io_completions
{          and indicates that the response is a special response to be
{          processed by the One Word Response Handler as specified in the
{          Logical PP table.
{
{   ERROR_RESPONSE - not used in Hyper Channel DX one word response.
{
{   INQUIRY_RESPONSE - not used in Hyper Channel DX one word response.
{
{   TERMINATION_PSEUDO_RESPONSE - not used in Hyper Channel DX one word response.


    VAR
      p_dx_pp_response: ^dxt$dx_pp_response;

    status.normal := TRUE;
    convert_p_fs_resp_to_p_dx_resp (one_word_response_p, p_dx_pp_response);

    tmp$check_taskid (p_dx_pp_response^.global_task_id, tmc$opt_return, status);
    IF NOT status.normal THEN
      status.normal := TRUE;
      dpp$display_error ('DX - INFORMATIVE, ONE WORD RESPONSE - TASK NO LONGER ACTIVE');
      display_integer_monitor ('DX - INVALID TASK ID, INDEX = ',
            $INTEGER (p_dx_pp_response^.global_task_id.index));
      display_integer_monitor ('DX - INVALID TASK ID, SEQNO = ',
            $INTEGER (p_dx_pp_response^.global_task_id.seqno));
      RETURN; {----->
    IFEND;

    tmp$set_task_ready (p_dx_pp_response^.global_task_id, 0 {readying_task_priority} ,
          tmc$rc_ready_conditional);


  PROCEND dxp$process_hcdx_one_word_resp;
MODEND dxm$process_one_word_response;
