-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgsinterface.h
103 lines (88 loc) · 3.16 KB
/
gsinterface.h
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
/*
Author : kolja <[email protected]>
Creation : 29/11/2003
Licence : GPL
*********************************************************************
File : $RCSfile: gsinterface.h,v $
Version : $Revision: 1.8 $
Modified by : $Author: kolja_gava $ ($Date: 2005/10/20 07:43:42 $)
*********************************************************************
GlobeSpan Chipset Common Interface
cantain all the information related to device
*/
#ifndef GSINTERFACE_H
#define GSINTERFACE_H
#include "pusb.h"
/* Vendor/ProdID for "ECI Telecom USB ADSL Loader" */
#define EZUSB_NAME "EZUSB USB ADSL Loader"
#define EZUSB_VENDOR 0x0547 /* 0x0547 */
#define EZUSB_PRODUCT 0x2131 /* 0x2131 */
/* Vendor/ProdID for "ECI Telecom USB ADSL WAN Modem" */
#define GS_NAME "GlobeSpan GS7070 USB ADSL WAN Modem"
#define GS_VENDOR 0x0915 /* 0x0915 */
#define GS_PRODUCT 0x8000 /* 0x8000 */
#define CONTROLCODEBUFFERSIZE 20
/* Piucked at random, I never get more that three controlcodes in a
row so 20, if there are 20 then somethings gone badly wrong!
*/
/* Error Codes */
#define GSLINEDROP -1
/* line dropped (e.g. you unplugged the modem from the phone line) */
#define GSSYNCERROR -2
/* can happed after a lkine drop? */
/* eci_device_chipset */
typedef enum device_chipset{
ECIDC_UNKNWN = 0, /* Unknown chipset */
ECIDC_GS7070 = 1, /* GS7070 chipset - standard one */
ECIDC_GS7470 = 2 /* GS7470 chipset - new modems */
} eci_device_chipset;
struct eci_device_t
{
eci_device_chipset eci_modem_chipset;
/* ep numbers */
unsigned char eci_int_ep;
unsigned char eci_in_ep;
unsigned char eci_out_ep;
unsigned char use_datain_iso_urb;
/* interfaces # */
unsigned short int alt_interface_synch;
unsigned short int alt_interface_ppp;
/* max size of data endpoint (Windows driver uses 448). */
short int eci_iso_packet_size;
/* number of ISO packet per URB (Windows driver uses 10) */
short int eci_nb_iso_packet;
/* number of simultaneous URB submitted to data endpoint (Windows drv : 20) */
short int eci_nb_pkt_ep_data_in;
/* EP INT output buffer size */
short int ep_int_out_buf_size;
/* EP INT data start point */
short int ep_int_data_start_point;
/* EP INT data size */
short int ep_int_data_size;
/* BULK RESPONSE VALUE */
unsigned short bulk_response_value;
/* AAL5 INPUT CELL STRUCTURE */
short int cell_r_size;
short int cell_r_hdr;
short int cell_r_data;
/* AAL5 OUTPUT CELL STRUCTURE */
short int cell_w_size;
short int cell_w_hdr;
short int cell_w_data;
short int pad_size;
};
/* structure for aal5 header decoding - kolja*/
struct aal5_header_st {
unsigned int vpi;
unsigned int vci;
unsigned int pti;
};
inline void getAal5HeaderStructure(const unsigned char* aal5Header, struct aal5_header_st* aal5HeaderOut);
/* set eci modem_chipset - kolja */
void set_eci_modem_chipset(char* chipset);
/* set eci modem devie altIface Descriptor infos - kolja
* (retrieves informations related to ep handled by required altIface
* and set it up on eci_device structure) */
inline int gsGetDeviceIfaceInfo(pusb_device_t dev, unsigned short int alt_interface);
inline const char * get_chipset_descr(eci_device_chipset eci_chipset);
#endif