-
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: 90815 b: refs/heads/master c: 6974e36 h: refs/heads/master i: 90813: 943a3e5 90811: 287270d 90807: 913061e 90799: f3662c6 90783: c4d5f59 90751: c54b5a1 v: v3
- Loading branch information
Emmanuel Grumbach
authored and
John W. Linville
committed
Apr 16, 2008
1 parent
f6f1191
commit fe95b0e
Showing
6 changed files
with
221 additions
and
41 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: 0a0bed1d10105a9f58cd14ebe216e8479dd31fda | ||
refs/heads/master: 6974e36356524fa856435cb1be40aaffbac9601a |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
/****************************************************************************** | ||
* | ||
* Copyright(c) 2003 - 2008 Intel Corporation. All rights reserved. | ||
* | ||
* Portions of this file are derived from the ipw3945 project, as well | ||
* as portions of the ieee80211 subsystem header files. | ||
* | ||
* 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. | ||
* | ||
* Contact Information: | ||
* James P. Ketrenos <ipw2100-admin@linux.intel.com> | ||
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | ||
* | ||
*****************************************************************************/ | ||
|
||
#include <net/mac80211.h> | ||
|
||
#include "iwl-eeprom.h" | ||
#include "iwl-4965.h" | ||
#include "iwl-core.h" | ||
#include "iwl-sta.h" | ||
#include "iwl-io.h" | ||
#include "iwl-helpers.h" | ||
|
||
int iwl_send_static_wepkey_cmd(struct iwl_priv *priv, u8 send_if_empty) | ||
{ | ||
int i, not_empty = 0; | ||
u8 buff[sizeof(struct iwl_wep_cmd) + | ||
sizeof(struct iwl_wep_key) * WEP_KEYS_MAX]; | ||
struct iwl_wep_cmd *wep_cmd = (struct iwl_wep_cmd *)buff; | ||
size_t cmd_size = sizeof(struct iwl_wep_cmd); | ||
struct iwl_host_cmd cmd = { | ||
.id = REPLY_WEPKEY, | ||
.data = wep_cmd, | ||
.meta.flags = CMD_ASYNC, | ||
}; | ||
|
||
memset(wep_cmd, 0, cmd_size + | ||
(sizeof(struct iwl_wep_key) * WEP_KEYS_MAX)); | ||
|
||
for (i = 0; i < WEP_KEYS_MAX ; i++) { | ||
wep_cmd->key[i].key_index = i; | ||
if (priv->wep_keys[i].key_size) { | ||
wep_cmd->key[i].key_offset = i; | ||
not_empty = 1; | ||
} else { | ||
wep_cmd->key[i].key_offset = WEP_INVALID_OFFSET; | ||
} | ||
|
||
wep_cmd->key[i].key_size = priv->wep_keys[i].key_size; | ||
memcpy(&wep_cmd->key[i].key[3], priv->wep_keys[i].key, | ||
priv->wep_keys[i].key_size); | ||
} | ||
|
||
wep_cmd->global_key_type = WEP_KEY_WEP_TYPE; | ||
wep_cmd->num_keys = WEP_KEYS_MAX; | ||
|
||
cmd_size += sizeof(struct iwl_wep_key) * WEP_KEYS_MAX; | ||
|
||
cmd.len = cmd_size; | ||
|
||
if (not_empty || send_if_empty) | ||
return iwl_send_cmd(priv, &cmd); | ||
else | ||
return 0; | ||
} | ||
|
||
int iwl_remove_default_wep_key(struct iwl_priv *priv, | ||
struct ieee80211_key_conf *key) | ||
{ | ||
int ret; | ||
unsigned long flags; | ||
|
||
spin_lock_irqsave(&priv->sta_lock, flags); | ||
priv->default_wep_key--; | ||
memset(&priv->wep_keys[key->keyidx], 0, sizeof(priv->wep_keys[0])); | ||
ret = iwl_send_static_wepkey_cmd(priv, 1); | ||
spin_unlock_irqrestore(&priv->sta_lock, flags); | ||
|
||
return ret; | ||
} | ||
|
||
int iwl_set_default_wep_key(struct iwl_priv *priv, | ||
struct ieee80211_key_conf *keyconf) | ||
{ | ||
int ret; | ||
unsigned long flags; | ||
|
||
keyconf->flags &= ~IEEE80211_KEY_FLAG_GENERATE_IV; | ||
keyconf->hw_key_idx = keyconf->keyidx; | ||
priv->stations[IWL_AP_ID].keyinfo.alg = ALG_WEP; | ||
|
||
spin_lock_irqsave(&priv->sta_lock, flags); | ||
priv->default_wep_key++; | ||
|
||
priv->wep_keys[keyconf->keyidx].key_size = keyconf->keylen; | ||
memcpy(&priv->wep_keys[keyconf->keyidx].key, &keyconf->key, | ||
keyconf->keylen); | ||
|
||
ret = iwl_send_static_wepkey_cmd(priv, 0); | ||
spin_unlock_irqrestore(&priv->sta_lock, flags); | ||
|
||
return ret; | ||
} | ||
|
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,46 @@ | ||
/****************************************************************************** | ||
* | ||
* Copyright(c) 2003 - 2008 Intel Corporation. All rights reserved. | ||
* | ||
* Portions of this file are derived from the ipw3945 project, as well | ||
* as portions of the ieee80211 subsystem header files. | ||
* | ||
* 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. | ||
* | ||
* Contact Information: | ||
* James P. Ketrenos <ipw2100-admin@linux.intel.com> | ||
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 | ||
* | ||
*****************************************************************************/ | ||
#ifndef __iwl_sta_h__ | ||
#define __iwl_sta_h__ | ||
|
||
#include <net/mac80211.h> | ||
|
||
#include "iwl-eeprom.h" | ||
#include "iwl-core.h" | ||
#include "iwl-4965.h" | ||
#include "iwl-io.h" | ||
#include "iwl-helpers.h" | ||
|
||
int iwl_send_static_wepkey_cmd(struct iwl_priv *priv, u8 send_if_empty); | ||
int iwl_remove_default_wep_key(struct iwl_priv *priv, | ||
struct ieee80211_key_conf *key); | ||
int iwl_set_default_wep_key(struct iwl_priv *priv, | ||
struct ieee80211_key_conf *key); | ||
|
||
#endif /* __iwl_sta_h__ */ |
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