Merge branch 'message-callback' into kbuild/kconfig
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / staging / cxt1e1 / pmcc4.h
CommitLineData
50ee11fe
BB
1/*
2 * $Id: pmcc4.h,v 1.4 2005/11/01 19:24:48 rickd PMCC4_3_1B $
3 */
4
5#ifndef _INC_PMCC4_H_
6#define _INC_PMCC4_H_
7
8/*-----------------------------------------------------------------------------
9 * pmcc4.h -
10 *
11 * Copyright (C) 2005 SBE, Inc.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * For further information, contact via email: support@sbei.com
24 * SBE, Inc. San Ramon, California U.S.A.
25 *-----------------------------------------------------------------------------
26 * RCS info:
27 * RCS revision: $Revision: 1.4 $
28 * Last changed on $Date: 2005/11/01 19:24:48 $
29 * Changed by $Author: rickd $
30 *-----------------------------------------------------------------------------
31 * $Log: pmcc4.h,v $
32 * Revision 1.4 2005/11/01 19:24:48 rickd
33 * Remove de-implement function prototypes. Several <int> to
34 * <status_t> changes for consistant usage of same.
35 *
36 * Revision 1.3 2005/09/28 00:10:08 rickd
37 * Add GNU license info. Use config params from libsbew.h
38 *
39 * Revision 1.2 2005/04/28 23:43:03 rickd
40 * Add RCS tracking heading.
41 *
42 *-----------------------------------------------------------------------------
43 */
44
45
46#if defined(__FreeBSD__) || defined(__NetBSD__)
47#include <sys/types.h>
48#else
49#ifndef __KERNEL__
50#include <sys/types.h>
51#else
52#include <linux/types.h>
53#endif
54#endif
55
56
57
58typedef int status_t;
59
60#define SBE_DRVR_FAIL 0
61#define SBE_DRVR_SUCCESS 1
62
63#ifdef __cplusplus
64extern "C"
65{
66#endif
67
68
69/********************/
70/* PMCC4 memory Map */
71/********************/
72
73#define COMET_OFFSET(x) (0x80000+(x)*0x10000)
74#define EEPROM_OFFSET 0xC0000
75#define CPLD_OFFSET 0xD0000
76
77 struct pmcc4_timeslot_param
78 {
79 u_int8_t card; /* the card number */
80 u_int8_t port; /* the port number */
81 u_int8_t _reserved1;
82 u_int8_t _reserved2;
83
84 /*
85 * each byte in bitmask below represents one timeslot (bitmask[0] is
86 * for timeslot 0 and so on), each bit in the byte selects timeslot
87 * bits for this channel (0xff - whole timeslot, 0x7f - 56kbps mode)
88 */
89 u_int8_t bitmask[32];
90 };
91
92 struct c4_musycc_param
93 {
94 u_int8_t RWportnum;
95 u_int16_t offset;
96 u_int32_t value;
97 };
98
99/*Alarm values */
100#define sbeE1RMAI 0x100
101#define sbeYelAlm 0x04
102#define sbeRedAlm 0x02
103#define sbeAISAlm 0x01
104
105#define sbeE1errSMF 0x02
106#define sbeE1CRC 0x01
107
108#ifdef __cplusplus
109}
110#endif
111
112#ifdef __KERNEL__
113
114/*
115 * Device Driver interface, routines are for internal use only.
116 */
117
118#include "pmcc4_private.h"
9c770f3b
JK
119
120char *get_hdlc_name (hdlc_device *);
50ee11fe
BB
121
122/*
123 * external interface
124 */
125
126void c4_cleanup (void);
127status_t c4_chan_up (ci_t *, int channum);
128status_t c4_del_chan_stats (int channum);
129status_t c4_del_chan (int channum);
130status_t c4_get_iidinfo (ci_t * ci, struct sbe_iid_info * iip);
131int c4_is_chan_up (int channum);
132
133void *getuserbychan (int channum);
134void pci_flush_write (ci_t * ci);
135void sbecom_set_loglevel (int debuglevel);
136char *sbeid_get_bdname (ci_t * ci);
137void sbeid_set_bdtype (ci_t * ci);
138void sbeid_set_hdwbid (ci_t * ci);
139u_int32_t sbeCrc (u_int8_t *, u_int32_t, u_int32_t, u_int32_t *);
140
141void VMETRO_TRACE (void *); /* put data into 8 LEDs */
142void VMETRO_TRIGGER (ci_t *, int); /* Note: int = 0(default)
143 * thru 15 */
144
145#if defined (SBE_ISR_TASKLET)
146void musycc_intr_bh_tasklet (ci_t *);
147
148#endif
149
150#endif /*** __KERNEL __ ***/
151#endif /* _INC_PMCC4_H_ */