Rather huge patch submission from Bob James of Rebel. See CHANGES for
a summary.origin
parent
a13726f436
commit
99d676cf23
5
CHANGES
5
CHANGES
|
@ -42,6 +42,11 @@
|
|||
*
|
||||
* --------------------------------------------------------------------
|
||||
0.1.8
|
||||
- Received a large patch from bjames of Rebel Computing. Here's a
|
||||
summary in his words:
|
||||
<TBD>Insert summary here</TBD>
|
||||
|
||||
|
||||
- Fixed some ci/co related problems pointed out by wbinjie.
|
||||
- Added ygalayda's startup scripts for PCI in the directory
|
||||
./etc/wlan_pci. They aren't installed, that will have to be done
|
||||
|
|
2
Makefile
2
Makefile
|
@ -43,7 +43,7 @@
|
|||
# --------------------------------------------------------------------
|
||||
|
||||
|
||||
DIRS = src doc man etc
|
||||
DIRS = src doc man etc
|
||||
|
||||
help:
|
||||
@echo "Pick one of the following targets:"
|
||||
|
|
1
THANKS
1
THANKS
|
@ -52,6 +52,7 @@ Scott Franzyshen <sfranzyshen@lazerlink.net>
|
|||
david <davidhsu@ficnet.net>
|
||||
Alessandro <acevirgil@inwind.it>
|
||||
Jouni Malinen <jkmaline@cc.hut.fi>
|
||||
Bob James<bob.james@rebel.com>
|
||||
|
||||
[Many, many more. If I've overlooked you and you want to be listed here,
|
||||
send me e-mail and I'll fix it. I _know_ a bunch of linux-wlan contributors
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
WLAN_VERSION=0
|
||||
WLAN_PATCHLEVEL=1
|
||||
WLAN_SUBLEVEL=8
|
||||
WLAN_EXTRAVERSION=
|
||||
WLAN_EXTRAVERSION=-pre10-rebel1
|
||||
WLAN_PLX=n
|
||||
WLAN_PCMCIA=y
|
||||
LINUX_SRC=/usr/src/linux
|
||||
|
|
|
@ -147,42 +147,26 @@ case "$ACTION" in
|
|||
mibattribute=dot11PrivacyInvoked=$dot11PrivacyInvoked
|
||||
if [ "a${PRIV_GENSTR}a" != "aa" ] ; then
|
||||
if [ ${PRIV_KEY128:-"false"} = "true" ]; then
|
||||
keys=`$PRIV_GENERATOR -l $PRIV_GENSTR`
|
||||
keys=`$PRIV_GENERATOR -l $PRIV_GENSTR 5`
|
||||
else
|
||||
keys=`$PRIV_GENERATOR -l $PRIV_GENSTR`
|
||||
keys=`$PRIV_GENERATOR -l $PRIV_GENSTR 13`
|
||||
fi
|
||||
|
||||
knum=0
|
||||
for i in $keys ; do
|
||||
if [ ${PRIV_KEY128:-"false"} = "true" ]; then
|
||||
$WLANCTL $DEVICE dot11req_mibset \
|
||||
mibattribute=dot11WEPDefaultKey$knum=$i
|
||||
else
|
||||
$WLANCTL $DEVICE dot11req_mibset \
|
||||
mibattribute=dot11WEP128DefaultKey$knum=$i
|
||||
fi
|
||||
$WLANCTL $DEVICE dot11req_mibset \
|
||||
mibattribute=dot11WEPDefaultKey$knum=$i
|
||||
knum=$[$knum + 1]
|
||||
done
|
||||
else
|
||||
if [ ${PRIV_KEY128:-"false"} = "true" ]; then
|
||||
$WLANCTL $DEVICE dot11req_mibset \
|
||||
mibattribute=dot11WEPDefaultKey0=$dot11WEP128DefaultKey0
|
||||
$WLANCTL $DEVICE dot11req_mibset \
|
||||
mibattribute=dot11WEPDefaultKey1=$dot11WEP128DefaultKey1
|
||||
$WLANCTL $DEVICE dot11req_mibset \
|
||||
mibattribute=dot11WEPDefaultKey2=$dot11WEP128DefaultKey2
|
||||
$WLANCTL $DEVICE dot11req_mibset \
|
||||
mibattribute=dot11WEPDefaultKey3=$dot11WEP128DefaultKey3
|
||||
else
|
||||
$WLANCTL $DEVICE dot11req_mibset \
|
||||
mibattribute=dot11WEP128DefaultKey0=$dot11WEPDefaultKey0
|
||||
$WLANCTL $DEVICE dot11req_mibset \
|
||||
mibattribute=dot11WEP128DefaultKey1=$dot11WEPDefaultKey1
|
||||
$WLANCTL $DEVICE dot11req_mibset \
|
||||
mibattribute=dot11WEP128DefaultKey2=$dot11WEPDefaultKey2
|
||||
$WLANCTL $DEVICE dot11req_mibset \
|
||||
mibattribute=dot11WEP128DefaultKey3=$dot11WEPDefaultKey3
|
||||
fi
|
||||
$WLANCTL $DEVICE dot11req_mibset \
|
||||
mibattribute=dot11WEPDefaultKey0=$dot11WEPDefaultKey0
|
||||
$WLANCTL $DEVICE dot11req_mibset \
|
||||
mibattribute=dot11WEPDefaultKey1=$dot11WEPDefaultKey1
|
||||
$WLANCTL $DEVICE dot11req_mibset \
|
||||
mibattribute=dot11WEPDefaultKey2=$dot11WEPDefaultKey2
|
||||
$WLANCTL $DEVICE dot11req_mibset \
|
||||
mibattribute=dot11WEPDefaultKey3=$dot11WEPDefaultKey3
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
@ -90,15 +90,10 @@ wlannoenable,*,*,*)
|
|||
PRIV_GENERATOR=/sbin/nwepgen # nwepgen, Neesus compatible
|
||||
PRIV_GENSTR="12345"
|
||||
# or set them explicitly. Set genstr or keys, not both.
|
||||
dot11WEPDefaultKey0= # format: xx:xx:xx:xx:xx
|
||||
dot11WEPDefaultKey1= # e.g. 01:20:03:40:05
|
||||
dot11WEPDefaultKey2=
|
||||
dot11WEPDefaultKey3=
|
||||
# or
|
||||
dot11WEP128DefaultKey0= # format: xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
|
||||
dot11WEP128DefaultKey1= # e.g. 01:02:03:04:05:06:07:08:09:0a:0b:0c:0d
|
||||
dot11WEP128DefaultKey2=
|
||||
dot11WEP128DefaultKey3=
|
||||
dot11WEPDefaultKey0= # format: xx:xx:xx:xx:xx or
|
||||
dot11WEPDefaultKey1= # xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
|
||||
dot11WEPDefaultKey2= # e.g. 01:20:03:40:05 or
|
||||
dot11WEPDefaultKey3= # 01:02:03:04:05:06:07:08:09:0a:0b:0c:0d
|
||||
|
||||
#=======STA START=====================================
|
||||
# SSID is all we have for now
|
||||
|
|
|
@ -45,9 +45,9 @@
|
|||
include ../config.mk
|
||||
|
||||
DIRS=p80211 prism2 shared wlanctl wland nwepgen \
|
||||
skeleton mkmeta
|
||||
skeleton mkmeta wlancfg
|
||||
ALL_DIRS=mkmeta p80211 prism2 shared wlanctl wland \
|
||||
nwepgen skeleton
|
||||
nwepgen skeleton wlancfg
|
||||
|
||||
ifneq ($(wildcard *.addon),)
|
||||
DIRS+=`cat *.addon`
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
#define WLAN_AUTHEN_FR_MAXLEN (WLAN_HDR_A3_LEN + 261)
|
||||
#define WLAN_DEAUTHEN_FR_MAXLEN (WLAN_HDR_A3_LEN + 2)
|
||||
#define WLAN_WEP_NKEYS 4
|
||||
#define WLAN_WEP_KEYLEN 5
|
||||
#define WLAN_WEP_MAXKEYLEN 13
|
||||
#define WLAN_CHALLENGE_IE_LEN 130
|
||||
#define WLAN_CHALLENGE_LEN 128
|
||||
#define WLAN_WEP_IV_LEN 4
|
||||
|
|
|
@ -164,7 +164,7 @@ grplistitem_t *p80211_did2grp( catlistitem_t *catlist, UINT32 did );
|
|||
p80211meta_t *p80211_did2item( catlistitem_t *catlist, UINT32 did );
|
||||
UINT32 p80211item_maxdatalen( struct catlistitem *metalist, UINT32 did );
|
||||
UINT32 p80211_metaname2did(struct catlistitem *metalist, char *itemname);
|
||||
UINT32 p80211item_maxitemlen( struct catlistitem *metalist, UINT32 did );
|
||||
UINT32 p80211item_getoffset( struct catlistitem *metalist, UINT32 did );
|
||||
int p80211item_gettype(p80211meta_t *meta);
|
||||
|
||||
#endif /* _P80211META_H */
|
||||
|
|
|
@ -87,6 +87,9 @@
|
|||
to a textual name */
|
||||
#define P80211_TYPE_UNKDATA 6 /* Data item containing an
|
||||
unknown data type */
|
||||
#define P80211_TYPE_INTARRAY 7 /* Array of 32-bit integers. */
|
||||
#define P80211_TYPE_BITARRAY 8 /* Array of bits. */
|
||||
#define P80211_TYPE_MACARRAY 9 /* Array of MAC addresses. */
|
||||
|
||||
/*----------------------------------------------------------------*/
|
||||
/* The following constants are indexes into the Mib Category List */
|
||||
|
@ -116,8 +119,8 @@
|
|||
/* p80211 DID field codes that represent access type and */
|
||||
/* is_table status. */
|
||||
|
||||
#define P80211DID_ACCESS_READONLY 0
|
||||
#define P80211DID_ACCESS_READWRITE 1
|
||||
#define P80211DID_ACCESS_READ 0x10000000
|
||||
#define P80211DID_ACCESS_WRITE 0x08000000
|
||||
#define P80211DID_ISTABLE_FALSE 0
|
||||
#define P80211DID_ISTABLE_TRUE 1
|
||||
|
||||
|
@ -171,6 +174,7 @@
|
|||
#define P80211ENUM_resultcode_invalid_mibattribute 9
|
||||
#define P80211ENUM_resultcode_cant_set_readonly_mib 10
|
||||
#define P80211ENUM_resultcode_implementation_failure 11
|
||||
#define P80211ENUM_resultcode_cant_get_writeonly_mib 12
|
||||
#define P80211ENUM_reason_unspec_reason 1
|
||||
#define P80211ENUM_reason_auth_not_valid 2
|
||||
#define P80211ENUM_reason_deauth_lv_ss 3
|
||||
|
@ -215,10 +219,10 @@
|
|||
#define MAXLEN_PSTR14 (14) /* pascal array of 14 bytes */
|
||||
#define MAXLEN_PSTR32 (32) /* pascal array of 32 bytes */
|
||||
#define MAXLEN_PSTR255 (255) /* pascal array of 255 bytes */
|
||||
#define MAXLEN_MIBATTRIBUTE (264) /* maximum mibattribute */
|
||||
#define MAXLEN_MIBATTRIBUTE (392) /* maximum mibattribute */
|
||||
/* where the size of the DATA itself */
|
||||
/* is a DID-LEN-DATA triple */
|
||||
/* with a max size of 4+4+256 */
|
||||
/* with a max size of 4+4+384 */
|
||||
|
||||
#define P80211_SET_INT(item, value) do { \
|
||||
(item).data = (value); \
|
||||
|
@ -252,7 +256,7 @@
|
|||
/* whether the metadata item is for a request command, confirm */
|
||||
/* command or both. */
|
||||
/*--------------------------------------------------------------------*/
|
||||
/* MSM: Does these belong in p80211meta.h? I'm not sure */
|
||||
/* MSM: Do these belong in p80211meta.h? I'm not sure */
|
||||
|
||||
#define P80211ITEM_SETFLAGS(q, r, c) ( q | r | c )
|
||||
|
||||
|
@ -265,9 +269,19 @@
|
|||
|
||||
#define MKENUMNAME(name) p80211enum_ ## name
|
||||
|
||||
/*----------------------------------------------------------------*/
|
||||
/* The following constants and macros are used to construct and */
|
||||
/* deconstruct the Data ID codes. */
|
||||
/*----------------------------------------------------------------
|
||||
* The following constants and macros are used to construct and
|
||||
* deconstruct the Data ID codes. The coding is as follows:
|
||||
*
|
||||
* ...rwtnnnnnnnniiiiiiggggggssssss s - Section
|
||||
* g - Group
|
||||
* i - Item
|
||||
* n - Index
|
||||
* t - Table flag
|
||||
* w - Write flag
|
||||
* r - Read flag
|
||||
* . - Unused
|
||||
*/
|
||||
|
||||
#define P80211DID_INVALID 0xffffffffUL
|
||||
#define P80211DID_VALID 0x00000000UL
|
||||
|
@ -277,16 +291,12 @@
|
|||
#define P80211DID_LSB_ITEM (12)
|
||||
#define P80211DID_LSB_INDEX (18)
|
||||
#define P80211DID_LSB_ISTABLE (26)
|
||||
#define P80211DID_LSB_ACCESS (27)
|
||||
#define P80211DID_LSB_TYPE (28)
|
||||
|
||||
#define P80211DID_MASK_SECTION (0x0000003fUL)
|
||||
#define P80211DID_MASK_GROUP (0x0000003fUL)
|
||||
#define P80211DID_MASK_ITEM (0x0000003fUL)
|
||||
#define P80211DID_MASK_INDEX (0x000000ffUL)
|
||||
#define P80211DID_MASK_ISTABLE (0x00000001UL)
|
||||
#define P80211DID_MASK_ACCESS (0x00000001UL)
|
||||
#define P80211DID_MASK_TYPE (0x00000007UL)
|
||||
|
||||
|
||||
#define P80211DID_MK(a,m,l) ((((UINT32)(a)) & (m)) << (l))
|
||||
|
@ -306,21 +316,14 @@
|
|||
#define P80211DID_MKISTABLE(a) P80211DID_MK(a, \
|
||||
P80211DID_MASK_ISTABLE, \
|
||||
P80211DID_LSB_ISTABLE )
|
||||
#define P80211DID_MKACCESS(a) P80211DID_MK(a, \
|
||||
P80211DID_MASK_ACCESS, \
|
||||
P80211DID_LSB_ACCESS )
|
||||
#define P80211DID_MKTYPE(a) P80211DID_MK(a, \
|
||||
P80211DID_MASK_TYPE, \
|
||||
P80211DID_LSB_TYPE )
|
||||
|
||||
|
||||
#define P80211DID_MKID(s,g,i,n,t,a,d) (P80211DID_MKSECTION(s) | \
|
||||
#define P80211DID_MKID(s,g,i,n,t,a) (P80211DID_MKSECTION(s) | \
|
||||
P80211DID_MKGROUP(g) | \
|
||||
P80211DID_MKITEM(i) | \
|
||||
P80211DID_MKINDEX(n) | \
|
||||
P80211DID_MKISTABLE(t) | \
|
||||
P80211DID_MKACCESS(a) | \
|
||||
P80211DID_MKTYPE(d) )
|
||||
(a) )
|
||||
|
||||
|
||||
#define P80211DID_GET(a,m,l) ((((UINT32)(a)) >> (l)) & (m))
|
||||
|
@ -340,12 +343,6 @@
|
|||
#define P80211DID_ISTABLE(a) P80211DID_GET(a, \
|
||||
P80211DID_MASK_ISTABLE, \
|
||||
P80211DID_LSB_ISTABLE)
|
||||
#define P80211DID_ACCESS(a) P80211DID_GET(a, \
|
||||
P80211DID_MASK_ACCESS, \
|
||||
P80211DID_LSB_ACCESS)
|
||||
#define P80211DID_TYPE(a) P80211DID_GET(a, \
|
||||
P80211DID_MASK_TYPE, \
|
||||
P80211DID_LSB_TYPE)
|
||||
|
||||
/*================================================================*/
|
||||
/* Types */
|
||||
|
@ -422,6 +419,15 @@ typedef struct p80211pstr32
|
|||
} __WLAN_ATTRIB_PACK__ p80211pstr32_t;
|
||||
__WLAN_PRAGMA_PACKDFLT__
|
||||
|
||||
/* MAC address array */
|
||||
__WLAN_PRAGMA_PACK1__
|
||||
typedef struct p80211macarray
|
||||
{
|
||||
UINT32 cnt __WLAN_ATTRIB_PACK__;
|
||||
UINT8 data[1][MAXLEN_PSTR6] __WLAN_ATTRIB_PACK__;
|
||||
} __WLAN_ATTRIB_PACK__ p80211macarray_t;
|
||||
__WLAN_PRAGMA_PACKDFLT__
|
||||
|
||||
/* prototype template */
|
||||
__WLAN_PRAGMA_PACK1__
|
||||
typedef struct p80211item
|
||||
|
@ -498,14 +504,14 @@ typedef struct p80211item_pstr255
|
|||
} __WLAN_ATTRIB_PACK__ p80211item_pstr255_t;
|
||||
__WLAN_PRAGMA_PACKDFLT__
|
||||
|
||||
/* message data item for UNK 264, namely mib items */
|
||||
typedef struct p80211item_unk264
|
||||
/* message data item for UNK 392, namely mib items */
|
||||
typedef struct p80211item_unk392
|
||||
{
|
||||
UINT32 did __WLAN_ATTRIB_PACK__;
|
||||
UINT16 status __WLAN_ATTRIB_PACK__;
|
||||
UINT16 len __WLAN_ATTRIB_PACK__;
|
||||
UINT8 data[MAXLEN_MIBATTRIBUTE] __WLAN_ATTRIB_PACK__;
|
||||
} __WLAN_ATTRIB_PACK__ p80211item_unk264_t;
|
||||
} __WLAN_ATTRIB_PACK__ p80211item_unk392_t;
|
||||
__WLAN_PRAGMA_PACK1__
|
||||
|
||||
/* message data item for UNK 1025, namely p2 pdas */
|
||||
|
@ -635,6 +641,34 @@ void p80211_fromtext_enumint( struct catlistitem *metalist, UINT32 did, UINT8 *i
|
|||
/* function that checks validity of an enum's binary value */
|
||||
UINT32 p80211_isvalid_enumint( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf );
|
||||
|
||||
/*-- INTARRAY --------------------------------------------------------*/
|
||||
/* UINT32[] => %d,%d,%d,... */
|
||||
void p80211_totext_intarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
|
||||
|
||||
/* %d,%d,%d,... ==> UINT32[] */
|
||||
void p80211_fromtext_intarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
|
||||
|
||||
/* function that checks validity of an integer array's value */
|
||||
UINT32 p80211_isvalid_intarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf );
|
||||
|
||||
/*-- BITARRAY --------------------------------------------------------*/
|
||||
/* UINT32 ==> %d,%d,%d,... */
|
||||
void p80211_totext_bitarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
|
||||
|
||||
/* %d,%d,%d,... ==> UINT32 */
|
||||
void p80211_fromtext_bitarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
|
||||
|
||||
/* function that checks validity of a bit array's value */
|
||||
UINT32 p80211_isvalid_bitarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf );
|
||||
|
||||
/*-- MACARRAY --------------------------------------------------------*/
|
||||
void p80211_totext_macarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
|
||||
|
||||
void p80211_fromtext_macarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
|
||||
|
||||
/* function that checks validity of a MAC address array's value */
|
||||
UINT32 p80211_isvalid_macarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf );
|
||||
|
||||
/*-- MIBATTRIUBTE ------------------------------------------------------*/
|
||||
/* <mibvalue> ==> <textual representation identified in MIB metadata> */
|
||||
void p80211_totext_getmibattribute( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
|
||||
|
|
|
@ -74,13 +74,13 @@ int main(int argc, char **argv)
|
|||
totitems = GETMETASIZE(msg_catlist[c].grplist[g].itemlist);
|
||||
for ( i = 1; i < totitems; i++ )
|
||||
{
|
||||
type = P80211DID_TYPE(
|
||||
msg_catlist[c].grplist[g].itemlist[i].did);
|
||||
type = p80211item_gettype(&msg_catlist[c].grplist[g].itemlist[i]);
|
||||
switch ( type )
|
||||
{
|
||||
case P80211_TYPE_BOUNDEDINT:
|
||||
case P80211_TYPE_INT:
|
||||
case P80211_TYPE_ENUMINT:
|
||||
case P80211_TYPE_BITARRAY:
|
||||
printf("\tp80211item_uint32_t");
|
||||
printf("\t%s\t__WLAN_ATTRIB_PACK__;\n",
|
||||
msg_catlist[c].grplist[g].itemlist[i].name);
|
||||
|
@ -91,6 +91,33 @@ int main(int argc, char **argv)
|
|||
printf("\t%s\t__WLAN_ATTRIB_PACK__;\n",
|
||||
msg_catlist[c].grplist[g].itemlist[i].name);
|
||||
break;
|
||||
case P80211_TYPE_INTARRAY:
|
||||
printf("\tstruct {\n");
|
||||
printf("\t\tUINT32\tdid\t__WLAN_ATTRIB_PACK__;\n");
|
||||
printf("\t\tUINT16\tstatus\t__WLAN_ATTRIB_PACK__;\n");
|
||||
printf("\t\tUINT16\tlen\t__WLAN_ATTRIB_PACK__;\n");
|
||||
printf("\t\tUINT32\tdata[%ld]\t__WLAN_ATTRIB_PACK__;\n",
|
||||
msg_catlist[c].grplist[g].itemlist[i].maxlen);
|
||||
printf("\t\t} %s\t__WLAN_ATTRIB_PACK__;\n",
|
||||
msg_catlist[c].grplist[g].itemlist[i].name);
|
||||
break;
|
||||
case P80211_TYPE_MACARRAY:
|
||||
printf("\tstruct {\n");
|
||||
printf("\t\tUINT32\tdid\t__WLAN_ATTRIB_PACK__;\n");
|
||||
printf("\t\tUINT16\tstatus\t__WLAN_ATTRIB_PACK__;\n");
|
||||
printf("\t\tUINT16\tlen\t__WLAN_ATTRIB_PACK__;\n");
|
||||
printf("\t\tUINT32\tcnt\t__WLAN_ATTRIB_PACK__;\n");
|
||||
printf("\t\tUINT8\tdata[%ld][WLAN_ADDR_LEN]\t__WLAN_ATTRIB_PACK__;\n",
|
||||
msg_catlist[c].grplist[g].itemlist[i].maxlen);
|
||||
printf("\t\t} %s\t__WLAN_ATTRIB_PACK__;\n",
|
||||
msg_catlist[c].grplist[g].itemlist[i].name);
|
||||
break;
|
||||
case P80211_TYPE_OCTETSTR:
|
||||
printf("\tp80211item_pstr%ld_t",
|
||||
msg_catlist[c].grplist[g].itemlist[i].maxlen);
|
||||
printf("\t%s\t__WLAN_ATTRIB_PACK__;\n",
|
||||
msg_catlist[c].grplist[g].itemlist[i].name);
|
||||
break;
|
||||
default:
|
||||
printf("\tp80211item_pstr%ld_t",
|
||||
msg_catlist[c].grplist[g].itemlist[i].maxlen);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* src/nwepgen/prism2mgmt.c
|
||||
/* src/nwepgen/nwepgen.c
|
||||
*
|
||||
* Management request handler functions.
|
||||
*
|
||||
|
@ -61,35 +61,38 @@
|
|||
#include <wlan/p80211hdr.h>
|
||||
|
||||
|
||||
void nwepgen(char *genstr, UINT8 wep_key[WLAN_WEP_NKEYS][WLAN_WEP_KEYLEN]);
|
||||
void nwepgen(char *genstr, int keylen, UINT8 wep_key[WLAN_WEP_NKEYS][WLAN_WEP_MAXKEYLEN]);
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
UINT8 wep_key[WLAN_WEP_NKEYS][WLAN_WEP_KEYLEN];
|
||||
UINT8 wep_key[WLAN_WEP_NKEYS][WLAN_WEP_MAXKEYLEN];
|
||||
int i;
|
||||
int j;
|
||||
int keylen;
|
||||
|
||||
if ( argc < 2 )
|
||||
if ( argc < 2 || argc > 3 )
|
||||
{
|
||||
printf("nwepgen: generates Neesus Datacom compatible WEP keys from a string\n");
|
||||
printf(" Usage: nwepgen <genstr>\n");
|
||||
printf(" Usage: nwepgen <genstr> <length>\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
nwepgen( argv[1], wep_key);
|
||||
keylen = (argc < 3) ? 5 : atoi(argv[2]);
|
||||
if ( keylen < 1 || keylen > WLAN_WEP_MAXKEYLEN )
|
||||
{
|
||||
printf(" Invalid key length. Valid range is 1-%d.\n", WLAN_WEP_MAXKEYLEN);
|
||||
return 0;
|
||||
}
|
||||
|
||||
nwepgen( argv[1], keylen, wep_key);
|
||||
|
||||
for ( i = 0; i < WLAN_WEP_NKEYS; i++)
|
||||
{
|
||||
/* printf("%d-", i); */
|
||||
for ( j=0; j < WLAN_WEP_KEYLEN; j++)
|
||||
for ( j=0; j < keylen; j++)
|
||||
{
|
||||
printf("%02x", wep_key[i][j]);
|
||||
if ( j < WLAN_WEP_KEYLEN - 1)
|
||||
{
|
||||
printf(":");
|
||||
}
|
||||
printf((j < keylen-1) ? "%02x:" : "%02x\n", wep_key[i][j]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -99,7 +102,7 @@ int main(int argc, char *argv[])
|
|||
* nwepgen
|
||||
*
|
||||
* Generates a set of WEP keys from a generator string. This is
|
||||
* intended as a convenience. Entering 20 hex bytes can be a pain.
|
||||
* intended as a convenience. Entering hex bytes can be a pain.
|
||||
*
|
||||
* Based on an algorithm supplied by Neesus Datacom,
|
||||
* http://www.neesus.com
|
||||
|
@ -118,12 +121,13 @@ int main(int argc, char *argv[])
|
|||
*
|
||||
* Arguments:
|
||||
* genstr a null terminated string
|
||||
* keylen number of bytes in key
|
||||
* wep_key a 2d array that is filled with the wep keys
|
||||
* Returns:
|
||||
* nothing
|
||||
----------------------------------------------------------------*/
|
||||
void
|
||||
nwepgen(char *genstr, UINT8 wep_key[WLAN_WEP_NKEYS][WLAN_WEP_KEYLEN])
|
||||
nwepgen(char *genstr, int keylen, UINT8 wep_key[WLAN_WEP_NKEYS][WLAN_WEP_MAXKEYLEN])
|
||||
{
|
||||
unsigned int i,j;
|
||||
unsigned char pseed[4]={0,0,0,0};
|
||||
|
@ -146,8 +150,8 @@ nwepgen(char *genstr, UINT8 wep_key[WLAN_WEP_NKEYS][WLAN_WEP_KEYLEN])
|
|||
((int)pseed[3])<<24;
|
||||
|
||||
/* generate keys. */
|
||||
for (i=0; i<4; i++) {
|
||||
for (j=0; j<5; j++) {
|
||||
for (i=0; i<WLAN_WEP_NKEYS; i++) {
|
||||
for (j=0; j<keylen; j++) {
|
||||
/* Note that these three lines are */
|
||||
/* equivalent to the Microsoft rand() */
|
||||
/* function. */
|
||||
|
|
|
@ -78,52 +78,35 @@ WLAN_INCLUDE_DEBUG="-DWLAN_INCLUDE_DEBUG"
|
|||
endif
|
||||
|
||||
# Source and obj and target definitions
|
||||
STA_CS_OBJ_DIR=obj_sta_cs
|
||||
AP_CS_OBJ_DIR=obj_ap_cs
|
||||
STA_PLX_OBJ_DIR=obj_sta_plx
|
||||
AP_PLX_OBJ_DIR=obj_ap_plx
|
||||
CS_OBJ_DIR=obj_cs
|
||||
PLX_OBJ_DIR=obj_plx
|
||||
|
||||
SRC=prism2sta.c prism2mgmt.c prism2mib.c hfa384x.c
|
||||
ifeq ($(WLAN_PLX), y)
|
||||
SRC+=pci-scan.c
|
||||
endif
|
||||
|
||||
STA_CS_MODULE=prism2sta_cs.o
|
||||
AP_CS_MODULE=prism2ap_cs.o
|
||||
STA_PLX_MODULE=prism2sta_plx.o
|
||||
AP_PLX_MODULE=prism2ap_plx.o
|
||||
CS_MODULE=prism2_cs.o
|
||||
PLX_MODULE=prism2_plx.o
|
||||
|
||||
STA_CS_OBJ= $(STA_CS_OBJ_DIR)/prism2sta.o \
|
||||
$(STA_CS_OBJ_DIR)/prism2mgmt.o \
|
||||
$(STA_CS_OBJ_DIR)/prism2mib.o \
|
||||
$(STA_CS_OBJ_DIR)/hfa384x.o
|
||||
CS_OBJ= $(CS_OBJ_DIR)/prism2sta.o \
|
||||
$(CS_OBJ_DIR)/prism2mgmt.o \
|
||||
$(CS_OBJ_DIR)/prism2mib.o \
|
||||
$(CS_OBJ_DIR)/hfa384x.o
|
||||
|
||||
AP_CS_OBJ= $(AP_CS_OBJ_DIR)/prism2sta.o \
|
||||
$(AP_CS_OBJ_DIR)/prism2mgmt.o \
|
||||
$(AP_CS_OBJ_DIR)/prism2mib.o \
|
||||
$(AP_CS_OBJ_DIR)/hfa384x.o
|
||||
|
||||
STA_PLX_OBJ= $(STA_PLX_OBJ_DIR)/prism2sta.o \
|
||||
$(STA_PLX_OBJ_DIR)/prism2mgmt.o \
|
||||
$(STA_PLX_OBJ_DIR)/prism2mib.o \
|
||||
$(STA_PLX_OBJ_DIR)/pci-scan.o \
|
||||
$(STA_PLX_OBJ_DIR)/hfa384x.o
|
||||
|
||||
AP_PLX_OBJ= $(AP_PLX_OBJ_DIR)/prism2sta.o \
|
||||
$(AP_PLX_OBJ_DIR)/prism2mgmt.o \
|
||||
$(AP_PLX_OBJ_DIR)/prism2mib.o \
|
||||
$(STA_PLX_OBJ_DIR)/pci-scan.o \
|
||||
$(AP_PLX_OBJ_DIR)/hfa384x.o
|
||||
PLX_OBJ= $(PLX_OBJ_DIR)/prism2sta.o \
|
||||
$(PLX_OBJ_DIR)/prism2mgmt.o \
|
||||
$(PLX_OBJ_DIR)/prism2mib.o \
|
||||
$(PLX_OBJ_DIR)/pci-scan.o \
|
||||
$(PLX_OBJ_DIR)/hfa384x.o
|
||||
|
||||
# List of modules to build
|
||||
MODULES=
|
||||
ifeq ($(WLAN_PCMCIA), y)
|
||||
MODULES+=$(STA_CS_MODULE)
|
||||
MODULES+=$(AP_CS_MODULE)
|
||||
MODULES+=$(CS_MODULE)
|
||||
endif
|
||||
ifeq ($(WLAN_PLX), y)
|
||||
MODULES+=$(STA_PLX_MODULE)
|
||||
MODULES+=$(AP_PLX_MODULE)
|
||||
MODULES+=$(PLX_MODULE)
|
||||
endif
|
||||
|
||||
# Implicit rules to handle the separate obj dirs
|
||||
|
@ -133,21 +116,13 @@ $(OBJ_DIR)/%.o : ../shared/%.c
|
|||
$(OBJ_DIR)/%.o : %.c
|
||||
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
|
||||
|
||||
$(STA_CS_OBJ_DIR)/%.o : %.c
|
||||
$(CS_OBJ_DIR)/%.o : %.c
|
||||
$(CC) -c $(CFLAGS) $(CPPFLAGS) \
|
||||
-DWLAN_STA -DWLAN_HOSTIF=WLAN_PCMCIA $< -o $@
|
||||
-DWLAN_HOSTIF=WLAN_PCMCIA $< -o $@
|
||||
|
||||
$(AP_CS_OBJ_DIR)/%.o : %.c
|
||||
$(PLX_OBJ_DIR)/%.o : %.c
|
||||
$(CC) -c $(CFLAGS) $(CPPFLAGS) \
|
||||
-DWLAN_AP -DWLAN_HOSTIF=WLAN_PCMCIA $< -o $@
|
||||
|
||||
$(STA_PLX_OBJ_DIR)/%.o : %.c
|
||||
$(CC) -c $(CFLAGS) $(CPPFLAGS) \
|
||||
-DWLAN_STA -DWLAN_HOSTIF=WLAN_PLX $< -o $@
|
||||
|
||||
$(AP_PLX_OBJ_DIR)/%.o : %.c
|
||||
$(CC) -c $(CFLAGS) $(CPPFLAGS) \
|
||||
-DWLAN_AP -DWLAN_HOSTIF=WLAN_PLX $< -o $@
|
||||
-DWLAN_HOSTIF=WLAN_PLX $< -o $@
|
||||
|
||||
# Compiler Options
|
||||
ifndef CFLAGS
|
||||
|
@ -180,101 +155,58 @@ DEP_SRC=$(SRC)
|
|||
all : .depend dirs $(MODULES)
|
||||
|
||||
dirs :
|
||||
mkdir -p $(STA_CS_OBJ_DIR)
|
||||
mkdir -p $(AP_CS_OBJ_DIR)
|
||||
mkdir -p $(STA_PLX_OBJ_DIR)
|
||||
mkdir -p $(AP_PLX_OBJ_DIR)
|
||||
mkdir -p $(CS_OBJ_DIR)
|
||||
mkdir -p $(PLX_OBJ_DIR)
|
||||
|
||||
$(STA_CS_MODULE) : $(STA_CS_OBJ)
|
||||
$(LD) -r -o $@ $(STA_CS_OBJ)
|
||||
$(CS_MODULE) : $(CS_OBJ)
|
||||
$(LD) -r -o $@ $(CS_OBJ)
|
||||
chmod -x $@
|
||||
|
||||
$(AP_CS_MODULE) : $(AP_CS_OBJ)
|
||||
$(LD) -r -o $@ $(AP_CS_OBJ)
|
||||
chmod -x $@
|
||||
|
||||
$(STA_PLX_MODULE) : $(STA_PLX_OBJ)
|
||||
$(LD) -r -o $@ $(STA_PLX_OBJ)
|
||||
chmod -x $@
|
||||
|
||||
$(AP_PLX_MODULE) : $(AP_PLX_OBJ)
|
||||
$(LD) -r -o $@ $(AP_PLX_OBJ)
|
||||
$(PLX_MODULE) : $(PLX_OBJ)
|
||||
$(LD) -r -o $@ $(PLX_OBJ)
|
||||
chmod -x $@
|
||||
|
||||
install : $(MODULES)
|
||||
mkdir -p $(TARGET_MODDIR)/pcmcia
|
||||
if [ -f $(TARGET_ROOT_ON_HOST)/etc/conf.modules ]; then \
|
||||
echo bob1 ;\
|
||||
MODULES_CONF=$(TARGET_ROOT_ON_HOST)/etc/conf.modules ; \
|
||||
elif [ -f $(TARGET_ROOT_ON_HOST)/etc/modules.conf ]; then \
|
||||
echo bob2 ;\
|
||||
MODULES_CONF=$(TARGET_ROOT_ON_HOST)/etc/modules.conf; \
|
||||
else \
|
||||
echo bob3 ;\
|
||||
MODULES_CONF=""; \
|
||||
fi ; \
|
||||
echo $$MODULES_CONF ; \
|
||||
if [ $$MODULES_CONF ]; then \
|
||||
cp -a $$MODULES_CONF $$MODULES_CONF.wlansave; \
|
||||
grep -v prism2 $$MODULES_CONF.wlansave > $$MODULES_CONF; \
|
||||
echo alias prism2_cs prism2$(WLAN_INSTALL_TYPE)_cs >> $$MODULES_CONF; \
|
||||
echo alias prism2_plx prism2$(WLAN_INSTALL_TYPE)_plx >> $$MODULES_CONF; \
|
||||
fi ;
|
||||
ifeq ($(WLAN_PCMCIA), y)
|
||||
cp -f $(STA_CS_MODULE) $(AP_CS_MODULE) $(TARGET_MODDIR)/pcmcia
|
||||
cp -f $(CS_MODULE) $(TARGET_MODDIR)/pcmcia
|
||||
endif
|
||||
ifeq ($(WLAN_PLX), y)
|
||||
cp -f $(STA_PLX_MODULE) $(AP_PLX_MODULE) $(TARGET_MODDIR)/net
|
||||
cp -f $(PLX_MODULE) $(TARGET_MODDIR)/net
|
||||
endif
|
||||
|
||||
clean:
|
||||
rm -f .depend.sta_cs .depend.ap_cs
|
||||
rm -f core core.* *.o .*.o *.s *.a .depend tmp_make *~ tags
|
||||
rm -fr $(STA_CS_OBJ_DIR) $(AP_CS_OBJ_DIR)
|
||||
rm -fr $(STA_PLX_OBJ_DIR) $(AP_PLX_OBJ_DIR)
|
||||
rm -fr $(CS_OBJ_DIR)
|
||||
rm -fr $(PLX_OBJ_DIR)
|
||||
rm -fr $(MODULES)
|
||||
|
||||
# This probably isn't the best way to handle the dependencies, but it works.
|
||||
DEPLIST=
|
||||
ifeq ($(WLAN_PCMCIA), y)
|
||||
DEPLIST+=.depend.sta_cs .depend.ap_cs
|
||||
DEPLIST+=.depend.cs
|
||||
endif
|
||||
ifeq ($(WLAN_PLX), y)
|
||||
DEPLIST+=.depend.sta_plx .depend.ap_plx
|
||||
DEPLIST+=.depend.plx
|
||||
endif
|
||||
|
||||
dep .depend: $(DEPLIST)
|
||||
cat $(DEPLIST) > .depend
|
||||
|
||||
.depend.sta_plx: $(DEP_SRC) ../../../config.mk
|
||||
.depend.plx: $(DEP_SRC) ../../../config.mk
|
||||
rm -f $@
|
||||
for i in $(DEP_SRC); do \
|
||||
(/bin/echo -n $(STA_PLX_OBJ_DIR)/ ; \
|
||||
$(CPP) -DWLAN_STA -DWLAN_HOSTIF=WLAN_PLX -M $(CPPFLAGS) $$i ) \
|
||||
(/bin/echo -n $(PLX_OBJ_DIR)/ ; \
|
||||
$(CPP) -DWLAN_HOSTIF=WLAN_PLX -M $(CPPFLAGS) $$i ) \
|
||||
>> $@ ; \
|
||||
done
|
||||
|
||||
.depend.ap_plx: $(DEP_SRC) ../../../config.mk
|
||||
.depend.cs: $(DEP_SRC) ../../../config.mk
|
||||
rm -f $@
|
||||
for i in $(DEP_SRC); do \
|
||||
(/bin/echo -n $(AP_PLX_OBJ_DIR)/ ; \
|
||||
$(CPP) -DWLAN_AP -DWLAN_HOSTIF=WLAN_PLX -M $(CPPFLAGS) $$i ) \
|
||||
>> $@ ; \
|
||||
done
|
||||
|
||||
.depend.sta_cs: $(DEP_SRC) ../../../config.mk
|
||||
rm -f $@
|
||||
for i in $(DEP_SRC); do \
|
||||
(/bin/echo -n $(STA_CS_OBJ_DIR)/ ; \
|
||||
$(CPP) -DWLAN_STA -DWLAN_HOSTIF=WLAN_PCMCIA -M $(CPPFLAGS) $$i ) \
|
||||
>> $@ ; \
|
||||
done
|
||||
|
||||
.depend.ap_cs: $(DEP_SRC) ../../../config.mk
|
||||
rm -f $@
|
||||
for i in $(DEP_SRC); do \
|
||||
(/bin/echo -n $(AP_CS_OBJ_DIR)/ ; \
|
||||
$(CPP) -DWLAN_AP -DWLAN_HOSTIF=WLAN_PCMCIA -M $(CPPFLAGS) $$i ) \
|
||||
(/bin/echo -n $(CS_OBJ_DIR)/ ; \
|
||||
$(CPP) -DWLAN_HOSTIF=WLAN_PCMCIA -M $(CPPFLAGS) $$i ) \
|
||||
>> $@ ; \
|
||||
done
|
||||
|
||||
|
|
|
@ -230,7 +230,6 @@ fail:
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
* hfa384x_drvr_getconfig16
|
||||
*
|
||||
|
@ -372,11 +371,16 @@ fail:
|
|||
----------------------------------------------------------------*/
|
||||
int hfa384x_drvr_setconfig16(hfa384x_t *hw, UINT16 rid, UINT16 *val)
|
||||
{
|
||||
int result = 0;
|
||||
int result;
|
||||
UINT16 value;
|
||||
|
||||
DBFENTER;
|
||||
*val = host2hfa384x_16(*val);
|
||||
result = hfa384x_drvr_setconfig(hw, rid, val, sizeof(UINT16));
|
||||
|
||||
value = host2hfa384x_16(*val);
|
||||
result = hfa384x_drvr_setconfig(hw, rid, &value, sizeof(UINT16));
|
||||
|
||||
DBFEXIT;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -403,11 +407,16 @@ int hfa384x_drvr_setconfig16(hfa384x_t *hw, UINT16 rid, UINT16 *val)
|
|||
----------------------------------------------------------------*/
|
||||
int hfa384x_drvr_setconfig32(hfa384x_t *hw, UINT16 rid, UINT32 *val)
|
||||
{
|
||||
int result = 0;
|
||||
int result;
|
||||
UINT32 value;
|
||||
|
||||
DBFENTER;
|
||||
*val = host2hfa384x_32(*val);
|
||||
result = hfa384x_drvr_setconfig(hw, rid, val, sizeof(UINT32));
|
||||
|
||||
value = host2hfa384x_32(*val);
|
||||
result = hfa384x_drvr_setconfig(hw, rid, &value, sizeof(UINT32));
|
||||
|
||||
DBFEXIT;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -140,18 +140,6 @@
|
|||
/* #error "HOSTIF unsupported or undefined!" */
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#if defined(WLAN_STA)
|
||||
static char *version = "prism2sta" DRIVER_SUFFIX ".o: " WLAN_RELEASE;
|
||||
static dev_info_t dev_info = "prism2sta" DRIVER_SUFFIX;
|
||||
#elif defined(WLAN_AP)
|
||||
static char *version = "prism2ap" DRIVER_SUFFIX ".o: " WLAN_RELEASE;
|
||||
static dev_info_t dev_info = "prism2ap" DRIVER_SUFFIX;
|
||||
/* #else , TODO: Fix .depend generation for multiple driver build */
|
||||
/* #error "Driver type (AP or STA) not defined!" */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static char *version = "prism2" DRIVER_SUFFIX ".o: " WLAN_RELEASE;
|
||||
static dev_info_t dev_info = "prism2" DRIVER_SUFFIX;
|
||||
|
||||
|
@ -249,10 +237,8 @@ static void prism2sta_inf_tallies(
|
|||
wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
|
||||
static void prism2sta_inf_scanresults(
|
||||
wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
|
||||
#ifdef WLAN_AP
|
||||
static void prism2sta_inf_chinforesults(
|
||||
wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
|
||||
#endif
|
||||
static void prism2sta_inf_linkstatus(
|
||||
wlandevice_t *wlandev, hfa384x_InfFrame_t *inf);
|
||||
static void prism2sta_inf_assocstatus(
|
||||
|
@ -818,6 +804,10 @@ int prism2sta_mlmerequest(wlandevice_t *wlandev, p80211msg_t *msg)
|
|||
WLAN_LOG_DEBUG0(2,"Received mlme readpda request\n");
|
||||
result = prism2mgmt_readpda(wlandev, msg);
|
||||
break;
|
||||
case DIDmsg_p2req_readcis :
|
||||
WLAN_LOG_DEBUG0(2,"Received mlme readcis request\n");
|
||||
result = prism2mgmt_readcis(wlandev, msg);
|
||||
break;
|
||||
case DIDmsg_p2req_auxport_state :
|
||||
WLAN_LOG_DEBUG0(2,"Received mlme auxport_state request\n");
|
||||
result = prism2mgmt_auxport_state(wlandev, msg);
|
||||
|
@ -882,6 +872,10 @@ int prism2sta_mlmerequest(wlandevice_t *wlandev, p80211msg_t *msg)
|
|||
WLAN_LOG_DEBUG0(2,"Received mlme autojoin request\n");
|
||||
result = prism2mgmt_autojoin(wlandev, msg);
|
||||
break;
|
||||
case DIDmsg_p2req_enable :
|
||||
WLAN_LOG_DEBUG0(2,"Received mlme enable request\n");
|
||||
result = prism2mgmt_enable(wlandev, msg);
|
||||
break;
|
||||
default:
|
||||
WLAN_LOG_WARNING1("Unknown mgmt request message 0x%08lx", msg->msgcode);
|
||||
break;
|
||||
|
@ -1065,11 +1059,13 @@ int prism2sta_initmac(wlandevice_t *wlandev)
|
|||
priv->ident_sta_fw.variant &= ~((UINT16)(BIT14 | BIT15));
|
||||
|
||||
if ( priv->ident_sta_fw.id == 0x1f ) {
|
||||
priv->ap = 0;
|
||||
WLAN_LOG_INFO4(
|
||||
"ident: sta f/w: id=0x%02x %d.%d.%d\n",
|
||||
priv->ident_sta_fw.id, priv->ident_sta_fw.major,
|
||||
priv->ident_sta_fw.minor, priv->ident_sta_fw.variant);
|
||||
} else {
|
||||
priv->ap = 1;
|
||||
WLAN_LOG_INFO4(
|
||||
"ident: ap f/w: id=0x%02x %d.%d.%d\n",
|
||||
priv->ident_sta_fw.id, priv->ident_sta_fw.major,
|
||||
|
@ -1327,13 +1323,37 @@ void prism2sta_inf_handover(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf)
|
|||
----------------------------------------------------------------*/
|
||||
void prism2sta_inf_tallies(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf)
|
||||
{
|
||||
prism2sta_priv_t *priv = wlandev->priv;
|
||||
UINT16 len, *src16;
|
||||
UINT32 *dst, *src32;
|
||||
int i, cnt;
|
||||
|
||||
DBFENTER;
|
||||
WLAN_LOG_DEBUG0(2,"received infoframe:COMMTALLIES (unhandled)\n");
|
||||
|
||||
/*
|
||||
** Determine if these are 16-bit or 32-bit tallies, based on the
|
||||
** record length of the info record.
|
||||
*/
|
||||
|
||||
cnt = sizeof(hfa384x_CommTallies32_t) / sizeof(UINT32);
|
||||
len = hfa384x2host_16(inf->framelen);
|
||||
if (len > 22) {
|
||||
dst = (UINT32 *) &priv->tallies;
|
||||
src32 = (UINT32 *) &inf->info.commtallies32;
|
||||
for (i = 0; i < cnt; i++, dst++, src32++)
|
||||
*dst += hfa384x2host_32(*src32);
|
||||
} else {
|
||||
dst = (UINT32 *) &priv->tallies;
|
||||
src16 = (UINT16 *) &inf->info.commtallies16;
|
||||
for (i = 0; i < cnt; i++, dst++, src16++)
|
||||
*dst += hfa384x2host_16(*src16);
|
||||
}
|
||||
|
||||
DBFEXIT;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
* prism2sta_inf_scanresults
|
||||
*
|
||||
|
@ -1395,7 +1415,7 @@ void prism2sta_inf_scanresults(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf)
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef WLAN_AP
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
* prism2sta_inf_chinforesults
|
||||
*
|
||||
|
@ -1448,7 +1468,7 @@ void prism2sta_inf_chinforesults(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf)
|
|||
DBFEXIT;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
* prism2sta_inf_linkstatus
|
||||
|
@ -1539,8 +1559,8 @@ failed:
|
|||
/*----------------------------------------------------------------
|
||||
* prism2sta_inf_assocstatus
|
||||
*
|
||||
* Handles the receipt of a Association Status info frame. Should
|
||||
* only be present in APs only.
|
||||
* Handles the receipt of an Association Status info frame. Should
|
||||
* be present in APs only.
|
||||
*
|
||||
* Arguments:
|
||||
* wlandev wlan device structure
|
||||
|
@ -1556,59 +1576,86 @@ failed:
|
|||
----------------------------------------------------------------*/
|
||||
void prism2sta_inf_assocstatus(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf)
|
||||
{
|
||||
char macbuf[WLAN_ADDR_LEN*3],macbuf2[WLAN_ADDR_LEN*3];
|
||||
int assocstatus, reason;
|
||||
prism2sta_priv_t *priv = wlandev->priv;
|
||||
hfa384x_AssocStatus_t rec;
|
||||
char macbuf[WLAN_ADDR_LEN*3];
|
||||
char macbuf2[WLAN_ADDR_LEN*3];
|
||||
int i;
|
||||
|
||||
DBFENTER;
|
||||
/* Convert */
|
||||
assocstatus = hfa384x2host_16(inf->info.assocstatus.assocstatus);
|
||||
p802addr_to_str(macbuf, inf->info.assocstatus.sta_addr);
|
||||
reason = hfa384x2host_16(inf->info.assocstatus.reason);
|
||||
|
||||
/* Handle */
|
||||
switch (assocstatus) {
|
||||
case HFA384x_ASSOCSTATUS_STAASSOC:
|
||||
WLAN_LOG_DEBUG2(1,"assocstatus=%d: STA %s associated.\n",
|
||||
assocstatus, macbuf);
|
||||
break;
|
||||
case HFA384x_ASSOCSTATUS_REASSOC:
|
||||
p802addr_to_str(macbuf2, inf->info.assocstatus.old_ap_addr);
|
||||
WLAN_LOG_DEBUG3(1,"assocstatus=%d: STA %s reassociated "
|
||||
"from AP %s.\n",
|
||||
assocstatus, macbuf, macbuf2);
|
||||
break;
|
||||
case HFA384x_ASSOCSTATUS_DISASSOC:
|
||||
WLAN_LOG_DEBUG3(1,"assocstatus=%d: STA %s disassociated, "
|
||||
"reason=%d.\n",
|
||||
assocstatus, macbuf, reason);
|
||||
break;
|
||||
case HFA384x_ASSOCSTATUS_ASSOCFAIL:
|
||||
WLAN_LOG_DEBUG3(1,"assocstatus=%d: STA %s assoc failed, "
|
||||
"reason=%d.\n",
|
||||
assocstatus, macbuf, reason);
|
||||
break;
|
||||
case HFA384x_ASSOCSTATUS_AUTHFAIL:
|
||||
WLAN_LOG_DEBUG3(1,"assocstatus=%d: STA %s auth failed, "
|
||||
"reason=%d.\n",
|
||||
assocstatus, macbuf, reason);
|
||||
break;
|
||||
default:
|
||||
WLAN_LOG_WARNING3( "unknown assocstatus=0x%02x, STA %s, "
|
||||
"reason=%d.\n",
|
||||
assocstatus, macbuf, reason);
|
||||
break;
|
||||
memcpy(&rec, &inf->info.assocstatus, sizeof(rec));
|
||||
rec.assocstatus = hfa384x2host_16(rec.assocstatus);
|
||||
rec.reason = hfa384x2host_16(rec.reason);
|
||||
|
||||
if (priv->log) {
|
||||
p802addr_to_str(macbuf, rec.sta_addr);
|
||||
switch (rec.assocstatus) {
|
||||
case HFA384x_ASSOCSTATUS_STAASSOC:
|
||||
printk(KERN_INFO "wlan-ap: %s Associated\n",
|
||||
macbuf);
|
||||
break;
|
||||
case HFA384x_ASSOCSTATUS_REASSOC:
|
||||
p802addr_to_str(macbuf2, rec.old_ap_addr);
|
||||
printk(KERN_INFO "wlan-ap: %s Reassociated from %s\n",
|
||||
macbuf, macbuf2);
|
||||
break;
|
||||
case HFA384x_ASSOCSTATUS_DISASSOC:
|
||||
printk(KERN_INFO "wlan-ap: %s Disssociated. Reason = %d\n",
|
||||
macbuf, rec.reason);
|
||||
break;
|
||||
case HFA384x_ASSOCSTATUS_ASSOCFAIL:
|
||||
printk(KERN_INFO "wlan-ap: %s Association failed. Reason = %d\n",
|
||||
macbuf, rec.reason);
|
||||
break;
|
||||
case HFA384x_ASSOCSTATUS_AUTHFAIL:
|
||||
printk(KERN_INFO "wlan-ap: %s Authentication failed. Reason = %d\n",
|
||||
macbuf, rec.reason);
|
||||
break;
|
||||
default:
|
||||
printk(KERN_INFO "wlan-ap: %s Unknown failure. Reason = %d\n",
|
||||
macbuf, rec.reason);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Find the address in the list of authenticated stations. If it wasn't
|
||||
** found, then this address has not been previously authenticated and
|
||||
** something weird has happened if this is anything other than an
|
||||
** "authentication failed" message. If the address was found, then
|
||||
** set the "associated" flag for that station, based on whether the
|
||||
** station is associating or losing its association. Something weird
|
||||
** has also happened if we find the address in the list of authenticated
|
||||
** stations but we are getting an "authentication failed" message.
|
||||
*/
|
||||
|
||||
for (i = 0; i < priv->authlist.cnt; i++)
|
||||
if (memcmp(rec.sta_addr, priv->authlist.addr[i], WLAN_ADDR_LEN) == 0)
|
||||
break;
|
||||
|
||||
if (i >= priv->authlist.cnt) {
|
||||
if (rec.assocstatus != HFA384x_ASSOCSTATUS_AUTHFAIL)
|
||||
WLAN_LOG_WARNING0("assocstatus info frame received for non-authenticated station.\n");
|
||||
} else {
|
||||
priv->authlist.assoc[i] =
|
||||
(rec.assocstatus == HFA384x_ASSOCSTATUS_STAASSOC ||
|
||||
rec.assocstatus == HFA384x_ASSOCSTATUS_REASSOC);
|
||||
|
||||
if (rec.assocstatus == HFA384x_ASSOCSTATUS_AUTHFAIL)
|
||||
WLAN_LOG_WARNING0("authfail assocstatus info frame received for authenticated station.\n");
|
||||
}
|
||||
|
||||
DBFEXIT;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
* prism2sta_inf_authreq
|
||||
*
|
||||
* Handles the receipt of a Authentication Request info frame. Should
|
||||
* only be present in APs only.
|
||||
* Handles the receipt of an Authentication Request info frame. Should
|
||||
* be present in APs only.
|
||||
*
|
||||
* Arguments:
|
||||
* wlandev wlan device structure
|
||||
|
@ -1621,12 +1668,177 @@ void prism2sta_inf_assocstatus(wlandevice_t *wlandev, hfa384x_InfFrame_t *inf)
|
|||
*
|
||||
* Call context:
|
||||
* interrupt
|
||||
*
|
||||
* TODO: Make sure that the correct status values are returned. Is
|
||||
* "unspecified failure" correct?
|
||||
*
|
||||
----------------------------------------------------------------*/
|
||||
void prism2sta_inf_authreq( wlandevice_t *wlandev, hfa384x_InfFrame_t *inf)
|
||||
{
|
||||
prism2sta_priv_t *priv = wlandev->priv;
|
||||
hfa384x_t *hw = priv->hw;
|
||||
hfa384x_authenticateStation_data_t rec;
|
||||
|
||||
int i, added, result, cnt;
|
||||
UINT8 *addr;
|
||||
char macbuf[WLAN_ADDR_LEN*3];
|
||||
|
||||
DBFENTER;
|
||||
WLAN_LOG_DEBUG0(2,"received infoframe:AUTHREQ (unhandled)\n");
|
||||
|
||||
/*
|
||||
** Build the AuthenticateStation record. Initialize it for denying
|
||||
** authentication.
|
||||
*/
|
||||
|
||||
memcpy(rec.address, inf->info.authreq.sta_addr, WLAN_ADDR_LEN);
|
||||
|
||||
rec.status = P80211ENUM_status_unspec_failure;
|
||||
|
||||
/*
|
||||
** Authenticate based on the access mode.
|
||||
*/
|
||||
|
||||
switch (priv->accessmode) {
|
||||
case WLAN_ACCESS_NONE:
|
||||
|
||||
/*
|
||||
** Deny all new authentications. However, if a station
|
||||
** is ALREADY authenticated, then accept it.
|
||||
*/
|
||||
|
||||
for (i = 0; i < priv->authlist.cnt; i++)
|
||||
if (memcmp(rec.address, priv->authlist.addr[i],
|
||||
WLAN_ADDR_LEN) == 0) {
|
||||
rec.status = P80211ENUM_status_successful;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WLAN_ACCESS_ALL:
|
||||
|
||||
/*
|
||||
** Allow all authentications.
|
||||
*/
|
||||
|
||||
rec.status = P80211ENUM_status_successful;
|
||||
break;
|
||||
|
||||
case WLAN_ACCESS_ALLOW:
|
||||
|
||||
/*
|
||||
** Only allow the authentication if the MAC address
|
||||
** is in the list of allowed addresses.
|
||||
**
|
||||
** Since this is the interrupt handler, we may be here
|
||||
** while the access list is in the middle of being
|
||||
** updated. Choose the list which is currently okay.
|
||||
** See "prism2mib_priv_accessallow()" for details.
|
||||
*/
|
||||
|
||||
if (priv->allow.modify == 0) {
|
||||
cnt = priv->allow.cnt;
|
||||
addr = priv->allow.addr[0];
|
||||
} else {
|
||||
cnt = priv->allow.cnt1;
|
||||
addr = priv->allow.addr1[0];
|
||||
}
|
||||
|
||||
for (i = 0; i < cnt; i++, addr += WLAN_ADDR_LEN)
|
||||
if (memcmp(rec.address, addr, WLAN_ADDR_LEN) == 0) {
|
||||
rec.status = P80211ENUM_status_successful;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case WLAN_ACCESS_DENY:
|
||||
|
||||
/*
|
||||
** Allow the authentication UNLESS the MAC address is
|
||||
** in the list of denied addresses.
|
||||
**
|
||||
** Since this is the interrupt handler, we may be here
|
||||
** while the access list is in the middle of being
|
||||
** updated. Choose the list which is currently okay.
|
||||
** See "prism2mib_priv_accessdeny()" for details.
|
||||
*/
|
||||
|
||||
if (priv->deny.modify == 0) {
|
||||
cnt = priv->deny.cnt;
|
||||
addr = priv->deny.addr[0];
|
||||
} else {
|
||||
cnt = priv->deny.cnt1;
|
||||
addr = priv->deny.addr1[0];
|
||||
}
|
||||
|
||||
rec.status = P80211ENUM_status_successful;
|
||||
|
||||
for (i = 0; i < cnt; i++, addr += WLAN_ADDR_LEN)
|
||||
if (memcmp(rec.address, addr, WLAN_ADDR_LEN) == 0) {
|
||||
rec.status = P80211ENUM_status_unspec_failure;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
** If the authentication is okay, then add the MAC address to the list
|
||||
** of authenticated stations. Don't add the address if it is already in
|
||||
** the list. (802.11b does not seem to disallow a station from issuing
|
||||
** an authentication request when the station is already authenticated.
|
||||
** Does this sort of thing ever happen? We might as well do the check
|
||||
** just in case.)
|
||||
*/
|
||||
|
||||
added = 0;
|
||||
|
||||
if (rec.status == P80211ENUM_status_successful) {
|
||||
for (i = 0; i < priv->authlist.cnt; i++)
|
||||
if (memcmp(rec.address, priv->authlist.addr[i], WLAN_ADDR_LEN) == 0)
|
||||
break;
|
||||
|
||||
if (i >= priv->authlist.cnt) {
|
||||
if (priv->authlist.cnt >= WLAN_AUTH_MAX) {
|
||||
rec.status = P80211ENUM_status_ap_full;
|
||||
} else {
|
||||
memcpy(priv->authlist.addr[priv->authlist.cnt],
|
||||
rec.address, WLAN_ADDR_LEN);
|
||||
priv->authlist.cnt++;
|
||||
added = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (priv->log) {
|
||||
p802addr_to_str(macbuf, rec.address);
|
||||
printk(KERN_INFO "wlan-ap: %s %s\n",
|
||||
macbuf,
|
||||
(rec.status == P80211ENUM_status_successful) ?
|
||||
"Authenticated" :
|
||||
(rec.status == P80211ENUM_status_ap_full) ?
|
||||
"Authentication denied (AP full)" :
|
||||
"Authentication denied (Access List)");
|
||||
}
|
||||
|
||||
/*
|
||||
** Send back the results of the authentication. If this doesn't work,
|
||||
** then make sure to remove the address from the authenticated list if
|
||||
** it was added.
|
||||
*/
|
||||
|
||||
rec.status = host2hfa384x_16(rec.status);
|
||||
|
||||
result = hfa384x_drvr_setconfig(hw, HFA384x_RID_AUTHENTICATESTA,
|
||||
&rec, sizeof(rec));
|
||||
if (result) {
|
||||
if (added) priv->authlist.cnt--;
|
||||
WLAN_LOG_ERROR1("setconfig(authenticatestation) failed, result=%d\n", result);
|
||||
}
|
||||
|
||||
DBFEXIT;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1635,7 +1847,7 @@ void prism2sta_inf_authreq( wlandevice_t *wlandev, hfa384x_InfFrame_t *inf)
|
|||
* prism2sta_inf_psusercnt
|
||||
*
|
||||
* Handles the receipt of a PowerSaveUserCount info frame. Should
|
||||
* only be present in APs only.
|
||||
* be present in APs only.
|
||||
*
|
||||
* Arguments:
|
||||
* wlandev wlan device structure
|
||||
|
@ -1651,9 +1863,14 @@ void prism2sta_inf_authreq( wlandevice_t *wlandev, hfa384x_InfFrame_t *inf)
|
|||
----------------------------------------------------------------*/
|
||||
void prism2sta_inf_psusercnt( wlandevice_t *wlandev, hfa384x_InfFrame_t *inf)
|
||||
{
|
||||
prism2sta_priv_t *priv = wlandev->priv;
|
||||
|
||||
DBFENTER;
|
||||
WLAN_LOG_DEBUG0(2,"received infoframe:PSUSERCNT (unhandled)\n");
|
||||
|
||||
priv->psusercount = hfa384x2host_16(inf->info.psusercnt.usercnt);
|
||||
|
||||
DBFEXIT;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1895,11 +2112,9 @@ void prism2sta_int_info(wlandevice_t *wlandev)
|
|||
case HFA384x_IT_SCANRESULTS:
|
||||
prism2sta_inf_scanresults(wlandev, &inf);
|
||||
break;
|
||||
#ifdef WLAN_AP
|
||||
case HFA384x_IT_CHINFORESULTS:
|
||||
prism2sta_inf_chinforesults(wlandev, &inf);
|
||||
break;
|
||||
#endif
|
||||
case HFA384x_IT_LINKSTATUS:
|
||||
prism2sta_inf_linkstatus(wlandev, &inf);
|
||||
break;
|
||||
|
@ -2181,7 +2396,7 @@ int prism2sta_int_rx_typedrop( wlandevice_t *wlandev, UINT16 fc)
|
|||
wlandev->rx.mgmt++;
|
||||
switch( fstype ) {
|
||||
case WLAN_FSTYPE_ASSOCREQ:
|
||||
printk("assocreq");
|
||||
printk("assocreq");
|
||||
wlandev->rx.assocreq++;
|
||||
break;
|
||||
case WLAN_FSTYPE_ASSOCRESP:
|
||||
|
@ -2443,10 +2658,14 @@ dev_link_t *prism2sta_attach(void)
|
|||
kfree_s(link, sizeof(dev_link_t));
|
||||
return NULL;
|
||||
}
|
||||
memset(wlandev->priv, 0, sizeof(prism2sta_priv_t));
|
||||
|
||||
/* Initialize the device private data stucture. */
|
||||
priv = (prism2sta_priv_t *) wlandev->priv;
|
||||
memset(priv, 0, sizeof(prism2sta_priv_t));
|
||||
|
||||
priv->dot11_desired_bss_type = 1;
|
||||
|
||||
/* Make up a hw data structure. */
|
||||
priv = (prism2sta_priv_t*)wlandev->priv;
|
||||
priv->hw = kmalloc(sizeof(hfa384x_t), GFP_KERNEL);
|
||||
if ( priv->hw == NULL ) {
|
||||
kfree_s(wlandev->priv, sizeof(prism2sta_priv_t));
|
||||
|
@ -3166,7 +3385,7 @@ int init_module(void)
|
|||
WLAN_LOG_NOTICE1("%s Loaded\n", version);
|
||||
WLAN_LOG_NOTICE1("dev_info is: %s\n", dev_info);
|
||||
|
||||
#if (WLAN_HOSTIF == WLAN_PCI)
|
||||
#if (WLAN_HOSTIF == WLAN_PLX)
|
||||
/* This call will result in a call to prism2sta_probe_pci
|
||||
* if there is a matched PCI card present (ie., which
|
||||
* vendor+device id are matched)
|
||||
|
|
|
@ -107,6 +107,7 @@
|
|||
|
||||
#define HFA384x_AUX_MKOFF(n, c) ((((UINT16)(n))&HFA384x_AUX_OFF_MASK) | (((UINT16)(c))<<12))
|
||||
#define HFA384x_AUX_MKPAGE(n) ((UINT16)(((n)&HFA384x_AUX_PAGE_MASK)>>7))
|
||||
|
||||
/*--- Controller Memory addresses -------------------*/
|
||||
#define HFA3842_PDA_BASE (0x007f0000UL)
|
||||
#define HFA3841_PDA_BASE (0x003f0000UL)
|
||||
|
@ -297,20 +298,20 @@ Configuration RID lengths: Network Params, Static Config Entities
|
|||
#define HFA384x_RID_CNFOWNATIMWIN_LEN ((UINT16)2)
|
||||
#define HFA384x_RID_CNFSYSSCALE_LEN ((UINT16)0)
|
||||
#define HFA384x_RID_CNFMAXDATALEN_LEN ((UINT16)0)
|
||||
#define HFA384x_RID_CNFWDSADDR_LEN ((UINT16)0)
|
||||
#define HFA384x_RID_CNFWDSADDR_LEN ((UINT16)6)
|
||||
#define HFA384x_RID_CNFPMENABLED_LEN ((UINT16)0)
|
||||
#define HFA384x_RID_CNFPMEPS_LEN ((UINT16)0)
|
||||
#define HFA384x_RID_CNFMULTICASTRX_LEN ((UINT16)0)
|
||||
#define HFA384x_RID_CNFMAXSLEEPDUR_LEN ((UINT16)0)
|
||||
#define HFA384x_RID_CNFPMHOLDDUR_LEN ((UINT16)0)
|
||||
#define HFA384x_RID_CNFOWNNAME_LEN ((UINT16)0)
|
||||
#define HFA384x_RID_CNFOWNNAME_LEN ((UINT16)34)
|
||||
#define HFA384x_RID_CNFOWNDTIMPER_LEN ((UINT16)0)
|
||||
#define HFA384x_RID_CNFWDSADDR1_LEN ((UINT16)0)
|
||||
#define HFA384x_RID_CNFWDSADDR2_LEN ((UINT16)0)
|
||||
#define HFA384x_RID_CNFWDSADDR3_LEN ((UINT16)0)
|
||||
#define HFA384x_RID_CNFWDSADDR4_LEN ((UINT16)0)
|
||||
#define HFA384x_RID_CNFWDSADDR5_LEN ((UINT16)0)
|
||||
#define HFA384x_RID_CNFWDSADDR6_LEN ((UINT16)0)
|
||||
#define HFA384x_RID_CNFWDSADDR1_LEN ((UINT16)6)
|
||||
#define HFA384x_RID_CNFWDSADDR2_LEN ((UINT16)6)
|
||||
#define HFA384x_RID_CNFWDSADDR3_LEN ((UINT16)6)
|
||||
#define HFA384x_RID_CNFWDSADDR4_LEN ((UINT16)6)
|
||||
#define HFA384x_RID_CNFWDSADDR5_LEN ((UINT16)6)
|
||||
#define HFA384x_RID_CNFWDSADDR6_LEN ((UINT16)6)
|
||||
#define HFA384x_RID_CNFMCASTPMBUFF_LEN ((UINT16)0)
|
||||
#define HFA384x_RID_CNFAUTHENTICATION_LEN ((UINT16)sizeof(UINT16))
|
||||
#define HFA384x_RID_CNFMAXSLEEPDUR_LEN ((UINT16)0)
|
||||
|
@ -422,21 +423,21 @@ Information RID Lengths: NIC Information
|
|||
--------------------------------------------------------------------*/
|
||||
#define HFA384x_RID_MAXLOADTIME_LEN ((UINT16)0)
|
||||
#define HFA384x_RID_DOWNLOADBUFFER_LEN ((UINT16)sizeof(hfa384x_downloadbuffer_t))
|
||||
#define HFA384x_RID_PRIIDENTITY_LEN ((UINT16)0)
|
||||
#define HFA384x_RID_PRISUPRANGE_LEN ((UINT16)0)
|
||||
#define HFA384x_RID_CFIACTRANGES_LEN ((UINT16)0)
|
||||
#define HFA384x_RID_PRIIDENTITY_LEN ((UINT16)8)
|
||||
#define HFA384x_RID_PRISUPRANGE_LEN ((UINT16)10)
|
||||
#define HFA384x_RID_CFIACTRANGES_LEN ((UINT16)10)
|
||||