How to port the tty driver from linux3.0 to linux2.6.14

Source: Internet
Author: User
For how to port the tty driver from linux3.0 to linux2.6.14, Linux general technology-Linux programming and kernel information, see the following for details. In the linux-2.6.30 version, tty_flip.h
Extern int tty_buffer_request_room (struct tty_struct * tty, size_t size );
Extern int tty_insert_flip_string_flags (struct tty_struct * tty, const unsigned char * chars, const char * flags, size_t size );
Extern int tty_insert_flip_string_fixed_flag (struct tty_struct * tty, const unsigned char * chars, char flag, size_t size );
Extern int tty_prepare_flip_string (struct tty_struct * tty, unsigned char ** chars, size_t size );
Extern int tty_prepare_flip_string_flags (struct tty_struct * tty, unsigned char ** chars, char ** flags, size_t size );
Void tty_schedule_flip (struct tty_struct * tty );
Static inline int tty_insert_flip_char (struct tty_struct * tty,
Unsigned char ch, char flag)
{
Struct tty_buffer * tb = tty-> buf. tail;
If (tb & tb-> used <tb-> size ){
Tb-> flag_buf_ptr [tb-> used] = flag;
Tb-> char_buf_ptr [tb-> used ++] = ch;
Return 1;
}
Return tty_insert_flip_string_flags (tty, & ch, & flag, 1 );
}

Static inline int tty_insert_flip_string (struct tty_struct * tty, const unsigned char * chars, size_t size)
{
Return tty_insert_flip_string_fixed_flag (tty, chars, TTY_NORMAL, size );
}


Tty_flip.h file in linux-2.6.14 version
# Ifndef _ LINUX_TTY_FLIP_H
# Define _ LINUX_TTY_FLIP_H

# Ifdef INCLUDE_INLINE_FUNCS
# Define _ INLINE _ extern
# Else
# Define _ INLINE _ static _ inline __
# Endif

_ INLINE _ void tty_insert_flip_char (struct tty_struct * tty,
Unsigned char ch, char flag)
{
If (tty-> flip. count <TTY_FLIPBUF_SIZE ){
Tty-> flip. count ++;
* Tty-> flip. flag_buf_ptr ++ = flag;
* Tty-> flip. char_buf_ptr ++ = ch;
}
}

_ INLINE _ void tty_schedule_flip (struct tty_struct * tty)
{
Schedule_delayed_work (& tty-> flip. work, 1 );
}

The current tty driver is ported from the linux-2.6.30 version to the linux-2.6.14 version, which requires the tty_insert_flip_string interface, but this interface calls the following interface
Tty_insert_flip_string_fixed_flag
Tty_buffer_request_room
Tty_buffer_find
These interfaces are not intended to Port tty_insert_flip_string to the kernel of 2.6.14 in 2.6.14. what do you need to do?
Thank you!
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.