Skip to content

Commit

Permalink
fix mt76x2 dat read
Browse files Browse the repository at this point in the history
  • Loading branch information
padavanonly committed May 2, 2023
1 parent 364952f commit aeab9ad
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -877,15 +877,21 @@ void RtmpOSFileSeek(RTMP_OS_FD osfd, int offset)
int RtmpOSFileRead(RTMP_OS_FD osfd, char *pDataPtr, int readLen)
{
/* The object must have a read method */
#if (KERNEL_VERSION(3, 19, 0) > LINUX_VERSION_CODE)
if (osfd->f_op && osfd->f_op->read) {
return osfd->f_op->read(osfd, pDataPtr, readLen, &osfd->f_pos);
#else

if (osfd->f_mode & FMODE_CAN_READ) {
return __vfs_read(osfd, pDataPtr, readLen, &osfd->f_pos);
#endif
} else {
DBGPRINT(RT_DEBUG_ERROR, ("no file read method\n"));
return -1;
}
}



int RtmpOSFileWrite(RTMP_OS_FD osfd, char *pDataPtr, int writeLen)
{
return osfd->f_op->write(osfd, pDataPtr, (size_t) writeLen, &osfd->f_pos);
Expand Down

0 comments on commit aeab9ad

Please sign in to comment.