summaryrefslogtreecommitdiff
path: root/packages/linux/linux-ezx-2.6.21/mux-linux-2.6.20.7-fix.patch
blob: cab7490118a0fa23242a960a554258020f2a3fbe (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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
Index: linux-2.6.20.7/drivers/char/ts0710.h
===================================================================
--- linux-2.6.20.7.orig/drivers/char/ts0710.h	2007-04-24 16:04:23.000000000 +0200
+++ linux-2.6.20.7/drivers/char/ts0710.h	2007-04-24 16:04:23.000000000 +0200
@@ -45,7 +45,7 @@
  *  11/18/2002  Modified
  */
 
-#include <linux/config.h>
+//#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/errno.h>
@@ -58,7 +58,7 @@
 #include <linux/major.h>
 #include <linux/mm.h>
 #include <linux/init.h>
-#include <linux/devfs_fs_kernel.h>
+//#include <linux/devfs_fs_kernel.h>
 
 #include <asm/uaccess.h>
 #include <asm/system.h>
Index: linux-2.6.20.7/drivers/char/ts0710_mux.c
===================================================================
--- linux-2.6.20.7.orig/drivers/char/ts0710_mux.c	2007-04-24 16:04:23.000000000 +0200
+++ linux-2.6.20.7/drivers/char/ts0710_mux.c	2007-04-24 16:26:58.000000000 +0200
@@ -46,7 +46,7 @@
  *  11/18/2002  Second version
  *  04/21/2004  Add GPRS PROC
  */
-#include <linux/config.h>
+//#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 
@@ -70,7 +70,7 @@
 #include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/init.h>
-#include <linux/devfs_fs_kernel.h>
+//#include <linux/devfs_fs_kernel.h>
 //#include <syslog.h>
 
 #include <asm/uaccess.h>
@@ -268,8 +268,8 @@
 static struct work_struct post_recv_tqueue;
 
 static struct tty_struct *mux_table[NR_MUXS];
-static struct termios *mux_termios[NR_MUXS];
-static struct termios *mux_termios_locked[NR_MUXS];
+static struct ktermios *mux_termios[NR_MUXS];
+static struct ktermios *mux_termios_locked[NR_MUXS];
 static volatile short int mux_tty[NR_MUXS];
 
 #ifdef min
@@ -1894,11 +1894,14 @@
 				if (test_bit(TTY_THROTTLED, &tty->flags)) {
 					queue_data = 1;
 				} else {
+					/*
 					if (test_bit
 					    (TTY_DONT_FLIP, &tty->flags)) {
 						queue_data = 1;
 						post_recv = 1;
-					} else if (recv_info->total) {
+					} else 
+					*/
+					if (recv_info->total) {
 						queue_data = 1;
 						post_recv = 1;
 					} else if (recv_room < uih_len) {
@@ -3149,7 +3152,7 @@
 
 /*For BP UART problem End*/
 
-static void receive_worker(void *private_)
+static void receive_worker(struct work_struct *private_)
 {
 	struct tty_struct *tty = COMM_FOR_MUX_TTY;
 	int i, count, tbuf_free, tbuf_read;
@@ -3440,7 +3443,7 @@
 	clear_bit(RECV_RUNNING, &mux_recv_flags);
 }
 
-static void post_recv_worker(void *private_)
+static void post_recv_worker(struct work_struct *private_)
 {
 	ts0710_con *ts0710 = &ts0710_connection;
 	int tty_idx;
@@ -3499,11 +3502,14 @@
 		if (test_bit(TTY_THROTTLED, &tty->flags)) {
 			add_post_recv_queue(&post_recv_q, recv_info);
 			continue;
-		} else if (test_bit(TTY_DONT_FLIP, &tty->flags)) {
+		}
+		/*
+		else if (test_bit(TTY_DONT_FLIP, &tty->flags)) {
 			post_recv = 1;
 			add_post_recv_queue(&post_recv_q, recv_info);
 			continue;
 		}
+		*/
 
 		flow_control = 0;
 		recv_packet2 = recv_info->mux_packet;
@@ -3635,7 +3641,7 @@
 	}
 }
 
-static void send_worker(void *private_)
+static void send_worker(struct work_struct *private_)
 {
 	ts0710_con *ts0710 = &ts0710_connection;
 	__u8 j;
@@ -3893,9 +3899,9 @@
 	}
 	post_recv_count_flag = 0;
 
-	INIT_WORK(&send_tqueue, send_worker, NULL);
-	INIT_WORK(&receive_tqueue, receive_worker, NULL);
-	INIT_WORK(&post_recv_tqueue, post_recv_worker, NULL);
+	INIT_WORK(&send_tqueue, send_worker);
+	INIT_WORK(&receive_tqueue, receive_worker);
+	INIT_WORK(&post_recv_tqueue, post_recv_worker);
 
 	mux_driver = alloc_tty_driver(NR_MUXS);
 	if (!mux_driver)
@@ -3904,12 +3910,12 @@
 	mux_driver->owner = THIS_MODULE;
 	mux_driver->driver_name = "ts0710mux";
 	mux_driver->name = "mux";
-	mux_driver->devfs_name = "mux";
+	//mux_driver->devfs_name = "mux";
 	mux_driver->major = TS0710MUX_MAJOR;
 	mux_driver->minor_start = TS0710MUX_MINOR_START;
 	mux_driver->type = TTY_DRIVER_TYPE_SERIAL;
 	mux_driver->subtype = SERIAL_TYPE_NORMAL;
-	mux_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW;
+	mux_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
 
 	mux_driver->init_termios = tty_std_termios;
 	mux_driver->init_termios.c_iflag = 0;
@@ -3917,10 +3923,10 @@
 	mux_driver->init_termios.c_cflag = B38400 | CS8 | CREAD;
 	mux_driver->init_termios.c_lflag = 0;
 
-//	mux_driver.ttys = mux_table;
+	//mux_driver.ttys = mux_table;
 	mux_driver->termios = mux_termios;
 	mux_driver->termios_locked = mux_termios_locked;
-//  mux_driver.driver_state = mux_state;
+	//mux_driver.driver_state = mux_state;
 	mux_driver->other = NULL;
 
 	mux_driver->open = mux_open;
Index: linux-2.6.20.7/drivers/char/ts0710_mux_usb.c
===================================================================
--- linux-2.6.20.7.orig/drivers/char/ts0710_mux_usb.c	2007-04-24 16:27:30.000000000 +0200
+++ linux-2.6.20.7/drivers/char/ts0710_mux_usb.c	2007-04-24 16:31:51.000000000 +0200
@@ -86,8 +86,8 @@
 struct tty_struct *usb_for_mux_tty = NULL;
 void (*usb_mux_dispatcher)(struct tty_struct *tty) = NULL;
 void (*usb_mux_sender)(void) = NULL;
-void (*ipcusb_ap_to_bp)(unsigned char*, int) = NULL;
-void (*ipcusb_bp_to_ap)(unsigned char*, int) = NULL;
+void (*ipcusb_ap_to_bp)(const unsigned char*, int) = NULL;
+void (*ipcusb_bp_to_ap)(const unsigned char*, int) = NULL;
 EXPORT_SYMBOL(usb_for_mux_driver);
 EXPORT_SYMBOL(usb_for_mux_tty);
 EXPORT_SYMBOL(usb_mux_dispatcher);
@@ -222,7 +222,7 @@
 		inbuf = list_entry(ptr, buf_list_t, list);
 		src_count = inbuf->size;
 		if (dst_count >= src_count) {
-			memcpy(buf, inbuf->body, src_count);
+			memcpy((char *)buf, inbuf->body, src_count);
 			ret = src_count;
 			list_del(ptr);
 			kfree(inbuf->body);
@@ -282,7 +282,7 @@
 	spin_unlock(&bvd_ipc->in_buf_lock);
 }
 
-static void usb_ipc_read_bulk(struct urb *urb, struct pt_regs *regs)
+static void usb_ipc_read_bulk(struct urb *urb)
 {
 	buf_list_t *inbuf;
 	int count = urb->actual_length;
@@ -319,7 +319,7 @@
 	bvd_dbg("usb_ipc_read_bulk: completed!!!");
 }
 
-static void usb_ipc_write_bulk(struct urb *urb, struct pt_regs *regs)
+static void usb_ipc_write_bulk(struct urb *urb)
 {
 	callback_times++;
 	bvd_ipc->write_finished_flag = 1;
@@ -437,7 +437,7 @@
 			/*send IN token*/
 			bvd_ipc->readurb_mux.actual_length = 0;
 			bvd_ipc->readurb_mux.dev = bvd_ipc->ipc_dev;
-			if (ret = usb_submit_urb(&bvd_ipc->readurb_mux, GFP_ATOMIC))
+			if ( (ret = usb_submit_urb(&bvd_ipc->readurb_mux, GFP_ATOMIC)) )
 				printk("ipcusb_xmit_data: usb_submit_urb(read mux bulk)"
 					"failed! status=%d\n", ret);
 			bvd_dbg("ipcusb_xmit_data: Send a IN token successfully!");
@@ -447,7 +447,7 @@
 		bvd_ipc->write_finished_flag = 0;
 		//printk("%s: clear write_finished_flag:%d\n", __FUNCTION__, bvd_ipc->write_finished_flag);
 		bvd_ipc->writeurb_mux.dev = bvd_ipc->ipc_dev;
-		if (result = usb_submit_urb(&bvd_ipc->writeurb_mux, GFP_ATOMIC))
+		if ( (result = usb_submit_urb(&bvd_ipc->writeurb_mux, GFP_ATOMIC)) )
 			warn("ipcusb_xmit_data: funky result! result=%d\n", result);
 
 		bvd_dbg("ipcusb_xmit_data: usb_submit_urb finished! result:%d", result);
@@ -556,7 +556,7 @@
 	struct usb_config_descriptor *ipccfg;
 	struct usb_interface_descriptor *interface;
 	struct usb_endpoint_descriptor *endpoint;
-	int ep_cnt, readsize, writesize;
+	int ep_cnt, readsize=0, writesize=0;
 	char have_bulk_in_mux, have_bulk_out_mux;
 
 	bvd_dbg("usb_ipc_probe: vendor id 0x%x, device id 0x%x",