Skip to content

Commit

Permalink
Staging: wlan-ng: multiple safe style cleanups
Browse files Browse the repository at this point in the history
Cleanups as suggested by checkpatch.pl utiltiy.
.o's from before and after cleanup have matching SHA1s.

Signed-off-by: Svenne Krap <svenne@krap.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Svenne Krap authored and Greg Kroah-Hartman committed Mar 4, 2010
1 parent 46800b2 commit 5dd8acc
Show file tree
Hide file tree
Showing 17 changed files with 217 additions and 216 deletions.
74 changes: 37 additions & 37 deletions drivers/staging/wlan-ng/hfa384x.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@

/* Make a 32-bit flat address from AUX format 16-bit page and offset */
#define HFA384x_ADDR_AUX_MKFLAT(p, o) \
(((u32)(((u16)(p))&HFA384x_ADDR_AUX_PAGE_MASK)) << 7) | \
((u32)(((u16)(o))&HFA384x_ADDR_AUX_OFF_MASK))
((((u32)(((u16)(p))&HFA384x_ADDR_AUX_PAGE_MASK)) << 7) | \
((u32)(((u16)(o))&HFA384x_ADDR_AUX_OFF_MASK)))

/* Make CMD format offset and page from a 32-bit flat address */
#define HFA384x_ADDR_CMD_MKPAGE(f) \
Expand Down Expand Up @@ -402,7 +402,7 @@ typedef struct hfa384x_authenticateStation_data {
/*-- Configuration Record: WPAData (data portion only) --*/
typedef struct hfa384x_WPAData {
u16 datalen;
u8 data[0]; // max 80
u8 data[0]; /* max 80 */
} __attribute__ ((packed)) hfa384x_WPAData_t;

/*--------------------------------------------------------------------
Expand Down Expand Up @@ -1133,7 +1133,7 @@ struct hfa384x;

typedef void (*ctlx_cmdcb_t) (struct hfa384x *, const struct hfa384x_usbctlx *);

typedef void (*ctlx_usercb_t) (struct hfa384x * hw,
typedef void (*ctlx_usercb_t) (struct hfa384x *hw,
void *ctlxresult, void *usercb_data);

typedef struct hfa384x_usbctlx {
Expand Down Expand Up @@ -1320,25 +1320,25 @@ typedef struct hfa384x {

} hfa384x_t;

void hfa384x_create(hfa384x_t * hw, struct usb_device *usb);
void hfa384x_destroy(hfa384x_t * hw);
void hfa384x_create(hfa384x_t *hw, struct usb_device *usb);
void hfa384x_destroy(hfa384x_t *hw);

int
hfa384x_corereset(hfa384x_t * hw, int holdtime, int settletime, int genesis);
int hfa384x_drvr_commtallies(hfa384x_t * hw);
int hfa384x_drvr_disable(hfa384x_t * hw, u16 macport);
int hfa384x_drvr_enable(hfa384x_t * hw, u16 macport);
int hfa384x_drvr_flashdl_enable(hfa384x_t * hw);
int hfa384x_drvr_flashdl_disable(hfa384x_t * hw);
int hfa384x_drvr_flashdl_write(hfa384x_t * hw, u32 daddr, void *buf, u32 len);
int hfa384x_drvr_getconfig(hfa384x_t * hw, u16 rid, void *buf, u16 len);
int hfa384x_drvr_ramdl_enable(hfa384x_t * hw, u32 exeaddr);
int hfa384x_drvr_ramdl_disable(hfa384x_t * hw);
int hfa384x_drvr_ramdl_write(hfa384x_t * hw, u32 daddr, void *buf, u32 len);
int hfa384x_drvr_readpda(hfa384x_t * hw, void *buf, unsigned int len);
int hfa384x_drvr_setconfig(hfa384x_t * hw, u16 rid, void *buf, u16 len);

static inline int hfa384x_drvr_getconfig16(hfa384x_t * hw, u16 rid, void *val)
hfa384x_corereset(hfa384x_t *hw, int holdtime, int settletime, int genesis);
int hfa384x_drvr_commtallies(hfa384x_t *hw);
int hfa384x_drvr_disable(hfa384x_t *hw, u16 macport);
int hfa384x_drvr_enable(hfa384x_t *hw, u16 macport);
int hfa384x_drvr_flashdl_enable(hfa384x_t *hw);
int hfa384x_drvr_flashdl_disable(hfa384x_t *hw);
int hfa384x_drvr_flashdl_write(hfa384x_t *hw, u32 daddr, void *buf, u32 len);
int hfa384x_drvr_getconfig(hfa384x_t *hw, u16 rid, void *buf, u16 len);
int hfa384x_drvr_ramdl_enable(hfa384x_t *hw, u32 exeaddr);
int hfa384x_drvr_ramdl_disable(hfa384x_t *hw);
int hfa384x_drvr_ramdl_write(hfa384x_t *hw, u32 daddr, void *buf, u32 len);
int hfa384x_drvr_readpda(hfa384x_t *hw, void *buf, unsigned int len);
int hfa384x_drvr_setconfig(hfa384x_t *hw, u16 rid, void *buf, u16 len);

static inline int hfa384x_drvr_getconfig16(hfa384x_t *hw, u16 rid, void *val)
{
int result = 0;
result = hfa384x_drvr_getconfig(hw, rid, val, sizeof(u16));
Expand All @@ -1347,44 +1347,44 @@ static inline int hfa384x_drvr_getconfig16(hfa384x_t * hw, u16 rid, void *val)
return result;
}

static inline int hfa384x_drvr_setconfig16(hfa384x_t * hw, u16 rid, u16 val)
static inline int hfa384x_drvr_setconfig16(hfa384x_t *hw, u16 rid, u16 val)
{
u16 value = cpu_to_le16(val);
return hfa384x_drvr_setconfig(hw, rid, &value, sizeof(value));
}

int
hfa384x_drvr_getconfig_async(hfa384x_t * hw,
hfa384x_drvr_getconfig_async(hfa384x_t *hw,
u16 rid, ctlx_usercb_t usercb, void *usercb_data);

int
hfa384x_drvr_setconfig_async(hfa384x_t * hw,
hfa384x_drvr_setconfig_async(hfa384x_t *hw,
u16 rid,
void *buf,
u16 len, ctlx_usercb_t usercb, void *usercb_data);

static inline int
hfa384x_drvr_setconfig16_async(hfa384x_t * hw, u16 rid, u16 val)
hfa384x_drvr_setconfig16_async(hfa384x_t *hw, u16 rid, u16 val)
{
u16 value = cpu_to_le16(val);
return hfa384x_drvr_setconfig_async(hw, rid, &value, sizeof(value),
NULL, NULL);
}

int hfa384x_drvr_start(hfa384x_t * hw);
int hfa384x_drvr_stop(hfa384x_t * hw);
int hfa384x_drvr_start(hfa384x_t *hw);
int hfa384x_drvr_stop(hfa384x_t *hw);
int
hfa384x_drvr_txframe(hfa384x_t * hw, struct sk_buff *skb,
p80211_hdr_t * p80211_hdr, p80211_metawep_t * p80211_wep);
void hfa384x_tx_timeout(wlandevice_t * wlandev);

int hfa384x_cmd_initialize(hfa384x_t * hw);
int hfa384x_cmd_enable(hfa384x_t * hw, u16 macport);
int hfa384x_cmd_disable(hfa384x_t * hw, u16 macport);
int hfa384x_cmd_allocate(hfa384x_t * hw, u16 len);
int hfa384x_cmd_monitor(hfa384x_t * hw, u16 enable);
hfa384x_drvr_txframe(hfa384x_t *hw, struct sk_buff *skb,
p80211_hdr_t *p80211_hdr, p80211_metawep_t *p80211_wep);
void hfa384x_tx_timeout(wlandevice_t *wlandev);

int hfa384x_cmd_initialize(hfa384x_t *hw);
int hfa384x_cmd_enable(hfa384x_t *hw, u16 macport);
int hfa384x_cmd_disable(hfa384x_t *hw, u16 macport);
int hfa384x_cmd_allocate(hfa384x_t *hw, u16 len);
int hfa384x_cmd_monitor(hfa384x_t *hw, u16 enable);
int
hfa384x_cmd_download(hfa384x_t * hw,
hfa384x_cmd_download(hfa384x_t *hw,
u16 mode, u16 lowaddr, u16 highaddr, u16 codelen);

#endif /* __KERNEL__ */
Expand Down
8 changes: 4 additions & 4 deletions drivers/staging/wlan-ng/hfa384x_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
#include <linux/usb.h>
#include <linux/byteorder/generic.h>

#define SUBMIT_URB(u,f) usb_submit_urb(u,f)
#define SUBMIT_URB(u, f) usb_submit_urb(u, f)

#include "p80211types.h"
#include "p80211hdr.h"
Expand Down Expand Up @@ -627,7 +627,7 @@ static hfa384x_usbctlx_t *usbctlx_alloc(void)
{
hfa384x_usbctlx_t *ctlx;

ctlx = kmalloc(sizeof(*ctlx), in_interrupt()? GFP_ATOMIC : GFP_KERNEL);
ctlx = kmalloc(sizeof(*ctlx), in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
if (ctlx != NULL) {
memset(ctlx, 0, sizeof(*ctlx));
init_completion(&ctlx->done);
Expand Down Expand Up @@ -675,7 +675,7 @@ struct usbctlx_cmd_completor {
};
typedef struct usbctlx_cmd_completor usbctlx_cmd_completor_t;

static int usbctlx_cmd_completor_fn(usbctlx_completor_t * head)
static int usbctlx_cmd_completor_fn(usbctlx_completor_t *head)
{
usbctlx_cmd_completor_t *complete = (usbctlx_cmd_completor_t *) head;
return usbctlx_get_status(complete->cmdresp, complete->result);
Expand Down Expand Up @@ -3649,7 +3649,7 @@ static void hfa384x_int_rxmonitor(wlandevice_t *wlandev,
/* check for unencrypted stuff if WEP bit set. */
if (*(datap - hdrlen + 1) & 0x40) /* wep set */
if ((*(datap) == 0xaa) && (*(datap + 1) == 0xaa))
*(datap - hdrlen + 1) &= 0xbf; // clear wep; it's the 802.2 header!
*(datap - hdrlen + 1) &= 0xbf; /* clear wep; it's the 802.2 header! */
}

if (hw->sniff_fcs) {
Expand Down
23 changes: 12 additions & 11 deletions drivers/staging/wlan-ng/p80211conv.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,12 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
/* XXXX need to pick keynum other than default? */

p80211_wep->data = kmalloc(skb->len, GFP_ATOMIC);

if ((foo = wep_encrypt(wlandev, skb->data, p80211_wep->data,
skb->len,
(wlandev->hostwep &
HOSTWEP_DEFAULTKEY_MASK),
p80211_wep->iv, p80211_wep->icv))) {
foo = wep_encrypt(wlandev, skb->data, p80211_wep->data,
skb->len,
(wlandev->hostwep &
HOSTWEP_DEFAULTKEY_MASK),
p80211_wep->iv, p80211_wep->icv);
if (foo) {
printk(KERN_WARNING
"Host en-WEP failed, dropping frame (%d).\n",
foo);
Expand Down Expand Up @@ -323,11 +323,12 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
skb->len);
return 1;
}
if ((foo = wep_decrypt(wlandev, skb->data + payload_offset + 4,
payload_length - 8, -1,
skb->data + payload_offset,
skb->data + payload_offset +
payload_length - 4))) {
foo = wep_decrypt(wlandev, skb->data + payload_offset + 4,
payload_length - 8, -1,
skb->data + payload_offset,
skb->data + payload_offset +
payload_length - 4);
if (foo) {
/* de-wep failed, drop skb. */
pr_debug("Host de-WEP failed, dropping frame (%d).\n",
foo);
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/wlan-ng/p80211conv.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ struct wlandevice;
int skb_p80211_to_ether(struct wlandevice *wlandev, u32 ethconv,
struct sk_buff *skb);
int skb_ether_to_p80211(struct wlandevice *wlandev, u32 ethconv,
struct sk_buff *skb, p80211_hdr_t * p80211_hdr,
p80211_metawep_t * p80211_wep);
struct sk_buff *skb, p80211_hdr_t *p80211_hdr,
p80211_metawep_t *p80211_wep);

int p80211_stt_findproto(u16 proto);

Expand Down
18 changes: 9 additions & 9 deletions drivers/staging/wlan-ng/p80211metadef.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@
(P80211DID_MKSECTION(2) | \
P80211DID_MKGROUP(1))
#define DIDmib_dot11mac_dot11OperationTable_dot11MACAddress \
(P80211DID_MKSECTION(2) | \
P80211DID_MKGROUP(1) | \
P80211DID_MKITEM(1) | 0x18000000)
((P80211DID_MKSECTION(2) | \
P80211DID_MKGROUP(1) | \
P80211DID_MKITEM(1) | 0x18000000))
#define DIDmib_dot11mac_dot11OperationTable_dot11RTSThreshold \
(P80211DID_MKSECTION(2) | \
P80211DID_MKGROUP(1) | \
Expand All @@ -210,18 +210,18 @@
P80211DID_MKGROUP(1) | \
P80211DID_MKITEM(5) | 0x18000000)
#define DIDmib_dot11mac_dot11OperationTable_dot11MaxTransmitMSDULifetime \
(P80211DID_MKSECTION(2) | \
P80211DID_MKGROUP(1) | \
P80211DID_MKITEM(6) | 0x10000000)
(P80211DID_MKSECTION(2) | \
P80211DID_MKGROUP(1) | \
P80211DID_MKITEM(6) | 0x10000000)
#define DIDmib_cat_dot11phy \
P80211DID_MKSECTION(3)
#define DIDmib_dot11phy_dot11PhyOperationTable \
(P80211DID_MKSECTION(3) | \
P80211DID_MKGROUP(1))
#define DIDmib_dot11phy_dot11PhyTxPowerTable_dot11CurrentTxPowerLevel \
(P80211DID_MKSECTION(3) | \
P80211DID_MKGROUP(3) | \
P80211DID_MKITEM(10) | 0x18000000)
(P80211DID_MKSECTION(3) | \
P80211DID_MKGROUP(3) | \
P80211DID_MKITEM(10) | 0x18000000)
#define DIDmib_dot11phy_dot11PhyDSSSTable \
(P80211DID_MKSECTION(3) | \
P80211DID_MKGROUP(5))
Expand Down
42 changes: 21 additions & 21 deletions drivers/staging/wlan-ng/p80211mgmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
#ifndef _P80211MGMT_H
#define _P80211MGMT_H

#ifndef _P80211HDR_H
#ifndef _P80211HDR_H
#include "p80211hdr.h"
#endif

Expand Down Expand Up @@ -496,25 +496,25 @@ typedef struct wlan_fr_deauthen {

} wlan_fr_deauthen_t;

void wlan_mgmt_encode_beacon(wlan_fr_beacon_t * f);
void wlan_mgmt_decode_beacon(wlan_fr_beacon_t * f);
void wlan_mgmt_encode_disassoc(wlan_fr_disassoc_t * f);
void wlan_mgmt_decode_disassoc(wlan_fr_disassoc_t * f);
void wlan_mgmt_encode_assocreq(wlan_fr_assocreq_t * f);
void wlan_mgmt_decode_assocreq(wlan_fr_assocreq_t * f);
void wlan_mgmt_encode_assocresp(wlan_fr_assocresp_t * f);
void wlan_mgmt_decode_assocresp(wlan_fr_assocresp_t * f);
void wlan_mgmt_encode_reassocreq(wlan_fr_reassocreq_t * f);
void wlan_mgmt_decode_reassocreq(wlan_fr_reassocreq_t * f);
void wlan_mgmt_encode_reassocresp(wlan_fr_reassocresp_t * f);
void wlan_mgmt_decode_reassocresp(wlan_fr_reassocresp_t * f);
void wlan_mgmt_encode_probereq(wlan_fr_probereq_t * f);
void wlan_mgmt_decode_probereq(wlan_fr_probereq_t * f);
void wlan_mgmt_encode_proberesp(wlan_fr_proberesp_t * f);
void wlan_mgmt_decode_proberesp(wlan_fr_proberesp_t * f);
void wlan_mgmt_encode_authen(wlan_fr_authen_t * f);
void wlan_mgmt_decode_authen(wlan_fr_authen_t * f);
void wlan_mgmt_encode_deauthen(wlan_fr_deauthen_t * f);
void wlan_mgmt_decode_deauthen(wlan_fr_deauthen_t * f);
void wlan_mgmt_encode_beacon(wlan_fr_beacon_t *f);
void wlan_mgmt_decode_beacon(wlan_fr_beacon_t *f);
void wlan_mgmt_encode_disassoc(wlan_fr_disassoc_t *f);
void wlan_mgmt_decode_disassoc(wlan_fr_disassoc_t *f);
void wlan_mgmt_encode_assocreq(wlan_fr_assocreq_t *f);
void wlan_mgmt_decode_assocreq(wlan_fr_assocreq_t *f);
void wlan_mgmt_encode_assocresp(wlan_fr_assocresp_t *f);
void wlan_mgmt_decode_assocresp(wlan_fr_assocresp_t *f);
void wlan_mgmt_encode_reassocreq(wlan_fr_reassocreq_t *f);
void wlan_mgmt_decode_reassocreq(wlan_fr_reassocreq_t *f);
void wlan_mgmt_encode_reassocresp(wlan_fr_reassocresp_t *f);
void wlan_mgmt_decode_reassocresp(wlan_fr_reassocresp_t *f);
void wlan_mgmt_encode_probereq(wlan_fr_probereq_t *f);
void wlan_mgmt_decode_probereq(wlan_fr_probereq_t *f);
void wlan_mgmt_encode_proberesp(wlan_fr_proberesp_t *f);
void wlan_mgmt_decode_proberesp(wlan_fr_proberesp_t *f);
void wlan_mgmt_encode_authen(wlan_fr_authen_t *f);
void wlan_mgmt_decode_authen(wlan_fr_authen_t *f);
void wlan_mgmt_encode_deauthen(wlan_fr_deauthen_t *f);
void wlan_mgmt_decode_deauthen(wlan_fr_deauthen_t *f);

#endif /* _P80211MGMT_H */
7 changes: 4 additions & 3 deletions drivers/staging/wlan-ng/p80211netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,8 @@ static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd)
}

/* Allocate a buf of size req->len */
if ((msgbuf = kmalloc(req->len, GFP_KERNEL))) {
msgbuf = kmalloc(req->len, GFP_KERNEL);
if (msgbuf) {
if (copy_from_user(msgbuf, (void __user *)req->data, req->len))
result = -EFAULT;
else
Expand Down Expand Up @@ -646,7 +647,7 @@ static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr)

/* Set up some convenience pointers. */
mibattr = &dot11req.mibattribute;
macaddr = (p80211item_pstr6_t *) & mibattr->data;
macaddr = (p80211item_pstr6_t *) &mibattr->data;
resultcode = &dot11req.resultcode;

/* Set up a dot11req_mibset */
Expand Down Expand Up @@ -674,7 +675,7 @@ static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr)
resultcode->data = 0;

/* now fire the request */
result = p80211req_dorequest(dev->ml_priv, (u8 *) & dot11req);
result = p80211req_dorequest(dev->ml_priv, (u8 *) &dot11req);

/* If the request wasn't successful, report an error and don't
* change the netdev address
Expand Down
44 changes: 22 additions & 22 deletions drivers/staging/wlan-ng/p80211netdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,16 @@ typedef struct wlandevice {
unsigned int ethconv;

/* device methods (init by MSD, used by p80211 */
int (*open) (struct wlandevice * wlandev);
int (*close) (struct wlandevice * wlandev);
void (*reset) (struct wlandevice * wlandev);
int (*txframe) (struct wlandevice * wlandev, struct sk_buff * skb,
p80211_hdr_t * p80211_hdr,
p80211_metawep_t * p80211_wep);
int (*mlmerequest) (struct wlandevice * wlandev, p80211msg_t * msg);
int (*set_multicast_list) (struct wlandevice * wlandev,
netdevice_t * dev);
void (*tx_timeout) (struct wlandevice * wlandev);
int (*open) (struct wlandevice *wlandev);
int (*close) (struct wlandevice *wlandev);
void (*reset) (struct wlandevice *wlandev);
int (*txframe) (struct wlandevice *wlandev, struct sk_buff *skb,
p80211_hdr_t *p80211_hdr,
p80211_metawep_t *p80211_wep);
int (*mlmerequest) (struct wlandevice *wlandev, p80211msg_t *msg);
int (*set_multicast_list) (struct wlandevice *wlandev,
netdevice_t *dev);
void (*tx_timeout) (struct wlandevice *wlandev);

/* 802.11 State */
u8 bssid[WLAN_BSSID_LEN];
Expand Down Expand Up @@ -227,16 +227,16 @@ typedef struct wlandevice {
} wlandevice_t;

/* WEP stuff */
int wep_change_key(wlandevice_t * wlandev, int keynum, u8 * key, int keylen);
int wep_decrypt(wlandevice_t * wlandev, u8 * buf, u32 len, int key_override,
u8 * iv, u8 * icv);
int wep_encrypt(wlandevice_t * wlandev, u8 * buf, u8 * dst, u32 len, int keynum,
u8 * iv, u8 * icv);

int wlan_setup(wlandevice_t * wlandev);
int wlan_unsetup(wlandevice_t * wlandev);
int register_wlandev(wlandevice_t * wlandev);
int unregister_wlandev(wlandevice_t * wlandev);
void p80211netdev_rx(wlandevice_t * wlandev, struct sk_buff *skb);
void p80211netdev_hwremoved(wlandevice_t * wlandev);
int wep_change_key(wlandevice_t *wlandev, int keynum, u8 *key, int keylen);
int wep_decrypt(wlandevice_t *wlandev, u8 *buf, u32 len, int key_override,
u8 *iv, u8 *icv);
int wep_encrypt(wlandevice_t *wlandev, u8 *buf, u8 *dst, u32 len, int keynum,
u8 *iv, u8 *icv);

int wlan_setup(wlandevice_t *wlandev);
int wlan_unsetup(wlandevice_t *wlandev);
int register_wlandev(wlandevice_t *wlandev);
int unregister_wlandev(wlandevice_t *wlandev);
void p80211netdev_rx(wlandevice_t *wlandev, struct sk_buff *skb);
void p80211netdev_hwremoved(wlandevice_t *wlandev);
#endif
Loading

0 comments on commit 5dd8acc

Please sign in to comment.