tty.c (d6c53c0e9bd0a83f9f9ddbc9fd80141a54d83896) | tty.c (2e124b4a390ca85325fae75764bef92f0547fa25) |
---|---|
1/* 2 * IPWireless 3G PCMCIA Network Driver 3 * 4 * Original code 5 * by Stephen Blackheath <stephen@blacksapphire.com>, 6 * Ben Martel <benm@symmetric.co.nz> 7 * 8 * Copyrighted as follows: --- 146 unchanged lines hidden (view full) --- 155{ 156 ipw_hangup(linux_tty); 157} 158 159/* Take data received from hardware, and send it out the tty */ 160void ipwireless_tty_received(struct ipw_tty *tty, unsigned char *data, 161 unsigned int length) 162{ | 1/* 2 * IPWireless 3G PCMCIA Network Driver 3 * 4 * Original code 5 * by Stephen Blackheath <stephen@blacksapphire.com>, 6 * Ben Martel <benm@symmetric.co.nz> 7 * 8 * Copyrighted as follows: --- 146 unchanged lines hidden (view full) --- 155{ 156 ipw_hangup(linux_tty); 157} 158 159/* Take data received from hardware, and send it out the tty */ 160void ipwireless_tty_received(struct ipw_tty *tty, unsigned char *data, 161 unsigned int length) 162{ |
163 struct tty_struct *linux_tty; | |
164 int work = 0; 165 166 mutex_lock(&tty->ipw_tty_mutex); | 163 int work = 0; 164 165 mutex_lock(&tty->ipw_tty_mutex); |
167 linux_tty = tty->port.tty; 168 if (linux_tty == NULL) { 169 mutex_unlock(&tty->ipw_tty_mutex); 170 return; 171 } | |
172 173 if (!tty->port.count) { 174 mutex_unlock(&tty->ipw_tty_mutex); 175 return; 176 } 177 mutex_unlock(&tty->ipw_tty_mutex); 178 179 work = tty_insert_flip_string(&tty->port, data, length); 180 181 if (work != length) 182 printk(KERN_DEBUG IPWIRELESS_PCCARD_NAME 183 ": %d chars not inserted to flip buffer!\n", 184 length - work); 185 186 /* 187 * This may sleep if ->low_latency is set 188 */ 189 if (work) | 166 167 if (!tty->port.count) { 168 mutex_unlock(&tty->ipw_tty_mutex); 169 return; 170 } 171 mutex_unlock(&tty->ipw_tty_mutex); 172 173 work = tty_insert_flip_string(&tty->port, data, length); 174 175 if (work != length) 176 printk(KERN_DEBUG IPWIRELESS_PCCARD_NAME 177 ": %d chars not inserted to flip buffer!\n", 178 length - work); 179 180 /* 181 * This may sleep if ->low_latency is set 182 */ 183 if (work) |
190 tty_flip_buffer_push(linux_tty); | 184 tty_flip_buffer_push(&tty->port); |
191} 192 193static void ipw_write_packet_sent_callback(void *callback_data, 194 unsigned int packet_length) 195{ 196 struct ipw_tty *tty = callback_data; 197 198 /* --- 460 unchanged lines hidden --- | 185} 186 187static void ipw_write_packet_sent_callback(void *callback_data, 188 unsigned int packet_length) 189{ 190 struct ipw_tty *tty = callback_data; 191 192 /* --- 460 unchanged lines hidden --- |