Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Unified Diff: chromeos/drivers/ath6kl/os/linux/cfg80211.c

Issue 3579004: ath6kl: Bringing in the upstream version (Closed) Base URL: http://git.chromium.org/git/kernel.git
Patch Set: Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/drivers/ath6kl/os/linux/ar6k_pal.c ('k') | chromeos/drivers/ath6kl/os/linux/eeprom.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/drivers/ath6kl/os/linux/cfg80211.c
diff --git a/chromeos/drivers/ath6kl/os/linux/cfg80211.c b/chromeos/drivers/ath6kl/os/linux/cfg80211.c
index 82911d10511560c39f3121c66f49c29c38437a1e..fd3313b742877670d7e764ec08c7227194f37592 100644
--- a/chromeos/drivers/ath6kl/os/linux/cfg80211.c
+++ b/chromeos/drivers/ath6kl/os/linux/cfg80211.c
@@ -1,25 +1,26 @@
-/*
- *
- * Copyright (c) 2004-2010 Atheros Communications Inc.
- * All rights reserved.
- *
- *
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2 as
-// published by the Free Software Foundation;
+//------------------------------------------------------------------------------
+// Copyright (c) 2004-2010 Atheros Communications Inc.
+// All rights reserved.
//
-// Software distributed under the License is distributed on an "AS
-// IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-// implied. See the License for the specific language governing
-// rights and limitations under the License.
+//
//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
//
- *
- */
-
+// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+//
+//
+//
+// Author(s): ="Atheros"
+//------------------------------------------------------------------------------
-#include <linux/kernel.h>
-#include <linux/netdevice.h>
#include <linux/wireless.h>
#include <linux/ieee80211.h>
#include <net/cfg80211.h>
@@ -541,13 +542,10 @@ ar6k_cfg80211_connect_event(AR_SOFTC_T *ar, A_UINT16 channel,
ibss_channel = ieee80211_get_channel(ar->wdev->wiphy, (int)channel);
- AR_DEBUG_PRINTF(ATH_DEBUG_INFO,
- ("%s: inform bss with bssid %02x:%02x:%02x:%02x:%02x:%02x "\
- "channel %d beaconInterval %d capability 0x%x\n",
- __func__,
- mgmt->bssid[0], mgmt->bssid[1], mgmt->bssid[2],
- mgmt->bssid[3], mgmt->bssid[4], mgmt->bssid[5],
- ibss_channel->hw_value, beaconInterval, capability));
+ AR_DEBUG_PRINTF(ATH_DEBUG_INFO,
+ ("%s: inform bss with bssid %pM channel %d beaconInterval %d "
+ "capability 0x%x\n", __func__, mgmt->bssid,
+ ibss_channel->hw_value, beaconInterval, capability));
bss = cfg80211_inform_bss_frame(ar->wdev->wiphy,
ibss_channel, mgmt,
@@ -712,12 +710,9 @@ ar6k_cfg80211_scan_node(void *arg, bss_t *ni)
channel = ieee80211_get_channel(wiphy, freq);
signal = ni->ni_snr * 100;
- AR_DEBUG_PRINTF(ATH_DEBUG_INFO,
- ("%s: bssid %02x:%02x:%02x:%02x:%02x:%02x channel %d freq %d size %d\n",
- __func__,
- mgmt->bssid[0], mgmt->bssid[1], mgmt->bssid[2],
- mgmt->bssid[3], mgmt->bssid[4], mgmt->bssid[5],
- channel->hw_value, freq, size));
+ AR_DEBUG_PRINTF(ATH_DEBUG_INFO,
+ ("%s: bssid %pM channel %d freq %d size %d\n", __func__,
+ mgmt->bssid, channel->hw_value, freq, size));
cfg80211_inform_bss_frame(wiphy, channel, mgmt,
le16_to_cpu(size),
signal, GFP_KERNEL);
@@ -865,9 +860,6 @@ ar6k_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
case WLAN_CIPHER_SUITE_WEP40:
case WLAN_CIPHER_SUITE_WEP104:
key_type = WEP_CRYPT;
- if(key_index == ar->arDefTxKeyIndex) {
- key_usage = GROUP_USAGE | TX_USAGE;
- }
break;
case WLAN_CIPHER_SUITE_TKIP:
@@ -894,7 +886,8 @@ ar6k_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev,
__func__, key_index, key->key_len, key_type,
key_usage, key->seq_len));
- status = wmi_addKey_cmd(ar->arWmi, key_index, key_type, key_usage,
+ ar->arDefTxKeyIndex = key_index;
+ status = wmi_addKey_cmd(ar->arWmi, ar->arDefTxKeyIndex, key_type, key_usage,
key->key_len, key->seq, key->key, KEY_OP_INIT_VAL,
(A_UINT8*)mac_addr, SYNC_BOTH_WMIFLAG);
@@ -987,6 +980,8 @@ ar6k_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *ndev,
A_UINT8 key_index)
{
AR_SOFTC_T *ar = (AR_SOFTC_T *)ar6k_priv(ndev);
+ struct ar_key *key = NULL;
+ A_STATUS status = A_OK;
AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: index %d\n", __func__, key_index));
@@ -1014,6 +1009,14 @@ ar6k_cfg80211_set_default_key(struct wiphy *wiphy, struct net_device *ndev,
}
ar->arDefTxKeyIndex = key_index;
+ key = &ar->keys[ar->arDefTxKeyIndex];
+ status = wmi_addKey_cmd(ar->arWmi, ar->arDefTxKeyIndex,
+ ar->arPairwiseCrypto, GROUP_USAGE | TX_USAGE,
+ key->key_len, key->seq, key->key, KEY_OP_INIT_VAL,
+ NULL, SYNC_BOTH_WMIFLAG);
+ if (status != A_OK) {
+ return -EIO;
+ }
return 0;
}
@@ -1083,34 +1086,11 @@ ar6k_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
const A_UINT8 *peer,
const struct cfg80211_bitrate_mask *mask)
{
- AR_SOFTC_T *ar = ar6k_priv(dev);
- A_STATUS status;
-
- AR_DEBUG_PRINTF(ATH_DEBUG_INFO, ("%s: mask 0x%x\n", __func__, mask->fixed));
-
- if(ar->arWmiReady == FALSE) {
- AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wmi not ready\n", __func__));
- return -EIO;
- }
-
- if(ar->arWlanState == WLAN_DISABLED) {
- AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: Wlan disabled\n", __func__));
- return -EIO;
- }
-
- status = wmi_set_fixrates_cmd(ar->arWmi, mask->fixed);
-
- if(status == A_EINVAL) {
- AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: invalid params\n", __func__));
- return -EINVAL;
- } else if(status != A_OK) {
- AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("%s: wmi_set_fixrates_cmd failed\n", __func__));
- return -EIO;
- }
-
- return 0;
+ AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Setting rates: Not supported\n"));
+ return -EIO;
}
+/* The type nl80211_tx_power_setting replaces the following data type from 2.6.36 onwards */
static int
ar6k_cfg80211_set_txpower(struct wiphy *wiphy, enum tx_power_setting type, int dbm)
{
« no previous file with comments | « chromeos/drivers/ath6kl/os/linux/ar6k_pal.c ('k') | chromeos/drivers/ath6kl/os/linux/eeprom.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698