summaryrefslogtreecommitdiff
path: root/drivers/staging/cxt1e1/pmcc4.h
blob: 26c1f0ea72e96dbde77cadbf9c20291c66da47d2 (plain)
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
50
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
76
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*
 * $Id: pmcc4.h,v 1.4 2005/11/01 19:24:48 rickd PMCC4_3_1B $
 */

#ifndef _INC_PMCC4_H_
#define _INC_PMCC4_H_

/*-----------------------------------------------------------------------------
 * pmcc4.h -
 *
 * Copyright (C) 2005  SBE, Inc.
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 * For further information, contact via email: support@sbei.com
 * SBE, Inc.  San Ramon, California  U.S.A.
 *-----------------------------------------------------------------------------
 * RCS info:
 * RCS revision: $Revision: 1.4 $
 * Last changed on $Date: 2005/11/01 19:24:48 $
 * Changed by $Author: rickd $
 *-----------------------------------------------------------------------------
 * $Log: pmcc4.h,v $
 * Revision 1.4  2005/11/01 19:24:48  rickd
 * Remove de-implement function prototypes.  Several <int> to
 * <status_t> changes for consistant usage of same.
 *
 * Revision 1.3  2005/09/28 00:10:08  rickd
 * Add GNU license info. Use config params from libsbew.h
 *
 * Revision 1.2  2005/04/28 23:43:03  rickd
 * Add RCS tracking heading.
 *
 *-----------------------------------------------------------------------------
 */


#if defined(__FreeBSD__) || defined(__NetBSD__)
#include <sys/types.h>
#else
#ifndef __KERNEL__
#include <sys/types.h>
#else
#include <linux/types.h>
#endif
#endif



typedef int status_t;

#define SBE_DRVR_FAIL     0
#define SBE_DRVR_SUCCESS  1

#ifdef __cplusplus
extern      "C"
{
#endif


/********************/
/* PMCC4 memory Map */
/********************/

#define COMET_OFFSET(x) (0x80000+(x)*0x10000)
#define EEPROM_OFFSET   0xC0000
#define CPLD_OFFSET     0xD0000

    struct pmcc4_timeslot_param
    {
        u_int8_t    card;       /* the card number */
        u_int8_t    port;       /* the port number */
        u_int8_t    _reserved1;
        u_int8_t    _reserved2;

        /*
         * each byte in bitmask below represents one timeslot (bitmask[0] is
         * for timeslot 0 and so on), each bit in the byte selects timeslot
         * bits for this channel (0xff - whole timeslot, 0x7f - 56kbps mode)
         */
        u_int8_t    bitmask[32];
    };

    struct c4_musycc_param
    {
        u_int8_t    RWportnum;
                    u_int16_t offset;
        u_int32_t   value;
    };

/*Alarm values */
#define sbeE1RMAI      0x100
#define sbeYelAlm      0x04
#define sbeRedAlm      0x02
#define sbeAISAlm      0x01

#define sbeE1errSMF    0x02
#define sbeE1CRC       0x01

#ifdef __cplusplus
}
#endif

#ifdef __KERNEL__

/*
 * Device Driver interface, routines are for internal use only.
 */

#include "pmcc4_private.h"

#if !(LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
char       *get_hdlc_name (hdlc_device *);

#endif


/*
 * external interface
 */

void        c4_cleanup (void);
status_t    c4_chan_up (ci_t *, int channum);
status_t    c4_del_chan_stats (int channum);
status_t    c4_del_chan (int channum);
status_t    c4_get_iidinfo (ci_t * ci, struct sbe_iid_info * iip);
int         c4_is_chan_up (int channum);

void       *getuserbychan (int channum);
void        pci_flush_write (ci_t * ci);
void        sbecom_set_loglevel (int debuglevel);
char       *sbeid_get_bdname (ci_t * ci);
void        sbeid_set_bdtype (ci_t * ci);
void        sbeid_set_hdwbid (ci_t * ci);
u_int32_t   sbeCrc (u_int8_t *, u_int32_t, u_int32_t, u_int32_t *);

void        VMETRO_TRACE (void *);       /* put data into 8 LEDs */
void        VMETRO_TRIGGER (ci_t *, int);       /* Note: int = 0(default)
                                                 * thru 15 */

#if defined (SBE_ISR_TASKLET)
void        musycc_intr_bh_tasklet (ci_t *);

#endif

#endif                          /*** __KERNEL __ ***/
#endif                          /* _INC_PMCC4_H_ */