Re: Adding new driver - looking for suggestions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: WPM$0431.PM$
Description: Mail message body


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux