
  PROCEDURE [INLINE] cmp$get_unit_type
    (    product_id: cmt$product_identification;
     VAR cm_unit_type: cmt$unit_type;
     VAR io_unit_type: iot$unit_type;
     VAR unit_class: cmt$unit_class;
     VAR found: boolean);

?? PUSH (LISTEXT := ON) ??

    VAR
      index: integer;

    { This INLINE procedure can only be called from ring 3 and
    { below.  It returns the internal CM and IO unit type along
    { with the class of unit. FOUND is set to false if the product
    { id is unknown to NOS/VE.

    found := FALSE;

    FOR index := 1 TO UPPERBOUND (cmv$product_id_ptr^) DO
      IF product_id = cmv$product_id_ptr^ [index].product_id THEN
        found := TRUE;
        cm_unit_type := cmv$product_id_ptr^ [index].cm_unit_type;
        io_unit_type := cmv$product_id_ptr^ [index].io_unit_type;
        unit_class := cmv$product_id_ptr^ [index].unit_class;
        RETURN;
      IFEND;
    FOREND;

    IF (product_id.product_number = ' $2620') OR (product_id.product_number = ' $2621') THEN
      unit_class := cmc$network_unit;
      io_unit_type := ioc$dt_mdi_1;
    ELSEIF product_id.product_number = ' $4000' THEN
      unit_class := cmc$network_unit;
      io_unit_type := ioc$dt_expresslink;
    ELSEIF product_id.product_number = ' $2629' THEN
      unit_class := cmc$network_unit;
      io_unit_type := ioc$dt_ica_2;
    ELSEIF (product_id.product_number = ' $7040') OR (product_id.product_number = ' $5380') THEN
      unit_class := cmc$network_unit;
      io_unit_type := ioc$dt_file_server;
    ELSEIF product_id.product_number = '  $380' THEN
      unit_class := cmc$rhfam_unit;
      io_unit_type := ioc$dt_lcn_1;
    ELSEIF product_id.product_number = '$65354' THEN
      found := TRUE;
      cm_unit_type := cmc$map_1;
      unit_class := cmc$map_unit;
      IF product_id.model_number = '10 ' THEN
        io_unit_type := ioc$dt_map_1;
      ELSE
        io_unit_type := ioc$dt_map_cmi_1;
      IFEND;
    ELSE
      cm_unit_type := cmc$foreign_unit;
      io_unit_type := ioc$dt_foreign_device;
    IFEND;

  PROCEND cmp$get_unit_type;

*copyc iot$unit_type
*copyc cmt$unit_type
*copyc cmv$product_id_string
?? POP ??
