CONTROLINK86 SMSC, CONTROLINK86 Datasheet

no-image

CONTROLINK86

Manufacturer Part Number
CONTROLINK86
Description
Development Software Embedded Networking Software
Manufacturer
SMSC
Datasheet

Specifications of CONTROLINK86

Tool Function
Compiler
Tool Type
Compiler
Processor Series
80x86
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
ControLink86
Real-time Networking Software
For the COM20020 ARCNET Controller
Version 1.41

Related parts for CONTROLINK86

CONTROLINK86 Summary of contents

Page 1

... ControLink86 Real-time Networking Software For the COM20020 ARCNET Controller Version 1.41 ...

Page 2

... TRANSMITTING MESSAGES.......................................................................................... 16 2.5.3 AN EXAMPLE OF A COMPLETE PROGRAM: ................................................................ 3.1 INTRODUCTION ..................................................................................................................... 18 3.2 OPERATE LOGICAL LINK CONTROL (IEEE 802.2) CLASS 1 SERVICES .......................... 18 3.3 LOGICAL LINK LAYER SOFTWARE STRUCTURE .............................................................. 18 3.4 LLC DATA STRUCTURES...................................................................................................... 19 3.4.1 LLC_MSG DATA STRUCTURE (SAP)............................................................................ 19 3.4.2 ADDITIONAL DATA STRUCTURES ................................................................................ 20 3.5 LLC1 FUNCTIONS .................................................................................................................. 20 3.5.1 llc1_request() ...

Page 3

... ControLink86 Realtime Networking Software 3.6.2.3 TEST REQUEST...............................................................................................................28 3.6.2.4 DATA REQUEST ..............................................................................................................29 3.6.3 LLC PACKET FORMAT.................................................................................................... 4.1 INTRODUCTION ..................................................................................................................... 32 4.2 DESCRIPTION OF STRUCTURE........................................................................................... 33 4.3 EXPLANATION OF OPERATION ........................................................................................... 33 4.4 LOW LEVEL DRIVER FUNCTIONS SUMMARY.................................................................... 34 4.5 CONFIGURABLE PARAMETERS .......................................................................................... 35 4.5.1 HARDWARE PARAMETERS ........................................................................................... 35 4.5.2 ARCNET PARAMETERS ................................................................................................. 36 4.5.3 PARAMETER LIST ........................................................................................................... 36 4 ...

Page 4

