Commit d101b958 authored by Prashant P. Shah's avatar Prashant P. Shah Committed by Greg Kroah-Hartman

Staging: wlags49_h2: fixed whitespace issues in wl_profile.c

This is a patch to the wl_profile.c file that fixes whitespace
issues found by the checkpatch.pl tool.
Signed-off-by: default avatarPrashant P. Shah <pshah.mumbai@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ad602259
...@@ -113,17 +113,19 @@ extern p_u32 DebugFlag; ...@@ -113,17 +113,19 @@ extern p_u32 DebugFlag;
extern dbg_info_t *DbgInfo; extern dbg_info_t *DbgInfo;
#endif #endif
int parse_yes_no( char* value ); int parse_yes_no(char *value);
int parse_yes_no( char* value ) { int parse_yes_no(char *value)
{
int rc = 0; //default to NO for invalid parameters int rc = 0; //default to NO for invalid parameters
if ( strlen( value ) == 1 ) { if (strlen(value) == 1) {
if ( ( value[0] | ('Y'^'y') ) == 'y' ) rc = 1; if ((value[0] | ('Y'^'y')) == 'y')
rc = 1;
// } else { // } else {
// this should not be debug time info, it is an enduser data entry error ;? // this should not be debug time info, it is an enduser data entry error ;?
// DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_MICROWAVE_ROBUSTNESS ); // DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_MICROWAVE_ROBUSTNESS);
} }
return rc; return rc;
} // parse_yes_no } // parse_yes_no
...@@ -149,11 +151,11 @@ int rc = 0; //default to NO for invalid parameters ...@@ -149,11 +151,11 @@ int rc = 0; //default to NO for invalid parameters
* N/A * N/A
* *
******************************************************************************/ ******************************************************************************/
void parse_config( struct net_device *dev ) void parse_config(struct net_device *dev)
{ {
int file_desc; int file_desc;
#if 0 // BIN_DL #if 0 // BIN_DL
int rc; int rc;
char *cp = NULL; char *cp = NULL;
#endif // BIN_DL #endif // BIN_DL
char buffer[MAX_LINE_SIZE]; char buffer[MAX_LINE_SIZE];
...@@ -163,48 +165,48 @@ void parse_config( struct net_device *dev ) ...@@ -163,48 +165,48 @@ void parse_config( struct net_device *dev )
ENCSTRCT sEncryption; ENCSTRCT sEncryption;
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
DBG_FUNC( "parse_config" ); DBG_FUNC("parse_config");
DBG_ENTER( DbgInfo ); DBG_ENTER(DbgInfo);
/* Get the wavelan specific info for this device */ /* Get the wavelan specific info for this device */
wvlan_config = (struct wl_private *)dev->priv; wvlan_config = (struct wl_private *)dev->priv;
if ( wvlan_config == NULL ) { if (wvlan_config == NULL) {
DBG_ERROR( DbgInfo, "Wavelan specific info struct not present?\n" ); DBG_ERROR(DbgInfo, "Wavelan specific info struct not present?\n");
return; return;
} }
/* setup the default encryption string */ /* setup the default encryption string */
strcpy( wvlan_config->szEncryption, DEF_CRYPT_STR ); strcpy(wvlan_config->szEncryption, DEF_CRYPT_STR);
/* Obtain a user-space process context, storing the original context */ /* Obtain a user-space process context, storing the original context */
fs = get_fs( ); fs = get_fs();
set_fs( get_ds( )); set_fs(get_ds());
/* Determine the filename for this device and attempt to open it */ /* Determine the filename for this device and attempt to open it */
sprintf( filename, "%s%s", ROOT_CONFIG_FILENAME, dev->name ); sprintf(filename, "%s%s", ROOT_CONFIG_FILENAME, dev->name);
file_desc = open( filename, O_RDONLY, 0 ); file_desc = open(filename, O_RDONLY, 0);
if ( file_desc != -1 ) { if (file_desc != -1) {
DBG_TRACE( DbgInfo, "Wireless config file found. Parsing options...\n" ); DBG_TRACE(DbgInfo, "Wireless config file found. Parsing options...\n");
/* Read out the options */ /* Read out the options */
while( readline( file_desc, buffer )) { while (readline(file_desc, buffer)) {
translate_option( buffer, wvlan_config ); translate_option(buffer, wvlan_config);
} }
/* Close the file */ /* Close the file */
close( file_desc ); //;?even if file_desc == -1 ??? close(file_desc); //;?even if file_desc == -1 ???
} else { } else {
DBG_TRACE( DbgInfo, "No iwconfig file found for this device; " DBG_TRACE(DbgInfo, "No iwconfig file found for this device; "
"config.opts or wireless.opts will be used\n" ); "config.opts or wireless.opts will be used\n");
} }
/* Return to the original context */ /* Return to the original context */
set_fs( fs ); set_fs(fs);
/* convert the WEP keys, if read in as key1, key2, type of data */ /* convert the WEP keys, if read in as key1, key2, type of data */
if ( wvlan_config->EnableEncryption ) { if (wvlan_config->EnableEncryption) {
memset( &sEncryption, 0, sizeof( sEncryption )); memset(&sEncryption, 0, sizeof(sEncryption));
wl_wep_decode( CRYPT_CODE, &sEncryption, wl_wep_decode(CRYPT_CODE, &sEncryption,
wvlan_config->szEncryption ); wvlan_config->szEncryption);
/* the Linux driver likes to use 1-4 for the key IDs, and then /* the Linux driver likes to use 1-4 for the key IDs, and then
convert to 0-3 when sending to the card. The Windows code convert to 0-3 when sending to the card. The Windows code
...@@ -216,63 +218,63 @@ void parse_config( struct net_device *dev ) ...@@ -216,63 +218,63 @@ void parse_config( struct net_device *dev )
sEncryption.wEnabled = wvlan_config->EnableEncryption; sEncryption.wEnabled = wvlan_config->EnableEncryption;
sEncryption.wTxKeyID = wvlan_config->TransmitKeyID - 1; sEncryption.wTxKeyID = wvlan_config->TransmitKeyID - 1;
memcpy( &sEncryption.EncStr, &wvlan_config->DefaultKeys, memcpy(&sEncryption.EncStr, &wvlan_config->DefaultKeys,
sizeof( CFG_DEFAULT_KEYS_STRCT )); sizeof(CFG_DEFAULT_KEYS_STRCT));
memset( wvlan_config->szEncryption, 0, sizeof( wvlan_config->szEncryption )); memset(wvlan_config->szEncryption, 0, sizeof(wvlan_config->szEncryption));
wl_wep_code( CRYPT_CODE, wvlan_config->szEncryption, &sEncryption, wl_wep_code(CRYPT_CODE, wvlan_config->szEncryption, &sEncryption,
sizeof( sEncryption )); sizeof(sEncryption));
} }
/* decode the encryption string for the call to wl_commit() */ /* decode the encryption string for the call to wl_commit() */
wl_wep_decode( CRYPT_CODE, &sEncryption, wvlan_config->szEncryption ); wl_wep_decode(CRYPT_CODE, &sEncryption, wvlan_config->szEncryption);
wvlan_config->TransmitKeyID = sEncryption.wTxKeyID + 1; wvlan_config->TransmitKeyID = sEncryption.wTxKeyID + 1;
wvlan_config->EnableEncryption = sEncryption.wEnabled; wvlan_config->EnableEncryption = sEncryption.wEnabled;
memcpy( &wvlan_config->DefaultKeys, &sEncryption.EncStr, memcpy(&wvlan_config->DefaultKeys, &sEncryption.EncStr,
sizeof( CFG_DEFAULT_KEYS_STRCT )); sizeof(CFG_DEFAULT_KEYS_STRCT));
#if 0 //BIN_DL #if 0 //BIN_DL
/* Obtain a user-space process context, storing the original context */ /* Obtain a user-space process context, storing the original context */
fs = get_fs( ); fs = get_fs();
set_fs( get_ds( )); set_fs(get_ds());
//;?just to fake something //;?just to fake something
strcpy(/*wvlan_config->fw_image_*/filename, "/etc/agere/fw.bin" ); strcpy(/*wvlan_config->fw_image_*/filename, "/etc/agere/fw.bin");
file_desc = open( /*wvlan_config->fw_image_*/filename, 0, 0 ); file_desc = open(/*wvlan_config->fw_image_*/filename, 0, 0);
if ( file_desc == -1 ) { if (file_desc == -1) {
DBG_ERROR( DbgInfo, "No image file found\n" ); DBG_ERROR(DbgInfo, "No image file found\n");
} else { } else {
DBG_TRACE( DbgInfo, "F/W image file found\n" ); DBG_TRACE(DbgInfo, "F/W image file found\n");
#define DHF_ALLOC_SIZE 96000 //just below 96K, let's hope it suffices for now and for the future #define DHF_ALLOC_SIZE 96000 //just below 96K, let's hope it suffices for now and for the future
cp = (char*)vmalloc( DHF_ALLOC_SIZE ); cp = (char *)vmalloc(DHF_ALLOC_SIZE);
if ( cp == NULL ) { if (cp == NULL) {
DBG_ERROR( DbgInfo, "error in vmalloc\n" ); DBG_ERROR(DbgInfo, "error in vmalloc\n");
} else { } else {
rc = read( file_desc, cp, DHF_ALLOC_SIZE ); rc = read(file_desc, cp, DHF_ALLOC_SIZE);
if ( rc == DHF_ALLOC_SIZE ) { if (rc == DHF_ALLOC_SIZE) {
DBG_ERROR( DbgInfo, "buffer too small, %d\n", DHF_ALLOC_SIZE ); DBG_ERROR(DbgInfo, "buffer too small, %d\n", DHF_ALLOC_SIZE);
} else if ( rc > 0 ) { } else if (rc > 0) {
DBG_TRACE( DbgInfo, "read O.K.: %d bytes %.12s\n", rc, cp ); DBG_TRACE(DbgInfo, "read O.K.: %d bytes %.12s\n", rc, cp);
rc = read( file_desc, &cp[rc], 1 ); rc = read(file_desc, &cp[rc], 1);
if ( rc == 0 ) { if (rc == 0) {
DBG_TRACE( DbgInfo, "no more to read\n" ); DBG_TRACE(DbgInfo, "no more to read\n");
} }
} }
if ( rc != 0 ) { if (rc != 0) {
DBG_ERROR( DbgInfo, "file not read in one swoop or other error"\ DBG_ERROR(DbgInfo, "file not read in one swoop or other error"\
", give up, too complicated, rc = %0X\n", rc ); ", give up, too complicated, rc = %0X\n", rc);
} }
vfree( cp ); vfree(cp);
} }
close( file_desc ); close(file_desc);
} }
set_fs( fs ); /* Return to the original context */ set_fs(fs); /* Return to the original context */
#endif // BIN_DL #endif // BIN_DL
DBG_LEAVE( DbgInfo ); DBG_LEAVE(DbgInfo);
return; return;
} // parse_config } // parse_config
...@@ -298,17 +300,17 @@ void parse_config( struct net_device *dev ) ...@@ -298,17 +300,17 @@ void parse_config( struct net_device *dev )
* -1 on error * -1 on error
* *
******************************************************************************/ ******************************************************************************/
int readline( int filedesc, char *buffer ) int readline(int filedesc, char *buffer)
{ {
int result = -1; int result = -1;
int bytes_read = 0; int bytes_read = 0;
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
/* Make sure the file descriptor is good */ /* Make sure the file descriptor is good */
if ( filedesc != -1 ) { if (filedesc != -1) {
/* Read in from the file byte by byte until a newline is reached */ /* Read in from the file byte by byte until a newline is reached */
while(( result = read( filedesc, &buffer[bytes_read], 1 )) == 1 ) { while ((result = read(filedesc, &buffer[bytes_read], 1)) == 1) {
if ( buffer[bytes_read] == '\n' ) { if (buffer[bytes_read] == '\n') {
buffer[bytes_read] = '\0'; buffer[bytes_read] = '\0';
bytes_read++; bytes_read++;
break; break;
...@@ -318,7 +320,7 @@ int readline( int filedesc, char *buffer ) ...@@ -318,7 +320,7 @@ int readline( int filedesc, char *buffer )
} }
/* Return the number of bytes read */ /* Return the number of bytes read */
if ( result == -1 ) { if (result == -1) {
return result; return result;
} else { } else {
return bytes_read; return bytes_read;
...@@ -346,7 +348,7 @@ int readline( int filedesc, char *buffer ) ...@@ -346,7 +348,7 @@ int readline( int filedesc, char *buffer )
* N/A * N/A
* *
******************************************************************************/ ******************************************************************************/
void translate_option( char *buffer, struct wl_private *lp ) void translate_option(char *buffer, struct wl_private *lp)
{ {
unsigned int value_convert = 0; unsigned int value_convert = 0;
int string_length = 0; int string_length = 0;
...@@ -355,16 +357,16 @@ void translate_option( char *buffer, struct wl_private *lp ) ...@@ -355,16 +357,16 @@ void translate_option( char *buffer, struct wl_private *lp )
u_char mac_value[ETH_ALEN]; u_char mac_value[ETH_ALEN];
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
DBG_FUNC( "translate_option" ); DBG_FUNC("translate_option");
if ( buffer == NULL || lp == NULL ) { if (buffer == NULL || lp == NULL) {
DBG_ERROR( DbgInfo, "Config file buffer and/or wavelan buffer ptr NULL\n" ); DBG_ERROR(DbgInfo, "Config file buffer and/or wavelan buffer ptr NULL\n");
return; return;
} }
ParseConfigLine( buffer, &key, &value ); ParseConfigLine(buffer, &key, &value);
if ( key == NULL || value == NULL ) { if (key == NULL || value == NULL) {
return; return;
} }
...@@ -375,9 +377,9 @@ void translate_option( char *buffer, struct wl_private *lp ) ...@@ -375,9 +377,9 @@ void translate_option( char *buffer, struct wl_private *lp )
/* handle DebugFlag as early as possible so it starts its influence as early /* handle DebugFlag as early as possible so it starts its influence as early
* as possible * as possible
*/ */
if ( strcmp( key, PARM_NAME_DEBUG_FLAG ) == 0 ) { if (strcmp(key, PARM_NAME_DEBUG_FLAG) == 0) {
if ( DebugFlag == ~0 ) { //if DebugFlag is not specified on the command line if (DebugFlag == ~0) { /* if DebugFlag is not specified on the command line */
if ( DbgInfo->DebugFlag == 0 ) { /* if pc_debug did not set DebugFlag (i.e.pc_debug is if (DbgInfo->DebugFlag == 0) { /* if pc_debug did not set DebugFlag (i.e.pc_debug is
* not specified or specified outside the 4-8 range * not specified or specified outside the 4-8 range
*/ */
DbgInfo->DebugFlag |= DBG_DEFAULTS; DbgInfo->DebugFlag |= DBG_DEFAULTS;
...@@ -388,250 +390,230 @@ void translate_option( char *buffer, struct wl_private *lp ) ...@@ -388,250 +390,230 @@ void translate_option( char *buffer, struct wl_private *lp )
DbgInfo->DebugFlag = simple_strtoul(value, NULL, 0); //;?Delete ASAP DbgInfo->DebugFlag = simple_strtoul(value, NULL, 0); //;?Delete ASAP
} }
#endif /* DBG */ #endif /* DBG */
if ( strcmp( key, PARM_NAME_AUTH_KEY_MGMT_SUITE ) == 0 ) { if (strcmp(key, PARM_NAME_AUTH_KEY_MGMT_SUITE) == 0) {
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_AUTH_KEY_MGMT_SUITE, value ); DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_AUTH_KEY_MGMT_SUITE, value);
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_AUTH_KEY_MGMT_SUITE ) || ( value_convert <= PARM_MAX_AUTH_KEY_MGMT_SUITE )) { if ((value_convert >= PARM_MIN_AUTH_KEY_MGMT_SUITE) || (value_convert <= PARM_MAX_AUTH_KEY_MGMT_SUITE)) {
lp->AuthKeyMgmtSuite = value_convert; lp->AuthKeyMgmtSuite = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_AUTH_KEY_MGMT_SUITE ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_AUTH_KEY_MGMT_SUITE);
} }
} } else if (strcmp(key, PARM_NAME_BRSC_2GHZ) == 0) {
else if ( strcmp( key, PARM_NAME_BRSC_2GHZ ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_BRSC_2GHZ, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_BRSC_2GHZ, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_BRSC ) || ( value_convert <= PARM_MAX_BRSC )) { if ((value_convert >= PARM_MIN_BRSC) || (value_convert <= PARM_MAX_BRSC)) {
lp->brsc[0] = value_convert; lp->brsc[0] = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_BRSC_2GHZ ); DBG_WARNING(DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_BRSC_2GHZ);
} }
} } else if (strcmp(key, PARM_NAME_BRSC_5GHZ) == 0) {
else if ( strcmp( key, PARM_NAME_BRSC_5GHZ ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_BRSC_5GHZ, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_BRSC_5GHZ, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_BRSC ) || ( value_convert <= PARM_MAX_BRSC )) { if ((value_convert >= PARM_MIN_BRSC) || (value_convert <= PARM_MAX_BRSC)) {
lp->brsc[1] = value_convert; lp->brsc[1] = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_BRSC_5GHZ ); DBG_WARNING(DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_BRSC_5GHZ);
} }
} } else if ((strcmp(key, PARM_NAME_DESIRED_SSID) == 0) || (strcmp(key, PARM_NAME_OWN_SSID) == 0)) {
else if (( strcmp( key, PARM_NAME_DESIRED_SSID ) == 0 ) || ( strcmp( key, PARM_NAME_OWN_SSID ) == 0 )) { DBG_TRACE(DbgInfo, "SSID, value: %s\n", value);
DBG_TRACE( DbgInfo, "SSID, value: %s\n", value );
memset( lp->NetworkName, 0, ( PARM_MAX_NAME_LEN + 1 )); memset(lp->NetworkName, 0, (PARM_MAX_NAME_LEN + 1));
/* Make sure the value isn't too long */ /* Make sure the value isn't too long */
string_length = strlen( value ); string_length = strlen(value);
if ( string_length > PARM_MAX_NAME_LEN ) { if (string_length > PARM_MAX_NAME_LEN) {
DBG_WARNING( DbgInfo, "SSID too long; will be truncated\n" ); DBG_WARNING(DbgInfo, "SSID too long; will be truncated\n");
string_length = PARM_MAX_NAME_LEN; string_length = PARM_MAX_NAME_LEN;
} }
memcpy( lp->NetworkName, value, string_length ); memcpy(lp->NetworkName, value, string_length);
} }
#if 0 #if 0
else if ( strcmp( key, PARM_NAME_DOWNLOAD_FIRMWARE ) == 0 ) { else if (strcmp(key, PARM_NAME_DOWNLOAD_FIRMWARE) == 0) {
DBG_TRACE( DbgInfo, "DOWNLOAD_FIRMWARE, value: %s\n", value ); DBG_TRACE(DbgInfo, "DOWNLOAD_FIRMWARE, value: %s\n", value);
memset( lp->fw_image_filename, 0, ( MAX_LINE_SIZE + 1 )); memset(lp->fw_image_filename, 0, (MAX_LINE_SIZE + 1));
/* Make sure the value isn't too long */ /* Make sure the value isn't too long */
string_length = strlen( value ); string_length = strlen(value);
if ( string_length > MAX_LINE_SIZE ) { if (string_length > MAX_LINE_SIZE) {
DBG_WARNING( DbgInfo, "F/W image file name too long; will be ignored\n" ); DBG_WARNING(DbgInfo, "F/W image file name too long; will be ignored\n");
} else { } else {
memcpy( lp->fw_image_filename, value, string_length ); memcpy(lp->fw_image_filename, value, string_length);
} }
} }
#endif #endif
else if ( strcmp( key, PARM_NAME_ENABLE_ENCRYPTION ) == 0 ) { else if (strcmp(key, PARM_NAME_ENABLE_ENCRYPTION) == 0) {
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_ENABLE_ENCRYPTION, value ); DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_ENABLE_ENCRYPTION, value);
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_ENABLE_ENCRYPTION ) && ( value_convert <= PARM_MAX_ENABLE_ENCRYPTION )) { if ((value_convert >= PARM_MIN_ENABLE_ENCRYPTION) && (value_convert <= PARM_MAX_ENABLE_ENCRYPTION)) {
lp->EnableEncryption = value_convert; lp->EnableEncryption = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_ENABLE_ENCRYPTION ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_ENABLE_ENCRYPTION);
} }
} } else if (strcmp(key, PARM_NAME_ENCRYPTION) == 0) {
else if ( strcmp( key, PARM_NAME_ENCRYPTION ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_ENCRYPTION, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_ENCRYPTION, value );
memset( lp->szEncryption, 0, sizeof( lp->szEncryption )); memset(lp->szEncryption, 0, sizeof(lp->szEncryption));
/* Make sure the value isn't too long */ /* Make sure the value isn't too long */
string_length = strlen( value ); string_length = strlen(value);
if ( string_length > sizeof( lp->szEncryption ) ) { if (string_length > sizeof(lp->szEncryption)) {
DBG_WARNING( DbgInfo, "%s too long; will be truncated\n", PARM_NAME_ENCRYPTION ); DBG_WARNING(DbgInfo, "%s too long; will be truncated\n", PARM_NAME_ENCRYPTION);
string_length = sizeof( lp->szEncryption ); string_length = sizeof(lp->szEncryption);
} }
memcpy( lp->szEncryption, value, string_length ); memcpy(lp->szEncryption, value, string_length);
} } else if (strcmp(key, PARM_NAME_KEY1) == 0) {
else if ( strcmp( key, PARM_NAME_KEY1 ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_KEY1, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_KEY1, value );
if ( is_valid_key_string( value )) { if (is_valid_key_string(value)) {
memset( lp->DefaultKeys.key[0].key, 0, MAX_KEY_SIZE ); memset(lp->DefaultKeys.key[0].key, 0, MAX_KEY_SIZE);
key_string2key( value, &lp->DefaultKeys.key[0] ); key_string2key(value, &lp->DefaultKeys.key[0]);
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY1 ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY1);
} }
} } else if (strcmp(key, PARM_NAME_KEY2) == 0) {
else if ( strcmp( key, PARM_NAME_KEY2 ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_KEY2, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_KEY2, value );
if ( is_valid_key_string( value )) { if (is_valid_key_string(value)) {
memset( lp->DefaultKeys.key[1].key, 0, MAX_KEY_SIZE ); memset(lp->DefaultKeys.key[1].key, 0, MAX_KEY_SIZE);
key_string2key( value, &lp->DefaultKeys.key[1] ); key_string2key(value, &lp->DefaultKeys.key[1]);
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY2 ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY2);
} }
} } else if (strcmp(key, PARM_NAME_KEY3) == 0) {
else if ( strcmp( key, PARM_NAME_KEY3 ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_KEY3, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_KEY3, value );
if ( is_valid_key_string( value )) { if (is_valid_key_string(value)) {
memset( lp->DefaultKeys.key[2].key, 0, MAX_KEY_SIZE ); memset(lp->DefaultKeys.key[2].key, 0, MAX_KEY_SIZE);
key_string2key( value, &lp->DefaultKeys.key[2] ); key_string2key(value, &lp->DefaultKeys.key[2]);
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY3 ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY3);
} }
} } else if (strcmp(key, PARM_NAME_KEY4) == 0) {
else if ( strcmp( key, PARM_NAME_KEY4 ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_KEY4, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_KEY4, value );
if ( is_valid_key_string( value )) { if (is_valid_key_string(value)) {
memset( lp->DefaultKeys.key[3].key, 0, MAX_KEY_SIZE ); memset(lp->DefaultKeys.key[3].key, 0, MAX_KEY_SIZE);
key_string2key( value, &lp->DefaultKeys.key[3] ); key_string2key(value, &lp->DefaultKeys.key[3]);
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY4 ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY4);
} }
} }
/* New Parameters for WARP */ /* New Parameters for WARP */
else if ( strcmp( key, PARM_NAME_LOAD_BALANCING ) == 0 ) { else if (strcmp(key, PARM_NAME_LOAD_BALANCING) == 0) {
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_LOAD_BALANCING, value ); DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_LOAD_BALANCING, value);
lp->loadBalancing = parse_yes_no(value); lp->loadBalancing = parse_yes_no(value);
} } else if (strcmp(key, PARM_NAME_MEDIUM_DISTRIBUTION) == 0) {
else if ( strcmp( key, PARM_NAME_MEDIUM_DISTRIBUTION ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_MEDIUM_DISTRIBUTION, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_MEDIUM_DISTRIBUTION, value );
lp->mediumDistribution = parse_yes_no(value); lp->mediumDistribution = parse_yes_no(value);
} } else if (strcmp(key, PARM_NAME_MICROWAVE_ROBUSTNESS) == 0) {
else if ( strcmp( key, PARM_NAME_MICROWAVE_ROBUSTNESS) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_MICROWAVE_ROBUSTNESS, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_MICROWAVE_ROBUSTNESS, value );
lp->MicrowaveRobustness = parse_yes_no(value); lp->MicrowaveRobustness = parse_yes_no(value);
} } else if (strcmp(key, PARM_NAME_MULTICAST_RATE) == 0) {
else if ( strcmp( key, PARM_NAME_MULTICAST_RATE ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_MULTICAST_RATE, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_MULTICAST_RATE, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_MULTICAST_RATE ) && ( value_convert <= PARM_MAX_MULTICAST_RATE )) { if ((value_convert >= PARM_MIN_MULTICAST_RATE) && (value_convert <= PARM_MAX_MULTICAST_RATE)) {
lp->MulticastRate[0] = value_convert; lp->MulticastRate[0] = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_MULTICAST_RATE ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_MULTICAST_RATE);
} }
} } else if (strcmp(key, PARM_NAME_OWN_CHANNEL) == 0) {
else if ( strcmp( key, PARM_NAME_OWN_CHANNEL ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_CHANNEL, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_CHANNEL, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if ( wl_is_a_valid_chan( value_convert )) { if (wl_is_a_valid_chan(value_convert)) {
if ( value_convert > 14 ) { if (value_convert > 14) {
value_convert = value_convert | 0x100; value_convert = value_convert | 0x100;
} }
lp->Channel = value_convert; lp->Channel = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_CHANNEL ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_CHANNEL);
} }
} } else if (strcmp(key, PARM_NAME_OWN_NAME) == 0) {
else if ( strcmp( key, PARM_NAME_OWN_NAME ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_NAME, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_NAME, value );
memset( lp->StationName, 0, ( PARM_MAX_NAME_LEN + 1 )); memset(lp->StationName, 0, (PARM_MAX_NAME_LEN + 1));
/* Make sure the value isn't too long */ /* Make sure the value isn't too long */
string_length = strlen( value ); string_length = strlen(value);
if ( string_length > PARM_MAX_NAME_LEN ) { if (string_length > PARM_MAX_NAME_LEN) {
DBG_WARNING( DbgInfo, "%s too long; will be truncated\n", PARM_NAME_OWN_NAME ); DBG_WARNING(DbgInfo, "%s too long; will be truncated\n", PARM_NAME_OWN_NAME);
string_length = PARM_MAX_NAME_LEN; string_length = PARM_MAX_NAME_LEN;
} }
memcpy( lp->StationName, value, string_length ); memcpy(lp->StationName, value, string_length);
} } else if (strcmp(key, PARM_NAME_RTS_THRESHOLD) == 0) {
else if ( strcmp( key, PARM_NAME_RTS_THRESHOLD ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_RTS_THRESHOLD ) && ( value_convert <= PARM_MAX_RTS_THRESHOLD )) { if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) {
lp->RTSThreshold = value_convert; lp->RTSThreshold = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD);
} }
} } else if (strcmp(key, PARM_NAME_SRSC_2GHZ) == 0) {
else if ( strcmp( key, PARM_NAME_SRSC_2GHZ ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_SRSC_2GHZ, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_SRSC_2GHZ, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_SRSC ) || ( value_convert <= PARM_MAX_SRSC )) { if ((value_convert >= PARM_MIN_SRSC) || (value_convert <= PARM_MAX_SRSC)) {
lp->srsc[0] = value_convert; lp->srsc[0] = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_SRSC_2GHZ ); DBG_WARNING(DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_SRSC_2GHZ);
} }
} } else if (strcmp(key, PARM_NAME_SRSC_5GHZ) == 0) {
else if ( strcmp( key, PARM_NAME_SRSC_5GHZ ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_SRSC_5GHZ, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_SRSC_5GHZ, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_SRSC ) || ( value_convert <= PARM_MAX_SRSC )) { if ((value_convert >= PARM_MIN_SRSC) || (value_convert <= PARM_MAX_SRSC)) {
lp->srsc[1] = value_convert; lp->srsc[1] = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_SRSC_5GHZ ); DBG_WARNING(DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_SRSC_5GHZ);
} }
} } else if (strcmp(key, PARM_NAME_SYSTEM_SCALE) == 0) {
else if ( strcmp( key, PARM_NAME_SYSTEM_SCALE ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_SYSTEM_SCALE, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_SYSTEM_SCALE, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_SYSTEM_SCALE ) && ( value_convert <= PARM_MAX_SYSTEM_SCALE )) { if ((value_convert >= PARM_MIN_SYSTEM_SCALE) && (value_convert <= PARM_MAX_SYSTEM_SCALE)) {
lp->DistanceBetweenAPs = value_convert; lp->DistanceBetweenAPs = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_SYSTEM_SCALE ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_SYSTEM_SCALE);
} }
} } else if (strcmp(key, PARM_NAME_TX_KEY) == 0) {
else if ( strcmp( key, PARM_NAME_TX_KEY ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_KEY, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_KEY, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_TX_KEY ) && ( value_convert <= PARM_MAX_TX_KEY )) { if ((value_convert >= PARM_MIN_TX_KEY) && (value_convert <= PARM_MAX_TX_KEY)) {
lp->TransmitKeyID = simple_strtoul(value, NULL, 0); lp->TransmitKeyID = simple_strtoul(value, NULL, 0);
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_KEY ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_KEY);
} }
} } else if (strcmp(key, PARM_NAME_TX_RATE) == 0) {
else if ( strcmp( key, PARM_NAME_TX_RATE ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_TX_RATE ) && ( value_convert <= PARM_MAX_TX_RATE )) { if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) {
lp->TxRateControl[0] = value_convert; lp->TxRateControl[0] = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE);
} }
} } else if (strcmp(key, PARM_NAME_TX_POW_LEVEL) == 0) {
else if ( strcmp( key, PARM_NAME_TX_POW_LEVEL ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_POW_LEVEL, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_POW_LEVEL, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_TX_POW_LEVEL ) || ( value_convert <= PARM_MAX_TX_POW_LEVEL )) { if ((value_convert >= PARM_MIN_TX_POW_LEVEL) || (value_convert <= PARM_MAX_TX_POW_LEVEL)) {
lp->txPowLevel = value_convert; lp->txPowLevel = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_POW_LEVEL ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_POW_LEVEL);
} }
} }
...@@ -640,101 +622,91 @@ void translate_option( char *buffer, struct wl_private *lp ) ...@@ -640,101 +622,91 @@ void translate_option( char *buffer, struct wl_private *lp )
/* Configuration parameters specific to STA mode */ /* Configuration parameters specific to STA mode */
#if 1 //;? (HCF_TYPE) & HCF_TYPE_STA #if 1 //;? (HCF_TYPE) & HCF_TYPE_STA
//;?seems reasonable that even an AP-only driver could afford this small additional footprint //;?seems reasonable that even an AP-only driver could afford this small additional footprint
if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_STA ) { if (CNV_INT_TO_LITTLE(lp->hcfCtx.IFB_FWIdentity.comp_id) == COMP_ID_FW_STA) {
//;?should we return an error status in AP mode //;?should we return an error status in AP mode
if ( strcmp( key, PARM_NAME_PORT_TYPE ) == 0 ) { if (strcmp(key, PARM_NAME_PORT_TYPE) == 0) {
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_PORT_TYPE, value ); DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_PORT_TYPE, value);
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert == PARM_MIN_PORT_TYPE ) || ( value_convert == PARM_MAX_PORT_TYPE )) { if ((value_convert == PARM_MIN_PORT_TYPE) || (value_convert == PARM_MAX_PORT_TYPE)) {
lp->PortType = value_convert; lp->PortType = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_PORT_TYPE ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_PORT_TYPE);
} }
} } else if (strcmp(key, PARM_NAME_PM_ENABLED) == 0) {
else if ( strcmp( key, PARM_NAME_PM_ENABLED ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_PM_ENABLED, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_PM_ENABLED, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
/* ;? how about wl_main.c containing /* ;? how about wl_main.c containing
* VALID_PARAM( PARM_PM_ENABLED <= WVLAN_PM_STATE_STANDARD || * VALID_PARAM(PARM_PM_ENABLED <= WVLAN_PM_STATE_STANDARD ||
* ( PARM_PM_ENABLED & 0x7FFF ) <= WVLAN_PM_STATE_STANDARD ); * (PARM_PM_ENABLED & 0x7FFF) <= WVLAN_PM_STATE_STANDARD);
*/ */
if ( ( value_convert & 0x7FFF ) <= PARM_MAX_PM_ENABLED) { if ((value_convert & 0x7FFF) <= PARM_MAX_PM_ENABLED) {
lp->PMEnabled = value_convert; lp->PMEnabled = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_PM_ENABLED ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_PM_ENABLED);
//;?this is a data entry error, hence not a DBG_WARNING //;?this is a data entry error, hence not a DBG_WARNING
} }
} } else if (strcmp(key, PARM_NAME_CREATE_IBSS) == 0) {
else if ( strcmp( key, PARM_NAME_CREATE_IBSS ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_CREATE_IBSS, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_CREATE_IBSS, value );
lp->CreateIBSS = parse_yes_no(value); lp->CreateIBSS = parse_yes_no(value);
} } else if (strcmp(key, PARM_NAME_MULTICAST_RX) == 0) {
else if ( strcmp( key, PARM_NAME_MULTICAST_RX ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_MULTICAST_RX, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_MULTICAST_RX, value );
lp->MulticastReceive = parse_yes_no(value); lp->MulticastReceive = parse_yes_no(value);
} } else if (strcmp(key, PARM_NAME_MAX_SLEEP) == 0) {
else if ( strcmp( key, PARM_NAME_MAX_SLEEP ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_MAX_SLEEP, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_MAX_SLEEP, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= 0 ) && ( value_convert <= 65535 )) { if ((value_convert >= 0) && (value_convert <= 65535)) {
lp->MaxSleepDuration = value_convert; lp->MaxSleepDuration = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_MAX_SLEEP ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_MAX_SLEEP);
} }
} } else if (strcmp(key, PARM_NAME_NETWORK_ADDR) == 0) {
else if ( strcmp( key, PARM_NAME_NETWORK_ADDR ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_NETWORK_ADDR, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_NETWORK_ADDR, value );
if ( parse_mac_address( value, mac_value ) == ETH_ALEN ) { if (parse_mac_address(value, mac_value) == ETH_ALEN) {
memcpy( lp->MACAddress, mac_value, ETH_ALEN ); memcpy(lp->MACAddress, mac_value, ETH_ALEN);
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_NETWORK_ADDR ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_NETWORK_ADDR);
} }
} } else if (strcmp(key, PARM_NAME_AUTHENTICATION) == 0) {
else if ( strcmp( key, PARM_NAME_AUTHENTICATION ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_AUTHENTICATION, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_AUTHENTICATION, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_AUTHENTICATION ) && ( value_convert <= PARM_MAX_AUTHENTICATION )) { if ((value_convert >= PARM_MIN_AUTHENTICATION) && (value_convert <= PARM_MAX_AUTHENTICATION)) {
lp->authentication = value_convert; lp->authentication = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_AUTHENTICATION ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_AUTHENTICATION);
} }
} } else if (strcmp(key, PARM_NAME_OWN_ATIM_WINDOW) == 0) {
else if ( strcmp( key, PARM_NAME_OWN_ATIM_WINDOW ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_ATIM_WINDOW, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_ATIM_WINDOW, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_OWN_ATIM_WINDOW ) && ( value_convert <= PARM_MAX_OWN_ATIM_WINDOW )) { if ((value_convert >= PARM_MIN_OWN_ATIM_WINDOW) && (value_convert <= PARM_MAX_OWN_ATIM_WINDOW)) {
lp->atimWindow = value_convert; lp->atimWindow = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_ATIM_WINDOW ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_ATIM_WINDOW);
} }
} } else if (strcmp(key, PARM_NAME_PM_HOLDOVER_DURATION) == 0) {
else if ( strcmp( key, PARM_NAME_PM_HOLDOVER_DURATION ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_PM_HOLDOVER_DURATION, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_PM_HOLDOVER_DURATION, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_PM_HOLDOVER_DURATION ) && ( value_convert <= PARM_MAX_PM_HOLDOVER_DURATION )) { if ((value_convert >= PARM_MIN_PM_HOLDOVER_DURATION) && (value_convert <= PARM_MAX_PM_HOLDOVER_DURATION)) {
lp->holdoverDuration = value_convert; lp->holdoverDuration = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_PM_HOLDOVER_DURATION ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_PM_HOLDOVER_DURATION);
} }
} } else if (strcmp(key, PARM_NAME_PROMISCUOUS_MODE) == 0) {
else if ( strcmp( key, PARM_NAME_PROMISCUOUS_MODE ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_PROMISCUOUS_MODE, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_PROMISCUOUS_MODE, value );
lp->promiscuousMode = parse_yes_no(value); lp->promiscuousMode = parse_yes_no(value);
} } else if (strcmp(key, PARM_NAME_CONNECTION_CONTROL) == 0) {
else if ( strcmp( key, PARM_NAME_CONNECTION_CONTROL ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_CONNECTION_CONTROL, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_CONNECTION_CONTROL, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_CONNECTION_CONTROL ) && ( value_convert <= PARM_MAX_CONNECTION_CONTROL )) { if ((value_convert >= PARM_MIN_CONNECTION_CONTROL) && (value_convert <= PARM_MAX_CONNECTION_CONTROL)) {
lp->connectionControl = value_convert; lp->connectionControl = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_CONNECTION_CONTROL ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_CONNECTION_CONTROL);
} }
} }
...@@ -745,227 +717,204 @@ void translate_option( char *buffer, struct wl_private *lp ) ...@@ -745,227 +717,204 @@ void translate_option( char *buffer, struct wl_private *lp )
/* Configuration parameters specific to AP mode */ /* Configuration parameters specific to AP mode */
#if 1 //;? (HCF_TYPE) & HCF_TYPE_AP #if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
//;?should we restore this to allow smaller memory footprint //;?should we restore this to allow smaller memory footprint
if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP ) { if (CNV_INT_TO_LITTLE(lp->hcfCtx.IFB_FWIdentity.comp_id) == COMP_ID_FW_AP) {
if ( strcmp( key, PARM_NAME_OWN_DTIM_PERIOD ) == 0 ) { if (strcmp(key, PARM_NAME_OWN_DTIM_PERIOD) == 0) {
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_DTIM_PERIOD, value ); DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_DTIM_PERIOD, value);
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if ( value_convert >= PARM_MIN_OWN_DTIM_PERIOD ) { if (value_convert >= PARM_MIN_OWN_DTIM_PERIOD) {
lp->DTIMPeriod = value_convert; lp->DTIMPeriod = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_DTIM_PERIOD ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_DTIM_PERIOD);
} }
} } else if (strcmp(key, PARM_NAME_REJECT_ANY) == 0) {
else if ( strcmp( key, PARM_NAME_REJECT_ANY ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_REJECT_ANY, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_REJECT_ANY, value );
lp->RejectAny = parse_yes_no(value); lp->RejectAny = parse_yes_no(value);
} } else if (strcmp(key, PARM_NAME_EXCLUDE_UNENCRYPTED) == 0) {
else if ( strcmp( key, PARM_NAME_EXCLUDE_UNENCRYPTED ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_EXCLUDE_UNENCRYPTED, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_EXCLUDE_UNENCRYPTED, value );
lp->ExcludeUnencrypted = parse_yes_no(value); lp->ExcludeUnencrypted = parse_yes_no(value);
} } else if (strcmp(key, PARM_NAME_MULTICAST_PM_BUFFERING) == 0) {
else if ( strcmp( key, PARM_NAME_MULTICAST_PM_BUFFERING ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_MULTICAST_PM_BUFFERING, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_MULTICAST_PM_BUFFERING, value );
lp->ExcludeUnencrypted = parse_yes_no(value); lp->ExcludeUnencrypted = parse_yes_no(value);
} } else if (strcmp(key, PARM_NAME_INTRA_BSS_RELAY) == 0) {
else if ( strcmp( key, PARM_NAME_INTRA_BSS_RELAY ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_INTRA_BSS_RELAY, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_INTRA_BSS_RELAY, value );
lp->ExcludeUnencrypted = parse_yes_no(value); lp->ExcludeUnencrypted = parse_yes_no(value);
} } else if (strcmp(key, PARM_NAME_OWN_BEACON_INTERVAL) == 0) {
else if ( strcmp( key, PARM_NAME_OWN_BEACON_INTERVAL ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_BEACON_INTERVAL, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_BEACON_INTERVAL, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if ( value_convert >= PARM_MIN_OWN_BEACON_INTERVAL ) { if (value_convert >= PARM_MIN_OWN_BEACON_INTERVAL) {
lp->ownBeaconInterval = value_convert; lp->ownBeaconInterval = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_BEACON_INTERVAL ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_BEACON_INTERVAL);
} }
} } else if (strcmp(key, PARM_NAME_COEXISTENCE) == 0) {
else if ( strcmp( key, PARM_NAME_COEXISTENCE ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_COEXISTENCE, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_COEXISTENCE, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if ( value_convert >= PARM_MIN_COEXISTENCE ) { if (value_convert >= PARM_MIN_COEXISTENCE) {
lp->coexistence = value_convert; lp->coexistence = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_COEXISTENCE ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_COEXISTENCE);
} }
} }
#ifdef USE_WDS #ifdef USE_WDS
else if ( strcmp( key, PARM_NAME_RTS_THRESHOLD1 ) == 0 ) { else if (strcmp(key, PARM_NAME_RTS_THRESHOLD1) == 0) {
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD1, value ); DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD1, value);
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_RTS_THRESHOLD ) && ( value_convert <= PARM_MAX_RTS_THRESHOLD )) { if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) {
lp->wds_port[0].rtsThreshold = value_convert; lp->wds_port[0].rtsThreshold = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD1 ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD1);
} }
} } else if (strcmp(key, PARM_NAME_RTS_THRESHOLD2) == 0) {
else if ( strcmp( key, PARM_NAME_RTS_THRESHOLD2 ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD2, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD2, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_RTS_THRESHOLD ) && ( value_convert <= PARM_MAX_RTS_THRESHOLD )) { if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) {
lp->wds_port[1].rtsThreshold = value_convert; lp->wds_port[1].rtsThreshold = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD2 ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD2);
} }
} } else if (strcmp(key, PARM_NAME_RTS_THRESHOLD3) == 0) {
else if ( strcmp( key, PARM_NAME_RTS_THRESHOLD3 ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD3, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD3, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_RTS_THRESHOLD ) && ( value_convert <= PARM_MAX_RTS_THRESHOLD )) { if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) {
lp->wds_port[2].rtsThreshold = value_convert; lp->wds_port[2].rtsThreshold = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD3 ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD3);
} }
} } else if (strcmp(key, PARM_NAME_RTS_THRESHOLD4) == 0) {
else if ( strcmp( key, PARM_NAME_RTS_THRESHOLD4 ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD4, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD4, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_RTS_THRESHOLD ) && ( value_convert <= PARM_MAX_RTS_THRESHOLD )) { if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) {
lp->wds_port[3].rtsThreshold = value_convert; lp->wds_port[3].rtsThreshold = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD4 ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD4);
} }
} } else if (strcmp(key, PARM_NAME_RTS_THRESHOLD5) == 0) {
else if ( strcmp( key, PARM_NAME_RTS_THRESHOLD5 ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD5, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD5, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_RTS_THRESHOLD ) && ( value_convert <= PARM_MAX_RTS_THRESHOLD )) { if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) {
lp->wds_port[4].rtsThreshold = value_convert; lp->wds_port[4].rtsThreshold = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD5 ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD5);
} }
} } else if (strcmp(key, PARM_NAME_RTS_THRESHOLD6) == 0) {
else if ( strcmp( key, PARM_NAME_RTS_THRESHOLD6 ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD6, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD6, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_RTS_THRESHOLD ) && ( value_convert <= PARM_MAX_RTS_THRESHOLD )) { if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) {
lp->wds_port[5].rtsThreshold = value_convert; lp->wds_port[5].rtsThreshold = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD6 ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD6);
} }
} } else if (strcmp(key, PARM_NAME_TX_RATE1) == 0) {
else if ( strcmp( key, PARM_NAME_TX_RATE1 ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE1, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE1, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_TX_RATE ) && ( value_convert <= PARM_MAX_TX_RATE )) { if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) {
lp->wds_port[0].txRateCntl = value_convert; lp->wds_port[0].txRateCntl = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE1 ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE1);
} }
} } else if (strcmp(key, PARM_NAME_TX_RATE2) == 0) {
else if ( strcmp( key, PARM_NAME_TX_RATE2 ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE2, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE2, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_TX_RATE ) && ( value_convert <= PARM_MAX_TX_RATE )) { if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) {
lp->wds_port[1].txRateCntl = value_convert; lp->wds_port[1].txRateCntl = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE2 ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE2);
} }
} } else if (strcmp(key, PARM_NAME_TX_RATE3) == 0) {
else if ( strcmp( key, PARM_NAME_TX_RATE3 ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE3, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE3, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_TX_RATE ) && ( value_convert <= PARM_MAX_TX_RATE )) { if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) {
lp->wds_port[2].txRateCntl = value_convert; lp->wds_port[2].txRateCntl = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE3 ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE3);
} }
} } else if (strcmp(key, PARM_NAME_TX_RATE4) == 0) {
else if ( strcmp( key, PARM_NAME_TX_RATE4 ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE4, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE4, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_TX_RATE ) && ( value_convert <= PARM_MAX_TX_RATE )) { if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) {
lp->wds_port[3].txRateCntl = value_convert; lp->wds_port[3].txRateCntl = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE4 ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE4);
} }
} } else if (strcmp(key, PARM_NAME_TX_RATE5) == 0) {
else if ( strcmp( key, PARM_NAME_TX_RATE5 ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE5, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE5, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_TX_RATE ) && ( value_convert <= PARM_MAX_TX_RATE )) { if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) {
lp->wds_port[4].txRateCntl = value_convert; lp->wds_port[4].txRateCntl = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE5 ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE5);
} }
} } else if (strcmp(key, PARM_NAME_TX_RATE6) == 0) {
else if ( strcmp( key, PARM_NAME_TX_RATE6 ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE6, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE6, value );
value_convert = simple_strtoul(value, NULL, 0); value_convert = simple_strtoul(value, NULL, 0);
if (( value_convert >= PARM_MIN_TX_RATE ) && ( value_convert <= PARM_MAX_TX_RATE )) { if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) {
lp->wds_port[5].txRateCntl = value_convert; lp->wds_port[5].txRateCntl = value_convert;
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE6 ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE6);
} }
} } else if (strcmp(key, PARM_NAME_WDS_ADDRESS1) == 0) {
else if ( strcmp( key, PARM_NAME_WDS_ADDRESS1 ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS1, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS1, value );
if ( parse_mac_address( value, mac_value ) == ETH_ALEN ) { if (parse_mac_address(value, mac_value) == ETH_ALEN) {
memcpy( lp->wds_port[0].wdsAddress, mac_value, ETH_ALEN ); memcpy(lp->wds_port[0].wdsAddress, mac_value, ETH_ALEN);
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS1 ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS1);
} }
} } else if (strcmp(key, PARM_NAME_WDS_ADDRESS2) == 0) {
else if ( strcmp( key, PARM_NAME_WDS_ADDRESS2 ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS2, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS2, value );
if ( parse_mac_address( value, mac_value ) == ETH_ALEN ) { if (parse_mac_address(value, mac_value) == ETH_ALEN) {
memcpy( lp->wds_port[1].wdsAddress, mac_value, ETH_ALEN ); memcpy(lp->wds_port[1].wdsAddress, mac_value, ETH_ALEN);
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS2 ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS2);
} }
} } else if (strcmp(key, PARM_NAME_WDS_ADDRESS3) == 0) {
else if ( strcmp( key, PARM_NAME_WDS_ADDRESS3 ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS3, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS3, value );
if ( parse_mac_address( value, mac_value ) == ETH_ALEN ) { if (parse_mac_address(value, mac_value) == ETH_ALEN) {
memcpy( lp->wds_port[2].wdsAddress, mac_value, ETH_ALEN ); memcpy(lp->wds_port[2].wdsAddress, mac_value, ETH_ALEN);
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS3 ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS3);
} }
} } else if (strcmp(key, PARM_NAME_WDS_ADDRESS4) == 0) {
else if ( strcmp( key, PARM_NAME_WDS_ADDRESS4 ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS4, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS4, value );
if ( parse_mac_address( value, mac_value ) == ETH_ALEN ) { if (parse_mac_address(value, mac_value) == ETH_ALEN) {
memcpy( lp->wds_port[3].wdsAddress, mac_value, ETH_ALEN ); memcpy(lp->wds_port[3].wdsAddress, mac_value, ETH_ALEN);
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS4 ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS4);
} }
} } else if (strcmp(key, PARM_NAME_WDS_ADDRESS5) == 0) {
else if ( strcmp( key, PARM_NAME_WDS_ADDRESS5 ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS5, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS5, value );
if ( parse_mac_address( value, mac_value ) == ETH_ALEN ) { if (parse_mac_address(value, mac_value) == ETH_ALEN) {
memcpy( lp->wds_port[4].wdsAddress, mac_value, ETH_ALEN ); memcpy(lp->wds_port[4].wdsAddress, mac_value, ETH_ALEN);
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS5 ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS5);
} }
} } else if (strcmp(key, PARM_NAME_WDS_ADDRESS6) == 0) {
else if ( strcmp( key, PARM_NAME_WDS_ADDRESS6 ) == 0 ) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS6, value);
DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS6, value );
if ( parse_mac_address( value, mac_value ) == ETH_ALEN ) { if (parse_mac_address(value, mac_value) == ETH_ALEN) {
memcpy( lp->wds_port[5].wdsAddress, mac_value, ETH_ALEN ); memcpy(lp->wds_port[5].wdsAddress, mac_value, ETH_ALEN);
} else { } else {
DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS6 ); DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS6);
} }
} }
#endif /* USE_WDS */ #endif /* USE_WDS */
...@@ -996,7 +945,7 @@ void translate_option( char *buffer, struct wl_private *lp ) ...@@ -996,7 +945,7 @@ void translate_option( char *buffer, struct wl_private *lp )
* The number of bytes in the final MAC address, should equal to ETH_ALEN. * The number of bytes in the final MAC address, should equal to ETH_ALEN.
* *
******************************************************************************/ ******************************************************************************/
int parse_mac_address( char *value, u_char *byte_array ) int parse_mac_address(char *value, u_char *byte_array)
{ {
int value_offset = 0; int value_offset = 0;
int array_offset = 0; int array_offset = 0;
...@@ -1004,11 +953,11 @@ int parse_mac_address( char *value, u_char *byte_array ) ...@@ -1004,11 +953,11 @@ int parse_mac_address( char *value, u_char *byte_array )
char byte_field[3]; char byte_field[3];
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
memset( byte_field, '\0', 3 ); memset(byte_field, '\0', 3);
while( value[value_offset] != '\0' ) { while (value[value_offset] != '\0') {
/* Skip over the colon chars seperating the bytes, if they exist */ /* Skip over the colon chars seperating the bytes, if they exist */
if ( value[value_offset] == ':' ) { if (value[value_offset] == ':') {
value_offset++; value_offset++;
continue; continue;
} }
...@@ -1018,9 +967,9 @@ int parse_mac_address( char *value, u_char *byte_array ) ...@@ -1018,9 +967,9 @@ int parse_mac_address( char *value, u_char *byte_array )
value_offset++; value_offset++;
/* Once the byte_field is filled, convert it and store it */ /* Once the byte_field is filled, convert it and store it */
if ( field_offset == 2 ) { if (field_offset == 2) {
byte_field[field_offset] = '\0'; byte_field[field_offset] = '\0';
byte_array[array_offset] = simple_strtoul( byte_field, NULL, 16 ); byte_array[array_offset] = simple_strtoul(byte_field, NULL, 16);
field_offset = 0; field_offset = 0;
array_offset++; array_offset++;
} }
...@@ -1052,42 +1001,42 @@ int parse_mac_address( char *value, u_char *byte_array ) ...@@ -1052,42 +1001,42 @@ int parse_mac_address( char *value, u_char *byte_array )
* N/A * N/A
* *
******************************************************************************/ ******************************************************************************/
void ParseConfigLine( char *pszLine, char **ppszLVal, char **ppszRVal ) void ParseConfigLine(char *pszLine, char **ppszLVal, char **ppszRVal)
{ {
int i; int i;
int size; int size;
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
DBG_FUNC( "ParseConfigLine" ); DBG_FUNC("ParseConfigLine");
DBG_ENTER( DbgInfo ); DBG_ENTER(DbgInfo);
/* get a snapshot of our string size */ /* get a snapshot of our string size */
size = strlen( pszLine ); size = strlen(pszLine);
*ppszLVal = NULL; *ppszLVal = NULL;
*ppszRVal = NULL; *ppszRVal = NULL;
if ( pszLine[0] != '#' && /* skip the line if it is a comment */ if (pszLine[0] != '#' && /* skip the line if it is a comment */
pszLine[0] != '\n'&& /* if it's an empty UNIX line, do nothing */ pszLine[0] != '\n' && /* if it's an empty UNIX line, do nothing */
!( pszLine[0] == '\r' && pszLine[1] == '\n' ) /* if it's an empty MS-DOS line, do nothing */ !(pszLine[0] == '\r' && pszLine[1] == '\n') /* if it's an empty MS-DOS line, do nothing */
) { ) {
/* advance past any whitespace, and assign the L-value */ /* advance past any whitespace, and assign the L-value */
for( i = 0; i < size; i++ ) { for (i = 0; i < size; i++) {
if ( pszLine[i] != ' ' ) { if (pszLine[i] != ' ') {
*ppszLVal = &pszLine[i]; *ppszLVal = &pszLine[i];
break; break;
} }
} }
/* advance to the end of the l-value*/ /* advance to the end of the l-value*/
for( i++; i < size; i++ ) { for (i++; i < size; i++) {
if ( pszLine[i] == ' ' || pszLine[i] == '=' ) { if (pszLine[i] == ' ' || pszLine[i] == '=') {
pszLine[i] = '\0'; pszLine[i] = '\0';
break; break;
} }
} }
/* make any whitespace and the equal sign a NULL character, and /* make any whitespace and the equal sign a NULL character, and
advance to the R-Value */ advance to the R-Value */
for( i++; i < size; i++ ) { for (i++; i < size; i++) {
if ( pszLine[i] == ' ' || pszLine[i] == '=' ) { if (pszLine[i] == ' ' || pszLine[i] == '=') {
pszLine[i] = '\0'; pszLine[i] = '\0';
continue; continue;
} }
...@@ -1095,16 +1044,16 @@ void ParseConfigLine( char *pszLine, char **ppszLVal, char **ppszRVal ) ...@@ -1095,16 +1044,16 @@ void ParseConfigLine( char *pszLine, char **ppszLVal, char **ppszRVal )
break; break;
} }
/* make the line ending character(s) a NULL */ /* make the line ending character(s) a NULL */
for( i++; i < size; i++ ) { for (i++; i < size; i++) {
if ( pszLine[i] == '\n' ) { if (pszLine[i] == '\n') {
pszLine[i] = '\0'; pszLine[i] = '\0';
} }
if (( pszLine[i] == '\r' ) && ( pszLine[i+1] == '\n' )) { if ((pszLine[i] == '\r') && (pszLine[i+1] == '\n')) {
pszLine[i] = '\0'; pszLine[i] = '\0';
} }
} }
} }
DBG_LEAVE( DbgInfo ); DBG_LEAVE(DbgInfo);
} // ParseConfigLine } // ParseConfigLine
/*============================================================================*/ /*============================================================================*/
......
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