cleanup and update kernel modules

This commit is contained in:
kram 2018-03-07 14:51:59 -08:00
parent 434c6651e4
commit 8fff27e46b
4 changed files with 16 additions and 13 deletions

View File

@ -1,7 +1,3 @@
# This file describes the maintainers for sonic-platform-modules-bfn
# See the SONiC project governance document for more information
Name = "Daxay"
Email = "support@barefootnetworks.com"
Github = barefootnetworks
Mailinglist = sonicproject@googlegroups.com

View File

@ -1,7 +1,4 @@
# This file describes the maintainers for sonic-platform-modules-bfn
# See the SONiC project governance document for more information
Name = "Daxay"
Email = "support@barefootnetworks.com"
Github = barefootnetworks
Mailinglist = sonicproject@googlegroups.com

View File

@ -58,7 +58,13 @@
#include <linux/version.h>
#include <linux/wait.h>
#include <linux/poll.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
#include <linux/sched/signal.h>
#else
#include <linux/sched.h>
#endif
#include <linux/cdev.h>
#include <linux/aer.h>
#include <linux/string.h>
@ -591,7 +597,6 @@ static ssize_t bf_read(struct file *filep, char __user *buf,
return -EINVAL;
count = sizeof(s32);
}
count = sizeof(s32)*BF_MSIX_ENTRY_CNT;
do {
set_current_state(TASK_INTERRUPTIBLE);
@ -611,7 +616,7 @@ static ssize_t bf_read(struct file *filep, char __user *buf,
if (copy_to_user(buf, &event_count, count))
retval = -EFAULT;
else { /* adjust the listener->event_count; */
for (i = 0 ; i < BF_MSIX_ENTRY_CNT; i++) {
for (i = 0 ; i < (count/sizeof(s32)); i++) {
if (cnt_match[i]) {
listener->event_count[i] = event_count[i];
}

View File

@ -58,7 +58,13 @@
#include <linux/version.h>
#include <linux/wait.h>
#include <linux/poll.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
#include <linux/sched/signal.h>
#else
#include <linux/sched.h>
#endif
#include <linux/cdev.h>
#include <linux/aer.h>
#include <linux/string.h>
@ -591,7 +597,6 @@ static ssize_t bf_read(struct file *filep, char __user *buf,
return -EINVAL;
count = sizeof(s32);
}
count = sizeof(s32)*BF_MSIX_ENTRY_CNT;
do {
set_current_state(TASK_INTERRUPTIBLE);
@ -611,7 +616,7 @@ static ssize_t bf_read(struct file *filep, char __user *buf,
if (copy_to_user(buf, &event_count, count))
retval = -EFAULT;
else { /* adjust the listener->event_count; */
for (i = 0 ; i < BF_MSIX_ENTRY_CNT; i++) {
for (i = 0 ; i < (count/sizeof(s32)); i++) {
if (cnt_match[i]) {
listener->event_count[i] = event_count[i];
}