|
@@ -150,6 +150,56 @@ static inline int __qdf_status_to_os_return(QDF_STATUS status)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+static inline QDF_STATUS __qdf_status_from_os_return(int rc)
|
|
|
+{
|
|
|
+ switch (rc) {
|
|
|
+ case 0:
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
+ case -ENOMEM:
|
|
|
+ return QDF_STATUS_E_NOMEM;
|
|
|
+ case -EAGAIN:
|
|
|
+ return QDF_STATUS_E_AGAIN;
|
|
|
+ case -EINVAL:
|
|
|
+ return QDF_STATUS_E_INVAL;
|
|
|
+ case -EFAULT:
|
|
|
+ return QDF_STATUS_E_FAULT;
|
|
|
+ case -EALREADY:
|
|
|
+ return QDF_STATUS_E_ALREADY;
|
|
|
+ case -EBADMSG:
|
|
|
+ return QDF_STATUS_E_BADMSG;
|
|
|
+ case -EBUSY:
|
|
|
+ return QDF_STATUS_E_BUSY;
|
|
|
+ case -ECANCELED:
|
|
|
+ return QDF_STATUS_E_CANCELED;
|
|
|
+ case -ECONNABORTED:
|
|
|
+ return QDF_STATUS_E_ABORTED;
|
|
|
+ case -EPERM:
|
|
|
+ return QDF_STATUS_E_PERM;
|
|
|
+ case -EEXIST:
|
|
|
+ return QDF_STATUS_E_EXISTS;
|
|
|
+ case -ENOENT:
|
|
|
+ return QDF_STATUS_E_NOENT;
|
|
|
+ case -E2BIG:
|
|
|
+ return QDF_STATUS_E_E2BIG;
|
|
|
+ case -ENOSPC:
|
|
|
+ return QDF_STATUS_E_NOSPC;
|
|
|
+ case -EADDRNOTAVAIL:
|
|
|
+ return QDF_STATUS_E_ADDRNOTAVAIL;
|
|
|
+ case -ENXIO:
|
|
|
+ return QDF_STATUS_E_ENXIO;
|
|
|
+ case -ENETDOWN:
|
|
|
+ return QDF_STATUS_E_NETDOWN;
|
|
|
+ case -EIO:
|
|
|
+ return QDF_STATUS_E_IO;
|
|
|
+ case -ENETRESET:
|
|
|
+ return QDF_STATUS_E_NETRESET;
|
|
|
+ case -EINPROGRESS:
|
|
|
+ return QDF_STATUS_E_PENDING;
|
|
|
+ default:
|
|
|
+ return QDF_STATUS_E_PERM;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* __qdf_set_bit() - set bit in address
|
|
|
* @nr: bit number to be set
|