⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cippd_protocol.c

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 C
📖 第 1 页 / 共 5 页
字号:
#ifndef	lintstatic char *sccsid = "@(#)cippd_protocol.c	4.1	(ULTRIX)	7/2/90";#endif	lint/************************************************************************ *                                                                      * *                      Copyright (c) 1988 - 1989 by                    * *              Digital Equipment Corporation, Maynard, MA              * *                      All rights reserved.                            * *                                                                      * *   This software is furnished under a license and may be used and     * *   copied  only  in accordance with the terms of such license and     * *   with the  inclusion  of  the  above  copyright  notice.   This     * *   software  or  any  other copies thereof may not be provided or     * *   otherwise made available to any other person.  No title to and     * *   ownership of the software is hereby transferred.                   * *                                                                      * *   The information in this software is subject to change  without     * *   notice  and should not be construed as a commitment by Digital     * *   Equipment Corporation.                                             * *                                                                      * *   Digital assumes no responsibility for the use  or  reliability     * *   of its software on equipment which is not supplied by Digital.     * *                                                                      * ************************************************************************ * * *   Facility:	Systems Communication Architecture *		Computer Interconnect Port-to-Port Driver * *   Abstract:	This module contains Computer Interconnect Port-to-Port *		Driver( CI PPD ) finite state machine action functions and *		control routines. * *   Creator:	Todd M. Katz	Creation Date:	October 20, 1985 * *   Function/Routines: * *   Control Routines *	cippd_dispatch		CI PPD Action Dispatcher *   Action Functions *	cippd_ack_rec		Discard Received ACK CI PPD Datagram *	cippd_build_sb		Build Formative System Block *	cippd_comp_trys		Compute Number of Transmission Attempts *	cippd_disb_path		Disable CI PPD Path *	cippd_enab_path		Enable CI PPD Path *	cippd_enter_db		Enter Path Block into Databases *	cippd_error_dg		Process Received ERROR CI PPD Datagram *	cippd_ignore_dg		Ignore CI PPD Datagram *	cippd_init_pb		Initialize a Path Block *	cippd_inv_cache		Invalidate Local Port Translation Cache *	cippd_panic		Unexpected State-Event Combination *	cippd_path_schd		Schedule Asynchronous CI PPD Path Clean Up *	cippd_pcreason		Map Path Crash Reason *	cippd_ppderror		Process CI PPD Protocol Errors *	cippd_req_id		Request Remote Port Identification *	cippd_rrestart		Process Remote CI PPD Path Restart Requests *	cippd_snd_ack		Send ACK CI PPD Datagram *	cippd_snd_stack		Send STACK CI PPD Datagram *	cippd_snd_start		Send START CI PPD Datagram *	cippd_snd_stop		Send STOP CI PPD Datagram *	cippd_start_tmr		Start CI PPD Traffic Interval Timer *	cippd_stop_dg		Process Received STOP CI PPD Datagram *	cippd_stop_tmr		Stop CI PPD Traffic Interval Timer *	cippd_test_trys		Test/Decrement Number of Transmission Attempts *	cippd_update_sb		Update Formative System Block *	cippd_upd_ptype		Update Hardware Port Type of Remote Port * *   Modification History: * *   14-Sep-1989	Pete Keilty *	1. Added bcmp instead of cast u_long for strings because of  *	   mips cpu's data alignment. * *   07-Sep-1989	Pete Keilty *	1. Added break in the scadb scan for loop of cippd_enter_db routine *	   on failure. This prevents Smp_unlock panic's lock not held. *	   On failure status is set to FAILURE so no need to continue  *	   scanning scadb. * *   06-Apr-1989	Pete Keilty *	1. Added include fiel smp_lock.h adn extern lock_t lk_scadb * *   17-Jan-1989	Todd M. Katz		TMK0005 *	1. The macro Scaaddr_lol() has been renamed to Scaaddr_low().  It now *	   accesses only the low order word( instead of low order longword ) of *	   a SCA system address. *	2. Include header file ../vaxmsi/msisysap.h. * *   17-Aug-1988        Todd M. Katz		TMK0004 *	 1. The following informational events( ES_I ) have been redefined as *	    warning events( ES_W ): TALKUP, BADSWTYPE. *	 2. The following informational events( ES_I ) have been redefined as *	    remote error events( ES_RE ): DBCONFLICT, RERROR. *	 3. The following informational events( ES_I ) have been redefined as *	    error events( ES_E ): TALKDOWN, ALLOCFAIL, NORETRIES. *	 4. Modifications to cippd_enter_db(): *		1) Allow DSSI tape storage controllers( software type == TFXX ) *		   to pass remote system software verification. *		2) Event log all new path establishments. *	 5. Routine cippd_error() has been changed to function cippd_ppderror() *	    and is invoked only when a CI PPD protocol violation occurs on a *	    formative path.  It processes all violations by explicitly logging *	    them with an error event code of SE_PPDPROTOCOL and returning a *	    failure status to force clean up of the formative path. *	 6. Add a new routine cippd_rrestart().  This routine is invoked only *	    when a START CI PPD datagram is received on a fully established *	    path.  Such datagrams indicate remote CI PPD termination and clean *	    up of the path and an attempt by the remote CI PPD to re-establish *	    it. *	 7. No need exists to cache the remote port station address in the PCCB *	    before invoking cippd_log_path().  Modify the following routines *	    and functions appropriately: cippd_build_sb(), cippd_enab_path(), *	    and cippd_test_trys(). *	 8. Modify cippd_stop_dg() to crash only fully established paths.  The *	    reception of a STOP CI PPD datagram over a formative path is logged *	    before path establishment is aborted by returning a failure status. *	 9. Modifications to cippd_pcreason() are as follows: *		1) It is now invocable only on established paths. *		2) The amount of error checking performed by it during mapping *		   has been greatly increased.  A panic occurs when an invalid *		   path crash code is encountered. *		3) All invocations of appropriate PD specific mapping routines *		   have been eliminated.  Port driver specific path crash *		   reason codes no longer exist.  All reason code mapping takes *		   place entirely within this routine. *      	4) It now handles both severe and "routine" path crash reasons *		   as required by the newly redefined sca error code formats. *	10. Modify cippd_comp_trys() to obtain port polling contact frequency *	    from a CI PPD specific PCCB field instead of from a CI PPD *	    configuration variable. *	11. Refer to error logging as event logging. * *   03-Jun-1988	Todd M. Katz		TMK0003 *      1. Modify cippd_build_sb() and cippd_enab_path() to event log instances *         of insufficient memory for new path establishment. *	2. Add logging of path establishment abortion due to exhausted retries. *	   This involves moving the check for exhausted retransmission attempts *	   from cippd_req_id(), cippd_snd_start(), and cippd_snd_stack() to a *	   new function, cippd_test_trys().  This new function determines *	   whether any retransmission attempts remain and aborts path *	   establishment when there are none.  This event is also logged *	   provided it is the first such failure to establish the path. *	   Logging of subsequent failures is bypassed until the CI PPD is *	   successful at establishing the path( cippd_enter_db() has been *	   appropriately modified ). *	3. Eliminate return of status by cippd_req_id(), cippd_snd_start(), and *	   cippd_snd_stack().  Formerly, these "routines" returned failure *	   status when unsuccessful at allocating a port specific buffer during *	   a retry attempt.  Such failures aborted path establishment.  Now *	   these routines just return on encountering an allocation failure. *	   The failure is not logged and path establishment is not aborted. *	   This change allows multiple attempts to be made to complete the *	   current step in the CI PPD path establishment sequence regardless of *	   intermediate failures.  Only when retries are exhausted is path *	   establishment aborted and the failure logged( by cippd_test_trys()). *	4. The following macros have been renamed: *		1) Test_mapbit() -> Test_lpinfomap() *		2) Set_mapbit() -> Set_lpinfomap() *		3) Clear_mapbit() -> Clear_lpinfomap() *	5. Eliminate the function cippd_chk_ver() and move its CI PPD protocol *	   checking function into cippd_enter_db().  Check for version *	   mismatches immediately after confirming that no database conflict *	   exists.  Also, modify cippd_enter_db() to log path establishments to *	   remote systems with unsupported system software types.  These *	   changes required extensive modifications to cippd_enter_db(). *	6. CI PPD event logging is now split between the routines *	   cippd_log_path() and cippd_log_sys() to differentiate between *	   logging of path specific and system level events respectively. *	   Modify cippd_build_sb(), cippd_enab_path(), cippd_enter_db(), and *	   cippd_test_trys() to invoke cippd_log_path(); and, cippd_errorlog() *	   to invoke cippd_log_sys(). *	7. Log the remote system's local port station address on database *	   conflicts( IE_DBCONFLICT ). * *   02-Jun-1988	Ricky S. Palmer *      Removed inclusion of header file ../vaxmsi/msisysap.h * *   09-Apr-1988	Todd M. Katz		TMK0002 *	1. Add comments to cippd_dispatch() concerning disposal of optional *	   port specific message buffers.  Such buffers are always disposed of *	   external to the CI PPD finite state machine and never within it. *	2. Add use of Pb_fork() macro in place of straight-line code. * *   08-Jan-1988	Todd M. Katz		TMK0001 *	Formated module, revised comments, increased robustness, made *	CI PPD and GVP completely independent from underlying port drivers, *	restructured code paths, and added SMP support. *//* * 		Communication Interconnect Port-to-Port Driver *  * The CI PPD provides device independent paths for use as communication * conduits between equivalent SCSs on different systems.  The CI PPD is * responsible for the establishment and termination of these paths.  It is not * responsible for their maintenance.  That is the province of the port drivers * which monitor the physical status of their paths and notify the CI PPD when * a path has failed.  The CI PPD is also never involved with either SCS or * application communications.  Such communications are always handled directly * by the port drivers. * * Path establishment requires the CI PPD to communicate with equivalent CI * PPDs on other systems.  Such communication between peers utilizes a CI PPD * specific communication protocol consisting of a sequence of exchanged * datagrams triggered by the discovery of a previously unknown remote CI PPD. * The purpose of these datagram exchanges is for both participants to meet the * following criteria necessary for path establishment: * * 	1. Discovery of the remote CI PPD. *  	2. Transmission of local system information. * 	3. Reception of remote system information. * 	4. Transmission of an acknowledgement of remote system information. * 	5. Reception of an acknowledgement of local system information. * * The order in which these criteria are met may vary; and therefore, the * actual sequence of exchanged datagrams may also vary.  This is because the * path establishment CI PPD protocol is datagram based and the delivery of * datagrams is never guaranteed.  This requires a certain robustness to be * built into the path establishment protocol so that multiple attempts are * made to meet a particular criteria before aborting path establishment. * However, while the exact order of datagram exchanges may vary there are two * basic exchanges. * * 	        CI PPD 1		   	       CI PPD 2 * 	-----------------------		------------------------------------ * * 			Path Establishment Sequence 1 * * 	Discovers Remote CI PPD * 	Transmits START --------------> * 					Discovers Remote CI PPD * 				<------	Transmits STACK * 	Transmits ACK ----------------> *  * 			Path Establishment Sequence 2 *  * 	Discovers Remote CI PPD		Discovers Remote CI PPD * 	Transmits START ----------> <--	Transmits START * 	Transmits STACK ----------> <--	Transmits STACK * 	Transmits ACK ------------> <--	Transmits ACK *  * In the first sequence CI PPD 1 discovers CI PPD 2, transmits its system * information within a START CI PPD datagram, receives both remote system * information and an acknowledgement of its information within a STACK CI PPD * datagram, and transmits an acknowledgement of the remote information within * an ACK CI PPD datagram.  Meanwhile, CI PPD 2 receives remote system * information within a START, discovers CI PPD 1, transmits both its * information and an acknowledgement of the remote information within a STACK, * and receives acknowledgement of its information within an ACK. *  * In the second sequence both CI PPDs mirror their counterpart in what perhaps * is an overly redundant exchange of datagrams.  Both simultaneously discover * each other, transmit their system information within a START, receive their * counterpart's information also within a START, transmit an acknowledgement * of their counterpart's information within a STACK, receive an * acknowledgement of their information also within a STACK, and then transmit * a superfluous ACK for good measure.  All other path establishment sequences * are hybrids of these two basic sequences. *  * Discovery of the remote CI PPD is achieved by requesting the identification * of its remote port.  Such requests are accomplished in a port driver * specific fashion which may involve the underlying port's datagram * capabilities but never its guaranteed delivery mechanisms( if such exist ). * Two situations requiring remote port identification requests exist: * *	1. CI PPDs routinely poll all possible remote ports for their *	   identities. *	2. CI PPDs also request the identification of a specific remote port. * * The first situation represents how CI PPDs discover previously unknown * remote ports and the possible existence of their CI PPDs.  It is how CI PPD * 1 discovers CI PPD 2 in the first path establishment sequence.  The second * situation represents how a CI PPD discovers a remote port after receiving * its system information.  It is how CI PPD 2 discovers CI PPD 1 also in this * same sequence.  Polling( Situation 1 ) also provides one means by which * port drivers may monitor the physical state of their established paths.   *  * As mentioned, a certain robustness must be built into the path establishment * sequence because it is datagram based and datagrams are subject to both loss

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -