From: Stephen Hemminger <shemminger@linux-foundation.org>
To: Ivo van Doorn <ivdoorn@gmail.com>
Cc: Dmitry Torokhov <dtor@insightbb.com>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
"John Linville" <linville@tuxdriver.com>,
Jiri Benc <jbenc@suse.cz>,
Lennart Poettering <lennart@poettering.net>,
Johannes Berg <johannes@sipsolutions.net>,
Larry Finger <Larry.Finger@lwfinger.net>
Subject: Re: [RFC] rfkill - Add support for input key to control wireless radio
Date: Tue, 30 Jan 2007 19:40:23 -0800 [thread overview]
Message-ID: <20070130194023.4e2d5305@localhost.localdomain> (raw)
In-Reply-To: <200612031936.34343.IvDoorn@gmail.com>
Hope you will be resubmitting this.
> +/*
> + * rfkill key structure.
> + */
> +struct rfkill_key {
> + /*
> + * For sysfs representation.
> + */
> + struct class_device *cdev;
> +
> + /*
> + * Pointer to rfkill structure
> + * that was filled in by key driver.
> + */
> + struct rfkill *rfkill;
Since rfkill is basically a function pointer table,
can it be made const?
> + /*
> + * Pointer to type structure that this key belongs to.
> + */
> + struct rfkill_type *type;
> +
> + /*
> + * Once key status change has been detected, the toggled
> + * field should be set to indicate a notification to
> + * user or driver should be performed.
> + */
> + int toggled;
> +
> + /*
> + * Current state of the device radio, this state will
> + * change after the radio has actually been toggled since
> + * receiving the radio key event.
> + */
> + int radio_status;
> +
> + /*
> + * Current status of the key which controls the radio,
> + * this value will change after the key state has changed
> + * after polling, or the key driver has send the new state
> + * manually.
> + */
> + int key_status;
Maybe turn these bits into a bit values (set_bit/clear_bit) in an unsigned long.
> + /*
> + * Input device for this key,
> + * we also keep track of the number of
> + * times this input device is open. This
> + * is important for determining to whom we
> + * should report key events.
> + */
> + struct input_dev *input;
> + unsigned int open_count;
atomic on open_count?
> + /*
> + * Key index number.
> + */
> + unsigned int key_index;
> +
> + /*
> + * List head structure to be used
> + * to add this structure to the list.
> + */
> + struct list_head entry;
> +};
> +
> +/*
> + * rfkill key type structure.
> + */
> +struct rfkill_type {
> + /*
> + * For sysfs representation.
> + */
> + struct class_device *cdev;
> +
> + /*
> + * Name of this radio type.
> + */
> + char *name;
const?
> + /*
> + * Key type identification. Value must be any
> + * in the key_type enum.
> + */
> + unsigned int key_type;
> +
> + /*
> + * Number of registered keys of this type.
> + */
> + unsigned int key_count;
> +};
> +
> +/*
> + * rfkill master structure.
> + */
> +struct rfkill_master {
> + /*
> + * For sysfs representation.
> + */
> + struct class *class;
> +
> + /*
> + * All access to the master structure
> + * and its children (the keys) are protected
> + * by this key lock.
> + */
> + struct semaphore key_sem;
mutex instead of semaphort
> + /*
> + * List of available key types.
> + */
> + struct rfkill_type type[KEY_TYPE_MAX];
> +
> + /*
> + * Total number of registered keys.
> + */
> + unsigned int key_count;
> +
> + /*
> + * Number of keys that require polling
> + */
> + unsigned int poll_required;
> +
> + /*
> + * List of rfkill_key structures.
> + */
> + struct list_head key_list;
> +
> + /*
> + * Work structures for periodic polling,
> + * as well as the scheduled radio toggling.
> + */
> + struct work_struct toggle_work;
> + struct work_struct poll_work;
delayed_rearming_work instead?
> +};
next prev parent reply other threads:[~2007-01-31 3:41 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-03 18:36 [RFC] rfkill - Add support for input key to control wireless radio Ivo van Doorn
2006-12-03 19:18 ` Arjan van de Ven
2006-12-03 22:03 ` Ivo van Doorn
2006-12-03 19:20 ` Arjan van de Ven
2006-12-03 22:05 ` Ivo van Doorn
2006-12-03 22:28 ` Ivo van Doorn
2006-12-05 0:18 ` Randy Dunlap
2006-12-05 21:20 ` Ivo van Doorn
2006-12-03 19:44 ` Dan Williams
2006-12-03 22:16 ` Ivo van Doorn
2006-12-04 8:53 ` Marcel Holtmann
2006-12-04 22:15 ` Dmitry Torokhov
2006-12-04 23:27 ` Ivo van Doorn
2006-12-06 14:37 ` Dmitry Torokhov
2006-12-06 15:18 ` Dan Williams
2006-12-06 15:24 ` Dmitry Torokhov
2006-12-06 19:31 ` Ivo van Doorn
2006-12-06 20:18 ` Dmitry Torokhov
2006-12-06 21:41 ` Ivo van Doorn
2006-12-06 22:04 ` Dmitry Torokhov
2006-12-07 21:53 ` Ivo van Doorn
2006-12-12 5:12 ` Dmitry Torokhov
2006-12-12 7:47 ` Ivo Van Doorn
2006-12-17 17:43 ` Ivo van Doorn
2007-01-30 16:33 ` Ivo van Doorn
2006-12-07 13:22 ` Dan Williams
2006-12-07 21:58 ` Ivo van Doorn
2006-12-06 22:05 ` Jiri Benc
2006-12-06 22:10 ` Dmitry Torokhov
2006-12-05 10:32 ` Christoph Hellwig
2006-12-05 21:21 ` Ivo van Doorn
2007-01-31 3:40 ` Stephen Hemminger [this message]
2007-01-31 10:39 ` Ivo van Doorn
2007-01-31 11:20 ` Ivo van Doorn
2007-03-30 5:27 ` Dmitry Torokhov
2007-03-30 5:29 ` Dmitry Torokhov
2007-03-30 14:59 ` Ivo van Doorn
2007-03-30 15:28 ` Dmitry Torokhov
2007-03-30 17:13 ` Ivo van Doorn
2007-03-30 18:37 ` Dmitry Torokhov
2007-03-31 12:49 ` Ivo van Doorn
2007-04-02 4:38 ` 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=20070130194023.4e2d5305@localhost.localdomain \
--to=shemminger@linux-foundation.org \
--cc=Larry.Finger@lwfinger.net \
--cc=dtor@insightbb.com \
--cc=ivdoorn@gmail.com \
--cc=jbenc@suse.cz \
--cc=johannes@sipsolutions.net \
--cc=lennart@poettering.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).