root/include/linux/if_frad.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * DLCI/FRAD    Definitions for Frame Relay Access Devices.  DLCI devices are
   3  *              created for each DLCI associated with a FRAD.  The FRAD driver
   4  *              is not truely a network device, but the lower level device
   5  *              handler.  This allows other FRAD manufacturers to use the DLCI
   6  *              code, including it's RFC1490 encapsulation along side the current
   7  *              implementation for the Sangoma cards.
   8  *
   9  * Version:     @(#)if_ifrad.h  0.10    23 Mar 96
  10  *
  11  * Author:      Mike McLagan <mike.mclagan@linux.org>
  12  *
  13  *              This program is free software; you can redistribute it and/or
  14  *              modify it under the terms of the GNU General Public License
  15  *              as published by the Free Software Foundation; either version
  16  *              2 of the License, or (at your option) any later version.
  17  */
  18 
  19 #ifndef _FRAD_H_
  20 #define _FRAD_H_
  21 
  22 /* Stuctures and constants associated with the DLCI device driver */
  23 
  24 #define DLCI_DEVADD     (SIOCDEVPRIVATE)
  25 #define DLCI_DEVDEL     (SIOCDEVPRIVATE + 1)
  26 
  27 struct dlci_add
  28 {
  29    char  devname[IFNAMSIZ];
  30    short dlci;
  31 };
  32 
  33 #define DLCI_GET_CONF   (SIOCDEVPRIVATE + 2)
  34 #define DLCI_SET_CONF   (SIOCDEVPRIVATE + 3)
  35 
  36 /* These are related to the Sangoma FRAD */
  37 struct dlci_conf {
  38    short flags;
  39    short CIR_fwd;
  40    short Bc_fwd;
  41    short Be_fwd;
  42    short CIR_bwd;
  43    short Bc_bwd;
  44    short Be_bwd; 
  45 
  46 /* these are part of the status read */
  47    short Tc_fwd;
  48    short Tc_bwd;
  49    short Tf_max;
  50    short Tb_max;
  51 };
  52 
  53 #define DLCI_GET_SLAVE  (SIOCDEVPRIVATE + 4)
  54 
  55 /* configuration flags for DLCI */
  56 #define DLCI_IGNORE_CIR_OUT     0x0001
  57 #define DLCI_ACCOUNT_CIR_IN     0x0002
  58 #define DLCI_BUFFER_IF          0x0008
  59 
  60 #define DLCI_VALID_FLAGS        0x000B
  61 
  62 
  63 /* defines for the actual Frame Relay hardware */
  64 #define FRAD_GET_CONF   (SIOCDEVPRIVATE)
  65 #define FRAD_SET_CONF   (SIOCDEVPRIVATE + 1)
  66 
  67 #define FRAD_LAST_IOCTL FRAD_SET_CONF
  68 
  69 struct frad_conf 
  70 {
  71    short station;
  72    short flags;
  73    short kbaud;
  74    short clocking;
  75    short mtu;
  76    short T391;
  77    short T392;
  78    short N391;
  79    short N392;
  80    short N393;
  81    short CIR_fwd;
  82    short Bc_fwd;
  83    short Be_fwd;
  84    short CIR_bwd;
  85    short Bc_bwd;
  86    short Be_bwd;
  87 
  88 /* Add new fields here, above is a mirror of the sangoma_conf */
  89 
  90 };
  91 
  92 #define FRAD_STATION_CPE        0x0000
  93 #define FRAD_STATION_NODE       0x0001
  94 
  95 #define FRAD_TX_IGNORE_CIR      0x0001
  96 #define FRAD_RX_ACCOUNT_CIR     0x0002
  97 #define FRAD_DROP_ABORTED       0x0004
  98 #define FRAD_BUFFERIF           0x0008
  99 #define FRAD_STATS              0x0010
 100 #define FRAD_MCI                0x0100
 101 #define FRAD_AUTODLCI           0x8000
 102 #define FRAD_VALID_FLAGS        0x811F
 103 
 104 #define FRAD_CLOCK_INT          0x0001
 105 #define FRAD_CLOCK_EXT          0x0000
 106 
 107 #ifdef __KERNEL__
 108 
 109 struct fradhdr
 110 {
 111    /* these are the fields of an RFC 1490 header               */
 112    unsigned char  control;
 113    unsigned char  pad;          /* for IP packets, this can be the NLPID */
 114    unsigned char  NLPID;
 115    unsigned char  OUI[3];
 116    unsigned short PID;
 117 };
 118 
 119 /* see RFC 1490 for the definition of the following */
 120 #define FRAD_I_UI               0x03
 121 
 122 #define FRAD_P_PADDING          0x00
 123 #define FRAD_P_Q933             0x08
 124 #define FRAD_P_SNAP             0x80
 125 #define FRAD_P_CLNP             0x81
 126 #define FRAD_P_IP               0xCC
 127 
 128 struct dlci_local
 129 {
 130    struct enet_statistics stats;
 131    struct device          *slave;
 132    struct dlci_conf       config;
 133    int                    configured;
 134 
 135    /* callback function */
 136    void              (*receive)(struct sk_buff *skb, struct device *);
 137 };
 138 
 139 struct frad_local
 140 {
 141    struct enet_statistics stats;
 142    struct timer_list timer;
 143 
 144    /* devices which this FRAD is slaved to */
 145    struct device     *master[CONFIG_DLCI_MAX];
 146    short             dlci[CONFIG_DLCI_MAX];
 147 
 148    /* callback functions */
 149    int               (*activate)(struct device *, struct device *);
 150    int               (*deactivate)(struct device *, struct device *);
 151    int               (*assoc)(struct device *, struct device *);
 152    int               (*deassoc)(struct device *, struct device *);
 153    int               (*dlci_conf)(struct device *, struct device *, int get);
 154 
 155    int               initialized;       /* mem_start, port, irq set ? */
 156    int               configured;        /* has this device been configured */
 157    int               type;              /* adapter type */
 158    int               state;             /* state of the S502/8 control latch */
 159    int               buffer;            /* current buffer for S508 firmware */
 160    struct frad_conf  config;
 161 };
 162 
 163 int register_frad(const char *name);
 164 int unregister_frad(const char *name);
 165 
 166 #endif __KERNEL__
 167 
 168 #endif

/* [previous][next][first][last][top][bottom][index][help] */