Commit e6e12661 authored by Leo Kim's avatar Leo Kim Committed by Greg Kroah-Hartman
Browse files

staging: wilc1000: replace wilc error types with the generic error types



This patch replaces the error types defined by wilc driver with the
generic error types provided by the Linux kernel.
- WILC_SUCCESS			0
- WILC_FAIL				-EFAULT
- WILC_BUSY				-EBUSY
- WILC_INVALID_ARGUMENT		-EINVAL
- WILC_INVALID_STATE		-EINVAL
- WILC_BUFFER_OVERFLOW		-EOVERFLOW
- WILC_NULL_PTR			-EFAULT
- WILC_TIMEOUT			-ETIMEDOUT
- WILC_NOT_FOUND			-ENOENT
- WILC_NO_MEM			-ENOMEM

After then removes all wilc definitions.

Signed-off-by: default avatarLeo Kim <leo.kim@atmel.com>
Signed-off-by: default avatarTony Cho <tony.cho@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 559e1a04
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -340,7 +340,7 @@ INLINE u16 get_asoc_id(u8 *data)

s32 CoreConfiguratorInit(void)
{
	s32 s32Error = WILC_SUCCESS;
	s32 s32Error = 0;

	PRINT_D(CORECONFIG_DBG, "CoreConfiguratorInit()\n");

@@ -415,7 +415,7 @@ u8 get_current_channel(u8 *pu8msa, u16 u16RxLen)
 */
s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
{
	s32 s32Error = WILC_SUCCESS;
	s32 s32Error = 0;
	tstrNetworkInfo *pstrNetworkInfo = NULL;
	u8 u8MsgType = 0;
	u8 u8MsgID = 0;
@@ -541,21 +541,21 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
 */
s32 DeallocateNetworkInfo(tstrNetworkInfo *pstrNetworkInfo)
{
	s32 s32Error = WILC_SUCCESS;
	s32 s32Error = 0;

	if (pstrNetworkInfo != NULL) {
		if (pstrNetworkInfo->pu8IEs != NULL) {
			kfree(pstrNetworkInfo->pu8IEs);
			pstrNetworkInfo->pu8IEs = NULL;
		} else {
			s32Error = WILC_FAIL;
			s32Error = -EFAULT;
		}

		kfree(pstrNetworkInfo);
		pstrNetworkInfo = NULL;

	} else {
		s32Error = WILC_FAIL;
		s32Error = -EFAULT;
	}

	return s32Error;
@@ -575,7 +575,7 @@ s32 DeallocateNetworkInfo(tstrNetworkInfo *pstrNetworkInfo)
s32 ParseAssocRespInfo(u8 *pu8Buffer, u32 u32BufferLen,
			       tstrConnectRespInfo **ppstrConnectRespInfo)
{
	s32 s32Error = WILC_SUCCESS;
	s32 s32Error = 0;
	tstrConnectRespInfo *pstrConnectRespInfo = NULL;
	u16 u16AssocRespLen = 0;
	u8 *pu8IEs = NULL;
@@ -632,21 +632,21 @@ s32 ParseAssocRespInfo(u8 *pu8Buffer, u32 u32BufferLen,
 */
s32 DeallocateAssocRespInfo(tstrConnectRespInfo *pstrConnectRespInfo)
{
	s32 s32Error = WILC_SUCCESS;
	s32 s32Error = 0;

	if (pstrConnectRespInfo != NULL) {
		if (pstrConnectRespInfo->pu8RespIEs != NULL) {
			kfree(pstrConnectRespInfo->pu8RespIEs);
			pstrConnectRespInfo->pu8RespIEs = NULL;
		} else {
			s32Error = WILC_FAIL;
			s32Error = -EFAULT;
		}

		kfree(pstrConnectRespInfo);
		pstrConnectRespInfo = NULL;

	} else {
		s32Error = WILC_FAIL;
		s32Error = -EFAULT;
	}

	return s32Error;
@@ -657,7 +657,7 @@ s32 ParseSurveyResults(u8 ppu8RcvdSiteSurveyResults[][MAX_SURVEY_RESULT_FRAG_SIZ
			       wid_site_survey_reslts_s **ppstrSurveyResults,
			       u32 *pu32SurveyResultsCount)
{
	s32 s32Error = WILC_SUCCESS;
	s32 s32Error = 0;
	wid_site_survey_reslts_s *pstrSurveyResults = NULL;
	u32 u32SurveyResultsCount = 0;
	u32 u32SurveyBytesLength = 0;
@@ -712,7 +712,7 @@ ERRORHANDLER:

s32 DeallocateSurveyResults(wid_site_survey_reslts_s *pstrSurveyResults)
{
	s32 s32Error = WILC_SUCCESS;
	s32 s32Error = 0;

	if (pstrSurveyResults != NULL) {
		kfree(pstrSurveyResults);
@@ -734,7 +734,7 @@ s32 DeallocateSurveyResults(wid_site_survey_reslts_s *pstrSurveyResults)

s32 CoreConfiguratorDeInit(void)
{
	s32 s32Error = WILC_SUCCESS;
	s32 s32Error = 0;

	PRINT_D(CORECONFIG_DBG, "CoreConfiguratorDeInit()\n");

+119 −119

File changed.

Preview size limit exceeded, changes collapsed.

+7 −7
Original line number Diff line number Diff line
@@ -178,21 +178,21 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len)

	if (dev == NULL) {
		PRINT_D(HOSTAPD_DBG, "ERROR: dev == NULL\n");
		return WILC_FAIL;
		return -EFAULT;
	}

	netif_stop_queue(dev);
	mgmt_tx = kmalloc(sizeof(struct tx_complete_mon_data), GFP_ATOMIC);
	if (mgmt_tx == NULL) {
		PRINT_ER("Failed to allocate memory for mgmt_tx structure\n");
		return WILC_FAIL;
		return -EFAULT;
	}

	mgmt_tx->buff = kmalloc(len, GFP_ATOMIC);
	if (mgmt_tx->buff == NULL) {
		PRINT_ER("Failed to allocate memory for mgmt_tx buff\n");
		kfree(mgmt_tx);
		return WILC_FAIL;
		return -EFAULT;

	}

@@ -225,13 +225,13 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb,

	/* Bug 4601 */
	if (wilc_wfi_mon == NULL)
		return WILC_FAIL;
		return -EFAULT;

	mon_priv = netdev_priv(wilc_wfi_mon);

	if (mon_priv == NULL) {
		PRINT_ER("Monitor interface private structure is NULL\n");
		return WILC_FAIL;
		return -EFAULT;
	}


@@ -351,7 +351,7 @@ struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_devi
{


	u32 ret = WILC_SUCCESS;
	u32 ret = 0;
	struct WILC_WFI_mon_priv *priv;

	/*If monitor interface is already initialized, return it*/
@@ -416,7 +416,7 @@ int WILC_WFI_deinit_mon_interface(void)
		}
		wilc_wfi_mon = NULL;
	}
	return WILC_SUCCESS;
	return 0;

}
#endif /* WILC_AP_EXTERNAL_MLME */
+1 −1
Original line number Diff line number Diff line
@@ -1905,7 +1905,7 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
	u32 size = 0, length = 0;
	perInterface_wlan_t *nic;
	struct wilc_priv *priv;
	s32 s32Error = WILC_SUCCESS;
	s32 s32Error = 0;

	/* struct iwreq *wrq = (struct iwreq *) req;	// tony moved to case SIOCSIWPRIV */
	nic = netdev_priv(ndev);
+0 −14
Original line number Diff line number Diff line
@@ -12,18 +12,4 @@

#include "linux_wlan_common.h"

/* 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_TIMEOUT			-109
#define WILC_NOT_FOUND			-113 /** Cant find the file to load */
#define WILC_NO_MEM			-114

#endif
Loading