public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
* Adding new driver - looking for suggestions
@ 2007-07-09 17:37 Chris Doré
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Doré @ 2007-07-09 17:37 UTC (permalink / raw)
  To: linux-serial


Hi all,

We would like to add support for our (Connect Tech) multi-port serial
adapters to the kernel.  Currently there is some limited support for some of
our cards already in 8250_pci, however we have some specific functionality
on our cards that we would like to add.  We already have a patch for 8250
(and friends) to add the new functionality, however I'm starting to think
that it may be better to create a separate driver, based on 8250/8250_pci,
for our specific boards/needs only.

I'm looking for any suggestions on what we should possibly do.

A current patch can be found here:
ftp://ftp.connecttech.com/pub/misc/bhbltnptm-2.6.21.patch


Thanks, Chris


^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: Adding new driver - looking for suggestions
@ 2007-07-10 21:35 Frantisek Rysanek
  2007-07-11 14:20 ` Chris Doré
  0 siblings, 1 reply; 3+ messages in thread
From: Frantisek Rysanek @ 2007-07-10 21:35 UTC (permalink / raw)
  To: linux-serial

[-- Attachment #1: Mail message body --]
[-- Type: text/plain, Size: 1300 bytes --]

On 9 Jul 2007 at 19:37, Chris Doré wrote:
>
> A current patch can be found here:
> ftp://ftp.connecttech.com/pub/misc/bhbltnptm-2.6.21.patch
>
I'm just another by-stander, I don't have any vote, let me just
present my opinion...


+++ linux-2.6.21-cti/include/linux/serial_core.h2007-07-06
03:44:52.000000000 - 0400
@@ -274,6 +274,9 @@ struct uart_port {
unsigned
intline;/* port index */
unsigned longmapbase;/* for
ioremap */
struct
device*dev;/* parent device
*/
+intlmode;
+int(*lmode_fn)(struct
uart_port *port, int ioctl, unsigned int *value);
+int(*ptm_fn)(struct uart_port
*port, int ioctl, unsigned int *value);


As far as patching the vanilla kernel is concerned:
You seem to suggest an addition of rather proprietary data (members)
to the neatly generic struct uart_port. I'd suggest adding something
like

void* priv; // device-specific driver private data

to the generic struct uart_port of the vanilla kernel, which you
could then use to hook your own private data struct, regardless of
whether the rest of your driver lives in 8250_pci.c or in a stand-
alone module. This is the way it's done in a number of other generic
device structs (or maybe the more modern way is to use a nested
struct with "parent struct decoding").

Frank Rysanek


[-- Attachment #2: Mail message body --]
[-- Type: Application/Octet-stream, Size: 6262 bytes --]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html  xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<title></title>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<meta http-equiv="Content-Style-Type" content="text/css"/>
</head>
<body>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
On 9 Jul 2007 at 19:37, Chris Dor&#233; wrote:</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000">
<span style=" font-size:10pt">
&gt; </span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000">
<span style=" font-size:10pt">
&gt; A current patch can be found here:</span></font>
<font face="Arial">
<span style=" font-size:10pt">
&#160;</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000">
<span style=" font-size:10pt">
&gt; ftp://ftp.connecttech.com/pub/misc/bhbltnptm-2.6.21.patch</span></font>
<font face="Arial">
<span style=" font-size:10pt">
&#160;</span></font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
&gt; </span></font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
I'm just another by-stander, I don't have any vote, let me just present my opinion... </span></font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
+++ linux-2.6.21-cti/include/linux/serial_core.h&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;2007-07-06 03:44:52.000000000 - 
0400 </span></font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
@@ -274,6 +274,9 @@ struct uart_port { </span></font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;unsigned int&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;line;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;/* 
port index */ </span></font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;unsigned long&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mapbase;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;/* for ioremap */ </span></font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;struct device&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;*dev;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;/* parent 
device */ </span></font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
+&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;int&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;lmode; </span></font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
+&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;int&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;(*lmode_fn)(struct uart_port *port, int ioctl, unsigned int *value); </span></font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
+&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;int&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;(*ptm_fn)(struct uart_port *port, int ioctl, unsigned int *value); </span></font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
As far as patching the vanilla kernel is concerned: </span></font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
You seem to suggest an addition of rather proprietary data (members) to the neatly generic </span></font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
struct uart_port. I'd suggest adding something like </span></font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;void* priv;&#160; // device-specific driver private data </span></font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
to the generic struct uart_port of the vanilla kernel, which you could then use to hook your 
own private data struct, regardless of whether the rest of your driver lives in 8250_pci.c or in 
a stand-alone module. This is the way it's done in a number of other generic device structs. </span></font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial">
<span style=" font-size:10pt">
Frank Rysanek </span></font>
</div>
<div align="left">
&nbsp;</div>
</body>
</html>

Attachments:
  C:\DOCUME~1\Fanouch\LOCALS~1\Temp\WPM$252E.PM$

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-07-11 14:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-09 17:37 Adding new driver - looking for suggestions Chris Doré
  -- strict thread matches above, loose matches on Subject: below --
2007-07-10 21:35 Frantisek Rysanek
2007-07-11 14:20 ` Chris Doré

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox