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

Unified Diff: chromeos/drivers/ath6kl/os/linux/wireless_ext.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/netbuf.c ('k') | chromeos/drivers/ath6kl/reorder/aggr_rx_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/drivers/ath6kl/os/linux/wireless_ext.c
diff --git a/chromeos/drivers/ath6kl/os/linux/wireless_ext.c b/chromeos/drivers/ath6kl/os/linux/wireless_ext.c
index 3085460e5b8ec230f39c81cb2398683dec5e9c2c..bb6de0f404fe37999ee12f0ed426fd5b5e9ae53d 100644
--- a/chromeos/drivers/ath6kl/os/linux/wireless_ext.c
+++ b/chromeos/drivers/ath6kl/os/linux/wireless_ext.c
@@ -1,24 +1,37 @@
-/*
- *
- * 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 "ar6000_drv.h"
+#define IWE_STREAM_ADD_EVENT(p1, p2, p3, p4, p5) \
+ iwe_stream_add_event((p1), (p2), (p3), (p4), (p5))
+
+#define IWE_STREAM_ADD_POINT(p1, p2, p3, p4, p5) \
+ iwe_stream_add_point((p1), (p2), (p3), (p4), (p5))
+
+#define IWE_STREAM_ADD_VALUE(p1, p2, p3, p4, p5, p6) \
+ iwe_stream_add_value((p1), (p2), (p3), (p4), (p5), (p6))
+
static void ar6000_set_quality(struct iw_quality *iq, A_INT8 rssi);
extern unsigned int wmitimeout;
extern A_WAITQUEUE_HEAD arEvent;
@@ -101,12 +114,8 @@ ar6000_scan_node(void *arg, bss_t *ni)
iwe.cmd = SIOCGIWAP;
iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
A_MEMCPY(iwe.u.ap_addr.sa_data, ni->ni_macaddr, 6);
- current_ev = iwe_stream_add_event(
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
- param->info,
-#endif
- current_ev, end_buf, &iwe,
- IW_EV_ADDR_LEN);
+ current_ev = IWE_STREAM_ADD_EVENT(param->info, current_ev, end_buf,
+ &iwe, IW_EV_ADDR_LEN);
}
param->bytes_needed += IW_EV_ADDR_LEN;
@@ -117,12 +126,8 @@ ar6000_scan_node(void *arg, bss_t *ni)
iwe.cmd = SIOCGIWESSID;
iwe.u.data.flags = 1;
iwe.u.data.length = cie->ie_ssid[1];
- current_ev = iwe_stream_add_point(
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
- param->info,
-#endif
- current_ev, end_buf, &iwe,
- (char*)&cie->ie_ssid[2]);
+ current_ev = IWE_STREAM_ADD_POINT(param->info, current_ev, end_buf,
+ &iwe, (char*)&cie->ie_ssid[2]);
}
param->bytes_needed += data_len;
@@ -133,12 +138,8 @@ ar6000_scan_node(void *arg, bss_t *ni)
iwe.cmd = SIOCGIWMODE;
iwe.u.mode = cie->ie_capInfo & IEEE80211_CAPINFO_ESS ?
IW_MODE_MASTER : IW_MODE_ADHOC;
- current_ev = iwe_stream_add_event(
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
- param->info,
-#endif
- current_ev, end_buf, &iwe,
- IW_EV_UINT_LEN);
+ current_ev = IWE_STREAM_ADD_EVENT(param->info, current_ev, end_buf,
+ &iwe, IW_EV_UINT_LEN);
}
param->bytes_needed += IW_EV_UINT_LEN;
}
@@ -149,12 +150,8 @@ ar6000_scan_node(void *arg, bss_t *ni)
iwe.cmd = SIOCGIWFREQ;
iwe.u.freq.m = cie->ie_chan * 100000;
iwe.u.freq.e = 1;
- current_ev = iwe_stream_add_event(
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
- param->info,
-#endif
- current_ev, end_buf, &iwe,
- IW_EV_FREQ_LEN);
+ current_ev = IWE_STREAM_ADD_EVENT(param->info, current_ev, end_buf,
+ &iwe, IW_EV_FREQ_LEN);
}
param->bytes_needed += IW_EV_FREQ_LEN;
@@ -163,12 +160,8 @@ ar6000_scan_node(void *arg, bss_t *ni)
A_MEMZERO(&iwe, sizeof(iwe));
iwe.cmd = IWEVQUAL;
ar6000_set_quality(&iwe.u.qual, ni->ni_snr);
- current_ev = iwe_stream_add_event(
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
- param->info,
-#endif
- current_ev, end_buf, &iwe,
- IW_EV_QUAL_LEN);
+ current_ev = IWE_STREAM_ADD_EVENT(param->info, current_ev, end_buf,
+ &iwe, IW_EV_QUAL_LEN);
}
param->bytes_needed += IW_EV_QUAL_LEN;
@@ -182,11 +175,8 @@ ar6000_scan_node(void *arg, bss_t *ni)
iwe.u.data.flags = IW_ENCODE_DISABLED;
}
iwe.u.data.length = 0;
- current_ev = iwe_stream_add_point(
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
- param->info,
-#endif
- current_ev, end_buf, &iwe, "");
+ current_ev = IWE_STREAM_ADD_POINT(param->info, current_ev, end_buf,
+ &iwe, "");
}
param->bytes_needed += IW_EV_POINT_LEN;
@@ -209,15 +199,9 @@ ar6000_scan_node(void *arg, bss_t *ni)
val = cie->ie_rates[2 + j];
iwe.u.bitrate.value =
(val >= 0x80)? ((val - 0x80) * 500000): (val * 500000);
- current_val = iwe_stream_add_value(
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
- param->info,
-#endif
- current_ev,
- current_val,
- end_buf,
- &iwe,
- IW_EV_PARAM_LEN);
+ current_val = IWE_STREAM_ADD_VALUE(param->info, current_ev,
+ current_val, end_buf,
+ &iwe, IW_EV_PARAM_LEN);
}
}
param->bytes_needed += data_len;
@@ -233,15 +217,9 @@ ar6000_scan_node(void *arg, bss_t *ni)
val = cie->ie_xrates[2 + j];
iwe.u.bitrate.value =
(val >= 0x80)? ((val - 0x80) * 500000): (val * 500000);
- current_val = iwe_stream_add_value(
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
- param->info,
-#endif
- current_ev,
- current_val,
- end_buf,
- &iwe,
- IW_EV_PARAM_LEN);
+ current_val = IWE_STREAM_ADD_VALUE(param->info, current_ev,
+ current_val, end_buf,
+ &iwe, IW_EV_PARAM_LEN);
}
}
param->bytes_needed += data_len;
@@ -259,11 +237,8 @@ ar6000_scan_node(void *arg, bss_t *ni)
A_MEMZERO(&iwe, sizeof(iwe));
iwe.cmd = IWEVGENIE;
iwe.u.data.length = cie->ie_wpa[1] + 2;
- current_ev = iwe_stream_add_point(
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
- param->info,
-#endif
- current_ev, end_buf, &iwe, (char*)cie->ie_wpa);
+ current_ev = IWE_STREAM_ADD_POINT(param->info, current_ev, end_buf,
+ &iwe, (char*)cie->ie_wpa);
}
param->bytes_needed += data_len;
}
@@ -275,11 +250,8 @@ ar6000_scan_node(void *arg, bss_t *ni)
A_MEMZERO(&iwe, sizeof(iwe));
iwe.cmd = IWEVGENIE;
iwe.u.data.length = cie->ie_rsn[1] + 2;
- current_ev = iwe_stream_add_point(
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
- param->info,
-#endif
- current_ev, end_buf, &iwe, (char*)cie->ie_rsn);
+ current_ev = IWE_STREAM_ADD_POINT(param->info, current_ev, end_buf,
+ &iwe, (char*)cie->ie_rsn);
}
param->bytes_needed += data_len;
}
@@ -308,11 +280,8 @@ ar6000_scan_node(void *arg, bss_t *ni)
snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11b");
break;
}
- current_ev = iwe_stream_add_event(
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
- param->info,
-#endif
- current_ev, end_buf, &iwe, IW_EV_CHAR_LEN);
+ current_ev = IWE_STREAM_ADD_EVENT(param->info, current_ev, end_buf,
+ &iwe, IW_EV_CHAR_LEN);
}
param->bytes_needed += IW_EV_CHAR_LEN;
@@ -323,11 +292,8 @@ ar6000_scan_node(void *arg, bss_t *ni)
data_len = iwe.u.data.length + IW_EV_POINT_LEN;
if ((end_buf - current_ev) > data_len)
{
- current_ev = iwe_stream_add_point(
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
- param->info,
-#endif
- current_ev, end_buf, &iwe, buf);
+ current_ev = IWE_STREAM_ADD_POINT(param->info, current_ev, end_buf,
+ &iwe, buf);
}
param->bytes_needed += data_len;
@@ -344,11 +310,8 @@ ar6000_scan_node(void *arg, bss_t *ni)
wpa_leader, sizeof(wpa_leader)-1);
if (iwe.u.data.length != 0) {
- current_ev = iwe_stream_add_point(
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
- param->info,
-#endif
- current_ev, end_buf, &iwe, buf);
+ current_ev = IWE_STREAM_ADD_POINT(param->info, current_ev,
+ end_buf, &iwe, buf);
}
}
param->bytes_needed += data_len;
@@ -366,11 +329,8 @@ ar6000_scan_node(void *arg, bss_t *ni)
rsn_leader, sizeof(rsn_leader)-1);
if (iwe.u.data.length != 0) {
- current_ev = iwe_stream_add_point(
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
- param->info,
-#endif
- current_ev, end_buf, &iwe, buf);
+ current_ev = IWE_STREAM_ADD_POINT(param->info, current_ev,
+ end_buf, &iwe, buf);
}
}
param->bytes_needed += data_len;
@@ -388,11 +348,8 @@ ar6000_scan_node(void *arg, bss_t *ni)
cie->ie_wmm[1]+2,
wmm_leader, sizeof(wmm_leader)-1);
if (iwe.u.data.length != 0) {
- current_ev = iwe_stream_add_point(
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
- param->info,
-#endif
- current_ev, end_buf, &iwe, buf);
+ current_ev = IWE_STREAM_ADD_POINT(param->info, current_ev,
+ end_buf, &iwe, buf);
}
}
param->bytes_needed += data_len;
@@ -409,11 +366,8 @@ ar6000_scan_node(void *arg, bss_t *ni)
cie->ie_ath[1]+2,
ath_leader, sizeof(ath_leader)-1);
if (iwe.u.data.length != 0) {
- current_ev = iwe_stream_add_point(
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
- param->info,
-#endif
- current_ev, end_buf, &iwe, buf);
+ current_ev = IWE_STREAM_ADD_POINT(param->info, current_ev,
+ end_buf, &iwe, buf);
}
}
param->bytes_needed += data_len;
@@ -430,11 +384,8 @@ ar6000_scan_node(void *arg, bss_t *ni)
cie->ie_wapi[1] + 2,
wapi_leader, sizeof(wapi_leader) - 1);
if (iwe.u.data.length != 0) {
- current_ev = iwe_stream_add_point(
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
- param->info,
-#endif
- current_ev, end_buf, &iwe, buf);
+ current_ev = IWE_STREAM_ADD_POINT(param->info, current_ev,
+ end_buf, &iwe, buf);
}
}
param->bytes_needed += data_len;
@@ -451,11 +402,8 @@ ar6000_scan_node(void *arg, bss_t *ni)
A_MEMZERO(&iwe, sizeof(iwe));
iwe.cmd = IWEVGENIE;
iwe.u.data.length = cie->ie_wsc[1] + 2;
- current_ev = iwe_stream_add_point(
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
- param->info,
-#endif
- current_ev, end_buf, &iwe, (char*)cie->ie_wsc);
+ current_ev = IWE_STREAM_ADD_POINT(param->info, current_ev, end_buf,
+ &iwe, (char*)cie->ie_wsc);
}
param->bytes_needed += data_len;
}
@@ -488,9 +436,7 @@ ar6000_ioctl_giwscan(struct net_device *dev,
param.current_ev = extra;
param.end_buf = extra + data->length;
param.bytes_needed = 0;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
param.info = info;
-#endif
/* Translate data to WE format */
wmi_iterate_nodes(ar->arWmi, ar6000_scan_node, &param);
@@ -768,6 +714,7 @@ ar6000_ioctl_siwrate(struct net_device *dev,
{
AR_SOFTC_T *ar = (AR_SOFTC_T *)ar6k_priv(dev);
A_UINT32 kbps;
+ A_INT8 rate_idx;
if (is_iwioctl_allowed(ar->arNextMode, info->cmd) != A_OK) {
A_PRINTF("wext_ioctl: cmd=0x%x not allowed in this mode\n", info->cmd);
@@ -779,7 +726,7 @@ ar6000_ioctl_siwrate(struct net_device *dev,
} else {
kbps = -1; /* -1 indicates auto rate */
}
- if(kbps != -1 && wmi_validate_bitrate(ar->arWmi, kbps) == A_EINVAL)
+ if(kbps != -1 && wmi_validate_bitrate(ar->arWmi, kbps, &rate_idx) != A_OK)
{
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BitRate is not Valid %d\n", kbps));
return -EINVAL;
@@ -2412,7 +2359,7 @@ ar6000_ioctl_giwap(struct net_device *dev,
return 0;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
+#if (WIRELESS_EXT >= 18)
/*
* SIOCSIWMLME
*/
@@ -2489,7 +2436,7 @@ ar6000_ioctl_siwmlme(struct net_device *dev,
up(&ar->arSem);
return 0;
}
-#endif /* LINUX_VERSION_CODE */
+#endif /* WIRELESS_EXT >= 18 */
/*
* SIOCGIWAPLIST
@@ -2563,17 +2510,24 @@ ar6000_ioctl_siwscan(struct net_device *dev,
return -EIO;
if (wmi_probedSsid_cmd(ar->arWmi, 1, SPECIFIC_SSID_FLAG, req.essid_len, req.essid) != A_OK)
return -EIO;
+ ar->scanSpecificSsid = 1;
}
else
{
- if (wmi_probedSsid_cmd(ar->arWmi, 1, DISABLE_SSID_FLAG, 0, NULL) != A_OK)
- return -EIO;
+ if (ar->scanSpecificSsid) {
+ if (wmi_probedSsid_cmd(ar->arWmi, 1, DISABLE_SSID_FLAG, 0, NULL) != A_OK)
+ return -EIO;
+ ar->scanSpecificSsid = 0;
+ }
}
}
else
{
- if (wmi_probedSsid_cmd(ar->arWmi, 1, DISABLE_SSID_FLAG, 0, NULL) != A_OK)
- return -EIO;
+ if (ar->scanSpecificSsid) {
+ if (wmi_probedSsid_cmd(ar->arWmi, 1, DISABLE_SSID_FLAG, 0, NULL) != A_OK)
+ return -EIO;
+ ar->scanSpecificSsid = 0;
+ }
}
#endif
#endif /* ANDROID_ENV */
@@ -2720,11 +2674,11 @@ static const iw_handler ath_handlers[] = {
(iw_handler) NULL, /* SIOCGIWTHRSPY */
(iw_handler) ar6000_ioctl_siwap, /* SIOCSIWAP */
(iw_handler) ar6000_ioctl_giwap, /* SIOCGIWAP */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
+#if (WIRELESS_EXT >= 18)
(iw_handler) ar6000_ioctl_siwmlme, /* SIOCSIWMLME */
#else
(iw_handler) NULL, /* -- hole -- */
-#endif /* LINUX_VERSION_CODE */
+#endif /* WIRELESS_EXT >= 18 */
(iw_handler) ar6000_ioctl_iwaplist, /* SIOCGIWAPLIST */
(iw_handler) ar6000_ioctl_siwscan, /* SIOCSIWSCAN */
(iw_handler) ar6000_ioctl_giwscan, /* SIOCGIWSCAN */
« no previous file with comments | « chromeos/drivers/ath6kl/os/linux/netbuf.c ('k') | chromeos/drivers/ath6kl/reorder/aggr_rx_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698