LWN: Comments on "Porting device drivers to the 2.6 kernel" https://lwn.net/Articles/22469/ This is a special feed containing comments posted to the individual LWN article titled "Porting device drivers to the 2.6 kernel". en-us Mon, 20 Oct 2025 18:06:21 +0000 Mon, 20 Oct 2025 18:06:21 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Porting device drivers to the 2.6 kernel https://lwn.net/Articles/822432/ https://lwn.net/Articles/822432/ 卡卡罗特 <div class="FormattedComment"> Marking for myself.<br> </div> Mon, 08 Jun 2020 06:26:08 +0000 Update to 2.6.38 https://lwn.net/Articles/425585/ https://lwn.net/Articles/425585/ coolaj86 <div class="FormattedComment"> I'm really really interested in seeing the most up-to-date examples. I'm sure a lot has changed since 2003.<br> <p> I could swing a few subscribers for that privilege. Probably not enough to pay for the cost of time, but a few nonetheless.<br> </div> Sun, 30 Jan 2011 17:37:48 +0000 char device drivers on the 2.6 kernel https://lwn.net/Articles/239393/ https://lwn.net/Articles/239393/ soorejp I got these warnings:<br> <p> include/linux/cdev.h:24: warning: ‘struct inode’ declared inside parameter list<br> include/linux/cdev.h:24: warning: its scope is only this definition or declaration, which is probably not what you want<br> <p> I changed the order of header file definition from:<br> #include &lt;linux/cdev.h&gt;<br> #include &lt;linux/fs.h&gt;<br> to<br> #include &lt;linux/fs.h&gt;<br> #include &lt;linux/cdev.h&gt;<br> and the error gone<br> Fri, 22 Jun 2007 11:54:57 +0000 char device drivers on the 2.6 kernel https://lwn.net/Articles/236509/ https://lwn.net/Articles/236509/ hy71 i am facing the same problem...<br> could anyone give some suggestion?<br> <p> thanks a lot!<br> <p> Fri, 01 Jun 2007 08:09:46 +0000 char device drivers on the 2.6 kernel https://lwn.net/Articles/231430/ https://lwn.net/Articles/231430/ psh2001 Hi,<br> <p> Any one has any solutions for this ?<br> even i am facing the same issue ...<br> <p> <p> Thanks,<br> Shiv<br> Mon, 23 Apr 2007 04:15:58 +0000 Porting device drivers to the 2.6 kernel https://lwn.net/Articles/182364/ https://lwn.net/Articles/182364/ vonbrand <p> Some random comments... <ul> <li> Have you thought of updating the articles (perhaps letting others do the (re)writing)? Some have comments indicating that updates are in order. <li> What about a cleanup of the comments? Most ones I see here aren't really about the subject matter, and are definitely useless for "longer term reference"... </ul> <p> Many thanks! Wed, 03 May 2006 17:37:15 +0000 Porting device drivers to the 2.6 kernel https://lwn.net/Articles/175635/ https://lwn.net/Articles/175635/ vikramkg82 hi<br> <p> i am new to device driver can any body tell me how to access the device file...exactly i need to access the harddisk inforamation at block level..or else can u tell where i can get the information about this plz <br> Wed, 15 Mar 2006 10:29:07 +0000 Porting device drivers to the 2.6 kernel https://lwn.net/Articles/175494/ https://lwn.net/Articles/175494/ Pype.Clicker it looks like the "Big Kernel Lock" headers have been moved from &lt;asm/smplock.h&gt; to &lt;linux/smp_lock.h&gt; between 2.4 and 2.6 ... patching the #include directive did it for me, i guess it will do for you aswell.<br> Tue, 14 Mar 2006 10:43:15 +0000 Porting device drivers to the 2.6 kernel https://lwn.net/Articles/173220/ https://lwn.net/Articles/173220/ agllno Hi all,<br> I want a small information about interruptible_sleep_on .I want it to make compatible for kernel version 2.6 from 2.2.So What modification i have to do or any altenatives are there. Please reply and give some details<br> Thanks in advance<br> Agnello<br> Thu, 23 Feb 2006 15:05:11 +0000 Porting device drivers to the 2.6 kernel https://lwn.net/Articles/172736/ https://lwn.net/Articles/172736/ York Dear Jonnathan:<br> where are the differences between 2.4 and 2.6 about pci driver program?<br> How can I get the way to port a pci driver in 2.6?<br> <p> Thank you!<br> Tue, 21 Feb 2006 02:33:03 +0000 Porting device drivers to the 2.6 kernel https://lwn.net/Articles/168740/ https://lwn.net/Articles/168740/ LSM This is the kind of stuff that made me subscribe to this community. Thanks Jonnathan!<br><br><a rel="nofollow" href="http://blog.lsmnetworks.com/">LSM</a> <a rel="nofollow" href="http://blog.lsmnetworks.com/php/introdaction-to-php.html">N</a><a rel="nofollow" href="http://blog.lsmnetworks.com/personal/lsm-networks-blog-is-going-live-today.html">etwor</a><a rel="nofollow" href="http://blog.lsmnetworks.com/php/searching-google-with-the-google-api.html">ks</a> <a rel="nofollow" href="http://blog.lsmnetworks.com/php/php-turns-10.html">Blog </a> Sun, 22 Jan 2006 11:39:35 +0000 Porting device drivers to the 2.6 kernel https://lwn.net/Articles/147912/ https://lwn.net/Articles/147912/ johnlin Hello,<br> <p> I got a problem proting device driver from 2.4 to 2.6, i.e. the asm/smplocak.h seems not in 2.6 kernel/include/asm, so could anyone help ?<br> <p> Thanks<br> <p> John<br> Wed, 17 Aug 2005 03:55:18 +0000 Porting modem drivers to the 2.6 kernel https://lwn.net/Articles/147090/ https://lwn.net/Articles/147090/ dabenavidesd Hi Phil.<br> A time ago, i tried to install a driver of my Intel 537 EP that is instaled on my ASUS board for AMD.<br> The driver was made for working on SuSE 9.1. However when trying to install in this OS, and compiling, following the specified steps, I've got 9 warnings.<br> The modem works perfectly under Windows XP (another company delivers the driver on CD besides the finished Intel chipset and other applications like “Classic Phone Tools” <a rel="nofollow" href="http://www.bvrp.com">http://www.bvrp.com</a>).<br> The driver is still hung in the Intel´s site, and this release supports 2.4.x and 2.6.x kernels.<br> Attached is my web site where is a historical record of the conversation between me and a support programmer from Intel Support Service; over all, we work in the makefile and correcting the files and dependencies of the used packages, although the trouble is still there.<br> Im interested in continue working about this kind of troubles. So let me know how can i help. <br> <a rel="nofollow" href="http://es.geocities.com/dabenavidesd/">http://es.geocities.com/dabenavidesd/</a><br> email: dabenavidesd@unal.edu.co<br> Thu, 11 Aug 2005 04:41:27 +0000 Porting PCTel modem driver to the 2.6 kernel https://lwn.net/Articles/139900/ https://lwn.net/Articles/139900/ DMXMusic Here is our situation - we have a working 2.4 driver for the PCTel PCT789T chip/modem. I have been looking high and low for a 2.6 version of this driver, but nobody seems to have taken on the task of porting the driver. I'm wondering if anyone can give me a rough time estimate for porting this driver - (it's basically a serial port driver, the dsp code is in a proprietary lib file) - I have done a couple simple Unix / Linux drivers, and worked on windows display drivers for a couple years, although I have not worked on serial port drivers. Any help is very much appreciated!<br> <p> Our company has something like 5000 of these modems on our devices in the field, and we need to support our customers.<br> <br> Thanks - Phil Brooks, Philip.Brooks@DMXMusic.com<br> Wed, 15 Jun 2005 16:59:13 +0000 swearing in the linux kernel https://lwn.net/Articles/135904/ https://lwn.net/Articles/135904/ tomek graphs over swearing in the linux kernel: http://www.vidarholen.net/contents/wordcount/ <a href="http://www.very-clever.com/" rel="nofollow">Tom</a> Fri, 13 May 2005 14:33:03 +0000 char device drivers on the 2.6 kernel https://lwn.net/Articles/134994/ https://lwn.net/Articles/134994/ prashy I am new to Linux Kernel Programming. Trying to build a basic char driver (register, open, release, unregister). When I compile the source I get the following errors, (even on kernel - 2.4). I try to compile the char drivers provided with the source and even get errors and warnings with them, here is the error dump,<br> <p> prcdd.c:6:1: warning: "__KERNEL__" redefined<br> prcdd.c:1:1: warning: this is the location of the previous definition<br> prcdd.c:7:1: warning: "MODULE" redefined<br> prcdd.c:1:1: warning: this is the location of the previous definition<br> In file included from /usr/include/linux/fs.h:23,<br> from prcdd.c:11:<br> /usr/include/linux/string.h:8:2: warning: #warning Using kernel header in userland!<br> prcdd.c:12:25: asm/uaccess.h: No such file or directory<br> prcdd.c:17: warning: `struct file' declared inside parameter list<br> prcdd.c:17: warning: its scope is only this definition or declaration, which is probably not what you want<br> prcdd.c:17: warning: `struct inode' declared inside parameter list<br> prcdd.c:18: warning: `struct file' declared inside parameter list<br> prcdd.c:18: warning: `struct inode' declared inside parameter list<br> prcdd.c:26: variable `fops' has initializer but incomplete type<br> prcdd.c:27: unknown field `owner' specified in initializer<br> prcdd.c:27: warning: excess elements in struct initializer<br> prcdd.c:27: warning: (near initialization for `fops')<br> prcdd.c:28: unknown field `open' specified in initializer<br> prcdd.c:28: warning: excess elements in struct initializer<br> prcdd.c:28: warning: (near initialization for `fops')<br> prcdd.c:29: unknown field `release' specified in initializer<br> prcdd.c:29: warning: excess elements in struct initializer<br> prcdd.c:29: warning: (near initialization for `fops')<br> prcdd.c: In function `prcdd_init':<br> prcdd.c:34: warning: implicit declaration of function `register_chrdev'<br> prcdd.c:38: warning: implicit declaration of function `printk'<br> prcdd.c: In function `prcdd_exit':<br> prcdd.c:48: warning: implicit declaration of function `unregister_chrdev'<br> prcdd.c: At top level:<br> prcdd.c:55: warning: `struct file' declared inside parameter list<br> prcdd.c:55: warning: `struct inode' declared inside parameter list<br> prcdd.c:56: conflicting types for `prcdd_open'<br> prcdd.c:17: previous declaration of `prcdd_open'<br> prcdd.c: In function `prcdd_open':<br> prcdd.c:59: `EBUSY' undeclared (first use in this function)<br> prcdd.c:59: (Each undeclared identifier is reported only once<br> prcdd.c:59: for each function it appears in.)<br> prcdd.c:63: warning: implicit declaration of function `atomic_inc'<br> prcdd.c:63: union has no member named `usecount'<br> prcdd.c: At top level:<br> prcdd.c:67: warning: `struct file' declared inside parameter list<br> prcdd.c:67: warning: `struct inode' declared inside parameter list<br> prcdd.c:68: conflicting types for `prcdd_release'<br> prcdd.c:18: previous declaration of `prcdd_release'<br> prcdd.c: In function `prcdd_release':<br> prcdd.c:71: warning: implicit declaration of function `atomic_dec'<br> prcdd.c:71: union has no member named `usecount'<br> prcdd.c: At top level:<br> prcdd.c:26: storage size of `fops' isn't known<br> <p> This is the source code,<br> <p> #if defined(CONFIG_MODVERSIONS) &amp;&amp; ! defined(MODVERSIONS)<br> #include &lt;linux/modversions.h&gt;<br> #define MODVERSIONS<br> #endif<br> <p> #define _KERNEL_<br> #define MODULE<br> <p> #include &lt;linux/kernel.h&gt;<br> #include &lt;linux/module.h&gt;<br> #include &lt;linux/fs.h&gt;<br> #include &lt;asm/uaccess.h&gt;<br> <p> //static int module_init(void);<br> //static void module_exit(void);<br> static int prcdd_open(struct inode *,struct file *);<br> static int prcdd_release(struct inode *,struct file *);<br> <p> #define SUCCESS 0<br> #define DEVICE_NAME "prcdd"<br> <p> static int Major;<br> static int Device_open = 0;<br> <p> static struct file_operations fops = {<br> .owner = THIS_MODULE,<br> .open = prcdd_open,<br> .release = prcdd_release,<br> };<br> <p> static int prcdd_init(void)<br> {<br> Major = register_chrdev(0,DEVICE_NAME,&amp;fops);<br> if (Major &lt; 0)<br> {<br> printk("Registering the character device failed with %d \n",Major);<br> return Major;<br> }<br> <p> printk("&lt;1&gt;The assigned major number is %d \n",Major);<br> return 0;<br> }<br> <p> static void prcdd_exit(void)<br> {<br> int ret = unregister_chrdev(Major,DEVICE_NAME);<br> if (ret &lt; 0)<br> {<br> printk("Error in unregister_chrdev: %d \n",ret);<br> }<br> }<br> <p> static int prcdd_open(struct inode *inode, struct file *file)<br> {<br> if (Device_open)<br> {<br> return -EBUSY;<br> }<br> Device_open++;<br> <p> MOD_INC_USE_COUNT;<br> return SUCCESS;<br> }<br> <p> static int prcdd_release(struct inode *inode, struct file *file)<br> {<br> Device_open--;<br> <p> MOD_DEC_USE_COUNT;<br> return 0;<br> }<br> <p> module_init(prcdd_init);<br> module_exit(prcdd_exit);<br> <p> Any pointers on how to proceed from here?<br> <p> <p> <p> Fri, 06 May 2005 21:56:51 +0000 Porting device drivers to the 2.5 kernel https://lwn.net/Articles/115507/ https://lwn.net/Articles/115507/ arafel Make that two...<br> Tue, 14 Dec 2004 14:06:42 +0000 Porting device drivers to the 2.6 kernel https://lwn.net/Articles/112874/ https://lwn.net/Articles/112874/ prakash07 I am using the function <br> alloc_chrdev_region(dev_t *dev,61,1,"prakash");<br> in module but while compilation it is giving the error.<br> <p> ***parse error before dev_t;<br> <p> i also added the &lt;linux/fs.h&gt; .<br> please any one help me .<br> <p> Fri, 26 Nov 2004 03:30:34 +0000 Porting drivers from kernel 2.4 to kernel 2.6,where can I find the documents https://lwn.net/Articles/110041/ https://lwn.net/Articles/110041/ gXyZOd I'm looking for some information too.<br> Seeing that devfs is obsolent I would have to port a module that implements a "Utime Calibration" (taken from the Kansas University Real Time patch) from the 2.4.18 to the 2.6.8/9 kernel.<br> Not using devfs any more in the 2.6 kernel the devfs_[register/unregister]_chrev functions are useless.<br> <p> I'm a n00b and am trying hard to learn.<br> <p> Thanks for any response.<br> Mon, 08 Nov 2004 18:49:35 +0000 Porting drivers from kernel 2.4 to kernel 2.6,where can I find the documents https://lwn.net/Articles/108860/ https://lwn.net/Articles/108860/ dkotian Porting drivers from kernel 2.4 to kernel 2.6,where can I find the documents<br> Fri, 29 Oct 2004 03:56:31 +0000 Porting device drivers to the 2.6 kernel https://lwn.net/Articles/89437/ https://lwn.net/Articles/89437/ Marsclic This is the material that made me subscribe to this site. Keep it coming Jonnathan! Mon, 14 Jun 2004 22:31:49 +0000 On whether this stuff should be free https://lwn.net/Articles/64450/ https://lwn.net/Articles/64450/ nhasan How about releasing it as a book? It should provide additional revenue to LWN and give us a hard copy reference. Wed, 24 Dec 2003 15:19:45 +0000 Porting device drivers to the 2.5 kernel https://lwn.net/Articles/31592/ https://lwn.net/Articles/31592/ LogicG8 I would just like to say that the release of this material prompted<br>me to purchase a subscription. It is a delicate balance providing<br>open content and providing incentive to readers to subscribe. I think<br>that LWN has done a great job and will continue to do so in the future.<p>Releasing quality content for free has nabbed at least one<br>subscriber. Thu, 08 May 2003 17:05:36 +0000 Porting device drivers to the 2.5 kernel https://lwn.net/Articles/24064/ https://lwn.net/Articles/24064/ vonbrand I think this deserves a place in the head of the page (perhaps replacing Old Site or Weekly edition). It is not a &quot;Recent feature&quot; anymore...<p>One minor gripe is that the articles don't default to a printable page format (yes, I do promise to buy the next book of yours regardless ;-)<br> Fri, 28 Feb 2003 20:09:01 +0000 An idea that works elsewhere https://lwn.net/Articles/23935/ https://lwn.net/Articles/23935/ materlik You might think about adding a little, polite blurb asking for a small donation to the end of each article, similar to what tidbits (a free Macintosh newsletter) is doing with <a href="http://www.tidbits.com/paybits/">PayBits</a>. Maybe one only visible to non-subscribers? <br> Their experiences so far have not been overwhelming, but there is some money being donated because of the constant reminders on the value of filtered, edited information. Thu, 27 Feb 2003 15:20:03 +0000 On whether this stuff should be free https://lwn.net/Articles/22602/ https://lwn.net/Articles/22602/ corbet Just as a response to all the comments here... I appreciate the input, and certainly do not feel criticized by any of the comments. <p> For what it's worth, I did consider keeping this material non-free for longer than the usual period. It is different from the usual news, and it has a slightly longer useful life. In the end, I decided against such a move; I would like these articles to be generally useful, and to serve as a contribution to the kernel project. Maintaining the same access policy also lets me fold some of the articles into the Kernel Page, which could use it - development news tends to slow down a lot during feature freezes. <p> So the driver porting articles go free after a week. We may yet do things differently for similar material in the future. <p> jon Wed, 12 Feb 2003 20:07:33 +0000 Re: Porting device drivers to the 2.5 kernel https://lwn.net/Articles/22601/ https://lwn.net/Articles/22601/ Ross Bruno,<p>I think you are mischaracterizing what other people are saying. Using the device driver documentation as an advertisement was only a suggestion. We all recognize that LWN can decide what to release and when to release it. You're point is also only a suggestion. If Jonathan felt he needed to say something, I'm sure he would. You don't need to speak for him. Wed, 12 Feb 2003 19:52:38 +0000 Porting device drivers to the 2.5 kernel https://lwn.net/Articles/22579/ https://lwn.net/Articles/22579/ rknop <p><i>"You MUST give your work for free"... If KotH really thinks that is important that this information be free,</i></p> <p>Be fair. That's not what KotH said. He said he thought it was in LWN.net's best interest to do what they've done, because of their good reputation in the community. He's not insisting that they must do what they've done, he's just congratulating them and saying he understands why they might think it's a good idea to do that.</p> <p>-Rob</p> Wed, 12 Feb 2003 17:17:37 +0000 Porting device drivers to the 2.5 kernel https://lwn.net/Articles/22571/ https://lwn.net/Articles/22571/ bruno The excellent writing at lwn.net is only possible if there are someone that<br>works in it full time. I think is wonderfull if someone can (and want) to<br>work full time in something and give it away for nothing, but I don't think<br>that you can say to someone &quot;You MUST give your work for free&quot;, at the end<br>of the day, with your work you have the right to make whatever you want: <br>Give if for free, sell, rent, lease or burn it, is your work and your <br>decision. <p>If KotH really thinks that is important that this information be free, he can<br>study the linux kernel, write a book and put it on the web for free, instead<br>of criticise the actitude of lwn.net Wed, 12 Feb 2003 15:27:35 +0000 Porting device drivers to the 2.5 kernel https://lwn.net/Articles/22564/ https://lwn.net/Articles/22564/ Webexcess <i>Do you work for nothing? Do you give all your time to other in exchange of nothing?</i> <p> I think you're oversimplifying a bit. The excellent writing at lwn.net is both its product and its advertising. How will potential subscribers be enticed if they can't see what lwn.net has to offer? <p> Also, the target audience largely consists of enthusiasts, many of whom are students and/or live in parts of the world where american dollars are very expensive. These are the same people that helped to build Linux into what it is today -- are you suggesting that they should be excluded? Wed, 12 Feb 2003 14:14:59 +0000 Porting device drivers to the 2.5 kernel https://lwn.net/Articles/22547/ https://lwn.net/Articles/22547/ bruno Do you work for nothing? Do you give all your time to other in exchange <br>of nothing? You can't pretend that other people do that, the people have <br>childrens, wives, mortgages... and work in exchange of money to pay their <br>bills. Sometimes you have a bussiness plan that lets you to give away <br>your work and get money from other sources, sometimes you need to put a <br>price or close the shop.<br> Wed, 12 Feb 2003 11:00:43 +0000 Porting device drivers to the 2.5 kernel https://lwn.net/Articles/22546/ https://lwn.net/Articles/22546/ KotH I wouldnt do that. LWN has a very good reputation as information source<br>around the open source community. A &quot;closed for all but subscribed ppl&quot;<br>policy would surely destroy that reputation.<p>Yes, i know that LWN doesnt have as much subscribers as it should have :(<br>but this is IMHO not the right way to get more. Wed, 12 Feb 2003 09:58:23 +0000 Porting device drivers to the 2.5 kernel https://lwn.net/Articles/22531/ https://lwn.net/Articles/22531/ fdesloges Wow! <br> <br>This is highly valuable stuff. Are you certain you want to give this away <br>for free after only a few days ? <br> <br>This alone would be a very good reason to subscribe. And as reference <br>stuff it will still be valuable many months down the road. <br> <br>Maybe it could fit in a &quot;available to non-subsciber 4 months later&quot; <br>category ? Or make only a few articles available (and the index of course <br>to hook subscribers) ? <br> <br>Whatever you do, thanks! <br> <br>FD Wed, 12 Feb 2003 01:55:03 +0000