Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > The Linux Kernel
Reload this Page serial low level driver compilation
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

The Linux Kernel Compiling, theory, programming or other discussion about the linux kernel

Reply
 
Thread Tools Display Modes
Old 06-03-2008   #1 (permalink)
archieval
Just Joined!
 
Join Date: Nov 2007
Posts: 2
serial low level driver compilation

Hi,

I am currently developing a low level serial driver to be registered with serial_core.c (in latest 2.6. kernel source), and I have a couple of questions about it.

Should serial_core.c be compiled with my driver? In the Makefile, should there be something like... ?

obj-m := serial_core.o myserial.o

And also, what does the algorithm of this code means (also found in drivers/serial/uart00.c of latest 2.6 kernel source)?

Code:
59 static void uart_tx_chars(struct uart_port *port)
 60 {
 61         struct circ_buf *xmit = &port->info->xmit;
 62         int count;
 63 
 64         if (port->x_char) {
 65                 pr_debug("wrote %2x", port->x_char);
 66                 port->icount.tx++;
 67                 port->x_char = 0;
 68                 return;
 69         }
 70         if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
 71                 tiny_stop_tx(port);
 72                 return;
 73         }
 74 
 75         count = port->fifosize >> 1;
 76         do {
 77                 
 78                 xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
 79                 port->icount.tx++;
 80                 if (uart_circ_empty(xmit))
 81                         break;
 82         } while (--count > 0);
 83 
 84         if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
 85                 uart_write_wakeup(port);
 86 
 87         if (uart_circ_empty(xmit))
 88                 tiny_stop_tx(port);
 89 }
what is the purpose of shifting in "count = port->fifosize >> 1"?

Thanks!
archieval is offline   Reply With Quote
Old 06-04-2008   #2 (permalink)
matt_kleviar
Just Joined!
 
Join Date: May 2008
Posts: 33
can you please tell what does port->fifosize refer to ?
matt_kleviar is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 07:42 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.0.0