LLC 2.88 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
/* Copyright 1998 Acorn Computers Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
*
*     LLC.H - Header for LLC Related exports
*
*     05-02-92 INH    Original
*
*/

/* Connection handle */

typedef int HCONN;


/* Physical network address */

typedef struct
{
  BYTE b[6];
}
  NETADDR;

/* Received Packet processing functions ***************** */

/* Receive functions are expected to dispose of the mbuf chains
   they are handed. Beware! The source address for a UI_RCV_PROC is
   a transient value only!
*/

typedef void (*UI_RCV_PROC) ( NETADDR *src, BUFCHAIN data, void *private );
typedef void (*LLC_RCV_PROC) ( HCONN hc, BUFCHAIN data, void *private );


/* Connection for LLC-level streams ******************** */

extern bool  LLC_Init ( void );
Stewart Brodie's avatar
Stewart Brodie committed
50
extern err_t LLC_AttachDriver ( char *drivername, const NETADDR *multi_hw );
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
extern void  LLC_Shutdown ( void );

/* UI (Datagram) service */

extern err_t UI_SetReceiver ( int SAP, UI_RCV_PROC RcvFn, void *private );
extern err_t UI_SendData ( NETADDR *dst, int SAP, BUFCHAIN pB );

/* LLC (Logical Link) service */

extern err_t LLC_SendData ( HCONN hc, BUFCHAIN data );

extern err_t LLC_OpenLink ( NETADDR *dst, int DSAP, LLC_RCV_PROC RcvFn,
            void *Private, HCONN *pHandleOut );

extern err_t LLC_CloseLink ( HCONN hc );

extern bool LLC_LinkOK ( HCONN hc );

extern int  LLC_GetMTU (void);

/* General */

extern void          LLC_BackgroundProcess(void);
extern NETADDR       LLC_MachineAddress;
extern volatile int  LLC_TickerTime;
Stewart Brodie's avatar
Stewart Brodie committed
76
/*extern int LLC_CallbackFn_handler(void);*/
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113

/* Timers ------------- */

/* We implement a general-purpose timer library, which
   provides a 'safe' callback when a given timer has
   expired.
*/

typedef void (*pfnExpire) ( void *prvdata );

struct Timer
{
  struct Timer *next, *prev;
  int           status;
#define TMR_INACTIVE 0
#define TMR_ACTIVE   1
  int           expiretime;


  pfnExpire     expirefn;
  void *        prvdata;
};

extern void TimerInit
       ( struct Timer *pT, pfnExpire expire_fn, void *prvdata );

extern void TimerStart
       ( struct Timer *pT, int timeout );

extern void TimerClear
       ( struct Timer *pT );

#define TimerRunning(p) ((p)->status == TMR_ACTIVE)


/* Exports used by CMHG veneers */

Stewart Brodie's avatar
Stewart Brodie committed
114
/*
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
extern int CallbackFn_handler(void);
extern int TickerFn_handler ( _kernel_swi_regs *R, int pw );
extern int ReceiveFn_handler ( _kernel_swi_regs *R, int pw );












Stewart Brodie's avatar
Stewart Brodie committed
130
*/