From: kilroyd@googlemail.com
To: linux-wireless@vger.kernel.org
Cc: proski@gnu.org, orinoco-devel@lists.sourceforge.net,
David Kilroy <kilroyd@gmail.com>
Subject: [PATCH 15/19] orinoco: Use a macro to define wireless handlers
Date: Sat, 2 Aug 2008 11:14:29 +0100 [thread overview]
Message-ID: <1217672073-7094-16-git-send-email-kilroyd@gmail.com> (raw)
In-Reply-To: <1217672073-7094-15-git-send-email-kilroyd@gmail.com>
The macro identifiers for the various ioctls required for WPA support
are longer than those currently used by the driver. This makes it messy
to keep line length below 80 character.
By defining a macro to initialise the handler table, we recover the
common text.
Signed-off-by: David Kilroy <kilroyd@gmail>
---
drivers/net/wireless/orinoco.c | 66 ++++++++++++++++++++-------------------
1 files changed, 34 insertions(+), 32 deletions(-)
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index b91b6cb..59720f9 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -5050,39 +5050,41 @@ static const struct iw_priv_args orinoco_privtab[] = {
* Structures to export the Wireless Handlers
*/
+#define STD_IW_HANDLER(id, func) \
+ [IW_IOCTL_IDX(id)] = (iw_handler) func
static const iw_handler orinoco_handler[] = {
- [SIOCSIWCOMMIT-SIOCIWFIRST] = (iw_handler) orinoco_ioctl_commit,
- [SIOCGIWNAME -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getname,
- [SIOCSIWFREQ -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setfreq,
- [SIOCGIWFREQ -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getfreq,
- [SIOCSIWMODE -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setmode,
- [SIOCGIWMODE -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getmode,
- [SIOCSIWSENS -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setsens,
- [SIOCGIWSENS -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getsens,
- [SIOCGIWRANGE -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getiwrange,
- [SIOCSIWSPY -SIOCIWFIRST] = (iw_handler) iw_handler_set_spy,
- [SIOCGIWSPY -SIOCIWFIRST] = (iw_handler) iw_handler_get_spy,
- [SIOCSIWTHRSPY-SIOCIWFIRST] = (iw_handler) iw_handler_set_thrspy,
- [SIOCGIWTHRSPY-SIOCIWFIRST] = (iw_handler) iw_handler_get_thrspy,
- [SIOCSIWAP -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setwap,
- [SIOCGIWAP -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getwap,
- [SIOCSIWSCAN -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setscan,
- [SIOCGIWSCAN -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getscan,
- [SIOCSIWESSID -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setessid,
- [SIOCGIWESSID -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getessid,
- [SIOCSIWNICKN -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setnick,
- [SIOCGIWNICKN -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getnick,
- [SIOCSIWRATE -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setrate,
- [SIOCGIWRATE -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getrate,
- [SIOCSIWRTS -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setrts,
- [SIOCGIWRTS -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getrts,
- [SIOCSIWFRAG -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setfrag,
- [SIOCGIWFRAG -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getfrag,
- [SIOCGIWRETRY -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getretry,
- [SIOCSIWENCODE-SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setiwencode,
- [SIOCGIWENCODE-SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getiwencode,
- [SIOCSIWPOWER -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_setpower,
- [SIOCGIWPOWER -SIOCIWFIRST] = (iw_handler) orinoco_ioctl_getpower,
+ STD_IW_HANDLER(SIOCSIWCOMMIT, orinoco_ioctl_commit),
+ STD_IW_HANDLER(SIOCGIWNAME, orinoco_ioctl_getname),
+ STD_IW_HANDLER(SIOCSIWFREQ, orinoco_ioctl_setfreq),
+ STD_IW_HANDLER(SIOCGIWFREQ, orinoco_ioctl_getfreq),
+ STD_IW_HANDLER(SIOCSIWMODE, orinoco_ioctl_setmode),
+ STD_IW_HANDLER(SIOCGIWMODE, orinoco_ioctl_getmode),
+ STD_IW_HANDLER(SIOCSIWSENS, orinoco_ioctl_setsens),
+ STD_IW_HANDLER(SIOCGIWSENS, orinoco_ioctl_getsens),
+ STD_IW_HANDLER(SIOCGIWRANGE, orinoco_ioctl_getiwrange),
+ STD_IW_HANDLER(SIOCSIWSPY, iw_handler_set_spy),
+ STD_IW_HANDLER(SIOCGIWSPY, iw_handler_get_spy),
+ STD_IW_HANDLER(SIOCSIWTHRSPY, iw_handler_set_thrspy),
+ STD_IW_HANDLER(SIOCGIWTHRSPY, iw_handler_get_thrspy),
+ STD_IW_HANDLER(SIOCSIWAP, orinoco_ioctl_setwap),
+ STD_IW_HANDLER(SIOCGIWAP, orinoco_ioctl_getwap),
+ STD_IW_HANDLER(SIOCSIWSCAN, orinoco_ioctl_setscan),
+ STD_IW_HANDLER(SIOCGIWSCAN, orinoco_ioctl_getscan),
+ STD_IW_HANDLER(SIOCSIWESSID, orinoco_ioctl_setessid),
+ STD_IW_HANDLER(SIOCGIWESSID, orinoco_ioctl_getessid),
+ STD_IW_HANDLER(SIOCSIWNICKN, orinoco_ioctl_setnick),
+ STD_IW_HANDLER(SIOCGIWNICKN, orinoco_ioctl_getnick),
+ STD_IW_HANDLER(SIOCSIWRATE, orinoco_ioctl_setrate),
+ STD_IW_HANDLER(SIOCGIWRATE, orinoco_ioctl_getrate),
+ STD_IW_HANDLER(SIOCSIWRTS, orinoco_ioctl_setrts),
+ STD_IW_HANDLER(SIOCGIWRTS, orinoco_ioctl_getrts),
+ STD_IW_HANDLER(SIOCSIWFRAG, orinoco_ioctl_setfrag),
+ STD_IW_HANDLER(SIOCGIWFRAG, orinoco_ioctl_getfrag),
+ STD_IW_HANDLER(SIOCGIWRETRY, orinoco_ioctl_getretry),
+ STD_IW_HANDLER(SIOCSIWENCODE, orinoco_ioctl_setiwencode),
+ STD_IW_HANDLER(SIOCGIWENCODE, orinoco_ioctl_getiwencode),
+ STD_IW_HANDLER(SIOCSIWPOWER, orinoco_ioctl_setpower),
+ STD_IW_HANDLER(SIOCGIWPOWER, orinoco_ioctl_getpower),
};
--
1.5.4.5
next prev parent reply other threads:[~2008-08-02 10:15 UTC|newest]
Thread overview: 75+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-02 10:14 [PATCH 00/19] orinoco: WPA for Agere based cards kilroyd
2008-08-02 10:14 ` [PATCH 01/19] orinoco: Add ESSID specific scanning for Agere fw kilroyd
2008-08-02 10:14 ` [PATCH 02/19] orinoco: Update scan translation kilroyd
2008-08-02 10:14 ` [PATCH 03/19] orinoco: Specify all three parameters to every Hermes command kilroyd
2008-08-02 10:14 ` [PATCH 04/19] orinoco: Move EXPORT_SYMBOL declarations next to exported function kilroyd
2008-08-02 10:14 ` [PATCH 05/19] orinoco: Add function to execute Hermes initialisation commands synchronously kilroyd
2008-08-02 10:14 ` [PATCH 06/19] orinoco: Move firmware download functionality into new module kilroyd
2008-08-02 10:14 ` [PATCH 07/19] orinoco: Make firmware download logic more generic kilroyd
2008-08-02 10:14 ` [PATCH 08/19] orinoco: Extend hermes_dld routines for Agere firmware kilroyd
2008-08-02 10:14 ` [PATCH 09/19] orinoco: Invoke firmware download in main driver kilroyd
2008-08-02 10:14 ` [PATCH 10/19] orinoco: Fix transmit for Agere/Lucent with fw 9.x kilroyd
2008-08-02 10:14 ` [PATCH 11/19] orinoco: address checkpatch typedef warning kilroyd
2008-08-02 10:14 ` [PATCH 12/19] orinoco: Use extended Agere scans available on 9.x series firmwares kilroyd
2008-08-02 10:14 ` [PATCH 13/19] orinoco: Don't use boolean parameter to record encoding type kilroyd
2008-08-02 10:14 ` [PATCH 14/19] orinoco: Split wevent work thread from wevent sending kilroyd
2008-08-02 10:14 ` kilroyd [this message]
2008-08-02 10:14 ` [PATCH 16/19] orinoco: Add WE-18 ioctls for WPA kilroyd
2008-08-02 10:14 ` [PATCH 17/19] orinoco: Send association events to userspace kilroyd
2008-08-02 10:14 ` [PATCH 18/19] orinoco: Process bulk of receive interrupt in a tasklet kilroyd
2008-08-02 10:14 ` [PATCH 19/19] orinoco: Add MIC on TX and check on RX kilroyd
2008-08-02 10:22 ` [PATCH 15/19] orinoco: Use a macro to define wireless handlers kilroyd
2008-08-04 4:48 ` [PATCH 01/19] orinoco: Add ESSID specific scanning for Agere fw Pavel Roskin
2008-08-04 15:34 ` Dan Williams
2008-08-05 16:22 ` Jean Tourrilhes
2008-09-02 23:06 ` Jean Tourrilhes
2008-09-08 12:48 ` Pavel Roskin
2008-09-08 16:45 ` Jean Tourrilhes
2008-09-08 18:32 ` Jean Tourrilhes
2008-09-09 18:37 ` Dave
2008-09-09 19:33 ` Jean Tourrilhes
2008-09-09 21:20 ` Tomas Winkler
2008-09-09 21:44 ` Jean Tourrilhes
2008-09-13 4:17 ` Pavel Roskin
2008-09-15 21:17 ` Jean Tourrilhes
2008-08-05 21:15 ` Pavel Roskin
2008-08-05 21:50 ` Dave
2008-08-05 21:55 ` Dan Williams
2008-08-05 22:48 ` Pavel Roskin
2008-08-06 13:13 ` Dan Williams
2008-08-06 13:48 ` Pavel Roskin
2008-08-06 19:26 ` Dave
2008-08-06 19:29 ` Dave
2008-08-06 20:56 ` Dan Williams
2008-08-06 21:03 ` Dan Williams
2008-08-06 21:08 ` Dave
2008-08-07 2:48 ` Dan Williams
2008-08-07 18:43 ` Dave
2008-08-07 19:42 ` Dan Williams
2008-08-07 20:17 ` Dave
2008-08-07 20:46 ` Dan Williams
2008-08-07 21:08 ` Dave
2008-08-08 14:51 ` Dan Williams
2008-08-04 3:57 ` [PATCH 00/19] orinoco: WPA for Agere based cards Pavel Roskin
2008-08-04 23:09 ` Dave
2008-08-04 23:28 ` Dan Williams
2008-08-06 0:37 ` Pavel Roskin
2008-08-06 18:33 ` Dave
2008-08-06 21:01 ` Dan Williams
2008-08-07 8:06 ` Jouni Malinen
2008-08-06 21:28 ` [PATCH 12/19] orinoco: Use extended Agere scans available on 9.x series firmwares kilroyd
2008-08-05 22:38 ` [Orinoco-devel] [PATCH 00/19] orinoco: WPA for Agere based cards Pavel Roskin
2008-08-08 0:02 ` Dave
2008-08-05 22:59 ` Pavel Roskin
2008-08-05 23:46 ` Dave
2008-08-06 0:41 ` [Orinoco-devel] " Pavel Roskin
2008-08-05 22:22 ` [PATCH 07/19] orinoco: Make firmware download logic more generic kilroyd
2008-08-05 22:22 ` [PATCH 09/19] orinoco: Invoke firmware download in main driver kilroyd
2008-08-05 22:22 ` [PATCH 12/19] orinoco: Use extended Agere scans available on 9.x series firmwares kilroyd
2008-08-20 19:28 ` [PATCH 00/19] orinoco: WPA for Agere based cards John W. Linville
2008-08-20 20:49 ` Dave
2008-08-20 21:06 ` Larry Finger
2008-08-20 21:07 ` Johannes Berg
2008-08-20 21:22 ` Johannes Berg
2008-08-20 23:07 ` Dave
2008-08-21 6:42 ` Johannes Berg
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=1217672073-7094-16-git-send-email-kilroyd@gmail.com \
--to=kilroyd@googlemail.com \
--cc=kilroyd@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=orinoco-devel@lists.sourceforge.net \
--cc=proski@gnu.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).