-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 122512 b: refs/heads/master c: 8f5c87d h: refs/heads/master v: v3
- Loading branch information
Winkler, Tomas
authored and
John W. Linville
committed
Dec 5, 2008
1 parent
d83ba66
commit 282bbe9
Showing
6 changed files
with
113 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 304a698a5819bf318fe7e6ea9fe7ff2560365ec2 | ||
refs/heads/master: 8f5c87dcf6d1a5e6d7ffe642cfd4debb5ccbec49 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
108 changes: 108 additions & 0 deletions
108
trunk/drivers/net/wireless/iwlwifi/iwl-agn-hcmd-check.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
/****************************************************************************** | ||
* | ||
* GPL LICENSE SUMMARY | ||
* | ||
* Copyright(c) 2008 Intel Corporation. All rights reserved. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of version 2 of the GNU General Public License as | ||
* published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, | ||
* USA | ||
* | ||
* The full GNU General Public License is included in this distribution | ||
* in the file called LICENSE.GPL. | ||
* | ||
* Contact Information: | ||
* Tomas Winkler <tomas.winkler@intel.com> | ||
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | ||
*****************************************************************************/ | ||
|
||
#include <linux/kernel.h> | ||
#include <net/mac80211.h> | ||
#include "iwl-dev.h" | ||
#include "iwl-debug.h" | ||
#include "iwl-commands.h" | ||
|
||
|
||
/** | ||
* iwl_check_rxon_cmd - validate RXON structure is valid | ||
* | ||
* NOTE: This is really only useful during development and can eventually | ||
* be #ifdef'd out once the driver is stable and folks aren't actively | ||
* making changes | ||
*/ | ||
int iwl_agn_check_rxon_cmd(struct iwl_rxon_cmd *rxon) | ||
{ | ||
int error = 0; | ||
int counter = 1; | ||
|
||
if (rxon->flags & RXON_FLG_BAND_24G_MSK) { | ||
error |= le32_to_cpu(rxon->flags & | ||
(RXON_FLG_TGJ_NARROW_BAND_MSK | | ||
RXON_FLG_RADAR_DETECT_MSK)); | ||
if (error) | ||
IWL_WARNING("check 24G fields %d | %d\n", | ||
counter++, error); | ||
} else { | ||
error |= (rxon->flags & RXON_FLG_SHORT_SLOT_MSK) ? | ||
0 : le32_to_cpu(RXON_FLG_SHORT_SLOT_MSK); | ||
if (error) | ||
IWL_WARNING("check 52 fields %d | %d\n", | ||
counter++, error); | ||
error |= le32_to_cpu(rxon->flags & RXON_FLG_CCK_MSK); | ||
if (error) | ||
IWL_WARNING("check 52 CCK %d | %d\n", | ||
counter++, error); | ||
} | ||
error |= (rxon->node_addr[0] | rxon->bssid_addr[0]) & 0x1; | ||
if (error) | ||
IWL_WARNING("check mac addr %d | %d\n", counter++, error); | ||
|
||
/* make sure basic rates 6Mbps and 1Mbps are supported */ | ||
error |= (((rxon->ofdm_basic_rates & IWL_RATE_6M_MASK) == 0) && | ||
((rxon->cck_basic_rates & IWL_RATE_1M_MASK) == 0)); | ||
if (error) | ||
IWL_WARNING("check basic rate %d | %d\n", counter++, error); | ||
|
||
error |= (le16_to_cpu(rxon->assoc_id) > 2007); | ||
if (error) | ||
IWL_WARNING("check assoc id %d | %d\n", counter++, error); | ||
|
||
error |= ((rxon->flags & (RXON_FLG_CCK_MSK | RXON_FLG_SHORT_SLOT_MSK)) | ||
== (RXON_FLG_CCK_MSK | RXON_FLG_SHORT_SLOT_MSK)); | ||
if (error) | ||
IWL_WARNING("check CCK and short slot %d | %d\n", | ||
counter++, error); | ||
|
||
error |= ((rxon->flags & (RXON_FLG_CCK_MSK | RXON_FLG_AUTO_DETECT_MSK)) | ||
== (RXON_FLG_CCK_MSK | RXON_FLG_AUTO_DETECT_MSK)); | ||
if (error) | ||
IWL_WARNING("check CCK & auto detect %d | %d\n", | ||
counter++, error); | ||
|
||
error |= ((rxon->flags & (RXON_FLG_AUTO_DETECT_MSK | | ||
RXON_FLG_TGG_PROTECT_MSK)) == RXON_FLG_TGG_PROTECT_MSK); | ||
if (error) | ||
IWL_WARNING("check TGG and auto detect %d | %d\n", | ||
counter++, error); | ||
|
||
if (error) | ||
IWL_WARNING("Tuning to channel %d\n", | ||
le16_to_cpu(rxon->channel)); | ||
|
||
if (error) { | ||
IWL_ERROR("Not a valid iwl4965_rxon_assoc_cmd field values\n"); | ||
return -1; | ||
} | ||
return 0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters