1/*
2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License as
4 * published by the Free Software Foundation; either version 2 of
5 * the License, or (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
15 * MA 02111-1307 USA
16 */
17
18#ifndef __WLAN_COMMON__
19#define __WLAN_COMMON__
20
21
22/****************************************/
23/*              FOR LINUX               */
24/****************************************/
25#ifndef  WIN32
26#define ULONG   unsigned long
27#define DWORD   unsigned long
28#define BYTE    char
29#define PBYTE   char *
30#define WORD    unsigned short
31#define INT     int
32#endif //#ifndef  WIN32
33
34
35//Define Error Code
36
37/************ Use Internally in Program************/
38#define	ERR_SUCCESS				0
39#define	ERR_SOCKET				-1
40#define	ERR_CONNFAILED			-2
41#define	ERR_SERVERBUSY			-3
42/************ Use Internally in Program************/
43
44#define	ERR_BASE				100
45#define	ERR_SERVER_OCCUPIED		ERR_BASE + 1
46#define	ERR_SERVER_LPT_FAIL		ERR_BASE + 2
47#define	ERR_SERVER_LPT_INTR		ERR_BASE + 3
48#define	ERR_SERVER_LPT_BUSY		ERR_BASE + 4
49#define	ERR_SERVER_LPT_OUTP		ERR_BASE + 5
50#define	ERR_SERVER_LPT_OFFL		ERR_BASE + 6
51
52//Use For Network Communication Protocol
53
54//Packet Type Section
55#define NET_SERVICE_ID_BASE	10
56#define NET_SERVICE_ID_LPT_EMU	NET_SERVICE_ID_BASE + 1
57
58
59//Packet Type Section
60#define NET_PACKET_TYPE_BASE	20
61#define NET_PACKET_TYPE_CMD	NET_PACKET_TYPE_BASE + 1
62#define NET_PACKET_TYPE_RES	NET_PACKET_TYPE_BASE + 2
63#define NET_PACKET_TYPE_DATA	NET_PACKET_TYPE_BASE + 3
64
65
66//Command ID Section
67#define NET_CMD_ID_BASE		30
68#define NET_CMD_ID_OPEN		NET_CMD_ID_BASE + 1
69#define NET_CMD_ID_CLOSE	NET_CMD_ID_BASE + 2
70#define NET_CMD_ID_DATA_RES	NET_CMD_ID_BASE + 3
71#define NET_CMD_ID_READ		NET_CMD_ID_BASE + 4
72
73
74//Command Packet Header Structure
75
76typedef struct lptCmdPKT
77{
78	BYTE		ServiceID;
79	BYTE		PacketType;
80	BYTE		CommandID;
81	BYTE		ParaLength;
82} LPT_CMD_PKT_HDR;
83
84
85//Response Packet Header Structure
86
87typedef struct lptResPKT
88{
89	BYTE		ServiceID;
90	BYTE		PacketType;
91	BYTE		CommandID;
92	BYTE		ResLength;
93} LPT_RES_PKT_HDR;
94
95
96
97
98//Data Packet Header Structure
99
100typedef struct lptDataPKT
101{
102	BYTE		ServiceID;
103	BYTE		PacketType;
104	WORD		DataLength;
105} LPT_DATA_PKT_HDR;
106
107typedef struct paraRes
108{
109	INT			msgid;
110}ParaRes;
111
112#endif
113
114