Subversion Repositories factorylink.mb_plus

Rev

Blame | Last modification | View Log | Download

/*============================================================================
*              Copyright (C) 1994, CYBERLOGIC Technologies Inc.
*=============================================================================
*
* Module Name :
*       netlib.h 
* 
* Abstract:
*       This file should be included by every module that makes calls to
*       functions in the netlib.obj interface library file.
*
* Author:
*       Paul Mikulski
* 
* ---------+-----+-----------------------------------------------------------
*   DATE   | BY  |  DESCRIPTION / REASON FOR MODIFICATION
* ---------+-----+-----------------------------------------------------------
* 03-09-94 | PM  |  Start of development
* ---------+-----+-----------------------------------------------------------
* ..-..-94 |     |
*==========+=====+==========================================================*/

/*==========================================================================*/
/* Include files
/*==========================================================================*/
#ifndef NETBIOS_INCLUDED
#include "netbios.h"
#endif

#define SA85_DIAGNOSTICS   0x55AA

/*
 * definition of the network status structure
 */
typedef struct _mbp_net_stat {

  unsigned short    diag;                   // diagnostics, must contain 0xAA55

  unsigned short    node_type;              // Node type id
  unsigned short    version;                // SA85.SYS version and error cnt define
  unsigned short    address;                // network address for this station
  unsigned short    mac_state;              // MAC state variable
  unsigned short    peer_status;            // provide status of this unit relative to the network
  unsigned short    token_pass_cnt;         // Toke pass counter
  unsigned short    token_rot_time;         // token rotaion time in ms

  unsigned char     dm_token_failed;        // Data Master failed during token ownership bit map
  unsigned char     pm_token_failed;        // Program Master failed during token ownership bit map

  unsigned char     dm_token_bitmap;        // Data Master token owner work bit map
  unsigned char     pm_token_bitmap;        // Program Master token owner work bit map

  unsigned char     ds_token_bitmap;        // Data Slave token owner work bit map
  unsigned char     ps_token_bitmap;        // Program Slave token owner work bit map

  unsigned short    ds_txf_req_bitmap;      // Data slave/get slave command transfer request bit map

  unsigned char     pm_txf_rsp_bitmap;      // Program Master/get master rsp transfer request bit map
  unsigned char     ps_txf_req_bitmap;      // Program slave/get slave command transfer request bit map

  unsigned char     pm_connect_bitmap;      // Program Master connect status bit map
  unsigned char     ps_alogout_bitmap_req;  // Program Slave automatic logout request bit map

  unsigned char     pretx_error_cnt;        // Pretransmit deferral error counter
  unsigned char     rx_dma_overrun;         // receive buffer DMA ovverrun error counter

  unsigned char     rep_cmd_rx_cnt;         // repeated command receive counter
  unsigned char     frame_size_err_cnt;     // frame size error counter

  unsigned char     cable_A_framing_err;    // cable A framing error
  unsigned char     cable_B_framing_err;    // cable B framing error

  unsigned char     rx_crc_error;           // Receiver CRC error counter 
  unsigned char     packet_len_err;         // bad packet length error counter
  
  unsigned char     link_address_err;       // bad link address error counter
  unsigned char     tx_dma_underrun;        // transmit buffer DMA-underrun error counter

  unsigned char     internal_packet_len;    // bad internal packet length error counter
  unsigned char     mac_fnc_code_err;       // bad MAC function code error counter

  unsigned char     com_retry;              // communication retry error counter
  unsigned char     com_failed;             // communication error failed error counter

  unsigned char     rx_packet_ok;           // good receive packet succes counter
  unsigned char     rx_no_rsp_cnt;          // no response received error counter

  unsigned char     rx_exc_rsp_cnt;         // exception response received error counter
  unsigned char     unexp_path_err_cnt;     // unexpected path error counter                                                   

  unsigned char     unexc_rsp_cnt;          // unexpected response error counter
  unsigned char     forgotten_err_cnt;      // forgotten transaction error counter
                                                     
  unsigned char     active_station[8];      // active station table bitmap
  unsigned char     token_station[8];       // token station table bitmap
  unsigned char     global_data_present[8]; // global data present table bitmap
  unsigned char     rx_buf_inuse[5];        // receive buffer in use table bitmap

  unsigned char     station_mgmt_cmd;       // station management command processed initiation counter

  unsigned char     dm_output_path[8];      // Data Master output path command initiator counter
  unsigned char     ds_input_path[8];       // Data Slave input path command initiator counter
  unsigned char     pm_output_path[8];      // Program Master output path command initiator counter
  unsigned char     ps_input_path[8];       // Program Slave input path command initiator counter

} MBP_NET_STAT;


/*==========================================================================*/
/* Function prototypes
/*==========================================================================*/
int
APIENTRY
ncb_reset(
    int adaptno
    );

int
APIENTRY
ncb_sa85off(
    int adaptno
    );

int
APIENTRY
ncb_status(
    PNCB ncbp,
    int adaptno
    );

int
APIENTRY
ncb_send(
    PNCB ncbp,
    int length,
    PCHAR buffer,
    UCHAR timeout
    );

int
APIENTRY
ncb_receive_wait(
    PNCB ncbp,
    PCHAR buffer,
    UCHAR timeout
    );

PNCB
APIENTRY
ncb_open(
    PCHAR name,
    int lan
    );

int
APIENTRY
ncb_receive(
    PNCB ncbp,
    PCHAR buffer
    );

PNCB
APIENTRY
ncb_open(
    PCHAR name,
    int lan
    );

int
APIENTRY
ncb_close(
    PNCB ncbp
    );

int
APIENTRY
ncb_send_datagram(
    PNCB ncbp,
    int length,
    PCHAR buffer,
    UCHAR timeout,
    int adaptno
    );

int
APIENTRY
ncb_receive_datagram(
    PNCB ncbp,
    int node,
    PCHAR buffer,
    UCHAR timeout,
    int adaptno
    );

int
APIENTRY
ncb_cancel(
    PNCB ncbp
    );

int
APIENTRY
ncb_set_slave_login(
    PNCB ncbp,
    UCHAR login_status
    );