diff options
author | Jiri Slaby <jslaby@suse.cz> | 2012-04-02 07:53:58 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-09 14:16:55 -0400 |
commit | 82e46b31908244678a6e7404c4204dd3f6fea9f0 (patch) | |
tree | 458c8dbbb7f1aabc714eed83b6638d1fd3363c73 | |
parent | ba43294d51ac6491e60c2fc33a974a9a1002dfed (diff) |
TTY: isdn, use xmit_buf from tty_port
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Karsten Keil <isdn@linux-pingi.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/isdn/i4l/isdn_tty.c | 16 | ||||
-rw-r--r-- | include/linux/isdn.h | 1 |
2 files changed, 9 insertions, 8 deletions
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index 869885620c94..dfb83e68bd86 100644 --- a/drivers/isdn/i4l/isdn_tty.c +++ b/drivers/isdn/i4l/isdn_tty.c | |||
@@ -333,7 +333,7 @@ isdn_tty_countDLE(unsigned char *buf, int len) | |||
333 | static int | 333 | static int |
334 | isdn_tty_handleDLEdown(modem_info *info, atemu *m, int len) | 334 | isdn_tty_handleDLEdown(modem_info *info, atemu *m, int len) |
335 | { | 335 | { |
336 | unsigned char *p = &info->xmit_buf[info->xmit_count]; | 336 | unsigned char *p = &info->port.xmit_buf[info->xmit_count]; |
337 | int count = 0; | 337 | int count = 0; |
338 | 338 | ||
339 | while (len > 0) { | 339 | while (len > 0) { |
@@ -477,7 +477,7 @@ isdn_tty_senddown(modem_info *info) | |||
477 | return; | 477 | return; |
478 | } | 478 | } |
479 | skb_reserve(skb, skb_res); | 479 | skb_reserve(skb, skb_res); |
480 | memcpy(skb_put(skb, buflen), info->xmit_buf, buflen); | 480 | memcpy(skb_put(skb, buflen), info->port.xmit_buf, buflen); |
481 | info->xmit_count = 0; | 481 | info->xmit_count = 0; |
482 | #ifdef CONFIG_ISDN_AUDIO | 482 | #ifdef CONFIG_ISDN_AUDIO |
483 | if (info->vonline & 2) { | 483 | if (info->vonline & 2) { |
@@ -1152,7 +1152,7 @@ isdn_tty_write(struct tty_struct *tty, const u_char *buf, int count) | |||
1152 | isdn_tty_check_esc(buf, m->mdmreg[REG_ESC], c, | 1152 | isdn_tty_check_esc(buf, m->mdmreg[REG_ESC], c, |
1153 | &(m->pluscount), | 1153 | &(m->pluscount), |
1154 | &(m->lastplus)); | 1154 | &(m->lastplus)); |
1155 | memcpy(&(info->xmit_buf[info->xmit_count]), buf, c); | 1155 | memcpy(&info->port.xmit_buf[info->xmit_count], buf, c); |
1156 | #ifdef CONFIG_ISDN_AUDIO | 1156 | #ifdef CONFIG_ISDN_AUDIO |
1157 | if (info->vonline) { | 1157 | if (info->vonline) { |
1158 | int cc = isdn_tty_handleDLEdown(info, m, c); | 1158 | int cc = isdn_tty_handleDLEdown(info, m, c); |
@@ -1906,13 +1906,15 @@ isdn_tty_modem_init(void) | |||
1906 | #ifdef CONFIG_ISDN_AUDIO | 1906 | #ifdef CONFIG_ISDN_AUDIO |
1907 | skb_queue_head_init(&info->dtmf_queue); | 1907 | skb_queue_head_init(&info->dtmf_queue); |
1908 | #endif | 1908 | #endif |
1909 | if (!(info->xmit_buf = kmalloc(ISDN_SERIAL_XMIT_MAX + 5, GFP_KERNEL))) { | 1909 | info->port.xmit_buf = kmalloc(ISDN_SERIAL_XMIT_MAX + 5, |
1910 | GFP_KERNEL); | ||
1911 | if (!info->port.xmit_buf) { | ||
1910 | printk(KERN_ERR "Could not allocate modem xmit-buffer\n"); | 1912 | printk(KERN_ERR "Could not allocate modem xmit-buffer\n"); |
1911 | retval = -ENOMEM; | 1913 | retval = -ENOMEM; |
1912 | goto err_unregister; | 1914 | goto err_unregister; |
1913 | } | 1915 | } |
1914 | /* Make room for T.70 header */ | 1916 | /* Make room for T.70 header */ |
1915 | info->xmit_buf += 4; | 1917 | info->port.xmit_buf += 4; |
1916 | } | 1918 | } |
1917 | return 0; | 1919 | return 0; |
1918 | err_unregister: | 1920 | err_unregister: |
@@ -1921,7 +1923,7 @@ err_unregister: | |||
1921 | #ifdef CONFIG_ISDN_TTY_FAX | 1923 | #ifdef CONFIG_ISDN_TTY_FAX |
1922 | kfree(info->fax); | 1924 | kfree(info->fax); |
1923 | #endif | 1925 | #endif |
1924 | kfree(info->xmit_buf - 4); | 1926 | kfree(info->port.xmit_buf - 4); |
1925 | } | 1927 | } |
1926 | tty_unregister_driver(m->tty_modem); | 1928 | tty_unregister_driver(m->tty_modem); |
1927 | err: | 1929 | err: |
@@ -1942,7 +1944,7 @@ isdn_tty_exit(void) | |||
1942 | #ifdef CONFIG_ISDN_TTY_FAX | 1944 | #ifdef CONFIG_ISDN_TTY_FAX |
1943 | kfree(info->fax); | 1945 | kfree(info->fax); |
1944 | #endif | 1946 | #endif |
1945 | kfree(info->xmit_buf - 4); | 1947 | kfree(info->port.xmit_buf - 4); |
1946 | } | 1948 | } |
1947 | tty_unregister_driver(dev->mdm.tty_modem); | 1949 | tty_unregister_driver(dev->mdm.tty_modem); |
1948 | put_tty_driver(dev->mdm.tty_modem); | 1950 | put_tty_driver(dev->mdm.tty_modem); |
diff --git a/include/linux/isdn.h b/include/linux/isdn.h index 95883ac5a2f4..215c41602af8 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h | |||
@@ -461,7 +461,6 @@ typedef struct modem_info { | |||
461 | int send_outstanding;/* # of outstanding send-requests */ | 461 | int send_outstanding;/* # of outstanding send-requests */ |
462 | int xmit_size; /* max. # of chars in xmit_buf */ | 462 | int xmit_size; /* max. # of chars in xmit_buf */ |
463 | int xmit_count; /* # of chars in xmit_buf */ | 463 | int xmit_count; /* # of chars in xmit_buf */ |
464 | unsigned char *xmit_buf; /* transmit buffer */ | ||
465 | struct sk_buff_head xmit_queue; /* transmit queue */ | 464 | struct sk_buff_head xmit_queue; /* transmit queue */ |
466 | atomic_t xmit_lock; /* Semaphore for isdn_tty_write */ | 465 | atomic_t xmit_lock; /* Semaphore for isdn_tty_write */ |
467 | #ifdef CONFIG_ISDN_AUDIO | 466 | #ifdef CONFIG_ISDN_AUDIO |