Index: chromeos/drivers/ath6kl/os/linux/include/ar6000_drv.h |
diff --git a/chromeos/drivers/ath6kl/os/linux/include/ar6000_drv.h b/chromeos/drivers/ath6kl/os/linux/include/ar6000_drv.h |
index c23dd888b9aa298556556ad817ceac52029d23b8..e6248830b7ef671e2cbbac44b7e6dad0ac57a059 100644 |
--- a/chromeos/drivers/ath6kl/os/linux/include/ar6000_drv.h |
+++ b/chromeos/drivers/ath6kl/os/linux/include/ar6000_drv.h |
@@ -1,51 +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" |
+//------------------------------------------------------------------------------ |
#ifndef _AR6000_H_ |
#define _AR6000_H_ |
-#include <linux/version.h> |
- |
- |
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17) |
-#include <linux/config.h> |
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) |
-#include <linux/autoconf.h> |
-#else |
-#include <generated/autoconf.h> |
-#endif |
#include <linux/init.h> |
-#include <linux/kernel.h> |
#include <linux/sched.h> |
#include <linux/spinlock.h> |
-#include <linux/skbuff.h> |
#include <linux/if_ether.h> |
-#include <linux/netdevice.h> |
#include <linux/etherdevice.h> |
#include <net/iw_handler.h> |
#include <linux/if_arp.h> |
#include <linux/ip.h> |
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26) |
-#include <asm/semaphore.h> |
-#else |
-#include <linux/semaphore.h> |
-#endif |
#include <linux/wireless.h> |
#ifdef ATH6K_CONFIG_CFG80211 |
#include <net/cfg80211.h> |
@@ -71,12 +57,8 @@ |
#include "aggr_recv_api.h" |
#include <host_version.h> |
#include <linux/rtnetlink.h> |
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) |
-#include <asm/uaccess.h> |
-#else |
#include <linux/init.h> |
#include <linux/moduleparam.h> |
-#endif |
#include "ar6000_api.h" |
#ifdef CONFIG_HOST_TCMD_SUPPORT |
#include <testcmd.h> |
@@ -159,8 +141,8 @@ extern "C" { |
#define AR6000_MAX_ENDPOINTS 4 |
#define MAX_NODE_NUM 15 |
/* MAX_HI_COOKIE_NUM are reserved for high priority traffic */ |
-#define MAX_DEF_COOKIE_NUM 150 |
-#define MAX_HI_COOKIE_NUM 15 /* 10% of MAX_COOKIE_NUM */ |
+#define MAX_DEF_COOKIE_NUM 180 |
+#define MAX_HI_COOKIE_NUM 18 /* 10% of MAX_COOKIE_NUM */ |
#define MAX_COOKIE_NUM (MAX_DEF_COOKIE_NUM + MAX_HI_COOKIE_NUM) |
/* MAX_DEFAULT_SEND_QUEUE_DEPTH is used to set the default queue depth for the |
@@ -190,6 +172,36 @@ enum { |
WLAN_INIT_MODE_DRV |
}; |
+/* Suspend - configuration */ |
+enum { |
+ WLAN_SUSPEND_CUT_PWR = 0, |
+ WLAN_SUSPEND_DEEP_SLEEP, |
+ WLAN_SUSPEND_WOW, |
+ WLAN_SUSPEND_CUT_PWR_IF_BT_OFF |
+}; |
+ |
+/* WiFi OFF - configuration */ |
+enum { |
+ WLAN_OFF_CUT_PWR = 0, |
+ WLAN_OFF_DEEP_SLEEP, |
+}; |
+ |
+/* WLAN low power state */ |
+enum { |
+ WLAN_POWER_STATE_ON = 0, |
+ WLAN_POWER_STATE_CUT_PWR = 1, |
+ WLAN_POWER_STATE_DEEP_SLEEP, |
+ WLAN_POWER_STATE_WOW |
+}; |
+ |
+/* WLAN WoW State */ |
+enum { |
+ WLAN_WOW_STATE_NONE = 0, |
+ WLAN_WOW_STATE_SUSPENDED, |
+ WLAN_WOW_STATE_SUSPENDING |
+}; |
+ |
+ |
typedef enum _AR6K_BIN_FILE { |
AR6K_OTP_FILE, |
AR6K_FIRMWARE_FILE, |
@@ -203,6 +215,12 @@ typedef enum _AR6K_BIN_FILE { |
#define SETUPHCI_DEFAULT 0 |
#endif /* SETUPHCI_ENABLED */ |
+#ifdef SETUPHCIPAL_ENABLED |
+#define SETUPHCIPAL_DEFAULT 1 |
+#else |
+#define SETUPHCIPAL_DEFAULT 0 |
+#endif /* SETUPHCIPAL_ENABLED */ |
+ |
#ifdef SETUPBTDEV_ENABLED |
#define SETUPBTDEV_DEFAULT 1 |
#else |
@@ -316,6 +334,15 @@ typedef enum _AR6K_BIN_FILE { |
#define AR6003_REV2_BOARD_DATA_FILE "ath6k/AR6003/hw2.0/bdata.CUSTOM.bin" |
#endif /* Board Data File */ |
+/* Power states */ |
+enum { |
+ WLAN_PWR_CTRL_UP = 0, |
+ WLAN_PWR_CTRL_CUT_PWR, |
+ WLAN_PWR_CTRL_DEEP_SLEEP, |
+ WLAN_PWR_CTRL_WOW, |
+ WLAN_PWR_CTRL_DEEP_SLEEP_DISABLED |
+}; |
+ |
/* HTC RAW streams */ |
typedef enum _HTC_RAW_STREAM_ID { |
HTC_RAW_STREAM_NOT_MAPPED = -1, |
@@ -376,7 +403,7 @@ struct ar_node_mapping { |
}; |
struct ar_cookie { |
- A_UINT32 arc_bp[2]; /* Must be first field */ |
+ unsigned long arc_bp[2]; /* Must be first field */ |
HTC_PACKET HtcPkt; /* HTC packet wrapper */ |
struct ar_cookie *arc_list_next; |
}; |
@@ -544,6 +571,7 @@ typedef struct ar6_softc { |
#ifndef EXPORT_HCI_BRIDGE_INTERFACE |
void *hcidev_info; |
#endif |
+ void *hcipal_info; |
WMI_AP_MODE_STAT arAPStats; |
A_UINT8 ap_hidden_ssid; |
A_UINT8 ap_country_code[3]; |
@@ -568,32 +596,67 @@ typedef struct ar6_softc { |
struct cfg80211_scan_request *scan_request; |
struct ar_key keys[WMI_MAX_KEY_INDEX + 1]; |
#endif /* ATH6K_CONFIG_CFG80211 */ |
-#if CONFIG_PM |
- A_UINT16 arOsPowerCtrl; |
+ A_UINT16 arWlanPowerState; |
+ A_BOOL arWlanOff; |
+#ifdef CONFIG_PM |
A_UINT16 arWowState; |
+ A_BOOL arBTOff; |
+ A_BOOL arBTSharing; |
+ A_UINT16 arSuspendConfig; |
+ A_UINT16 arWlanOffConfig; |
+ A_UINT16 arWow2Config; |
#endif |
A_UINT8 scan_triggered; |
WMI_SCAN_PARAMS_CMD scParams; |
- A_UINT8 mcast_filters[MAC_MAX_FILTERS_PER_LIST][4]; |
+#define AR_MCAST_FILTER_MAC_ADDR_SIZE 4 |
+ A_UINT8 mcast_filters[MAC_MAX_FILTERS_PER_LIST][AR_MCAST_FILTER_MAC_ADDR_SIZE]; |
A_UINT8 bdaddr[6]; |
+ A_BOOL scanSpecificSsid; |
+#ifdef CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT |
+ void *arApDev; |
+#endif |
} AR_SOFTC_T; |
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) |
-/* Looks like we need this for 2.4 kernels */ |
+#ifdef CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT |
+typedef struct { |
+ struct net_device *arNetDev; /* net_device pointer */ |
+ AR_SOFTC_T *arDev; /* ar device pointer */ |
+ struct net_device *arStaNetDev; /* net_device pointer */ |
+} AR_VIRTUAL_INTERFACE_T; |
+#endif /* CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT */ |
+ |
+#ifdef ATH6K_CONFIG_CFG80211 |
static inline void *ar6k_priv(struct net_device *dev) |
{ |
- return(dev->priv); |
+ return (wdev_priv(dev->ieee80211_ptr)); |
} |
#else |
-#ifdef ATH6K_CONFIG_CFG80211 |
+#ifdef CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT |
static inline void *ar6k_priv(struct net_device *dev) |
{ |
- return (wdev_priv(dev->ieee80211_ptr)); |
+ extern struct net_device *arApNetDev; |
+ |
+ if (arApNetDev == dev) { |
+ /* return arDev saved in virtual interface context */ |
+ AR_VIRTUAL_INTERFACE_T *arVirDev; |
+ arVirDev = netdev_priv(dev); |
+ return arVirDev->arDev; |
+ } else { |
+ return netdev_priv(dev); |
+ } |
} |
#else |
#define ar6k_priv netdev_priv |
+#endif /* CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT */ |
#endif /* ATH6K_CONFIG_CFG80211 */ |
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) */ |
+ |
+#define SET_HCI_BUS_TYPE(pHciDev, __bus, __type) do { \ |
+ (pHciDev)->bus = (__bus); \ |
+ (pHciDev)->dev_type = (__type); \ |
+} while(0) |
+ |
+#define GET_INODE_FROM_FILEP(filp) \ |
+ (filp)->f_path.dentry->d_inode |
#define arAc2EndpointID(ar,ac) (ar)->arAc2EpMapping[(ac)] |
#define arSetAc2EndpointIDMap(ar,ac,ep) \ |
@@ -612,9 +675,7 @@ struct ar_giwscan_param { |
char *current_ev; |
char *end_buf; |
A_UINT32 bytes_needed; |
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) |
struct iw_request_info *info; |
-#endif |
}; |
#define AR6000_STAT_INC(ar, stat) (ar->arNetStats.stat++) |
@@ -642,6 +703,8 @@ int ar6000_init(struct net_device *dev); |
int ar6000_dbglog_get_debug_logs(AR_SOFTC_T *ar); |
void ar6000_TxDataCleanup(AR_SOFTC_T *ar); |
int ar6000_acl_data_tx(struct sk_buff *skb, struct net_device *dev); |
+void ar6000_restart_endpoint(struct net_device *dev); |
+void ar6000_stop_endpoint(struct net_device *dev, A_BOOL keepprofile, A_BOOL getdbglogs); |
#ifdef HTC_RAW_INTERFACE |