aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000/wilc_errorsupport.h
diff options
context:
space:
mode:
authorJohnny Kim <johnny.kim@atmel.com>2015-05-11 14:30:56 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-24 13:36:53 -0700
commitc5c77ba18ea66aa05441c71e38473efb787705a4 (patch)
tree346d9f9d956b97650977db976e45f01d31223154 /drivers/staging/wilc1000/wilc_errorsupport.h
parentstaging: panel: fix stackdump (diff)
downloadlinux-dev-c5c77ba18ea66aa05441c71e38473efb787705a4.tar.xz
linux-dev-c5c77ba18ea66aa05441c71e38473efb787705a4.zip
staging: wilc1000: Add SDIO/SPI 802.11 driver
This driver is for the wilc1000 which is a single chip IEEE 802.11 b/g/n device. The driver works together with cfg80211, which is the kernel side of configuration management for wireless devices because the wilc1000 chipset is fullmac where the MLME is managed in hardware. The driver worked from kernel version 2.6.38 and being now ported to several others since then. A TODO file is included as well in this commit. Signed-off-by: Johnny Kim <johnny.kim@atmel.com> Signed-off-by: Rachel Kim <rachel.kim@atmel.com> Signed-off-by: Dean Lee <dean.lee@atmel.com> Signed-off-by: Chris Park <chris.park@atmel.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000/wilc_errorsupport.h')
-rw-r--r--drivers/staging/wilc1000/wilc_errorsupport.h84
1 files changed, 84 insertions, 0 deletions
diff --git a/drivers/staging/wilc1000/wilc_errorsupport.h b/drivers/staging/wilc1000/wilc_errorsupport.h
new file mode 100644
index 000000000000..6405ef8ad431
--- /dev/null
+++ b/drivers/staging/wilc1000/wilc_errorsupport.h
@@ -0,0 +1,84 @@
+#ifndef __WILC_ERRORSUPPORT_H__
+#define __WILC_ERRORSUPPORT_H__
+
+/*!
+ * @file wilc_errorsupport.h
+ * @brief Error reporting and handling support
+ * @author syounan
+ * @sa wilc_oswrapper.h top level OS wrapper file
+ * @date 10 Aug 2010
+ * @version 1.0
+ */
+
+#include "linux_wlan_common.h"
+
+/* Psitive Numbers to indicate sucess with special status */
+#define WILC_ALREADY_EXSIT (+100) /** The requested object already exists */
+
+/* Generic success will return 0 */
+#define WILC_SUCCESS 0 /** Generic success */
+
+/* Negative numbers to indicate failures */
+#define WILC_FAIL -100 /** Generic Fail */
+#define WILC_BUSY -101 /** Busy with another operation*/
+#define WILC_INVALID_ARGUMENT -102 /** A given argument is invalid*/
+#define WILC_INVALID_STATE -103 /** An API request would violate the Driver state machine (i.e. to start PID while not camped)*/
+#define WILC_BUFFER_OVERFLOW -104 /** In copy operations if the copied data is larger than the allocated buffer*/
+#define WILC_NULL_PTR -105 /** null pointer is passed or used */
+#define WILC_EMPTY -107
+#define WILC_FULL -108
+#define WILC_TIMEOUT -109
+#define WILC_CANCELED -110 /** The required operation have been canceled by the user*/
+#define WILC_INVALID_FILE -112 /** The Loaded file is corruped or having an invalid format */
+#define WILC_NOT_FOUND -113 /** Cant find the file to load */
+#define WILC_NO_MEM -114
+#define WILC_UNSUPPORTED_VERSION -115
+#define WILC_FILE_EOF -116
+
+
+/* Error type */
+typedef WILC_Sint32 WILC_ErrNo;
+
+#define WILC_IS_ERR(__status__) (__status__ < WILC_SUCCESS)
+
+#define WILC_ERRORCHECK(__status__) do { \
+ if (WILC_IS_ERR(__status__)) { \
+ PRINT_ER("PRINT_ER(%d)\n", __status__); \
+ goto ERRORHANDLER; \
+ } \
+} while (0)
+
+#define WILC_ERRORREPORT(__status__, __err__) do { \
+ PRINT_ER("PRINT_ER(%d)\n", __err__); \
+ __status__ = __err__; \
+ goto ERRORHANDLER; \
+} while (0)
+
+#define WILC_NULLCHECK(__status__, __ptr__) do { \
+ if (__ptr__ == WILC_NULL) { \
+ WILC_ERRORREPORT(__status__, WILC_NULL_PTR); \
+ } \
+} while (0)
+
+#define WILC_CATCH(__status__) \
+ERRORHANDLER: \
+ if (WILC_IS_ERR(__status__)) \
+
+#ifdef CONFIG_WILC_ASSERTION_SUPPORT
+
+/**
+ * @brief prints a diagnostic message and aborts the program
+ * @param[in] pcExpression The expression that triggered the assertion
+ * @param[in] pcFileName The name of the current source file.
+ * @param[in] u32LineNumber The line number in the current source file.
+ * @warning DO NOT CALL DIRECTLY. USE EQUIVALENT MACRO FUNCTION INSTEAD.
+ */
+void WILC_assert_INTERNAL(WILC_Char *pcExpression, WILC_Char *pcFileName, WILC_Uint32 u32LineNumber);
+
+#define WILC_assert(__expression__) (void)(!!(__expression__) || (WILC_assert_INTERNAL((# __expression__), __WILC_FILE__, __WILC_LINE__), 0))
+
+#else
+#define WILC_assert(__expression__) ((void)0)
+#endif
+
+#endif