Commit 75f49e07 authored by Mithlesh Thukral's avatar Mithlesh Thukral Committed by Greg Kroah-Hartman

Staging: wlan-ng: Lindent cleanups

Lindent script cleanups in wlan-ng driver in the staging tree.
This is a item in the TODO list.
Signed-off-by: default avatarMithlesh Thukral <mithlesh@linsyssoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 1611a52c
This diff is collapsed.
This diff is collapsed.
......@@ -102,9 +102,9 @@ static u8 oui_8021h[] = { 0x00, 0x00, 0xf8 };
* Call context:
* May be called in interrupt or non-interrupt context
----------------------------------------------------------------*/
int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
struct sk_buff *skb, p80211_hdr_t *p80211_hdr,
p80211_metawep_t *p80211_wep)
int skb_ether_to_p80211(wlandevice_t * wlandev, u32 ethconv,
struct sk_buff *skb, p80211_hdr_t * p80211_hdr,
p80211_metawep_t * p80211_wep)
{
u16 fc;
......@@ -209,8 +209,8 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
if ((foo = wep_encrypt(wlandev, skb->data, p80211_wep->data,
skb->len,
(wlandev->
hostwep & HOSTWEP_DEFAULTKEY_MASK),
(wlandev->hostwep &
HOSTWEP_DEFAULTKEY_MASK),
p80211_wep->iv, p80211_wep->icv))) {
printk(KERN_WARNING
"Host en-WEP failed, dropping frame (%d).\n",
......@@ -230,8 +230,8 @@ int skb_ether_to_p80211(wlandevice_t *wlandev, u32 ethconv,
}
/* jkriegl: from orinoco, modified */
static void orinoco_spy_gather(wlandevice_t *wlandev, char *mac,
p80211_rxmeta_t *rxmeta)
static void orinoco_spy_gather(wlandevice_t * wlandev, char *mac,
p80211_rxmeta_t * rxmeta)
{
int i;
......@@ -272,7 +272,7 @@ static void orinoco_spy_gather(wlandevice_t *wlandev, char *mac,
* Call context:
* May be called in interrupt or non-interrupt context
----------------------------------------------------------------*/
int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
int skb_p80211_to_ether(wlandevice_t * wlandev, u32 ethconv,
struct sk_buff *skb)
{
netdevice_t *netdev = wlandev->netdev;
......@@ -329,8 +329,7 @@ int skb_p80211_to_ether(wlandevice_t *wlandev, u32 ethconv,
skb->data + payload_offset +
payload_length - 4))) {
/* de-wep failed, drop skb. */
pr_debug(
"Host de-WEP failed, dropping frame (%d).\n",
pr_debug("Host de-WEP failed, dropping frame (%d).\n",
foo);
wlandev->rx.decrypt_err++;
return 2;
......
......@@ -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);
......
......@@ -68,8 +68,6 @@
/*================================================================*/
/* Project Includes */
/*================================================================*/
/* Constants */
......@@ -188,7 +186,6 @@ typedef union p80211_hdr {
p80211_hdr_a4_t a4;
} __attribute__ ((packed)) p80211_hdr_t;
/* Frame and header length macros */
#define WLAN_CTL_FRAMELEN(fstype) (\
......
......@@ -60,7 +60,6 @@
/*================================================================*/
/* Project Includes */
/*================================================================*/
/* Types */
......
......@@ -103,12 +103,10 @@
/*================================================================*/
/* Project Includes */
#ifndef _P80211HDR_H
#include "p80211hdr.h"
#endif
/*================================================================*/
/* Constants */
......@@ -504,25 +502,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 */
......@@ -51,7 +51,6 @@
/*================================================================*/
/* Project Includes */
#define WLAN_DEVNAMELEN_MAX 16
/*--------------------------------------------------------------------*/
......
......@@ -94,18 +94,18 @@
static void p80211netdev_rx_bh(unsigned long arg);
/* netdevice method functions */
static int p80211knetdev_init(netdevice_t *netdev);
static struct net_device_stats *p80211knetdev_get_stats(netdevice_t *netdev);
static int p80211knetdev_open(netdevice_t *netdev);
static int p80211knetdev_stop(netdevice_t *netdev);
static int p80211knetdev_init(netdevice_t * netdev);
static struct net_device_stats *p80211knetdev_get_stats(netdevice_t * netdev);
static int p80211knetdev_open(netdevice_t * netdev);
static int p80211knetdev_stop(netdevice_t * netdev);
static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
netdevice_t *netdev);
static void p80211knetdev_set_multicast_list(netdevice_t *dev);
static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr,
netdevice_t * netdev);
static void p80211knetdev_set_multicast_list(netdevice_t * dev);
static int p80211knetdev_do_ioctl(netdevice_t * dev, struct ifreq *ifr,
int cmd);
static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr);
static void p80211knetdev_tx_timeout(netdevice_t *netdev);
static int p80211_rx_typedrop(wlandevice_t *wlandev, u16 fc);
static int p80211knetdev_set_mac_address(netdevice_t * dev, void *addr);
static void p80211knetdev_tx_timeout(netdevice_t * netdev);
static int p80211_rx_typedrop(wlandevice_t * wlandev, u16 fc);
int wlan_watchdog = 5000;
module_param(wlan_watchdog, int, 0644);
......@@ -127,7 +127,7 @@ MODULE_PARM_DESC(wlan_wext_write, "enable write wireless extensions");
* Returns:
* nothing
----------------------------------------------------------------*/
static int p80211knetdev_init(netdevice_t *netdev)
static int p80211knetdev_init(netdevice_t * netdev)
{
/* Called in response to register_netdev */
/* This is usually the probe function, but the probe has */
......@@ -150,7 +150,7 @@ static int p80211knetdev_init(netdevice_t *netdev)
* Returns:
* the address of the statistics structure
----------------------------------------------------------------*/
static struct net_device_stats *p80211knetdev_get_stats(netdevice_t *netdev)
static struct net_device_stats *p80211knetdev_get_stats(netdevice_t * netdev)
{
wlandevice_t *wlandev = netdev->ml_priv;
......@@ -174,7 +174,7 @@ static struct net_device_stats *p80211knetdev_get_stats(netdevice_t *netdev)
* Returns:
* zero on success, non-zero otherwise
----------------------------------------------------------------*/
static int p80211knetdev_open(netdevice_t *netdev)
static int p80211knetdev_open(netdevice_t * netdev)
{
int result = 0; /* success */
wlandevice_t *wlandev = netdev->ml_priv;
......@@ -209,7 +209,7 @@ static int p80211knetdev_open(netdevice_t *netdev)
* Returns:
* zero on success, non-zero otherwise
----------------------------------------------------------------*/
static int p80211knetdev_stop(netdevice_t *netdev)
static int p80211knetdev_stop(netdevice_t * netdev)
{
int result = 0;
wlandevice_t *wlandev = netdev->ml_priv;
......@@ -236,7 +236,7 @@ static int p80211knetdev_stop(netdevice_t *netdev)
* Side effects:
*
----------------------------------------------------------------*/
void p80211netdev_rx(wlandevice_t *wlandev, struct sk_buff *skb)
void p80211netdev_rx(wlandevice_t * wlandev, struct sk_buff *skb)
{
/* Enqueue for post-irq processing */
skb_queue_tail(&wlandev->nsd_rxq, skb);
......@@ -345,7 +345,7 @@ static void p80211netdev_rx_bh(unsigned long arg)
* zero on success, non-zero on failure.
----------------------------------------------------------------*/
static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
netdevice_t *netdev)
netdevice_t * netdev)
{
int result = 0;
int txresult = -1;
......@@ -472,7 +472,7 @@ static int p80211knetdev_hard_start_xmit(struct sk_buff *skb,
* Returns:
* nothing
----------------------------------------------------------------*/
static void p80211knetdev_set_multicast_list(netdevice_t *dev)
static void p80211knetdev_set_multicast_list(netdevice_t * dev)
{
wlandevice_t *wlandev = dev->ml_priv;
......@@ -485,7 +485,7 @@ static void p80211knetdev_set_multicast_list(netdevice_t *dev)
#ifdef SIOCETHTOOL
static int p80211netdev_ethtool(wlandevice_t *wlandev, void __user *useraddr)
static int p80211netdev_ethtool(wlandevice_t * wlandev, void __user * useraddr)
{
u32 ethcmd;
struct ethtool_drvinfo info;
......@@ -557,7 +557,7 @@ static int p80211netdev_ethtool(wlandevice_t *wlandev, void __user *useraddr)
* Process thread (ioctl caller). TODO: SMP support may require
* locks.
----------------------------------------------------------------*/
static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd)
static int p80211knetdev_do_ioctl(netdevice_t * dev, struct ifreq *ifr, int cmd)
{
int result = 0;
p80211ioctl_req_t *req = (p80211ioctl_req_t *) ifr;
......@@ -634,7 +634,7 @@ static int p80211knetdev_do_ioctl(netdevice_t *dev, struct ifreq *ifr, int cmd)
*
* by: Collin R. Mulliner <collin@mulliner.org>
----------------------------------------------------------------*/
static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr)
static int p80211knetdev_set_mac_address(netdevice_t * dev, void *addr)
{
struct sockaddr *new_addr = addr;
p80211msg_dot11req_mibset_t dot11req;
......@@ -649,7 +649,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 */
......@@ -677,7 +677,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
......@@ -694,7 +694,7 @@ static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr)
return result;
}
static int wlan_change_mtu(netdevice_t *dev, int new_mtu)
static int wlan_change_mtu(netdevice_t * dev, int new_mtu)
{
/* 2312 is max 802.11 payload, 20 is overhead, (ether + llc +snap)
and another 8 for wep. */
......@@ -742,7 +742,7 @@ static const struct net_device_ops p80211_netdev_ops = {
* compiled drivers, this function will be called in the
* context of the kernel startup code.
----------------------------------------------------------------*/
int wlan_setup(wlandevice_t *wlandev)
int wlan_setup(wlandevice_t * wlandev)
{
int result = 0;
netdevice_t *dev;
......@@ -800,7 +800,7 @@ int wlan_setup(wlandevice_t *wlandev)
* compiled drivers, this function will be called in the
* context of the kernel startup code.
----------------------------------------------------------------*/
int wlan_unsetup(wlandevice_t *wlandev)
int wlan_unsetup(wlandevice_t * wlandev)
{
int result = 0;
......@@ -836,7 +836,7 @@ int wlan_unsetup(wlandevice_t *wlandev)
* Call Context:
* Can be either interrupt or not.
----------------------------------------------------------------*/
int register_wlandev(wlandevice_t *wlandev)
int register_wlandev(wlandevice_t * wlandev)
{
int i = 0;
......@@ -864,7 +864,7 @@ int register_wlandev(wlandevice_t *wlandev)
* Call Context:
* Can be either interrupt or not.
----------------------------------------------------------------*/
int unregister_wlandev(wlandevice_t *wlandev)
int unregister_wlandev(wlandevice_t * wlandev)
{
struct sk_buff *skb;
......@@ -907,7 +907,7 @@ int unregister_wlandev(wlandevice_t *wlandev)
* Call context:
* Usually interrupt.
----------------------------------------------------------------*/
void p80211netdev_hwremoved(wlandevice_t *wlandev)
void p80211netdev_hwremoved(wlandevice_t * wlandev)
{
wlandev->hwremoved = 1;
if (wlandev->state == WLAN_DEVICE_OPEN)
......@@ -937,7 +937,7 @@ void p80211netdev_hwremoved(wlandevice_t *wlandev)
* Call context:
* interrupt
----------------------------------------------------------------*/
static int p80211_rx_typedrop(wlandevice_t *wlandev, u16 fc)
static int p80211_rx_typedrop(wlandevice_t * wlandev, u16 fc)
{
u16 ftype;
u16 fstype;
......@@ -1095,7 +1095,7 @@ static int p80211_rx_typedrop(wlandevice_t *wlandev, u16 fc)
return drop;
}
static void p80211knetdev_tx_timeout(netdevice_t *netdev)
static void p80211knetdev_tx_timeout(netdevice_t * netdev)
{
wlandevice_t *wlandev = netdev->ml_priv;
......
......@@ -182,16 +182,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];
......@@ -230,16 +230,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
......@@ -73,9 +73,9 @@
#include "p80211metastruct.h"
#include "p80211req.h"
static void p80211req_handlemsg(wlandevice_t *wlandev, p80211msg_t *msg);
static int p80211req_mibset_mibget(wlandevice_t *wlandev,
p80211msg_dot11req_mibget_t *mib_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);
/*----------------------------------------------------------------
......@@ -94,7 +94,7 @@ static int p80211req_mibset_mibget(wlandevice_t *wlandev,
* Potentially blocks the caller, so it's a good idea to
* not call this function from an interrupt context.
----------------------------------------------------------------*/
int p80211req_dorequest(wlandevice_t *wlandev, u8 *msgbuf)
int p80211req_dorequest(wlandevice_t * wlandev, u8 * msgbuf)
{
int result = 0;
p80211msg_t *msg = (p80211msg_t *) msgbuf;
......@@ -150,7 +150,7 @@ int p80211req_dorequest(wlandevice_t *wlandev, u8 *msgbuf)
* Call context:
* Process thread
----------------------------------------------------------------*/
static void p80211req_handlemsg(wlandevice_t *wlandev, p80211msg_t *msg)
static void p80211req_handlemsg(wlandevice_t * wlandev, p80211msg_t * msg)
{
switch (msg->msgcode) {
......@@ -180,8 +180,8 @@ static void p80211req_handlemsg(wlandevice_t *wlandev, p80211msg_t *msg)
return;
}
static int p80211req_mibset_mibget(wlandevice_t *wlandev,
p80211msg_dot11req_mibget_t *mib_msg,
static int p80211req_mibset_mibget(wlandevice_t * wlandev,
p80211msg_dot11req_mibget_t * mib_msg,
int isget)
{
p80211itemd_t *mibitem = (p80211itemd_t *) mib_msg->mibattribute.data;
......@@ -243,8 +243,8 @@ static int p80211req_mibset_mibget(wlandevice_t *wlandev,
u32 *data = (u32 *) mibitem->data;
if (isget) {
if (wlandev->
hostwep & HOSTWEP_EXCLUDEUNENCRYPTED)
if (wlandev->hostwep &
HOSTWEP_EXCLUDEUNENCRYPTED)
*data = P80211ENUM_truth_true;
else
*data = P80211ENUM_truth_false;
......
......@@ -48,6 +48,6 @@
#ifndef _LINUX_P80211REQ_H
#define _LINUX_P80211REQ_H
int p80211req_dorequest(wlandevice_t *wlandev, u8 *msgbuf);
int p80211req_dorequest(wlandevice_t * wlandev, u8 * msgbuf);
#endif
......@@ -61,7 +61,6 @@
/* Project Includes */
/*================================================================*/
/*----------------------------------------------------------------*/
/* The following constants are indexes into the Mib Category List */
/* and the Message Category List */
......@@ -345,11 +344,11 @@ struct catlistitem;
/* metadata items. Some components may choose to use more, */
/* less or different metadata items. */
typedef void (*p80211_totext_t) (struct catlistitem *, u32 did, u8 *itembuf,
typedef void (*p80211_totext_t) (struct catlistitem *, u32 did, u8 * itembuf,
char *textbuf);
typedef void (*p80211_fromtext_t) (struct catlistitem *, u32 did, u8 *itembuf,
typedef void (*p80211_fromtext_t) (struct catlistitem *, u32 did, u8 * itembuf,
char *textbuf);
typedef u32(*p80211_valid_t) (struct catlistitem *, u32 did, u8 *itembuf);
typedef u32(*p80211_valid_t) (struct catlistitem *, u32 did, u8 * itembuf);
/*----------------------------------------------------------------*/
/* Enumeration Lists */
......
......@@ -48,8 +48,6 @@
/*================================================================*/
/* System Includes */
#include <linux/netdevice.h>
#include <linux/wireless.h>
#include <linux/slab.h>
......@@ -138,17 +136,24 @@ static const u32 wep_crc32_table[256] = {
/* keylen in bytes! */
int wep_change_key(wlandevice_t *wlandev, int keynum, u8* key, int keylen)
int wep_change_key(wlandevice_t * wlandev, int keynum, u8 * key, int keylen)
{
if (keylen < 0) return -1;
if (keylen >= MAX_KEYLEN) return -1;
if (key == NULL) return -1;
if (keynum < 0) return -1;
if (keynum >= NUM_WEPKEYS) return -1;
if (keylen < 0)
return -1;
if (keylen >= MAX_KEYLEN)
return -1;
if (key == NULL)
return -1;
if (keynum < 0)
return -1;
if (keynum >= NUM_WEPKEYS)
return -1;
#ifdef WEP_DEBUG
printk(KERN_DEBUG "WEP key %d len %d = %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n", keynum, keylen, key[0], key[1], key[2], key[3], key[4], key[5], key[6], key[7]);
printk(KERN_DEBUG
"WEP key %d len %d = %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
keynum, keylen, key[0], key[1], key[2], key[3], key[4], key[5],
key[6], key[7]);
#endif
wlandev->wep_keylens[keynum] = keylen;
......@@ -161,14 +166,16 @@ int wep_change_key(wlandevice_t *wlandev, int keynum, u8* key, int keylen)
4-byte IV at start of buffer, 4-byte ICV at end of buffer.
if successful, buf start is payload begin, length -= 8;
*/
int wep_decrypt(wlandevice_t *wlandev, u8 *buf, u32 len, int key_override, u8 *iv, u8 *icv)
int wep_decrypt(wlandevice_t * wlandev, u8 * buf, u32 len, int key_override,
u8 * iv, u8 * icv)
{
u32 i, j, k, crc, keylen;
u8 s[256], key[64], c_crc[4];
u8 keyidx;
/* Needs to be at least 8 bytes of payload */
if (len <= 0) return -1;
if (len <= 0)
return -1;
/* initialize the first bytes of the key from the IV */
key[0] = iv[0];
......@@ -179,19 +186,24 @@ int wep_decrypt(wlandevice_t *wlandev, u8 *buf, u32 len, int key_override, u8 *i
if (key_override >= 0)
keyidx = key_override;
if (keyidx >= NUM_WEPKEYS) return -2;
if (keyidx >= NUM_WEPKEYS)
return -2;
keylen = wlandev->wep_keylens[keyidx];
if (keylen == 0) return -3;
if (keylen == 0)
return -3;
/* copy the rest of the key over from the designated key */
memcpy(key+3, wlandev->wep_keys[keyidx], keylen);
memcpy(key + 3, wlandev->wep_keys[keyidx], keylen);
keylen+=3; /* add in IV bytes */
keylen += 3; /* add in IV bytes */
#ifdef WEP_DEBUG
printk(KERN_DEBUG "D %d: %02x %02x %02x (%d %d) %02x:%02x:%02x:%02x:%02x\n", len, key[0], key[1], key[2], keyidx, keylen, key[3], key[4], key[5], key[6], key[7]);
printk(KERN_DEBUG
"D %d: %02x %02x %02x (%d %d) %02x:%02x:%02x:%02x:%02x\n", len,
key[0], key[1], key[2], keyidx, keylen, key[3], key[4], key[5],
key[6], key[7]);
#endif
/* set up the RC4 state */
......@@ -200,16 +212,16 @@ int wep_decrypt(wlandevice_t *wlandev, u8 *buf, u32 len, int key_override, u8 *i
j = 0;
for (i = 0; i < 256; i++) {
j = (j + s[i] + key[i % keylen]) & 0xff;
swap(i,j);
swap(i, j);
}
/* Apply the RC4 to the data, update the CRC32 */
crc = ~0;
i = j = 0;
for (k = 0; k < len; k++) {
i = (i+1) & 0xff;
j = (j+s[i]) & 0xff;
swap(i,j);
i = (i + 1) & 0xff;
j = (j + s[i]) & 0xff;
swap(i, j);
buf[k] ^= s[(s[i] + s[j]) & 0xff];
crc = wep_crc32_table[(crc ^ buf[k]) & 0xff] ^ (crc >> 8);
}
......@@ -223,28 +235,32 @@ int wep_decrypt(wlandevice_t *wlandev, u8 *buf, u32 len, int key_override, u8 *i
for (k = 0; k < 4; k++) {
i = (i + 1) & 0xff;
j = (j+s[i]) & 0xff;
swap(i,j);
j = (j + s[i]) & 0xff;
swap(i, j);
if ((c_crc[k] ^ s[(s[i] + s[j]) & 0xff]) != icv[k])
return -(4 | (k << 4)) ; /* ICV mismatch */
return -(4 | (k << 4)); /* ICV mismatch */
}
return 0;
}
/* encrypts in-place. */
int wep_encrypt(wlandevice_t *wlandev, u8 *buf, u8 *dst, u32 len, int keynum, u8 *iv, u8 *icv)
int wep_encrypt(wlandevice_t * wlandev, u8 * buf, u8 * dst, u32 len, int keynum,
u8 * iv, u8 * icv)
{
u32 i, j, k, crc, keylen;
u8 s[256], key[64];
/* no point in WEPping an empty frame */
if (len <= 0) return -1;
if (len <= 0)
return -1;
/* we need to have a real key.. */
if (keynum >= NUM_WEPKEYS) return -2;
if (keynum >= NUM_WEPKEYS)
return -2;
keylen = wlandev->wep_keylens[keynum];
if (keylen <= 0) return -3;
if (keylen <= 0)
return -3;
/* use a random IV. And skip known weak ones. */
get_random_bytes(iv, 3);
......@@ -258,12 +274,15 @@ int wep_encrypt(wlandevice_t *wlandev, u8 *buf, u8 *dst, u32 len, int keynum, u8
key[2] = iv[2];
/* copy the rest of the key over from the designated key */
memcpy(key+3, wlandev->wep_keys[keynum], keylen);
memcpy(key + 3, wlandev->wep_keys[keynum], keylen);
keylen+=3; /* add in IV bytes */
keylen += 3; /* add in IV bytes */
#ifdef WEP_DEBUG
printk(KERN_DEBUG "E %d (%d/%d %d) %02x %02x %02x %02x:%02x:%02x:%02x:%02x\n", len, iv[3], keynum, keylen, key[0], key[1], key[2], key[3], key[4], key[5], key[6], key[7]);
printk(KERN_DEBUG
"E %d (%d/%d %d) %02x %02x %02x %02x:%02x:%02x:%02x:%02x\n", len,
iv[3], keynum, keylen, key[0], key[1], key[2], key[3], key[4],
key[5], key[6], key[7]);
#endif
/* set up the RC4 state */
......@@ -272,7 +291,7 @@ int wep_encrypt(wlandevice_t *wlandev, u8 *buf, u8 *dst, u32 len, int keynum, u8
j = 0;
for (i = 0; i < 256; i++) {
j = (j + s[i] + key[i % keylen]) & 0xff;
swap(i,j);
swap(i, j);
}
/* Update CRC32 then apply RC4 to the data */
......@@ -280,9 +299,9 @@ int wep_encrypt(wlandevice_t *wlandev, u8 *buf, u8 *dst, u32 len, int keynum, u8
i = j = 0;
for (k = 0; k < len; k++) {
crc = wep_crc32_table[(crc ^ buf[k]) & 0xff] ^ (crc >> 8);
i = (i+1) & 0xff;
j = (j+s[i]) & 0xff;
swap(i,j);
i = (i + 1) & 0xff;
j = (j + s[i]) & 0xff;
swap(i, j);
dst[k] = buf[k] ^ s[(s[i] + s[j]) & 0xff];
}
crc = ~crc;
......@@ -295,8 +314,8 @@ int wep_encrypt(wlandevice_t *wlandev, u8 *buf, u8 *dst, u32 len, int keynum, u8
for (k = 0; k < 4; k++) {
i = (i + 1) & 0xff;
j = (j+s[i]) & 0xff;
swap(i,j);
j = (j + s[i]) & 0xff;
swap(i, j);
icv[k] ^= s[(s[i] + s[j]) & 0xff];
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -117,7 +117,7 @@
* process thread (usually)
* interrupt
----------------------------------------------------------------*/
int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
int prism2mgmt_scan(wlandevice_t * wlandev, void *msgp)
{
int result = 0;
hfa384x_t *hw = wlandev->priv;
......@@ -362,7 +362,7 @@ int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp)
* process thread (usually)
* interrupt
----------------------------------------------------------------*/
int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp)
int prism2mgmt_scan_results(wlandevice_t * wlandev, void *msgp)
{
int result = 0;
p80211msg_dot11req_scan_results_t *req;
......@@ -511,7 +511,7 @@ int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp)
* process thread (usually)
* interrupt
----------------------------------------------------------------*/
int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
int prism2mgmt_start(wlandevice_t * wlandev, void *msgp)
{
int result = 0;
hfa384x_t *hw = wlandev->priv;
......@@ -544,7 +544,7 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
/*** STATION ***/
/* Set the REQUIRED config items */
/* SSID */
pstr = (p80211pstrd_t *)&(msg->ssid.data);
pstr = (p80211pstrd_t *) & (msg->ssid.data);
prism2mgmt_pstr2bytestr(p2bytestr, pstr);
result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFOWNSSID,
bytebuf, HFA384x_RID_CNFOWNSSID_LEN);
......@@ -688,7 +688,7 @@ int prism2mgmt_start(wlandevice_t *wlandev, void *msgp)
* Call context:
* process thread (usually)
----------------------------------------------------------------*/
int prism2mgmt_readpda(wlandevice_t *wlandev, void *msgp)
int prism2mgmt_readpda(wlandevice_t * wlandev, void *msgp)
{
hfa384x_t *hw = wlandev->priv;
p80211msg_p2req_readpda_t *msg = msgp;
......@@ -754,7 +754,7 @@ int prism2mgmt_readpda(wlandevice_t *wlandev, void *msgp)
* Call context:
* process thread (usually)
----------------------------------------------------------------*/
int prism2mgmt_ramdl_state(wlandevice_t *wlandev, void *msgp)
int prism2mgmt_ramdl_state(wlandevice_t * wlandev, void *msgp)
{
hfa384x_t *hw = wlandev->priv;
p80211msg_p2req_ramdl_state_t *msg = msgp;
......@@ -810,7 +810,7 @@ int prism2mgmt_ramdl_state(wlandevice_t *wlandev, void *msgp)
* Call context:
* process thread (usually)
----------------------------------------------------------------*/
int prism2mgmt_ramdl_write(wlandevice_t *wlandev, void *msgp)
int prism2mgmt_ramdl_write(wlandevice_t * wlandev, void *msgp)
{
hfa384x_t *hw = wlandev->priv;
p80211msg_p2req_ramdl_write_t *msg = msgp;
......@@ -872,7 +872,7 @@ int prism2mgmt_ramdl_write(wlandevice_t *wlandev, void *msgp)
* Call context:
* process thread (usually)
----------------------------------------------------------------*/
int prism2mgmt_flashdl_state(wlandevice_t *wlandev, void *msgp)
int prism2mgmt_flashdl_state(wlandevice_t * wlandev, void *msgp)
{
int result = 0;
hfa384x_t *hw = wlandev->priv;
......@@ -943,7 +943,7 @@ int prism2mgmt_flashdl_state(wlandevice_t *wlandev, void *msgp)
* Call context:
* process thread (usually)
----------------------------------------------------------------*/
int prism2mgmt_flashdl_write(wlandevice_t *wlandev, void *msgp)
int prism2mgmt_flashdl_write(wlandevice_t * wlandev, void *msgp)
{
hfa384x_t *hw = wlandev->priv;
p80211msg_p2req_flashdl_write_t *msg = msgp;
......@@ -1004,7 +1004,7 @@ int prism2mgmt_flashdl_write(wlandevice_t *wlandev, void *msgp)
* process thread (usually)
* interrupt
----------------------------------------------------------------*/
int prism2mgmt_autojoin(wlandevice_t *wlandev, void *msgp)
int prism2mgmt_autojoin(wlandevice_t * wlandev, void *msgp)
{
hfa384x_t *hw = wlandev->priv;
int result = 0;
......@@ -1037,7 +1037,7 @@ int prism2mgmt_autojoin(wlandevice_t *wlandev, void *msgp)
/* Set the ssid */
memset(bytebuf, 0, 256);
pstr = (p80211pstrd_t *)&(msg->ssid.data);
pstr = (p80211pstrd_t *) & (msg->ssid.data);
prism2mgmt_pstr2bytestr(p2bytestr, pstr);
result = hfa384x_drvr_setconfig(hw, HFA384x_RID_CNFDESIREDSSID,
bytebuf,
......@@ -1075,7 +1075,7 @@ int prism2mgmt_autojoin(wlandevice_t *wlandev, void *msgp)
* process thread (usually)
* interrupt
----------------------------------------------------------------*/
int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
int prism2mgmt_wlansniff(wlandevice_t * wlandev, void *msgp)
{
int result = 0;
p80211msg_lnxreq_wlansniff_t *msg = msgp;
......@@ -1096,16 +1096,15 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
/* Disable monitor mode */
result = hfa384x_cmd_monitor(hw, HFA384x_MONITOR_DISABLE);
if (result) {
pr_debug(
"failed to disable monitor mode, result=%d\n",
pr_debug("failed to disable monitor mode, result=%d\n",
result);
goto failed;
}
/* Disable port 0 */
result = hfa384x_drvr_disable(hw, 0);
if (result) {
pr_debug(
"failed to disable port 0 after sniffing, result=%d\n",
pr_debug
("failed to disable port 0 after sniffing, result=%d\n",
result);
goto failed;
}
......@@ -1117,8 +1116,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
HFA384x_RID_CNFWEPFLAGS,
hw->presniff_wepflags);
if (result) {
pr_debug(
"failed to restore wepflags=0x%04x, result=%d\n",
pr_debug
("failed to restore wepflags=0x%04x, result=%d\n",
hw->presniff_wepflags, result);
goto failed;
}
......@@ -1130,8 +1129,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
HFA384x_RID_CNFPORTTYPE,
word);
if (result) {
pr_debug(
"failed to restore porttype, result=%d\n",
pr_debug
("failed to restore porttype, result=%d\n",
result);
goto failed;
}
......@@ -1139,8 +1138,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
/* Enable the port */
result = hfa384x_drvr_enable(hw, 0);
if (result) {
pr_debug(
"failed to enable port to presniff setting, result=%d\n",
pr_debug
("failed to enable port to presniff setting, result=%d\n",
result);
goto failed;
}
......@@ -1161,30 +1160,32 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
/* Save macport 0 state */
result = hfa384x_drvr_getconfig16(hw,
HFA384x_RID_CNFPORTTYPE,
&(hw->
&
(hw->
presniff_port_type));
if (result) {
pr_debug(
"failed to read porttype, result=%d\n",
pr_debug
("failed to read porttype, result=%d\n",
result);
goto failed;
}
/* Save the wepflags state */
result = hfa384x_drvr_getconfig16(hw,
HFA384x_RID_CNFWEPFLAGS,
&(hw->
&
(hw->
presniff_wepflags));
if (result) {
pr_debug(
"failed to read wepflags, result=%d\n",
pr_debug
("failed to read wepflags, result=%d\n",
result);
goto failed;
}
hfa384x_drvr_stop(hw);
result = hfa384x_drvr_start(hw);
if (result) {
pr_debug(
"failed to restart the card for sniffing, result=%d\n",
pr_debug
("failed to restart the card for sniffing, result=%d\n",
result);
goto failed;
}
......@@ -1192,8 +1193,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
/* Disable the port */
result = hfa384x_drvr_disable(hw, 0);
if (result) {
pr_debug(
"failed to enable port for sniffing, result=%d\n",
pr_debug
("failed to enable port for sniffing, result=%d\n",
result);
goto failed;
}
......@@ -1210,8 +1211,7 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
hw->sniff_channel = word;
if (result) {
pr_debug(
"failed to set channel %d, result=%d\n",
pr_debug("failed to set channel %d, result=%d\n",
word, result);
goto failed;
}
......@@ -1224,8 +1224,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
HFA384x_RID_CNFPORTTYPE,
word);
if (result) {
pr_debug(
"failed to set porttype %d, result=%d\n",
pr_debug
("failed to set porttype %d, result=%d\n",
word, result);
goto failed;
}
......@@ -1243,8 +1243,8 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
}
if (result) {
pr_debug(
"failed to set wepflags=0x%04x, result=%d\n",
pr_debug
("failed to set wepflags=0x%04x, result=%d\n",
word, result);
goto failed;
}
......@@ -1269,16 +1269,15 @@ int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp)
/* Enable the port */
result = hfa384x_drvr_enable(hw, 0);
if (result) {
pr_debug(
"failed to enable port for sniffing, result=%d\n",
pr_debug
("failed to enable port for sniffing, result=%d\n",
result);
goto failed;
}
/* Enable monitor mode */
result = hfa384x_cmd_monitor(hw, HFA384x_MONITOR_ENABLE);
if (result) {
pr_debug(
"failed to enable monitor mode, result=%d\n",
pr_debug("failed to enable monitor mode, result=%d\n",
result);
goto failed;
}
......
......@@ -63,43 +63,43 @@
extern int prism2_reset_holdtime;
extern int prism2_reset_settletime;
u32 prism2sta_ifstate(wlandevice_t *wlandev, u32 ifstate);
u32 prism2sta_ifstate(wlandevice_t * wlandev, u32 ifstate);
void prism2sta_ev_info(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
void prism2sta_ev_txexc(wlandevice_t *wlandev, u16 status);
void prism2sta_ev_tx(wlandevice_t *wlandev, u16 status);
void prism2sta_ev_rx(wlandevice_t *wlandev, struct sk_buff *skb);
void prism2sta_ev_alloc(wlandevice_t *wlandev);
void prism2sta_ev_info(wlandevice_t * wlandev, hfa384x_InfFrame_t * inf);
void prism2sta_ev_txexc(wlandevice_t * wlandev, u16 status);
void prism2sta_ev_tx(wlandevice_t * wlandev, u16 status);
void prism2sta_ev_rx(wlandevice_t * wlandev, struct sk_buff *skb);
void prism2sta_ev_alloc(wlandevice_t * wlandev);
int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_scan(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_scan_results(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_start(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_wlansniff(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_readpda(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_ramdl_state(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_ramdl_write(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_flashdl_state(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_flashdl_write(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_autojoin(wlandevice_t *wlandev, void *msgp);
int prism2mgmt_mibset_mibget(wlandevice_t * wlandev, void *msgp);
int prism2mgmt_scan(wlandevice_t * wlandev, void *msgp);
int prism2mgmt_scan_results(wlandevice_t * wlandev, void *msgp);
int prism2mgmt_start(wlandevice_t * wlandev, void *msgp);
int prism2mgmt_wlansniff(wlandevice_t * wlandev, void *msgp);
int prism2mgmt_readpda(wlandevice_t * wlandev, void *msgp);
int prism2mgmt_ramdl_state(wlandevice_t * wlandev, void *msgp);
int prism2mgmt_ramdl_write(wlandevice_t * wlandev, void *msgp);
int prism2mgmt_flashdl_state(wlandevice_t * wlandev, void *msgp);
int prism2mgmt_flashdl_write(wlandevice_t * wlandev, void *msgp);
int prism2mgmt_autojoin(wlandevice_t * wlandev, void *msgp);
/*---------------------------------------------------------------
* conversion functions going between wlan message data types and
* Prism2 data types
---------------------------------------------------------------*/
/* byte area conversion functions*/
void prism2mgmt_pstr2bytearea(u8 *bytearea, p80211pstrd_t *pstr);
void prism2mgmt_bytearea2pstr(u8 *bytearea, p80211pstrd_t *pstr, int len);
void prism2mgmt_pstr2bytearea(u8 * bytearea, p80211pstrd_t * pstr);
void prism2mgmt_bytearea2pstr(u8 * bytearea, p80211pstrd_t * pstr, int len);
/* byte string conversion functions*/
void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr);
void prism2mgmt_bytestr2pstr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr);
void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t * bytestr, p80211pstrd_t * pstr);
void prism2mgmt_bytestr2pstr(hfa384x_bytestr_t * bytestr, p80211pstrd_t * pstr);
/* functions to convert Group Addresses */
void prism2mgmt_get_grpaddr(u32 did, p80211pstrd_t *pstr, hfa384x_t *priv);
void prism2mgmt_get_grpaddr(u32 did, p80211pstrd_t * pstr, hfa384x_t * priv);
int prism2mgmt_set_grpaddr(u32 did,
u8 *prism2buf, p80211pstrd_t *pstr,
hfa384x_t *priv);
u8 * prism2buf, p80211pstrd_t * pstr,
hfa384x_t * priv);
int prism2mgmt_get_grpaddr_index(u32 did);
void prism2sta_processing_defer(struct work_struct *data);
......
......@@ -86,65 +86,65 @@ typedef struct mibrec {
u16 parm1;
u16 parm2;
u16 parm3;
int (*func) (struct mibrec *mib,
int (*func) (struct mibrec * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg, void *data);
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg, void *data);
} mibrec_t;
static int prism2mib_bytearea2pstr(mibrec_t *mib,
static int prism2mib_bytearea2pstr(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg,
void *data);
static int prism2mib_uint32(mibrec_t *mib,
static int prism2mib_uint32(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg, void *data);
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg, void *data);
static int prism2mib_flag(mibrec_t *mib,
static int prism2mib_flag(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg, void *data);
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg, void *data);
static int prism2mib_wepdefaultkey(mibrec_t *mib,
static int prism2mib_wepdefaultkey(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg,
void *data);
static int prism2mib_privacyinvoked(mibrec_t *mib,
static int prism2mib_privacyinvoked(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg,
void *data);
static int prism2mib_excludeunencrypted(mibrec_t *mib,
static int prism2mib_excludeunencrypted(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg,
void *data);
static int prism2mib_fragmentationthreshold(mibrec_t *mib,
static int prism2mib_fragmentationthreshold(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg,
void *data);
static int prism2mib_priv(mibrec_t *mib,
static int prism2mib_priv(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg, void *data);
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg, void *data);
static mibrec_t mibtab[] = {
......@@ -258,7 +258,7 @@ static mibrec_t mibtab[] = {
* interrupt
----------------------------------------------------------------*/
int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp)
int prism2mgmt_mibset_mibget(wlandevice_t * wlandev, void *msgp)
{
hfa384x_t *hw = wlandev->priv;
int result, isget;
......@@ -330,8 +330,7 @@ int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp)
if (msg->resultcode.data == P80211ENUM_resultcode_success) {
if (result != 0) {
pr_debug("get/set failure, result=%d\n",
result);
pr_debug("get/set failure, result=%d\n", result);
msg->resultcode.data =
P80211ENUM_resultcode_implementation_failure;
} else {
......@@ -373,11 +372,11 @@ int prism2mgmt_mibset_mibget(wlandevice_t *wlandev, void *msgp)
*
----------------------------------------------------------------*/
static int prism2mib_bytearea2pstr(mibrec_t *mib,
static int prism2mib_bytearea2pstr(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg,
void *data)
{
int result;
......@@ -423,11 +422,11 @@ static int prism2mib_bytearea2pstr(mibrec_t *mib,
*
----------------------------------------------------------------*/
static int prism2mib_uint32(mibrec_t *mib,
static int prism2mib_uint32(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg, void *data)
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg, void *data)
{
int result;
u32 *uint32 = (u32 *) data;
......@@ -470,11 +469,11 @@ static int prism2mib_uint32(mibrec_t *mib,
*
----------------------------------------------------------------*/
static int prism2mib_flag(mibrec_t *mib,
static int prism2mib_flag(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg, void *data)
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg, void *data)
{
int result;
u32 *uint32 = (u32 *) data;
......@@ -527,11 +526,11 @@ static int prism2mib_flag(mibrec_t *mib,
*
----------------------------------------------------------------*/
static int prism2mib_wepdefaultkey(mibrec_t *mib,
static int prism2mib_wepdefaultkey(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg,
void *data)
{
int result;
......@@ -577,11 +576,11 @@ static int prism2mib_wepdefaultkey(mibrec_t *mib,
*
----------------------------------------------------------------*/
static int prism2mib_privacyinvoked(mibrec_t *mib,
static int prism2mib_privacyinvoked(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg,
void *data)
{
int result;
......@@ -623,11 +622,11 @@ static int prism2mib_privacyinvoked(mibrec_t *mib,
*
----------------------------------------------------------------*/
static int prism2mib_excludeunencrypted(mibrec_t *mib,
static int prism2mib_excludeunencrypted(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg,
void *data)
{
int result;
......@@ -662,11 +661,11 @@ static int prism2mib_excludeunencrypted(mibrec_t *mib,
*
----------------------------------------------------------------*/
static int prism2mib_fragmentationthreshold(mibrec_t *mib,
static int prism2mib_fragmentationthreshold(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg,
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg,
void *data)
{
int result;
......@@ -711,11 +710,11 @@ static int prism2mib_fragmentationthreshold(mibrec_t *mib,
*
----------------------------------------------------------------*/
static int prism2mib_priv(mibrec_t *mib,
static int prism2mib_priv(mibrec_t * mib,
int isget,
wlandevice_t *wlandev,
hfa384x_t *hw,
p80211msg_dot11req_mibset_t *msg, void *data)
wlandevice_t * wlandev,
hfa384x_t * hw,
p80211msg_dot11req_mibset_t * msg, void *data)
{
p80211pstrd_t *pstr = (p80211pstrd_t *) data;
......@@ -727,7 +726,7 @@ static int prism2mib_priv(mibrec_t *mib,
if (isget) {
hfa384x_drvr_getconfig(hw,
HFA384x_RID_CNFWPADATA,
(u8 *)&wpa,
(u8 *) & wpa,
sizeof(wpa));
pstr->len = le16_to_cpu(wpa.datalen);
memcpy(pstr->data, wpa.data, pstr->len);
......@@ -738,7 +737,7 @@ static int prism2mib_priv(mibrec_t *mib,
result =
hfa384x_drvr_setconfig(hw,
HFA384x_RID_CNFWPADATA,
(u8 *)&wpa,
(u8 *) & wpa,
sizeof(wpa));
}
break;
......@@ -765,7 +764,7 @@ static int prism2mib_priv(mibrec_t *mib,
*
----------------------------------------------------------------*/
void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr)
void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t * bytestr, p80211pstrd_t * pstr)
{
bytestr->len = cpu_to_le16((u16) (pstr->len));
memcpy(bytestr->data, pstr->data, pstr->len);
......@@ -786,7 +785,7 @@ void prism2mgmt_pstr2bytestr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr)
*
----------------------------------------------------------------*/
void prism2mgmt_pstr2bytearea(u8 *bytearea, p80211pstrd_t *pstr)
void prism2mgmt_pstr2bytearea(u8 * bytearea, p80211pstrd_t * pstr)
{
memcpy(bytearea, pstr->data, pstr->len);
}
......@@ -806,7 +805,7 @@ void prism2mgmt_pstr2bytearea(u8 *bytearea, p80211pstrd_t *pstr)
*
----------------------------------------------------------------*/
void prism2mgmt_bytestr2pstr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr)
void prism2mgmt_bytestr2pstr(hfa384x_bytestr_t * bytestr, p80211pstrd_t * pstr)
{
pstr->len = (u8) (le16_to_cpu((u16) (bytestr->len)));
memcpy(pstr->data, bytestr->data, pstr->len);
......@@ -827,13 +826,8 @@ void prism2mgmt_bytestr2pstr(hfa384x_bytestr_t *bytestr, p80211pstrd_t *pstr)
*
----------------------------------------------------------------*/
void prism2mgmt_bytearea2pstr(u8 *bytearea, p80211pstrd_t *pstr, int len)
void prism2mgmt_bytearea2pstr(u8 * bytearea, p80211pstrd_t * pstr, int len)
{
pstr->len = (u8) len;
memcpy(pstr->data, bytearea, len);
}
This diff is collapsed.
......@@ -24,8 +24,7 @@ static struct usb_device_id usb_prism_tbl[] = {
(0x066b, 0x2213, "Linksys WUSB12v1.1 11Mbps WLAN USB Adapter")},
{PRISM_USB_DEVICE
(0x067c, 0x1022, "Siemens SpeedStream 1022 11Mbps WLAN USB Adapter")},
{PRISM_USB_DEVICE
(0x049f, 0x0033,
{PRISM_USB_DEVICE(0x049f, 0x0033,
"Compaq/Intel W100 PRO/Wireless 11Mbps multiport WLAN Adapter")},
{PRISM_USB_DEVICE
(0x0411, 0x0016, "Melco WLI-USB-S11 11Mbps WLAN Adapter")},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment