summaryrefslogtreecommitdiff
path: root/drivers/staging/csr/csr_wifi_hip_xbv.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-19 23:15:42 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-19 23:37:01 (GMT)
commit635d2b00e5070378e7bf812acf47fb135c6ab928 (patch)
tree7048a0a511f3d221aa2dfe40aa3a401991f1b175 /drivers/staging/csr/csr_wifi_hip_xbv.h
parent15a4bc17b7f4e85cb019e683f14e834078ec2208 (diff)
downloadlinux-fsl-qoriq-635d2b00e5070378e7bf812acf47fb135c6ab928.tar.xz
Staging: add CSR wifi module
This consists of two modules, the driver, and a "helper" module that is just a wrapper around common kernel functions. The wrapper module will be removed soon, but for now it's needed. These files were based on the csr-linux-wifi-5.0.3-oss.tar.gz package provided by CSR and Blue Giga, and is covered under the license specified in the LICENSE.txt file (basically dual BSD and GPLv2). The files were flattened out of the deep directory mess they were originally in, and a few EXPORT_SYMBOL_GPL() were added in order for everything to link properly with the helper module setup. Cc: Mikko Virkkilä <mikko.virkkila@bluegiga.com> Cc: Lauri Hintsala <Lauri.Hintsala@bluegiga.com> Cc: Riku Mettälä <riku.mettala@bluegiga.com> Cc: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/csr/csr_wifi_hip_xbv.h')
-rw-r--r--drivers/staging/csr/csr_wifi_hip_xbv.h127
1 files changed, 127 insertions, 0 deletions
diff --git a/drivers/staging/csr/csr_wifi_hip_xbv.h b/drivers/staging/csr/csr_wifi_hip_xbv.h
new file mode 100644
index 0000000..fdc4560
--- /dev/null
+++ b/drivers/staging/csr/csr_wifi_hip_xbv.h
@@ -0,0 +1,127 @@
+/*****************************************************************************
+
+ (c) Cambridge Silicon Radio Limited 2011
+ All rights reserved and confidential information of CSR
+
+ Refer to LICENSE.txt included with this source for details
+ on the license terms.
+
+*****************************************************************************/
+
+/*
+ * ---------------------------------------------------------------------------
+ * FILE: csr_wifi_hip_xbv.h
+ *
+ * PURPOSE:
+ * Definitions and declarations for code to read XBV files - the UniFi
+ * firmware download file format.
+ *
+ * ---------------------------------------------------------------------------
+ */
+#ifndef __XBV_H__
+#define __XBV_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef CSR_WIFI_XBV_TEST
+/* Driver includes */
+#include "csr_wifi_hip_unifi.h"
+#endif
+
+
+struct VMEQ
+{
+ CsrUint32 addr;
+ CsrUint16 mask;
+ CsrUint16 value;
+};
+
+struct VAND
+{
+ CsrUint32 first;
+ CsrUint32 count;
+};
+
+struct VERS
+{
+ CsrUint32 num_vand;
+};
+
+struct FWDL
+{
+ CsrUint32 dl_addr;
+ CsrUint32 dl_size;
+ CsrUint32 dl_offset;
+};
+
+struct FWOV
+{
+ CsrUint32 dl_size;
+ CsrUint32 dl_offset;
+};
+
+struct PTDL
+{
+ CsrUint32 dl_size;
+ CsrUint32 dl_offset;
+};
+
+#define MAX_VMEQ 64
+#define MAX_VAND 64
+#define MAX_FWDL 256
+#define MAX_PTDL 256
+
+/* An XBV1 file can either contain firmware or patches (at the
+ * moment). The 'mode' member of the xbv1_t structure tells us which
+ * one is the case. */
+typedef enum
+{
+ xbv_unknown,
+ xbv_firmware,
+ xbv_patch
+} xbv_mode;
+
+typedef struct
+{
+ xbv_mode mode;
+
+ /* Parts of a Firmware XBV1 */
+
+ struct VMEQ vmeq[MAX_VMEQ];
+ CsrUint32 num_vmeq;
+ struct VAND vand[MAX_VAND];
+ struct VERS vers;
+
+ CsrUint32 slut_addr;
+
+ /* F/W download image, possibly more than one part */
+ struct FWDL fwdl[MAX_FWDL];
+ CsrInt16 num_fwdl;
+
+ /* F/W overlay image, add r not used */
+ struct FWOV fwov;
+
+ /* Parts of a Patch XBV1 */
+
+ CsrUint32 build_id;
+
+ struct PTDL ptdl[MAX_PTDL];
+ CsrInt16 num_ptdl;
+} xbv1_t;
+
+
+typedef CsrInt32 (*fwreadfn_t)(void *ospriv, void *dlpriv, CsrUint32 offset, void *buf, CsrUint32 len);
+
+CsrResult xbv1_parse(card_t *card, fwreadfn_t readfn, void *dlpriv, xbv1_t *fwinfo);
+CsrInt32 xbv1_read_slut(card_t *card, fwreadfn_t readfn, void *dlpriv, xbv1_t *fwinfo,
+ symbol_t *slut, CsrUint32 slut_len);
+void* xbv_to_patch(card_t *card, fwreadfn_t readfn, const void *fw_buf, const xbv1_t *fwinfo,
+ CsrUint32 *size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __XBV_H__ */