-- File: Base.pack - last edit:
-- AOF                 21-Oct-87  8:45:41
-- SMA                 27-May-86 10:38:47

-- Copyright (C) 1986, 1987 by Xerox Corporation. All rights reserved.

--Packager Base[UnpackedBase]/m

Base: SEGMENT =

  BEGIN
  BasicCommunications: CODE PACK =
    BEGIN
    Boss[
      ENTRY VECTOR, GetDeviceChain, GetContext, ChangeNumberOfInputBuffers];
    BufferMgr[
      ENTRY VECTOR, DataBytesPerRawBuffer, GetBufferInternal, GetInputBuffer,
      Enqueue, Dequeue, ReturnBuffer, GeneralPoolMaintainance,
      AllocateNewCluster, AllocateNewClusterUnlocked, AllocateNewClusterLocked,
      InitializeBuffer, GetBuffer, MakePool, DestroyPool];
    DispatcherImpl[
      ENTRY VECTOR, MainDispatcher, PutOnGlobalInputQueue, OrphanDecapsulate,
      PutOnGlobalDoneQueue, EncapsulateAndTransmit, OrphanEncapsulate,
      SetMaximumBufferSize];
    PilotCommUtil[ENTRY VECTOR, PulsesToTicks, AllocateBuffers, FreeBuffers];
    END;  --BaseIdle

  EthernetDriver: CODE PACK =
    BEGIN
    EthernetDriver[
      ENTRY VECTOR, InInterrupt, OutInterrupt, GetBufferAndIocb,
      FreeBufferAndIocb, SendRawBuffer, SendBufferInternal, Watcher,
      SmashCSBs, WatchCarefully, CheckBuffer, WatcherNotify, SanityCheck,
      MaybeChangeNumberOfInputBuffers, ActivateDriver, CreateAnEthernetDriver];
    END;  --EthernetDriver

  CondosEtc: CODE PACK =
    BEGIN
    Boss[AddDeviceToChain, RemoveDeviceFromChain, GetNthDevice];
    BufferMgr[
      CreditReceiveBuffer, SmashTheRequeueProc, MakeSystemBufferPool,
      DestroySystemBufferPool, QueueInitialize, QueueCleanup];
    DispatcherImpl[
      AcquireUniqueName, AddFamilyMember, GetFamilyUnit, EvictFamily,
      RemoveFamilyMemberInternal, RegisterFamily, ReleaseUniqueName,
      RemoveFamilyMember, CATCH CODE];
    EthernetDriver[
      DeactivateDriver, DeleteDriver, CreateDefaultEthernetDrivers,
      SetupEthernetDriver, CATCH CODE];
    PilotCommUtil[
      AllocateIocbs, FreeIocbs, Create, Destroy, CATCH CODE];
    END;  --CondosEtc

  StartStopAndDebug: CODE PACK =
    BEGIN
    Boss[
      CATCH CODE, CommPackageGo, CommPackageOff, GetUseCount, GetDoStats,
      GetEthernetStats, SmashDeviceChain, MAIN];
    BufferMgr[CATCH CODE, BuffersLeft, SendBuffersLeft, ReceiveBuffersLeft,
      ExtractFromQueue, GetSizes, GetIntervals, GetDefaults, GetStatistics,
      SetIntervals, SetDefaults, MAIN];
    DispatcherImpl[Ripple, SetSpyProc, DispatcherOn, DispatcherOff, MAIN];
    EthernetDriver[
      AdjustLengtoOfD0EthernetInputQueue, GetNthDeviceLikeMe,
      RealSetCollectGarbageToo, SetEthernetCollectGarbageToo,
      RealEthernetListenForHost, SetEthernetListener, MAIN];
    PilotCommUtil[CaptureErrors, DefaultErrorHandler, Glitch, MAIN];
    StatsHot;
    CommunicationControl;
    END;  --StartStop
  END;

  BaseFrames: FRAME PACK = {Base};