Staging: wlan-ng: p80211req.c: Coding style cleanups

Signed-off-by: Moritz Muehlenhoff <jmm@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Moritz Muehlenhoff 2009-02-08 02:20:46 +01:00 committed by Greg Kroah-Hartman
parent 4793a5e2fd
commit b1de9675ac
1 changed files with 97 additions and 102 deletions

View File

@ -50,9 +50,6 @@
* -------------------------------------------------------------------- * --------------------------------------------------------------------
*/ */
/*================================================================*/
/* System Includes */
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h> #include <linux/sched.h>
@ -67,9 +64,6 @@
#include "wlan_compat.h" #include "wlan_compat.h"
/*================================================================*/
/* Project Includes */
#include "p80211types.h" #include "p80211types.h"
#include "p80211hdr.h" #include "p80211hdr.h"
#include "p80211mgmt.h" #include "p80211mgmt.h"
@ -81,15 +75,10 @@
#include "p80211metastruct.h" #include "p80211metastruct.h"
#include "p80211req.h" #include "p80211req.h"
/*================================================================*/
/* Local Function Declarations */
static void p80211req_handlemsg(wlandevice_t *wlandev, p80211msg_t *msg); static void p80211req_handlemsg(wlandevice_t *wlandev, p80211msg_t *msg);
static int p80211req_mibset_mibget(wlandevice_t *wlandev, p80211msg_dot11req_mibget_t *mib_msg, int isget); static int p80211req_mibset_mibget(wlandevice_t *wlandev,
p80211msg_dot11req_mibget_t *mib_msg,
/*================================================================*/ int isget);
/* Function Definitions */
/*---------------------------------------------------------------- /*----------------------------------------------------------------
* p80211req_dorequest * p80211req_dorequest
@ -113,8 +102,7 @@ int p80211req_dorequest( wlandevice_t *wlandev, u8 *msgbuf)
p80211msg_t *msg = (p80211msg_t *) msgbuf; p80211msg_t *msg = (p80211msg_t *) msgbuf;
/* Check to make sure the MSD is running */ /* Check to make sure the MSD is running */
if ( if (!((wlandev->msdstate == WLAN_MSD_HWPRESENT &&
!((wlandev->msdstate == WLAN_MSD_HWPRESENT &&
msg->msgcode == DIDmsg_lnxreq_ifstate) || msg->msgcode == DIDmsg_lnxreq_ifstate) ||
wlandev->msdstate == WLAN_MSD_RUNNING || wlandev->msdstate == WLAN_MSD_RUNNING ||
wlandev->msdstate == WLAN_MSD_FWLOAD)) { wlandev->msdstate == WLAN_MSD_FWLOAD)) {
@ -122,16 +110,16 @@ int p80211req_dorequest( wlandevice_t *wlandev, u8 *msgbuf)
} }
/* Check Permissions */ /* Check Permissions */
if (!capable(CAP_NET_ADMIN) && if (!capable(CAP_NET_ADMIN) && (msg->msgcode != DIDmsg_dot11req_mibget)) {
(msg->msgcode != DIDmsg_dot11req_mibget)) { printk(KERN_ERR
printk(KERN_ERR "%s: only dot11req_mibget allowed for non-root.\n", wlandev->name); "%s: only dot11req_mibget allowed for non-root.\n",
wlandev->name);
return -EPERM; return -EPERM;
} }
/* Check for busy status */ /* Check for busy status */
if ( test_and_set_bit(1, &(wlandev->request_pending))) { if (test_and_set_bit(1, &(wlandev->request_pending)))
return -EBUSY; return -EBUSY;
}
/* Allow p80211 to look at msg and handle if desired. */ /* Allow p80211 to look at msg and handle if desired. */
/* So far, all p80211 msgs are immediate, no waitq/timer necessary */ /* So far, all p80211 msgs are immediate, no waitq/timer necessary */
@ -169,8 +157,10 @@ static void p80211req_handlemsg( wlandevice_t *wlandev, p80211msg_t *msg)
switch (msg->msgcode) { switch (msg->msgcode) {
case DIDmsg_lnxreq_hostwep:{ case DIDmsg_lnxreq_hostwep:{
p80211msg_lnxreq_hostwep_t *req = (p80211msg_lnxreq_hostwep_t*) msg; p80211msg_lnxreq_hostwep_t *req =
wlandev->hostwep &= ~(HOSTWEP_DECRYPT|HOSTWEP_ENCRYPT); (p80211msg_lnxreq_hostwep_t *) msg;
wlandev->hostwep &=
~(HOSTWEP_DECRYPT | HOSTWEP_ENCRYPT);
if (req->decrypt.data == P80211ENUM_truth_true) if (req->decrypt.data == P80211ENUM_truth_true)
wlandev->hostwep |= HOSTWEP_DECRYPT; wlandev->hostwep |= HOSTWEP_DECRYPT;
if (req->encrypt.data == P80211ENUM_truth_true) if (req->encrypt.data == P80211ENUM_truth_true)
@ -181,11 +171,11 @@ static void p80211req_handlemsg( wlandevice_t *wlandev, p80211msg_t *msg)
case DIDmsg_dot11req_mibget: case DIDmsg_dot11req_mibget:
case DIDmsg_dot11req_mibset:{ case DIDmsg_dot11req_mibset:{
int isget = (msg->msgcode == DIDmsg_dot11req_mibget); int isget = (msg->msgcode == DIDmsg_dot11req_mibget);
p80211msg_dot11req_mibget_t *mib_msg = (p80211msg_dot11req_mibget_t *) msg; p80211msg_dot11req_mibget_t *mib_msg =
(p80211msg_dot11req_mibget_t *) msg;
p80211req_mibset_mibget(wlandev, mib_msg, isget); p80211req_mibset_mibget(wlandev, mib_msg, isget);
} }
default: default:
// XXX do nothing!
; ;
} /* switch msg->msgcode */ } /* switch msg->msgcode */
@ -225,11 +215,13 @@ static int p80211req_mibset_mibget(wlandevice_t *wlandev,
u32 *data = (u32 *) mibitem->data; u32 *data = (u32 *) mibitem->data;
if (isget) { if (isget) {
*data = wlandev->hostwep & HOSTWEP_DEFAULTKEY_MASK; *data =
wlandev->hostwep & HOSTWEP_DEFAULTKEY_MASK;
} else { } else {
wlandev->hostwep &= ~(HOSTWEP_DEFAULTKEY_MASK); wlandev->hostwep &= ~(HOSTWEP_DEFAULTKEY_MASK);
wlandev->hostwep |= (*data & HOSTWEP_DEFAULTKEY_MASK); wlandev->hostwep |=
(*data & HOSTWEP_DEFAULTKEY_MASK);
} }
break; break;
} }
@ -244,7 +236,8 @@ static int p80211req_mibset_mibget(wlandevice_t *wlandev,
} else { } else {
wlandev->hostwep &= ~(HOSTWEP_PRIVACYINVOKED); wlandev->hostwep &= ~(HOSTWEP_PRIVACYINVOKED);
if (*data == P80211ENUM_truth_true) if (*data == P80211ENUM_truth_true)
wlandev->hostwep |= HOSTWEP_PRIVACYINVOKED; wlandev->hostwep |=
HOSTWEP_PRIVACYINVOKED;
} }
break; break;
} }
@ -252,19 +245,21 @@ static int p80211req_mibset_mibget(wlandevice_t *wlandev,
u32 *data = (u32 *) mibitem->data; u32 *data = (u32 *) mibitem->data;
if (isget) { if (isget) {
if (wlandev->hostwep & HOSTWEP_EXCLUDEUNENCRYPTED) if (wlandev->
hostwep & HOSTWEP_EXCLUDEUNENCRYPTED)
*data = P80211ENUM_truth_true; *data = P80211ENUM_truth_true;
else else
*data = P80211ENUM_truth_false; *data = P80211ENUM_truth_false;
} else { } else {
wlandev->hostwep &= ~(HOSTWEP_EXCLUDEUNENCRYPTED); wlandev->hostwep &=
~(HOSTWEP_EXCLUDEUNENCRYPTED);
if (*data == P80211ENUM_truth_true) if (*data == P80211ENUM_truth_true)
wlandev->hostwep |= HOSTWEP_EXCLUDEUNENCRYPTED; wlandev->hostwep |=
HOSTWEP_EXCLUDEUNENCRYPTED;
} }
break; break;
} }
default: default:
// XXXX do nothing!
; ;
} }