u-boot-mkimage-gta01-native: re-add till uboot-utils actually works
[openembedded.git] / packages / linux / linux-ezx-2.6.21 / mux-linux-2.6.20.7-fix.patch
1 Index: linux-2.6.20.7/drivers/char/ts0710.h
2 ===================================================================
3 --- linux-2.6.20.7.orig/drivers/char/ts0710.h   2007-04-24 16:04:23.000000000 +0200
4 +++ linux-2.6.20.7/drivers/char/ts0710.h        2007-04-24 16:04:23.000000000 +0200
5 @@ -45,7 +45,7 @@
6   *  11/18/2002  Modified
7   */
8  
9 -#include <linux/config.h>
10 +//#include <linux/config.h>
11  #include <linux/module.h>
12  
13  #include <linux/errno.h>
14 @@ -58,7 +58,7 @@
15  #include <linux/major.h>
16  #include <linux/mm.h>
17  #include <linux/init.h>
18 -#include <linux/devfs_fs_kernel.h>
19 +//#include <linux/devfs_fs_kernel.h>
20  
21  #include <asm/uaccess.h>
22  #include <asm/system.h>
23 Index: linux-2.6.20.7/drivers/char/ts0710_mux.c
24 ===================================================================
25 --- linux-2.6.20.7.orig/drivers/char/ts0710_mux.c       2007-04-24 16:04:23.000000000 +0200
26 +++ linux-2.6.20.7/drivers/char/ts0710_mux.c    2007-04-24 16:26:58.000000000 +0200
27 @@ -46,7 +46,7 @@
28   *  11/18/2002  Second version
29   *  04/21/2004  Add GPRS PROC
30   */
31 -#include <linux/config.h>
32 +//#include <linux/config.h>
33  #include <linux/module.h>
34  #include <linux/types.h>
35  
36 @@ -70,7 +70,7 @@
37  #include <linux/mm.h>
38  #include <linux/slab.h>
39  #include <linux/init.h>
40 -#include <linux/devfs_fs_kernel.h>
41 +//#include <linux/devfs_fs_kernel.h>
42  //#include <syslog.h>
43  
44  #include <asm/uaccess.h>
45 @@ -268,8 +268,8 @@
46  static struct work_struct post_recv_tqueue;
47  
48  static struct tty_struct *mux_table[NR_MUXS];
49 -static struct termios *mux_termios[NR_MUXS];
50 -static struct termios *mux_termios_locked[NR_MUXS];
51 +static struct ktermios *mux_termios[NR_MUXS];
52 +static struct ktermios *mux_termios_locked[NR_MUXS];
53  static volatile short int mux_tty[NR_MUXS];
54  
55  #ifdef min
56 @@ -1894,11 +1894,14 @@
57                                 if (test_bit(TTY_THROTTLED, &tty->flags)) {
58                                         queue_data = 1;
59                                 } else {
60 +                                       /*
61                                         if (test_bit
62                                             (TTY_DONT_FLIP, &tty->flags)) {
63                                                 queue_data = 1;
64                                                 post_recv = 1;
65 -                                       } else if (recv_info->total) {
66 +                                       } else 
67 +                                       */
68 +                                       if (recv_info->total) {
69                                                 queue_data = 1;
70                                                 post_recv = 1;
71                                         } else if (recv_room < uih_len) {
72 @@ -3149,7 +3152,7 @@
73  
74  /*For BP UART problem End*/
75  
76 -static void receive_worker(void *private_)
77 +static void receive_worker(struct work_struct *private_)
78  {
79         struct tty_struct *tty = COMM_FOR_MUX_TTY;
80         int i, count, tbuf_free, tbuf_read;
81 @@ -3440,7 +3443,7 @@
82         clear_bit(RECV_RUNNING, &mux_recv_flags);
83  }
84  
85 -static void post_recv_worker(void *private_)
86 +static void post_recv_worker(struct work_struct *private_)
87  {
88         ts0710_con *ts0710 = &ts0710_connection;
89         int tty_idx;
90 @@ -3499,11 +3502,14 @@
91                 if (test_bit(TTY_THROTTLED, &tty->flags)) {
92                         add_post_recv_queue(&post_recv_q, recv_info);
93                         continue;
94 -               } else if (test_bit(TTY_DONT_FLIP, &tty->flags)) {
95 +               }
96 +               /*
97 +               else if (test_bit(TTY_DONT_FLIP, &tty->flags)) {
98                         post_recv = 1;
99                         add_post_recv_queue(&post_recv_q, recv_info);
100                         continue;
101                 }
102 +               */
103  
104                 flow_control = 0;
105                 recv_packet2 = recv_info->mux_packet;
106 @@ -3635,7 +3641,7 @@
107         }
108  }
109  
110 -static void send_worker(void *private_)
111 +static void send_worker(struct work_struct *private_)
112  {
113         ts0710_con *ts0710 = &ts0710_connection;
114         __u8 j;
115 @@ -3893,9 +3899,9 @@
116         }
117         post_recv_count_flag = 0;
118  
119 -       INIT_WORK(&send_tqueue, send_worker, NULL);
120 -       INIT_WORK(&receive_tqueue, receive_worker, NULL);
121 -       INIT_WORK(&post_recv_tqueue, post_recv_worker, NULL);
122 +       INIT_WORK(&send_tqueue, send_worker);
123 +       INIT_WORK(&receive_tqueue, receive_worker);
124 +       INIT_WORK(&post_recv_tqueue, post_recv_worker);
125  
126         mux_driver = alloc_tty_driver(NR_MUXS);
127         if (!mux_driver)
128 @@ -3904,12 +3910,12 @@
129         mux_driver->owner = THIS_MODULE;
130         mux_driver->driver_name = "ts0710mux";
131         mux_driver->name = "mux";
132 -       mux_driver->devfs_name = "mux";
133 +       //mux_driver->devfs_name = "mux";
134         mux_driver->major = TS0710MUX_MAJOR;
135         mux_driver->minor_start = TS0710MUX_MINOR_START;
136         mux_driver->type = TTY_DRIVER_TYPE_SERIAL;
137         mux_driver->subtype = SERIAL_TYPE_NORMAL;
138 -       mux_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW;
139 +       mux_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
140  
141         mux_driver->init_termios = tty_std_termios;
142         mux_driver->init_termios.c_iflag = 0;
143 @@ -3917,10 +3923,10 @@
144         mux_driver->init_termios.c_cflag = B38400 | CS8 | CREAD;
145         mux_driver->init_termios.c_lflag = 0;
146  
147 -//     mux_driver.ttys = mux_table;
148 +       //mux_driver.ttys = mux_table;
149         mux_driver->termios = mux_termios;
150         mux_driver->termios_locked = mux_termios_locked;
151 -//  mux_driver.driver_state = mux_state;
152 +       //mux_driver.driver_state = mux_state;
153         mux_driver->other = NULL;
154  
155         mux_driver->open = mux_open;
156 Index: linux-2.6.20.7/drivers/char/ts0710_mux_usb.c
157 ===================================================================
158 --- linux-2.6.20.7.orig/drivers/char/ts0710_mux_usb.c   2007-04-24 16:27:30.000000000 +0200
159 +++ linux-2.6.20.7/drivers/char/ts0710_mux_usb.c        2007-04-24 16:31:51.000000000 +0200
160 @@ -86,8 +86,8 @@
161  struct tty_struct *usb_for_mux_tty = NULL;
162  void (*usb_mux_dispatcher)(struct tty_struct *tty) = NULL;
163  void (*usb_mux_sender)(void) = NULL;
164 -void (*ipcusb_ap_to_bp)(unsigned char*, int) = NULL;
165 -void (*ipcusb_bp_to_ap)(unsigned char*, int) = NULL;
166 +void (*ipcusb_ap_to_bp)(const unsigned char*, int) = NULL;
167 +void (*ipcusb_bp_to_ap)(const unsigned char*, int) = NULL;
168  EXPORT_SYMBOL(usb_for_mux_driver);
169  EXPORT_SYMBOL(usb_for_mux_tty);
170  EXPORT_SYMBOL(usb_mux_dispatcher);
171 @@ -222,7 +222,7 @@
172                 inbuf = list_entry(ptr, buf_list_t, list);
173                 src_count = inbuf->size;
174                 if (dst_count >= src_count) {
175 -                       memcpy(buf, inbuf->body, src_count);
176 +                       memcpy((char *)buf, inbuf->body, src_count);
177                         ret = src_count;
178                         list_del(ptr);
179                         kfree(inbuf->body);
180 @@ -282,7 +282,7 @@
181         spin_unlock(&bvd_ipc->in_buf_lock);
182  }
183  
184 -static void usb_ipc_read_bulk(struct urb *urb, struct pt_regs *regs)
185 +static void usb_ipc_read_bulk(struct urb *urb)
186  {
187         buf_list_t *inbuf;
188         int count = urb->actual_length;
189 @@ -319,7 +319,7 @@
190         bvd_dbg("usb_ipc_read_bulk: completed!!!");
191  }
192  
193 -static void usb_ipc_write_bulk(struct urb *urb, struct pt_regs *regs)
194 +static void usb_ipc_write_bulk(struct urb *urb)
195  {
196         callback_times++;
197         bvd_ipc->write_finished_flag = 1;
198 @@ -437,7 +437,7 @@
199                         /*send IN token*/
200                         bvd_ipc->readurb_mux.actual_length = 0;
201                         bvd_ipc->readurb_mux.dev = bvd_ipc->ipc_dev;
202 -                       if (ret = usb_submit_urb(&bvd_ipc->readurb_mux, GFP_ATOMIC))
203 +                       if ( (ret = usb_submit_urb(&bvd_ipc->readurb_mux, GFP_ATOMIC)) )
204                                 printk("ipcusb_xmit_data: usb_submit_urb(read mux bulk)"
205                                         "failed! status=%d\n", ret);
206                         bvd_dbg("ipcusb_xmit_data: Send a IN token successfully!");
207 @@ -447,7 +447,7 @@
208                 bvd_ipc->write_finished_flag = 0;
209                 //printk("%s: clear write_finished_flag:%d\n", __FUNCTION__, bvd_ipc->write_finished_flag);
210                 bvd_ipc->writeurb_mux.dev = bvd_ipc->ipc_dev;
211 -               if (result = usb_submit_urb(&bvd_ipc->writeurb_mux, GFP_ATOMIC))
212 +               if ( (result = usb_submit_urb(&bvd_ipc->writeurb_mux, GFP_ATOMIC)) )
213                         warn("ipcusb_xmit_data: funky result! result=%d\n", result);
214  
215                 bvd_dbg("ipcusb_xmit_data: usb_submit_urb finished! result:%d", result);
216 @@ -556,7 +556,7 @@
217         struct usb_config_descriptor *ipccfg;
218         struct usb_interface_descriptor *interface;
219         struct usb_endpoint_descriptor *endpoint;
220 -       int ep_cnt, readsize, writesize;
221 +       int ep_cnt, readsize=0, writesize=0;
222         char have_bulk_in_mux, have_bulk_out_mux;
223  
224         bvd_dbg("usb_ipc_probe: vendor id 0x%x, device id 0x%x",