From: Roberto Nibali <ratz@drugphish.ch>
To: Nuno Monteiro <nuno+lkml@itsari.org>
Cc: Jan Engelhardt <jengelh@linux01.gwdg.de>,
"Leonard Milcin Jr." <leonard.milcin@post.pl>,
linux-kernel@vger.kernel.org
Subject: Re: [OT] Re: keyboard driver of 2.6 kernel
Date: Fri, 06 Jan 2006 00:28:33 +0100 [thread overview]
Message-ID: <43BDABA1.1060607@drugphish.ch> (raw)
In-Reply-To: <20060105210751.GC4332@hobbes.itsari.org>
>> I'll let you know if I need it; I reckon it might not be too
>> difficult to backport it anyway, so I can also do it myself ;).
>>
> I stumbled upon ttyrpld a couple weeks ago and thought it was pretty
> useful, to keep track of all actions performed on a couple of machines
> where only the admins have local accounts. Since I'm running a (heavily
> modified) custom 2.4.22 kernel, I took the version Jan offered for
> 2.4.29 (in ttyrpld-2.03.5) and synced it up with the work he did on
> later versions. I think it's identical, functionality wise, to the
> patch he offered on ttyrpld 2.10. I also massaged it a bit so it would
> build statically into the kernel (my boxes don't have module support)
> and to get rid of the extra fluff -- the dependency on moduleparm.h
> which doesn't exit in 2.4.22, the BSD defines, the 2.6 defines, etc.
> Also, if built as a module, it'll be called 'rpl' instead of 'rpldev'.
Why?
> I'm running it now on a couple boxes, with the latest userspace bits
> (libHX 1.74 and ttyrpld 2.10), and It Works For Me (tm). So, with that
> disclaimer out of the way, here's the patch. It's diffed against my
> custom 2.4.22 kernel, but should apply fairly well to any 2.4.
Thanks for sharing your work! Comments on the coding style aside (it's
not exactly winning a beauty contest), one thing I spotted while
skimming over your patch:
> +static int urpl_open(struct inode *inode, struct file *filp) {
> + // This one is called when the device node has been opened.
> + if(inode != NULL) {
> + inode->i_mtime = CURRENT_TIME;
> + inode->i_mode &= ~(S_IWUGO | S_IXUGO);
> + }
> +
> + /* The RPL device should only be opened once, since otherwise,
different
> + packets could go to different readers. */
> + down(&Open_lock);
> + if(Open_count) {
> + up(&Open_lock);
> + return -EBUSY;
> + }
> + ++Open_count;
> + up(&Open_lock);
> +
> + down(&Buffer_lock);
> + Buffer = __vmalloc(Bufsize, GFP_KERNEL | __GFP_HIGHMEM,
PAGE_KERNEL);
> + if(Buffer == NULL) {
> + up(&Buffer_lock);
> + up(&Open_lock);
This does not seem to be correct. This semaphore has been released
already and urpl_open is not called under a lock AFAICS.
I'll see if we can fit something like this into the next kernel round
for our distro. The code needs major cleanup though.
Best regards,
Roberto Nibali, ratz
--
echo
'[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq' | dc
next prev parent reply other threads:[~2006-01-05 23:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-04 8:32 keyboard driver of 2.6 kernel P.Manohar
2006-01-04 8:33 ` Arjan van de Ven
2006-01-04 9:07 ` Leonard Milcin Jr.
2006-01-04 9:23 ` Jan Engelhardt
2006-01-05 10:08 ` [OT] " Roberto Nibali
2006-01-05 11:51 ` Jan Engelhardt
2006-01-05 12:43 ` Roberto Nibali
2006-01-05 21:07 ` Nuno Monteiro
2006-01-05 23:28 ` Roberto Nibali [this message]
2006-01-06 7:01 ` Jan Engelhardt
2006-01-06 10:28 ` Nuno Monteiro
2006-01-05 11:58 ` Leonard Milcin Jr.
2006-01-05 12:47 ` Roberto Nibali
2006-01-04 16:25 ` Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43BDABA1.1060607@drugphish.ch \
--to=ratz@drugphish.ch \
--cc=jengelh@linux01.gwdg.de \
--cc=leonard.milcin@post.pl \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno+lkml@itsari.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox