The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/dev/iwlwifi/mvm/debugfs.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
    2 /*
    3  * Copyright (C) 2012-2014 Intel Corporation
    4  * Copyright (C) 2013-2014 Intel Mobile Communications GmbH
    5  */
    6 #define MVM_DEBUGFS_READ_FILE_OPS(name)                                 \
    7 static const struct file_operations iwl_dbgfs_##name##_ops = {          \
    8         .read = iwl_dbgfs_##name##_read,                                \
    9         .open = simple_open,                                            \
   10         .llseek = generic_file_llseek,                                  \
   11 }
   12 
   13 #define MVM_DEBUGFS_WRITE_WRAPPER(name, buflen, argtype)                \
   14 static ssize_t _iwl_dbgfs_##name##_write(struct file *file,             \
   15                                          const char __user *user_buf,   \
   16                                          size_t count, loff_t *ppos)    \
   17 {                                                                       \
   18         argtype *arg = file->private_data;                              \
   19         char buf[buflen] = {};                                          \
   20         size_t buf_size = min(count, sizeof(buf) -  1);                 \
   21                                                                         \
   22         if (copy_from_user(buf, user_buf, buf_size))                    \
   23                 return -EFAULT;                                         \
   24                                                                         \
   25         return iwl_dbgfs_##name##_write(arg, buf, buf_size, ppos);      \
   26 }                                                                       \
   27 
   28 #define _MVM_DEBUGFS_READ_WRITE_FILE_OPS(name, buflen, argtype)         \
   29 MVM_DEBUGFS_WRITE_WRAPPER(name, buflen, argtype)                        \
   30 static const struct file_operations iwl_dbgfs_##name##_ops = {          \
   31         .write = _iwl_dbgfs_##name##_write,                             \
   32         .read = iwl_dbgfs_##name##_read,                                \
   33         .open = simple_open,                                            \
   34         .llseek = generic_file_llseek,                                  \
   35 };
   36 
   37 #define _MVM_DEBUGFS_WRITE_FILE_OPS(name, buflen, argtype)              \
   38 MVM_DEBUGFS_WRITE_WRAPPER(name, buflen, argtype)                        \
   39 static const struct file_operations iwl_dbgfs_##name##_ops = {          \
   40         .write = _iwl_dbgfs_##name##_write,                             \
   41         .open = simple_open,                                            \
   42         .llseek = generic_file_llseek,                                  \
   43 };

Cache object: bc81e1cb72523b50af1c17082834d392


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.