| Linux - Kernel This forum is for all discussion relating to the Linux kernel. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
10-26-2012, 08:22 AM
|
#1
|
|
LQ Newbie
Registered: Oct 2012
Posts: 2
Rep: 
|
serial 8250 loopback mechanism in driver code,bypassing the hardware layer completely
I want to implement a serial loopback driver code in 8250.c found in /drivers/tty/serial/8250.c as found in linux-3.6.1 kernel. I do not want to use the hardware loopback(i.e by shorting pin 2(tx) and 3(rx) of the standard serial port), instead I want to modify the 8250.c driver such that, the data from user space will travel from the "serial8250_tx_char" function directly to the "serial8250_rx_char" without going to the hardware, i.e I want to receive what is transmitted?
One possible implementation would be to put the transmission circular buffer data into the tty flip buffer, and then push this data up to the tty core so that the user space can receive it? I want to know how to do it in the code. We can search the "rx and tx" functions mentioned above-that is where I am looking, and how will I test this, means by writing on the device file and then immediately receiving the same.
I also have a sample patch, but not sure, whether it will work.
Any help would be appreciated...
Abhijit
|
|
|
|
10-27-2012, 05:54 PM
|
#2
|
|
Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 11,789
|
Quote:
Originally Posted by abhijit.lamsoge
I want to implement a serial loopback driver code in 8250.c found in /drivers/tty/serial/8250.c as found in linux-3.6.1 kernel. I do not want to use the hardware loopback(i.e by shorting pin 2(tx) and 3(rx) of the standard serial port), instead I want to modify the 8250.c driver such that, the data from user space will travel from the "serial8250_tx_char" function directly to the "serial8250_rx_char" without going to the hardware, i.e I want to receive what is transmitted?
One possible implementation would be to put the transmission circular buffer data into the tty flip buffer, and then push this data up to the tty core so that the user space can receive it? I want to know how to do it in the code. We can search the "rx and tx" functions mentioned above-that is where I am looking, and how will I test this, means by writing on the device file and then immediately receiving the same.
|
You can redirect the output to a file, to see if it's writing. Since you're modifying the code to do something like this anyway, this change should be trivial for you.
Quote:
|
I also have a sample patch, but not sure, whether it will work.
|
One good way to know if it will work, is to test it. If you've got a patch, implement it, and see what it does.
|
|
|
|
10-28-2012, 11:53 PM
|
#3
|
|
LQ Newbie
Registered: Oct 2012
Posts: 2
Original Poster
Rep: 
|
TB0ne..thanks, I ll check it and revert.
Thanks.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 06:43 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|