LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 04-17-2012, 10:48 PM   #1
unifoxz
LQ Newbie
 
Registered: Dec 2011
Posts: 19

Rep: Reputation: Disabled
Question Enable "add port" functionality to char driver


I am writing a character device driver, and I would like to know how to extend the "add port" functionality to the device in the driver.

Any suggestions are welcomed.
Thank you very much.
 
Old 04-18-2012, 01:53 AM   #2
Markus Franke
LQ Newbie
 
Registered: Nov 2010
Distribution: Ubuntu 11.04
Posts: 13

Rep: Reputation: 2
What do you mean by "add port" functionality?

So long,
Markus
 
Old 04-18-2012, 06:00 AM   #3
unifoxz
LQ Newbie
 
Registered: Dec 2011
Posts: 19

Original Poster
Rep: Reputation: Disabled
That the device driver can support multiple ports as uart driver does.
 
Old 04-18-2012, 06:02 AM   #4
unifoxz
LQ Newbie
 
Registered: Dec 2011
Posts: 19

Original Poster
Rep: Reputation: Disabled
In uart, it is implemented by uart_add_one_port().
I am confused about the concept behind this kind of "add port" function.
 
1 members found this post helpful.
Old 04-19-2012, 02:53 AM   #5
Markus Franke
LQ Newbie
 
Registered: Nov 2010
Distribution: Ubuntu 11.04
Posts: 13

Rep: Reputation: 2
Well, as far as I can see from Linux kernel source this "add port"-functionality is a special feature of the serial core within the linux kernel. If you want to have similar behaviour for a custom driver which does not interact with the serial core then you would have to implement this by yourself.

The uart_add_one_port() function is used by platform specific UART drivers like [1] in order to register the different UART's available on the platform. Each UART is represented by an own set of hardware registers and this function publishes these information to the kernel (serial core).

You could also have a look at the linux kernel documentation in [2].

Hope this helps a bit.

[1] <LINUX>/drivers/tty/serial/atmel_serial.c
[2] <LINUX>/Documentation/serial/driver
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ - "snprintf" inside "for" doesn't work as expected. (int to char*) Repgahroll Programming 14 08-31-2010 08:27 AM
ssh / sshd config: how enable "tunneling with port forwarding on the network"? frenchn00b Linux - Server 1 08-30-2009 01:57 PM
Problems with "error: invalid conversion from `const char*' to `char*' " dave.f.one Linux - Newbie 10 11-19-2008 10:01 AM
"hub 1-2:1.0 Cannot enable port 2. Maybe the USB cable is bad?" General Linux - Hardware 1 04-21-2007 05:06 PM
user-mode Linux char device driver with "unresolved symbol __generic_copy_to_user" dlobron Linux - General 0 11-14-2004 09:41 AM


All times are GMT -5. The time now is 07:21 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration