summaryrefslogtreecommitdiff
path: root/drivers/staging/ath6kl/include/common/epping_test.h
diff options
context:
space:
mode:
authorVipin Mehta <vmehta@atheros.com>2010-09-01 23:06:33 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-09-02 22:43:26 +0400
commit30295c8936f3a426985e99bebb17d72bd7847910 (patch)
tree28ff0c23bfa931b73a35e7b11df1bf104260c6fa /drivers/staging/ath6kl/include/common/epping_test.h
parent9b9913d80b2896ecd9e0a1a8f167ccad66fac79c (diff)
downloadlinux-30295c8936f3a426985e99bebb17d72bd7847910.tar.xz
staging: add ath6kl driver for AR6003 chip
AR6003 is a single stream, SDIO based 802.11 chipset from Atheros optimized for mobile and embedded devices. ath6kl is a cfg80211 driver for AR6003 and supports both the station and AP mode of operation. Station mode supports 802.11 a/b/g/n with HT20 on 2.4/5GHz and HT40 only on 5GHz. Some of the other features include WPA/WPA2, WPS, WMM, WMM-PS, and BT coexistence. AP mode can be operated only in b/g mode with support for a subset of features mentioned above. The driver supports cfg80211 but comes with its own set of wext ioctls which have historically supported some of our customers with features like BT 3.0 and AP mode of operation. For further details, please refer to: http://wireless.kernel.org/en/users/Drivers/ath6kl The driver requires firmware that runs on the chip's network processor. The majority of it is stored in ROM. The binaries that are downloaded and executed from RAM are as follows: 1) Patch against the code in ROM for bug fixes and feature enhancements. 2) Code to copy the data from the OTP region of the memory into RAM. 3) Calibration file carrying board specific data. The above files need to be present in the directory '/lib/firmware/ath6k/AR6003/hw2.0/' for the driver to initialize the chip upon enumeration. The files can be downloaded from the link specified at the following location: http://wireless.kernel.org/en/users/Drivers/ath6kl#Download This driver is only provided in the interim while we work on the mac80211 replacement, ath6k. Once the mac80211 driver achieves feature parity with the ath6kl driver, the ath6kl will be deprecated and removed from staging. Signed-off-by: Vipin Mehta <vmehta@atheros.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/ath6kl/include/common/epping_test.h')
-rw-r--r--drivers/staging/ath6kl/include/common/epping_test.h120
1 files changed, 120 insertions, 0 deletions
diff --git a/drivers/staging/ath6kl/include/common/epping_test.h b/drivers/staging/ath6kl/include/common/epping_test.h
new file mode 100644
index 000000000000..f8aeb3f657ea
--- /dev/null
+++ b/drivers/staging/ath6kl/include/common/epping_test.h
@@ -0,0 +1,120 @@
+//------------------------------------------------------------------------------
+// Copyright (c) 2009-2010 Atheros Corporation. All rights reserved.
+//
+//
+// 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"
+//
+
+/* This file contains shared definitions for the host/target endpoint ping test */
+
+#ifndef EPPING_TEST_H_
+#define EPPING_TEST_H_
+
+#ifndef ATH_TARGET
+#include "athstartpack.h"
+#endif
+
+ /* alignment to 4-bytes */
+#define EPPING_ALIGNMENT_PAD (((sizeof(HTC_FRAME_HDR) + 3) & (~0x3)) - sizeof(HTC_FRAME_HDR))
+
+#ifndef A_OFFSETOF
+#define A_OFFSETOF(type,field) (int)(&(((type *)NULL)->field))
+#endif
+
+#define EPPING_RSVD_FILL 0xCC
+
+#define HCI_RSVD_EXPECTED_PKT_TYPE_RECV_OFFSET 7
+
+typedef PREPACK struct {
+ A_UINT8 _HCIRsvd[8]; /* reserved for HCI packet header (GMBOX) testing */
+ A_UINT8 StreamEcho_h; /* stream no. to echo this packet on (filled by host) */
+ A_UINT8 StreamEchoSent_t; /* stream no. packet was echoed to (filled by target)
+ When echoed: StreamEchoSent_t == StreamEcho_h */
+ A_UINT8 StreamRecv_t; /* stream no. that target received this packet on (filled by target) */
+ A_UINT8 StreamNo_h; /* stream number to send on (filled by host) */
+ A_UINT8 Magic_h[4]; /* magic number to filter for this packet on the host*/
+ A_UINT8 _rsvd[6]; /* reserved fields that must be set to a "reserved" value
+ since this packet maps to a 14-byte ethernet frame we want
+ to make sure ethertype field is set to something unknown */
+
+ A_UINT8 _pad[2]; /* padding for alignment */
+ A_UINT8 TimeStamp[8]; /* timestamp of packet (host or target) */
+ A_UINT32 HostContext_h; /* 4 byte host context, target echos this back */
+ A_UINT32 SeqNo; /* sequence number (set by host or target) */
+ A_UINT16 Cmd_h; /* ping command (filled by host) */
+ A_UINT16 CmdFlags_h; /* optional flags */
+ A_UINT8 CmdBuffer_h[8]; /* buffer for command (host -> target) */
+ A_UINT8 CmdBuffer_t[8]; /* buffer for command (target -> host) */
+ A_UINT16 DataLength; /* length of data */
+ A_UINT16 DataCRC; /* 16 bit CRC of data */
+ A_UINT16 HeaderCRC; /* header CRC (fields : StreamNo_h to end, minus HeaderCRC) */
+} POSTPACK EPPING_HEADER;
+
+#define EPPING_PING_MAGIC_0 0xAA
+#define EPPING_PING_MAGIC_1 0x55
+#define EPPING_PING_MAGIC_2 0xCE
+#define EPPING_PING_MAGIC_3 0xEC
+
+
+
+#define IS_EPPING_PACKET(pPkt) (((pPkt)->Magic_h[0] == EPPING_PING_MAGIC_0) && \
+ ((pPkt)->Magic_h[1] == EPPING_PING_MAGIC_1) && \
+ ((pPkt)->Magic_h[2] == EPPING_PING_MAGIC_2) && \
+ ((pPkt)->Magic_h[3] == EPPING_PING_MAGIC_3))
+
+#define SET_EPPING_PACKET_MAGIC(pPkt) { (pPkt)->Magic_h[0] = EPPING_PING_MAGIC_0; \
+ (pPkt)->Magic_h[1] = EPPING_PING_MAGIC_1; \
+ (pPkt)->Magic_h[2] = EPPING_PING_MAGIC_2; \
+ (pPkt)->Magic_h[3] = EPPING_PING_MAGIC_3;}
+
+#define CMD_FLAGS_DATA_CRC (1 << 0) /* DataCRC field is valid */
+#define CMD_FLAGS_DELAY_ECHO (1 << 1) /* delay the echo of the packet */
+#define CMD_FLAGS_NO_DROP (1 << 2) /* do not drop at HTC layer no matter what the stream is */
+
+#define IS_EPING_PACKET_NO_DROP(pPkt) ((pPkt)->CmdFlags_h & CMD_FLAGS_NO_DROP)
+
+#define EPPING_CMD_ECHO_PACKET 1 /* echo packet test */
+#define EPPING_CMD_RESET_RECV_CNT 2 /* reset recv count */
+#define EPPING_CMD_CAPTURE_RECV_CNT 3 /* fetch recv count, 4-byte count returned in CmdBuffer_t */
+#define EPPING_CMD_NO_ECHO 4 /* non-echo packet test (tx-only) */
+#define EPPING_CMD_CONT_RX_START 5 /* continous RX packets, parameters are in CmdBuffer_h */
+#define EPPING_CMD_CONT_RX_STOP 6 /* stop continuous RX packet transmission */
+
+ /* test command parameters may be no more than 8 bytes */
+typedef PREPACK struct {
+ A_UINT16 BurstCnt; /* number of packets to burst together (for HTC 2.1 testing) */
+ A_UINT16 PacketLength; /* length of packet to generate including header */
+ A_UINT16 Flags; /* flags */
+
+#define EPPING_CONT_RX_DATA_CRC (1 << 0) /* Add CRC to all data */
+#define EPPING_CONT_RX_RANDOM_DATA (1 << 1) /* randomize the data pattern */
+#define EPPING_CONT_RX_RANDOM_LEN (1 << 2) /* randomize the packet lengths */
+} POSTPACK EPPING_CONT_RX_PARAMS;
+
+#define EPPING_HDR_CRC_OFFSET A_OFFSETOF(EPPING_HEADER,StreamNo_h)
+#define EPPING_HDR_BYTES_CRC (sizeof(EPPING_HEADER) - EPPING_HDR_CRC_OFFSET - (sizeof(A_UINT16)))
+
+#define HCI_TRANSPORT_STREAM_NUM 16 /* this number is higher than the define WMM AC classes so we
+ can use this to distinguish packets */
+
+#ifndef ATH_TARGET
+#include "athendpack.h"
+#endif
+
+
+#endif /*EPPING_TEST_H_*/