... Local Area Network Layers concept • Data Link Layer purpose Since ControLink is software written for SMSC’s COM200xx it is implied that a programmer has the knowledge of these network controllers as well as the architecture of the host systems on which ControLink will be installed. When beginning development the programmer is encouraged to obtain and study International standard ISO 8802-2 (ANSI/IEEE Std ...

Page 5

... ControLink86 Realtime Networking Software #include <dos.h> while() { … } <ENTER> “term” 0x21 Courier font is used for examples, user input, program output and error messages in text. A column row of three dots (ellipsis) indicates that a part of an example code was intentionally omitted. Uppercase letters within the <> brackets denote the names of keys on the keyboard ...

Page 6

... In the streamlined or collapsed OSI stack only layer 7 (the Application layer), layer 2 (Data link), and layer 1 (Physical layer) are used (see Figure 1). ControLink is combined with SMSC’s COM200xx family of ARCNET Controllers for layers 1 and 2. The Application layer (layer 7) is inherently specific, as the name suggests, to the application at hand ...

Page 7

... FIGURE 3 - ARCHITECTURE OF THE CONTROL SOFTWARE BASED ON CONTROLINK 2.1HOW TO USE CONTROLINK ControLink86 is delivered as source code to be linked with the target application. Aside from the source code there are additional files that provide auxiliary functions like declarations and definitions. Two programming examples complete with the application code, make files (for Microsoft Visual C++) and executables are included ...

Page 8

... APP_5 ├─ INCLUDE └─ SOURCE 2.1.1SOURCE CODE The source code for ControLink86 resides in the following directories. CLINK1_4 SOURCE └─ D20.C ├─ LLC1.C └─ D20 low level driver for the COM200xx ARCNET Local Area Network Controller that contains the source code to accomplish the following tasks: • ...

Page 9

... ControLink86 Realtime Networking Software ARCDEF.H contains definitions related to the COM200xx LAN Controller contains definitions and declarations related to the low level driver D20.H D20.C, error codes, and data structures LLC.H contains definitions related to the Logical Link Control driver error codes and data structures contains the necessary declarations for the Class 1 LLC driver LLC1 ...

Page 10

... Other stations can send a packet to this physical station and this packet will be redirected internally to the SAP for which it is intended. Service Access Points: Logical Addresses For Data SAP1 SAP2 Thus ControLink offers four addressing modes: SAP3 SAP4 ControLink86 Message Deliverer Message Queue COM200xx (Physical Network Address) FIGURE 4 - SAP CONCEPT 10 ...

Page 11

... Each of these logical addresses can hold the data for a different aspect of the control process. This is illustrated by the Figure 5. power control speed SAP1 APPLICATION temp. fan sensor status SAP2 SAP3 SAP4 ControLink86 Message Deliverer Message Queue COM200xx (Physical Network Address) FIGURE 5 - USING SAPS 11 SAPn Physical Medium ...

Page 12

... ControLink86 Realtime Networking Software 2.4SETTING UP CONTROLINK An ARCNET based application that wants to use ControLink must set up the necessary interface to ControLink. This interface consists of SAP control structures (called LLC - MSG) and the buffers to hold the data for each SAP. This interface is configured during the initialization phase of the application. ...

Page 13

... ControLink86 Realtime Networking Software /* assign each SAP buffer to the structure */ SAP1.msgptr = SAP1BUF; SAP2.msgptr = SAP2BUF; SAP3.msgptr = SAP3BUF; GSAP1.msgptr = GSAP1BUF; GSAP2.msgptr = GSAP2BUF; GSAP3.msgptr = GSAP3BUF; } Note: the size of the SAP buffer only has large as the maximum message size. For example system has a maximum message size of 16 bytes then only a 16 byte buffer is necessary. ...

Page 14

... ControLink86 Realtime Networking Software 2.4.3 CLASS 1 DRIVER STATE MACHINE INITIALIZATION The Class 1 driver utilizes a state machine for processing all requests. The requests to the state machine llc1_request() are sent from the application as well as the network (other mode) itself. The state machine ...

Page 15

