OpenCores
URL https://opencores.org/ocsvn/fade_ether_protocol/fade_ether_protocol/trunk

Subversion Repositories fade_ether_protocol

[/] [fade_ether_protocol/] [trunk/] [stable_jumbo_frames_version/] [linux/] [fpga_l3_fade.c] - Diff between revs 47 and 48

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 47 Rev 48
Line 18... Line 18...
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 */
 
 
#include <linux/module.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/kernel.h>
 
#include <linux/version.h>
#include <linux/sched.h>
#include <linux/sched.h>
#include <asm/uaccess.h>
#include <asm/uaccess.h>
 
 
MODULE_LICENSE("GPL v2");
MODULE_LICENSE("GPL v2");
//#define FADE_DEBUG 1
//#define FADE_DEBUG 1
Line 373... Line 374...
  case L3_V1_IOC_READPTRS:
  case L3_V1_IOC_READPTRS:
    {
    {
      void * res = (void *) arg;
      void * res = (void *) arg;
      long res2;
      long res2;
      struct l3_v1_buf_pointers bp;
      struct l3_v1_buf_pointers bp;
 
#if LINUX_VERSION_CODE >= 0x50000
 
      if (!access_ok(res,sizeof(bp))) {
 
#else
      if (!access_ok(VERIFY_WRITE,res,sizeof(bp))) {
      if (!access_ok(VERIFY_WRITE,res,sizeof(bp))) {
 
#endif
        return -EFAULT;
        return -EFAULT;
      } else {
      } else {
        read_lock_bh(&sd->ptrs_lock);
        read_lock_bh(&sd->ptrs_lock);
        bp.head=sd->head;
        bp.head=sd->head;
        bp.tail=sd->tail;
        bp.tail=sd->tail;
Line 437... Line 442...
    {
    {
      void * source = (void *) arg;
      void * source = (void *) arg;
      struct l3_v1_slave sl;
      struct l3_v1_slave sl;
      struct net_device *dev = NULL;
      struct net_device *dev = NULL;
      long res2;
      long res2;
 
#if LINUX_VERSION_CODE >= 0x50000
 
      if (!access_ok(source,sizeof(sl))) {
 
#else 
      if (!access_ok(VERIFY_READ,source,sizeof(sl))) {
      if (!access_ok(VERIFY_READ,source,sizeof(sl))) {
 
#endif
        return -EFAULT;
        return -EFAULT;
      }
      }
      /* First deactivate the slave to avoid situation where data are modified
      /* First deactivate the slave to avoid situation where data are modified
       * while slave is active */
       * while slave is active */
      if (sd->active) sd->active = 0;
      if (sd->active) sd->active = 0;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.