Updated to 4.4.1

This commit is contained in:
CGarces
2017-05-11 20:47:23 +02:00
parent 9dde4572b4
commit 3d6c7de21a
396 changed files with 174471 additions and 106990 deletions

View File

@@ -804,7 +804,7 @@ void rtw_mfree2d(void *pbuf, int h, int w, int size)
rtw_mfree((u8 *)pbuf, h*sizeof(void*) + w*h*size);
}
void _rtw_memcpy(void* dst, void* src, u32 sz)
void _rtw_memcpy(void *dst, const void *src, u32 sz)
{
#if defined (PLATFORM_LINUX)|| defined (PLATFORM_FREEBSD)
@@ -821,6 +821,15 @@ void _rtw_memcpy(void* dst, void* src, u32 sz)
}
inline void _rtw_memmove(void *dst, const void *src, u32 sz)
{
#if defined(PLATFORM_LINUX)
memmove(dst, src, sz);
#else
#warning "no implementation\n"
#endif
}
int _rtw_memcmp(void *dst, void *src, u32 sz)
{
@@ -1270,13 +1279,15 @@ void _rtw_spinunlock_ex(_lock *plock)
void _rtw_init_queue(_queue *pqueue)
void _rtw_init_queue(_queue *pqueue)
{
_rtw_init_listhead(&(pqueue->queue));
_rtw_spinlock_init(&(pqueue->lock));
}
void _rtw_deinit_queue(_queue *pqueue)
{
_rtw_spinlock_free(&(pqueue->lock));
}
u32 _rtw_queue_empty(_queue *pqueue)
@@ -1551,7 +1562,7 @@ void rtw_udelay_os(int us)
}
#endif
void rtw_yield_os()
void rtw_yield_os(void)
{
#ifdef PLATFORM_LINUX
yield();
@@ -1598,7 +1609,7 @@ static android_suspend_lock_t rtw_resume_scan_lock ={
};
#endif
inline void rtw_suspend_lock_init()
inline void rtw_suspend_lock_init(void)
{
#ifdef CONFIG_WAKELOCK
wake_lock_init(&rtw_suspend_lock, WAKE_LOCK_SUSPEND, RTW_SUSPEND_LOCK_NAME);
@@ -1617,7 +1628,7 @@ inline void rtw_suspend_lock_init()
#endif
}
inline void rtw_suspend_lock_uninit()
inline void rtw_suspend_lock_uninit(void)
{
#ifdef CONFIG_WAKELOCK
wake_lock_destroy(&rtw_suspend_lock);
@@ -1890,12 +1901,20 @@ static int closeFile(struct file *fp)
static int readFile(struct file *fp,char *buf,int len)
{
int rlen=0, sum=0;
if (!fp->f_op || !fp->f_op->read)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
if (!(fp->f_mode & FMODE_CAN_READ))
#else
if (!fp->f_op || !fp->f_op->read)
#endif
return -EPERM;
while(sum<len) {
rlen=fp->f_op->read(fp,buf+sum,len-sum, &fp->f_pos);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))
rlen = __vfs_read(fp, buf+sum, len-sum, &fp->f_pos);
#else
rlen = fp->f_op->read(fp, buf+sum, len-sum, &fp->f_pos);
#endif
if(rlen>0)
sum+=rlen;
else if(0 != rlen)
@@ -2051,7 +2070,7 @@ int rtw_is_file_readable(char *path)
* @param sz how many bytes to read at most
* @return the byte we've read
*/
int rtw_retrive_from_file(char *path, u8* buf, u32 sz)
int rtw_retrieve_from_file(char *path, u8 *buf, u32 sz)
{
#ifdef PLATFORM_LINUX
int ret =retriveFromFile(path, buf, sz);
@@ -2141,7 +2160,6 @@ void rtw_free_netdev(struct net_device * netdev)
if(!pnpi->priv)
goto RETURN;
rtw_vmfree(pnpi->priv, pnpi->sizeof_priv);
free_netdev(netdev);
RETURN:
@@ -2190,7 +2208,7 @@ int rtw_change_ifname(_adapter *padapter, const char *ifname)
rtw_init_netdev_name(pnetdev, ifname);
_rtw_memcpy(pnetdev->dev_addr, padapter->eeprompriv.mac_addr, ETH_ALEN);
_rtw_memcpy(pnetdev->dev_addr, adapter_mac_addr(padapter), ETH_ALEN);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26))
if(!rtnl_is_locked())
@@ -2476,3 +2494,41 @@ void rtw_cbuf_free(struct rtw_cbuf *cbuf)
rtw_mfree((u8*)cbuf, sizeof(*cbuf) + sizeof(void*)*cbuf->size);
}
/**
* IsHexDigit -
*
* Return TRUE if chTmp is represent for hex digit
* FALSE otherwise.
*/
inline BOOLEAN IsHexDigit(char chTmp)
{
if ((chTmp >= '0' && chTmp <= '9') ||
(chTmp >= 'a' && chTmp <= 'f') ||
(chTmp >= 'A' && chTmp <= 'F'))
return _TRUE;
else
return _FALSE;
}
/**
* is_alpha -
*
* Return TRUE if chTmp is represent for alphabet
* FALSE otherwise.
*/
inline BOOLEAN is_alpha(char chTmp)
{
if ((chTmp >= 'a' && chTmp <= 'z') ||
(chTmp >= 'A' && chTmp <= 'Z'))
return _TRUE;
else
return _FALSE;
}
inline char alpha_to_upper(char c)
{
if ((c >= 'a' && c <= 'z'))
c = 'A' + (c - 'a');
return c;
}