... ControLink86 Realtime Networking Software … /* initialize Class 1 state machine with local SAP */ status = llc1_request(0,0,ENABLE_WITHOUT_DUP_ADDR_CHECK, &SAP0); if (status == E_OK) { status = llc1_request(1,0, SAP_ACTIVATION_REQUEST, &SAP1); if (status == E_OK) { printf(“SAP 1 is up\n”); } else { printf(“Error in activating SAP 1\n”); } GSAP1.group = 1; status = llc1_request(1,0, SAP_ACTIVATION_REQUEST, &GSAP1); ...

Page 16

... EXAMPLE OF A COMPLETE PROGRAM: The following is a skeleton application that illustrates the usage of the ControLink86 functions. /* include files */ … /* application specific definitions */ … /* global declarations: SAP structures, SAPBUF buffers, flags, etc */ struct LLC_MSG SAP[MAX_SAPS] ...

Page 17

... ControLink86 Realtime Networking Software … void main(void initialize network hardware - COM2002x */ /* initialize ControLink */ /* initialize SAPs */ /* control loop */ while( packet received from the network */ if(NETWORK EVENT) { llc1_service(); for < number_of_saps; i++) { /* check every on-line sap */ rx_status = llc1_indication(i); /* process the status */ switch(rx_status end of the for loop */ ...

Page 18

... The Class 1 Service Interface for Link Layer Control (LLC ANSI/IEEE 802.2 and ISO 802.2 compatible networking protocol. The Class 1 interface is designed to be used in conjunction with the SMSC low level driver for the COM2002x family of ARCNET local area network controllers. This section describes the use of the Class 1 (LLC1) software routines. This is not an IEEE 802.2 users or capabilities guide, but is a description of a set of software routines that allow for the easy use of the Class 1 interface and COM2002x drivers ...

Page 19

... ControLink86 Realtime Networking Software The SMSC Class 1 driver offers many services as detailed in Section C. Incoming packets from the physical medium are received by the hardware and queued in system memory by an interrupt handler located in the Low Level Driver (described in Section 4). The following are the functions included in the Logical Link Control Layer software LLC1.C: Function llc1_service() ...

Page 20

... SAP. Global SAPS have their own arrays: USIGN8 LLC1_GSAP_Status[MAX_SAPS] USIGN8 LLC1_GSAP_Indication[MAX_SAPS] 3.5LLC1 FUNCTIONS The SMSC LLC routines provide all the Class 1 services. The user of these routines must call each of the routines with the proper parameters. Details regarding the services provided by LLC Class 1 services is provided in Section 3.6. 3.5.1llc1_request() ...

Page 21

... ControLink86 Realtime Networking Software OUTINE ARAMETERS Parameter lssap ldsap event struct LLC_MSG *request OUTINE ETURN ALUES Action ENABLE_WITH_DUP_ADDR_CHECK ENABLE_WITHOUT_DUP_ADDR_CHECK SAP_ACTIVATION_REQUEST XID_REQUEST TEST_REQUEST DATA_REQUEST REPORT_STATUS Unknown Service OUTINE XAMPLE /* startup a SAP 1 */ event = SAP_ACTIVATION_REQUEST; status = llc1_request(1,0,event,&lsap[1]); Description logical source SAP, values 1-63 (1-15 default) ...

Page 22

... ControLink86 Realtime Networking Software 3.5.2llc_1service OUTINE ESCRIPTION The service routine checks for incoming messages and routes the messages to the correct SAP. If the SAP is null (0=station SAP) then the service routine provides complete servicing of the message and the user never sees the message. If the message is for this station and the local SAP is on-line then the message is copied into the local SAP’ ...

Page 23

... ControLink86 Realtime Networking Software Action For any SAP number OUTINE XAMPLE /* process the indications received on the SAP */ status = llc1_indication(1); switch (status) { case UNITDATA_INDICATION: printf(“\nUI Data Indication to LSAP %d from DSAP %d\n”, dsap, ssap); count = lsap[i].lsbcount; bufptr = lsap[i].msgptr; ...

Page 24

... ControLink86 Realtime Networking Software 3.5.4llc1_group_indication OUTINE ESCRIPTION The indication routine notifies the user that a message has been received for the a group SAP. It retrieves the LLC1_GSAP_Indication[ ] The indication routine parameter is the logical group SAP number value not equal to NO_INDICATION is returned then the value describes the type of indication ...

Page 25

... The LLC Class 1 services are defined as connectionless or datagram routines. Note that these are services provided by the SMSC driver and are invoked using the Request/Indication routines. These routines provide functions to exchange, test, and send data units to and from other LLC Class 1 entities (nodes and itself) on the network ...

Page 26

... RECEIVE_NULL_DSAP_XID_R_CNT_0 RECEIVE_NULL_DSAP_XID_R_CNT_1 RECEIVE_NULL_DSAP_TEST_C Note these services are automatically performed by the LLC software and are invisible to the system. 3.6.1.3DISABLE STATION/NODE The disable station request terminates all SAPs and shuts down the station and node hardware. The node is then removed from the network. The following occurs when a Disable Request is sent: 1. Host issues a DISABLE_REQUEST command to it’ ...

Page 27

... ControLink86 Realtime Networking Software 3.6.2SERVICE ACCESS POINT (SAP) SERVICES The SAP services are directed at the local service access points (at the stations Logical Link Layer). The activation and deactivation requests are used to start/stop a SAP. The XID and TEST requests are used to exchange information about the types of services and test the communications link ...

Page 28

... ControLink86 Realtime Networking Software The exchange Identification request is an 802.2 function that conveys information regarding the LLC Class 1 and receive window size (number of receive buffers). Future revisions of ControLink will include an enhanced XID frame that appends an eight character ASCII label and SAP address associated with the label. Any node receiving an XID frame will automatically respond with an XID response frame that includes the same information ...

Page 29

... The DATA request procedure is the process through which application relevant data is transferred. When the DATA request function is initiated, ControLink sends out a 802.2 UI (Unnumbered Information) frame. This procedure does not invoke an automatic response from the ControLink software. When Data frames are sent, the application software must decode the data and respond if necessary. ...

Page 30

... ControLink86 Realtime Networking Software bufptr++; *bufptr = ‘E’; bufptr++; *bufptr = ‘L’; bufptr++; *bufptr = ‘L’; bufptr++; *bufptr = ‘O’; /* fill in the size of the packet */ lsap[i].msbcount = 0; lsap[i].lsbcount = 10; /* request sending the HELLO packet */ status = llc1_request(i,j,event,&lsap[i]); 3.6.3LLC PACKET FORMAT The LLC packet format uses the ARCNET Trade Association (ATA) ANSI 878 ...

Page 31

... ControLink86 Realtime Networking Software Note: The System Code field is used to identify protocols and/or manufacturers but its use is optional. System Codes are issued and maintained by the ARCNET Trade Association (ATA). Contact the ATA for a System Code for your application. ARCNET Trade Association 3365 N ...

Page 32

... The ControLink Low Level Driver is a set of basic network driver and utility routines written in ANSI “C” for use with SMSC’s COM2002x family of Embedded ARCNET Controllers. However the D20 driver expands a platform specific macros defined in the MSC.H file. These macros are the timing primitives. ...

Page 33

... Data SERVICE FUNCTIONS FIGURE 9 - LOW LEVEL DRIVER SOFTWARE DESIGN The D20 (Low Level) Driver receives various requests from the upper layer (Logical Link Control Layer) as well as the network events from the COM2002x ARCNET ULANC. Refer to the COM2002x ULANC Data Sheet for the description of the network events. The network events represented in Figure 9 directly correspond to the network interrupts that can be enabled using Interrupt Mask Register of COM2002x and checked for indication in the Status Register and Diagnostic Status Register ...

Page 34

... INITIALIZATION PARAMETER MAINTENANCE FIGURE 10: D20 LOW LEVEL DRIVER OPERATION The solid lines indicate the initiator of the D20 Driver software process. The dashed lines indicate the transfer of control or data to the other D20 Driver processes. 4.4LOW LEVEL DRIVER FUNCTIONS SUMMARY Function d20_set_defaults() ...

Page 35

... ControLink86 Realtime Networking Software Function d20_get_qentry() d20_network_map d20_registers() d20_diagnostic() d20_clear_diag() d20_tokens d20_exit() d20_interrupt() d20_check_int() d20_check_diag() read_data() write_data() check_network_status() 4.5CONFIGURABLE PARAMETERS The COM2002x device driver routines have user-selectable parameters which allow the application programmer to customize the driver to application-specific or different hardware environments. The parameters are broken up into two areas: specific to the hardware platform and ARCNET specific ...

Page 36

... ControLink86 Realtime Networking Software • type of computer bus (8/16 bit) • operating mode of the driver: polled or interrupt • type of interrupt controller • interrupt level • interrupt mask • end of interrupt sequence • system clock frequency 4.5.2ARCNET PARAMETERS The ARCNET parameters determine the personality of this node and the characteristics of the network such as: • ...

Page 37

... COM2002x for future uses for calculating the necessary timing primitives. Valid values are Specifies how the Node ID value is determined Software set: Node ID is stored in D20_NODE_ID parameter Set the node ID to the value determined by reading the DIP switch at hardware address BASE + D20_NODE_SW_PORT. ...

Page 38

... ControLink86 Realtime Networking Software Parameter D20_IMR D20_RETRIES D20_DISABLE_TX D20_WRITE_ACK D20_WAIT_TA D20_IN_BUFFERS D20_OUT_BUFFERS D20_BROADCAST D20_SHORT_LONG Default Description 0xFF Mask for the interrupt Mask Register. This parameter holds the flags that should be processed by the d20_check_int() function. The position of the flag is the same as the COM2002x Interrupt Mask Register ...

Page 39

... ControLink86 Realtime Networking Software Parameter D20_CMD_CHAIN D20_NET_TIMEOUT D20_BACKPLANE D20_NODE_ID D20_P1MODE D20_FOUR_NAKS Default Description 0x00 COM2002x can receive and transmit messages one by one or in the command chaining mode, when two Packet RAM pages are scheduled for receive or transmit at a time. 0x00 - normal mode (one by one) ...

Page 40

... ControLink86 Realtime Networking Software Parameter D20_ET3 D20_RCV_ALL D20_NET_SPEED D20_SLOW_ARB 4.6D20 DRIVER: DESCRIPTION OF THE FUNCTIONS This chapter discusses all D20 Driver functions. 4.6.1d20_set_defaults(); OUTINE ESCRIPTION This functions is a simple list assignment that gives the default values to the D20 Driver parameters stored in the d20_params[ ] array. The parameters are initialized to the default values listed in the Section 4 ...

Page 41

... ControLink86 Realtime Networking Software OUTINE ARAMETERS none OUTINE ETURN ALUES none OUTINE XAMPLE … /* set the driver default values */ d20_set_defaults(); … 4.6.2d20_get_parameter OUTINE ESCRIPTION The get parameter routine is called to retrieve the current value of one of the driver parameters. The driver parameter name is used as the input parameter to the get parameter routine ...

Page 42

... COM2002x, determines the Node ID, joins the network (participates in the token passing scheme) and enables COM2002x for the reception of a packet. COM2002x and the driver software are initialized according to the COM2002x Driver parameters (see Section 4.5). The D20 Driver parameters may be initialized by the d20_defaults() function or individually, by the upper layers, using d20_set_parameter() function ...

Page 43

... ControLink86 Realtime Networking Software … 4.6.5d20_read_packet OUTINE ESCRIPTION Received data retrieval function. After the data has been received by the COM2002x, the d20_check_int() routine pulls it out of the COM2002x Packet RAM and stores it in the driver queue called inbuf[ ]. The upper layer or the control application may schedule the retrieval of the received data from this queue ...

Page 44

... This function is used for scheduling a transmission of a packet. This function is used by the upper layers or the control application to schedule a transmission of a packet. This function will transfer the data provided by the parent software to the COM2002x Packet RAM page that is available for transmission. If the transmitter is available, this function will then issue a command to initiate the transmission (see COM2002x ULANC for the description of the Command Register) ...

Page 45

... ControLink86 Realtime Networking Software user_buf[4] user_buf[5] … user_buf[n] or user_buf[256 + OUTINE ROTOTYPE USIGN8 d20_write_packet(USIGN8 *data_ptr OUTINE ARAMETERS Parameter data_ptr OUTINE ETURN ALUES Action Long packet specified and only short packets allowed The packet size is not allowed by the ARCNET protocol Transmitter is currently busy ...

Page 46

... ControLink86 Realtime Networking Software OUTINE ARAMETERS Parameter ptr OUTINE ETURN ALUES none OUTINE XAMPLE /* data buffer declaration */ USIGN8 ptr[512]; … /* get the packet out of the inbuf[ ] queue*/ d20_get_qentry(ptr); /* data now available … 4.6.8d20_network_map OUTINE ESCRIPTION The network map routine builds a map of the nodes connected to the network. A pointer to a buffer is passed to the routine and the buffer’ ...

Page 47

... ControLink86 Realtime Networking Software { /* it is part of the network */ } } 4.6.9d20_registers OUTINE ESCRIPTION This function copies the contents of the COM2002x Read Registers to the user specified buffer of 10 bytes (USIGN8). Refer to the COM2002x ULANC Data Sheet for the explanation of the internal registers. After the operation is completed, the contents of the buffer is as follows: ...

Page 48

... ControLink86 Realtime Networking Software This function transfers the state of the diagnostic counters to the specified user buffer. Diagnostic counters are used to record the number of occurrences of various network events as well as upper layers’ requests. After the transfer, the buffer holds the following information: ...

Page 49

... ControLink86 Realtime Networking Software OUTINE ROTOTYPE void d20_clear_diag(void OUTINE ARAMETERS none OUTINE ETURN ALUES none OUTINE XAMPLE … /* clear diagnostic counters*/ d20_clear_diag(); … 4.6.12d20_tokens OUTINE ESCRIPTION The tokens routine waits n number of token rotations and then returns to the caller. This routine can be used for timing functions. The number of rotations can 255. ...

Page 50

... ControLink86 Realtime Networking Software none OUTINE XAMPLE … /* leave the network and exit */ d20_exit(); … 4.6.14d20_interrupt OUTINE ESCRIPTION This is the function that is vectored to when the COM2002x generates the hardware interrupt. The vector to this ISR is stored during the driver initialization recommended that the real-life control system chains the vector to this ISR rather than replace it ...

Page 51

... ISR. The real-life control application may require different actions upon the occurrence of any network events than those programmed into the d20_check_int() parser. The designer may want to tailor this parser, inserting the control software in places, where the diagnostic counters are incremented. R ...

Page 52

... ControLink86 Realtime Networking Software 4.6.16d20_check_diag OUTINE ESCRIPTION This function checks if the POR (Power on Reset) bit in the Diagnostic Status Register is set separate function from the d20_check_int() because this event occurs only once during the particular network session result of this routine the D20_POR_CNT diagnostic counter is incremented. ...

Page 53

... ControLink86 Realtime Networking Software OUTINE ARAMETERS Parameter page offset count shortlong user_buffer OUTINE ETURN ALUES none OUTINE XAMPLE /* after the reset, read two bytes from the beginning of the packet ram and determine if they are 0xD1 and the node address (0xfe) ...

Page 54

... ControLink86 Realtime Networking Software OUTINE ARAMETERS Parameter page offset count shortlong user_buffer OUTINE ETURN ALUES none OUTINE XAMPLE … /* write two bytes into the page 0. offset 0, from the user_buffer USIGN8 user_buffer[2] = {1, 2}; … write_data( user_buffer); … 4.6.19check_network_status OUTINE ESCRIPTION This is an auxiliary function to check whether the MAC layer (network) is alive, tokens are passed or the medium is undergoing a reconfiguration ...

Page 55

... ControLink86 Realtime Networking Software /* check if the network is operational */ USIGN8 status; … switch(check_network_status()) { case E_OK: /* network ok */ break; case E_NO_TOKEN: /* process for no token */ break; case E_ONE_NODE: /* alone on the network */ break; default: break; } … 55 ...

Page 56

... ControLink86 Realtime Networking Software 5.LIST OF ERROR CODES RETURNED 5.1CODES RETURNED BY THE D20.C DRIVER FUNCTIONS Name E_OK 0 E_NO_PARAMETERS E_BAD_STATUS E_NOT_INITED E_BAD_COMMAND E_BAD_PARAMETER E_BAD_DATA E_NO_PACKET E_NO_TOKEN 8 E_BAD_PACKET_SIZE E_TX_BUSY E_ACK E_ABORT E_DUPID E_ONE_NODE E_NODE_USED E_QFULL E_NAK_NO_TX E_DRIVER_OPTION E_TA_NO_ACK E_NOT_OK 5.2CODES RETURNED BY THE LLC1.C FUNCTIONS ...

Page 57

... ControLink86 Realtime Networking Software 6.NETWORK SPEED ControLink86 is primarily designed to operate with the default network speed and timeout values for the COM2002x ULANC controllers. The network speed and timeout concepts are explained in the COM2002x ULANC Data Sheets. The default values are those which are the original values for the ARCNET Local Area Network Standard: ATA/ANSI 878 ...

Page 58

... ControLink86 Realtime Networking Software The timing primitives are provided in the MSC.H file. These are: • DELAYMS(number_of_milliseconds) • DELAYUS(number_of_microseconds). D20 driver must wait for the expiration of the above timers in cases of: • Reset • Reconfiguration • Token timing The timing macros are provided for several platforms based on the PC ISA bus. The designer of a real- life control application is responsible for making sure that these macros hold for the physical system that is in use ...

Page 59

... ControLink86 Realtime Networking Software 7.SAMPLE PROGRAM APP_INT.C The following listing is the actual program distributed with ControLink86, and interrupt based demonstration application. This is the file APP_INT.C /*********************************************************************/ /*-------------------------------------------------------------------*/ /* STANDARD MICROSYSTEMS CORPORATION /*-------------------------------------------------------------------*/ /* Module: ControLink Test Program /* Filename: app_int.c /* Description: Example program to exercise ControLink functions ...

Page 60

... ControLink86 Realtime Networking Software "D20_FOUR_NAKS", "D20_ET3", "D20_RCV_ALL", "D20_NET_SPEED", "D20_SLOW_ARB" }; static char *status_str "E_OK", "E_NO_PARAMETERS", "E_BAD_STATUS", "E_NOT_INITED", "E_BAD_COMMAND", "E_BAD_PARAMETER", "E_BAD_DATA", "E_NO_PACKET", "E_NO_TOKEN", "E_BAD_PACKET_SIZE", "E_TX_BUSY", "E_ACK", "E_ABORT", "E_DUPID", "E_ONE_NODE", "E_NODE_USED", "E_QFULL", "E_NAK_NO_TX", "E_DRIVER_OPTION", "E_TA_NO_ACK", "E_NOT_OK" }; /*=== GLOBAL DECLARATIONS =================================================*/ /* SAPs */ struct LLC_MSG SAP[MAX_SAPS]; USIGN8 SAPBUF[MAX_SAPS][MAX_SAPBUF] ...

Page 61

... ControLink86 Realtime Networking Software CLRSCR; net_init(); prompt(); CLRSCR; /* show all active nodes on the link */ display_netmap(); prompt(); CLRSCR; /* tell controlink to activate the SAPs, use a 0 DSAP to init_sap(); prompt(); CLRSCR; /*===========*/ /* TEST CODE */ /*===========*/ printf("Enter:\n"); printf(" <t> to transmit a data packet from a SAP to a SAP\n"); ...

Page 62

... ControLink86 Realtime Networking Software change_sap(); } /* display configuration of all SAPs*/ else if((dummx == 'd') || (dummx == 'D')) { show_saps(); } /* exit */ else if((dummx == 'e') || (dummx == 'E')) { d20_exit(); exit(-1); } dummx = 0x00 end of main(..) */ /**************************************************************************** * FUNCTION NAME: prompt * * DESCRIPTION : prompts operator to exit or continue * * RETURN VALUE : none ***************************************************************************/ void prompt(void) { char dummy1[10]; /* continue or exit */ printf(" ...

Page 63

... ControLink86 Realtime Networking Software case NO_INDICATION: break; case UNITDATA_INDICATION: { printf("\nSAP %d received %d bytes: { ", (sapid + 1), ((SAP[sapid].msbcount << SAP[sapid].lsbcount)); for < sizeof_sb[sapid]; j++) { if((j < > (sizeof_sb[sapid] - 3))) { printf("%02x ", SAPBUF[sapid][j]); } else if(j < printf("... "); } } printf("}\n"); break; ...

Page 64

... ControLink86 Realtime Networking Software fflush(stdin); sscanf(&dummy[0], "%d", &ssapidx); /* adjust ssapidx for the index to the arrays */ if(ssapidx == 0) { printf("SAP 0 is reserved - use another!\n"); return(E_NOT_OK); } else { ssapidx--; } /* get the sap to send from */ printf("Enter the SAP number to send the to: "); ...

Page 65

... ControLink86 Realtime Networking Software char dummy[10]; USIGN8 temp_param; USIGN8 i; FILE *params; /* select the configuration parameters for the D20.C */ printf("Enter:\n"); printf(" <d> for the default parameters - in D20.C\n"); printf(" <m> for manual setting of the parameters\n"); printf(" <f> to initialize parameters from the file D20.PAR\n"); ...

Page 66

... ControLink86 Realtime Networking Software if((dummy[0] == 'y') || (dummy[0] == 'Y')) { /* initialize hardware */ init_status = d20_init(); } else if((dummy[0] == 'e') || (dummy[0] == 'e')) { exit(-1); } else { printf("\nInvalid selection - exiting!\n"); exit(-1 check the result of the initialization */ if(init_status != E_OK) { printf("\nInitialization failed, ERROR CODE = %s\n", status_str[init_status]); printf("Exiting\n"); d20_exit(); ...

Page 67

... ControLink86 Realtime Networking Software printf("D20_P1MODE D20_FOUR_NAKS D20_ET3 D20_RCV_ALL D20_NET_SPEED printf(" %02x %02x d20_get_parameter(D20P_P1MODE), d20_get_parameter(D20P_FOUR_NAKS), d20_get_parameter(D20P_ET3), d20_get_parameter(D20P_RCV_ALL), d20_get_parameter(D20P_NET_SPEED), d20_get_parameter(D20P_SLOW_ARB)); } /* end of display_parameters(..) /**************************************************************************** * FUNCTION NAME: init_sap * * DESCRIPTION : initialize llc driver and all declared saps * * RETURN VALUE : none ***************************************************************************/ void init_sap(void) { char dummy[10]; ...

Page 68

... ControLink86 Realtime Networking Software { exit(-1); } else { printf("\nInvalid selection - exiting!\n"); exit(-1 link LLC structure to SAP buffers */ for ( < numof_saps; i++) { SAP[i].msgptr = &SAPBUF[i][0 initialize LLC driver */ sap_status = llc1_request(0, 0, ENABLE_WITHOUT_DUP_ADDR_CHECK, &SAP[0]); if(sap_status != E_OK) { printf("ERROR - going online!\n"); } /* activate SAPS */ for < numof_saps; i++) { sap_status = llc1_request((USIGN8)(i + 1), 0, SAP_ACTIVATION_REQUEST, & ...

Page 69

... ControLink86 Realtime Networking Software if(netmap[i] & (1 << j)) { printf("%02x, ", (( j)); } } } printf("\n\n"); if((net_status != E_OK)) { printf("Bad network, status = %s\n", status_str[net_status]); printf("Exiting ControLink\n"); exit(-1 end of display_netmap(..) /**************************************************************************** * FUNCTION NAME: change_sap * * DESCRIPTION : changes data in a selected SAP buffer * * RETURN VALUE : none ...

Page 70

... ControLink86 Realtime Networking Software else if((dummy[0] == 'e') || (dummy[0] == 'E')) { return; } else if((dummy[0] == 'n') || (dummy[0] == 'N')) { printf("\nSAP %d retains its old parameters\n", (sapidx + 1)); } /* get the formatting character */ printf("\nEnter the formatting character of the SAPBUF %d: ", (sapidx + 1)); gets(&dummy[0]); printf("\n"); fflush(stdin); sscanf(&dummy[0], "%x", &temp); ...

Page 71

... ControLink86 Realtime Networking Software void show_saps(void) { unsigned int i; unsigned int j; USIGN8 status; for < numof_saps; i++) { status = llc1_request((USIGN8)(i + 1), 0, REPORT_STATUS, &SAP[i]); printf("SAP %d status is %d. SAP %d has %d bytes: { " 1), status, sizeof_sb[i]); for < sizeof_sb[i]; j++) { if((j < > (sizeof_sb[i] - 3))) { printf("%02x ", SAPBUF[i][j]); ...

Page 72

... See ANSI/IEEE 802.2 Standard Standard Microsystems Corporation integrated family of the ARCNET Local Area Network Controller. This is the main element of the network hardware for which the ControLink86 has been developed. This family includes the following parts: COM20010, COM20020, COM20020-5, COM20022. ...

Page 73

... A measure of how fast the signals are sent on the medium. Some COM2002x's standard network speeds are 2.5Mbps (Mega-bits-per- second) and 5Mbps. This parameter is controlled by the choice of the crystal oscillator as well as the software via divisors. See section 6. Synonymous with Station. A unique number by which one station is distinguished from another. ...

Page 74

... SID is a field in the MAC frame (packet). Source Service Access Point - a SAP that is an originator of the data or request. A system connected to a network: its application plus network software and hardware. A dedicated message that is passed from a node with the lower address to a node with a higher address as the invitation to transmit. ...

Page 75

... Any and all such uses without prior written approval of an Officer of SMSC and further testing and/or modification will be fully at the risk of the customer. Copies of this document or other SMSC literature, as well as the Terms of Sale Agreement, may be obtained by visiting SMSC’s website at http://www.smsc.com. SMSC is a registered trademark of Standard Microsystems Corporation (“ ...

Related keywords