66 #include <linux/kernel.h>
69 #include <linux/ctype.h>
78 #include <linux/netdevice.h>
101 static const long chan_freq_list[][2] =
132 extern dbg_info_t *DbgInfo;
201 return ((( value - min ) * 100 ) / ( max - min ));
235 if( s[0] ==
'0' && ( s[1] ==
'x' || s[1] ==
'X' )) {
236 if( l == 12 || l == 28 ) {
237 for( i = 2; i <
l; i++ ) {
251 return( l == 0 || l == 5 || l == 13 );
289 if( ks[0] ==
'0' && ( ks[1] ==
'x' || ks[1] ==
'X' )) {
291 p = (
char *)key->
key;
293 for( i = 2; i < l; i+=2 ) {
335 CFG_PRIVACY_OPT_IMPLEMENTED_STRCT ltv;
348 privacy = CNV_LITTLE_TO_INT( ltv.privacy_opt_implemented );
382 switch( hcfStatus ) {
386 pMsg =
"Expected adapter event did not occur in expected time";
392 pMsg =
"Card not found (ejected unexpectedly)";
398 pMsg =
"Command buffer size insufficient";
404 pMsg =
"Primary functions are not compatible";
410 pMsg =
"Primary functions are compatible, "
411 "station/ap functions are not";
417 pMsg =
"Inquire cmd while another Inquire in progress";
429 pMsg =
"Timeout on ack for enable/disable of AUX registers";
434 pMsg =
"Timeout on timer calibration during initialization process";
439 pMsg =
"Timeout on Busy bit drop during BAP setup";
444 pMsg =
"Hermes and HCF are out of sync";
450 sprintf( buffer,
"Error code %d", hcfStatus );
484 DBG_FUNC(
"wl_endian_translate_event" );
488 switch( pLtv->
typ ) {
501 while( numAPs >= 1 ) {
505 CNV_LITTLE_TO_INT( pAps[numAPs].channel_id );
508 CNV_LITTLE_TO_INT( pAps[numAPs].noise_level );
511 CNV_LITTLE_TO_INT( pAps[numAPs].signal_level );
514 CNV_LITTLE_TO_INT( pAps[numAPs].beacon_interval_time );
520 CNV_LITTLE_TO_INT( pAps[numAPs].ssid_len );
534 probe_resp->
durID = CNV_LITTLE_TO_INT( probe_resp->
durID );
544 probe_resp->
flags = CNV_LITTLE_TO_INT( probe_resp->
flags );
550 #define ls ((LINK_STATUS_STRCT *)pLtv)
551 ls->linkStatus = CNV_LITTLE_TO_INT(
ls->linkStatus );
615 DBG_PRINT(
"HCF ASSERT: Line %d, VAL: 0x%.8x\n", line_number, (
u32)qual );
651 if( probe_rsp ==
NULL ) {
656 buf_size =
sizeof( probe_rsp->
rawData );
711 if( probe_rsp ==
NULL || length ==
NULL ) {
716 buf_size =
sizeof( probe_rsp->
rawData );
735 *length = ie_length + 2;
744 i += ( ie_length - 1 );
785 memset( output, 0,
sizeof( output ));
786 memset( row_buf, 0,
sizeof( row_buf ));
790 rows = length / rowsize;
791 remainder = length % rowsize;
795 for( count = 0; count <
rows; count++ ) {
796 sprintf( row_buf,
"%02x%02x%02x%02x",
797 buffer[count*rowsize], buffer[count*rowsize+1],
798 buffer[count*rowsize+2], buffer[count*rowsize+3]);
799 strcat( output, row_buf );
802 memset( row_buf, 0,
sizeof( row_buf ));
806 for( count = 0; count < remainder; count++ ) {
807 sprintf( row_buf,
"%02x", buffer[(rows*rowsize)+count]);
808 strcat( output, row_buf );
843 if( channel & 0x100 ) {
844 channel = channel & 0x0FF;
848 for( i = 0; i <
ARRAY_SIZE(chan_freq_list); i++ ) {
849 if( chan_freq_list[i][0] == channel ) {
886 for( i = 0; i <
ARRAY_SIZE(chan_freq_list); i++ ) {
887 if( chan_freq_list[i][1] == frequency ) {
924 if( channel & 0x100 ) {
925 channel = channel & 0x0FF;
929 for( i = 0; i <
ARRAY_SIZE(chan_freq_list); i++ ) {
930 if( chan_freq_list[i][0] == channel ) {
931 return chan_freq_list[
i][1];
967 for( i = 0; i <
ARRAY_SIZE(chan_freq_list); i++ ) {
968 if( chan_freq_list[i][1] == frequency ) {
969 return chan_freq_list[
i][0];
1002 DBG_FUNC(
"wl_process_link_status" );
1008 switch( link_stat ) {
1010 DBG_TRACE( DbgInfo,
"Link Status : Connected\n" );
1014 DBG_TRACE( DbgInfo,
"Link Status : Disconnected\n" );
1017 DBG_TRACE( DbgInfo,
"Link Status : Access Point Change\n" );
1020 DBG_TRACE( DbgInfo,
"Link Status : Access Point Out of Range\n" );
1023 DBG_TRACE( DbgInfo,
"Link Status : Access Point In Range\n" );
1026 DBG_TRACE( DbgInfo,
"Link Status : UNKNOWN (0x%04x)\n", link_stat );
1064 DBG_FUNC(
"wl_process_probe_response" );
1073 DBG_TRACE( DbgInfo,
"(%s) =========================\n", lp->
dev->name );
1074 DBG_TRACE( DbgInfo,
"(%s) length : 0x%04x.\n", lp->
dev->name,
1077 if( probe_rsp->
length > 1 ) {
1078 DBG_TRACE( DbgInfo,
"(%s) infoType : 0x%04x.\n", lp->
dev->name,
1081 DBG_TRACE( DbgInfo,
"(%s) signal : 0x%02x.\n", lp->
dev->name,
1084 DBG_TRACE( DbgInfo,
"(%s) silence : 0x%02x.\n", lp->
dev->name,
1087 DBG_TRACE( DbgInfo,
"(%s) rxFlow : 0x%02x.\n", lp->
dev->name,
1090 DBG_TRACE( DbgInfo,
"(%s) rate : 0x%02x.\n", lp->
dev->name,
1093 DBG_TRACE( DbgInfo,
"(%s) frame cntl : 0x%04x.\n", lp->
dev->name,
1096 DBG_TRACE( DbgInfo,
"(%s) durID : 0x%04x.\n", lp->
dev->name,
1099 DBG_TRACE(DbgInfo,
"(%s) address1 : %pM\n", lp->
dev->name,
1102 DBG_TRACE(DbgInfo,
"(%s) address2 : %pM\n", lp->
dev->name,
1105 DBG_TRACE(DbgInfo,
"(%s) BSSID : %pM\n", lp->
dev->name,
1108 DBG_TRACE( DbgInfo,
"(%s) sequence : 0x%04x.\n", lp->
dev->name,
1111 DBG_TRACE(DbgInfo,
"(%s) address4 : %pM\n", lp->
dev->name,
1114 DBG_TRACE( DbgInfo,
"(%s) datalength : 0x%04x.\n", lp->
dev->name,
1125 DBG_TRACE( DbgInfo,
"(%s) channel : %d\n", lp->
dev->name,
1126 probe_rsp->channel );
1131 DBG_TRACE( DbgInfo,
"(%s) lenType : 0x%04x.\n", lp->
dev->name,
1135 DBG_TRACE( DbgInfo,
"(%s) timeStamp : %d.%d.%d.%d.%d.%d.%d.%d\n",
1146 DBG_TRACE( DbgInfo,
"(%s) beaconInt : 0x%04x.\n", lp->
dev->name,
1149 DBG_TRACE( DbgInfo,
"(%s) capability : 0x%04x.\n", lp->
dev->name,
1152 DBG_TRACE( DbgInfo,
"(%s) SSID len : 0x%04x.\n", lp->
dev->name,
1156 if( probe_rsp->
rawData[1] > 0 ) {
1159 memset( ssid, 0,
sizeof( ssid ));
1164 lp->
dev->name, ssid );
1170 if( wpa_ie !=
NULL ) {
1171 DBG_TRACE( DbgInfo,
"(%s) WPA-IE : %s\n",
1175 DBG_TRACE( DbgInfo,
"(%s) flags : 0x%04x.\n",
1183 if( probe_rsp->
length == 1 ) {
1184 DBG_TRACE( DbgInfo,
"SCAN COMPLETE\n" );
1227 DBG_WARNING( DbgInfo,
"Num of scan results exceeds storage, truncating\n" );
1266 DBG_FUNC(
"wl_process_updated_record" );
1275 DBG_TRACE( DbgInfo,
"Updated Record: CFG_CUR_COUNTRY_INFO\n" );
1280 DBG_TRACE( DbgInfo,
"Updated Record: WAIT_FOR_CONNECT (0xFD40)\n" );
1285 DBG_TRACE( DbgInfo,
"UNKNOWN: 0x%04x\n",
1321 DBG_FUNC(
"wl_process_assoc_status" );
1332 DBG_TRACE( DbgInfo,
"Association Status : STA Associated\n" );
1336 DBG_TRACE( DbgInfo,
"Association Status : STA Reassociated\n" );
1340 DBG_TRACE( DbgInfo,
"Association Status : STA Disassociated\n" );
1344 DBG_TRACE( DbgInfo,
"Association Status : UNKNOWN (0x%04x)\n",
1351 if(( assoc_stat->
assocStatus == 2 ) && ( assoc_stat->
len == 8 )) {
1352 DBG_TRACE(DbgInfo,
"Old AP Address : %pM\n",
1388 DBG_FUNC(
"wl_process_security_status" );
1399 DBG_TRACE( DbgInfo,
"Security Status : Dissassociate [AP]\n" );
1403 DBG_TRACE( DbgInfo,
"Security Status : Deauthenticate [AP]\n" );
1407 DBG_TRACE( DbgInfo,
"Security Status : Authenticate Fail [STA] or [AP]\n" );
1411 DBG_TRACE( DbgInfo,
"Security Status : MIC Fail\n" );
1415 DBG_TRACE( DbgInfo,
"Security Status : Associate Fail\n" );
1419 DBG_TRACE( DbgInfo,
"Security Status : UNKNOWN (0x%04x)\n",
1452 memcpy(tallies, pTallies,
sizeof(*tallies));
1453 DBG_TRACE( DbgInfo,
"Get tallies okay, dixe: %d\n",
sizeof(*tallies) );
1455 DBG_TRACE( DbgInfo,
"Get tallies failed\n" );