Lines 50-56
Link Here
|
50 |
#ifdef PROTOCOL_DEBUG |
50 |
#ifdef PROTOCOL_DEBUG |
51 |
#ifdef CONFIG_PROC_FS |
51 |
#ifdef CONFIG_PROC_FS |
52 |
#define PROC_XBUS_COMMAND "command" |
52 |
#define PROC_XBUS_COMMAND "command" |
|
|
53 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0) |
53 |
static const struct file_operations proc_xbus_command_ops; |
54 |
static const struct file_operations proc_xbus_command_ops; |
|
|
55 |
#else |
56 |
static const struct proc_ops proc_xbus_command_ops; |
57 |
#endif |
54 |
#endif |
58 |
#endif |
55 |
#endif |
59 |
#endif |
56 |
|
60 |
|
Lines 65-71
Link Here
|
65 |
"Register devices automatically (1) or not (0). UNUSED."); |
69 |
"Register devices automatically (1) or not (0). UNUSED."); |
66 |
|
70 |
|
67 |
#ifdef CONFIG_PROC_FS |
71 |
#ifdef CONFIG_PROC_FS |
|
|
72 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0) |
68 |
static const struct file_operations xbus_read_proc_ops; |
73 |
static const struct file_operations xbus_read_proc_ops; |
|
|
74 |
#else |
75 |
static const struct proc_ops xbus_read_proc_ops; |
76 |
#endif |
69 |
#endif |
77 |
#endif |
70 |
static void transport_init(xbus_t *xbus, struct xbus_ops *ops, |
78 |
static void transport_init(xbus_t *xbus, struct xbus_ops *ops, |
71 |
ushort max_send_size, |
79 |
ushort max_send_size, |
Lines 1828-1833
Link Here
|
1828 |
return single_open(file, xbus_proc_show, PDE_DATA(inode)); |
1836 |
return single_open(file, xbus_proc_show, PDE_DATA(inode)); |
1829 |
} |
1837 |
} |
1830 |
|
1838 |
|
|
|
1839 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0) |
1831 |
static const struct file_operations xbus_read_proc_ops = { |
1840 |
static const struct file_operations xbus_read_proc_ops = { |
1832 |
.owner = THIS_MODULE, |
1841 |
.owner = THIS_MODULE, |
1833 |
.open = xbus_read_proc_open, |
1842 |
.open = xbus_read_proc_open, |
Lines 1835-1840
Link Here
|
1835 |
.llseek = seq_lseek, |
1844 |
.llseek = seq_lseek, |
1836 |
.release = single_release, |
1845 |
.release = single_release, |
1837 |
}; |
1846 |
}; |
|
|
1847 |
#else |
1848 |
static const struct proc_ops xbus_read_proc_ops = { |
1849 |
.proc_open = xbus_read_proc_open, |
1850 |
.proc_read = seq_read, |
1851 |
.proc_lseek = seq_lseek, |
1852 |
.proc_release = single_release, |
1853 |
}; |
1854 |
#endif |
1838 |
|
1855 |
|
1839 |
#ifdef PROTOCOL_DEBUG |
1856 |
#ifdef PROTOCOL_DEBUG |
1840 |
static ssize_t proc_xbus_command_write(struct file *file, |
1857 |
static ssize_t proc_xbus_command_write(struct file *file, |
Lines 1927-1937
Link Here
|
1927 |
return 0; |
1944 |
return 0; |
1928 |
} |
1945 |
} |
1929 |
|
1946 |
|
|
|
1947 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0) |
1930 |
static const struct file_operations proc_xbus_command_ops = { |
1948 |
static const struct file_operations proc_xbus_command_ops = { |
1931 |
.owner = THIS_MODULE, |
1949 |
.owner = THIS_MODULE, |
1932 |
.open = proc_xbus_command_open, |
1950 |
.open = proc_xbus_command_open, |
1933 |
.write = proc_xbus_command_write, |
1951 |
.write = proc_xbus_command_write, |
1934 |
}; |
1952 |
}; |
|
|
1953 |
#else |
1954 |
static const struct proc_ops proc_xbus_command_ops = { |
1955 |
.proc_open = proc_xbus_command_open, |
1956 |
.proc_write = proc_xbus_command_write, |
1957 |
}; |
1958 |
#endif |
1935 |
#endif |
1959 |
#endif |
1936 |
|
1960 |
|
1937 |
static int xpp_proc_read_show(struct seq_file *sfile, void *data) |
1961 |
static int xpp_proc_read_show(struct seq_file *sfile, void *data) |
Lines 1961-1966
Link Here
|
1961 |
return single_open(file, xpp_proc_read_show, PDE_DATA(inode)); |
1985 |
return single_open(file, xpp_proc_read_show, PDE_DATA(inode)); |
1962 |
} |
1986 |
} |
1963 |
|
1987 |
|
|
|
1988 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0) |
1964 |
static const struct file_operations xpp_proc_read_ops = { |
1989 |
static const struct file_operations xpp_proc_read_ops = { |
1965 |
.owner = THIS_MODULE, |
1990 |
.owner = THIS_MODULE, |
1966 |
.open = xpp_proc_read_open, |
1991 |
.open = xpp_proc_read_open, |
Lines 1968-1974
Link Here
|
1968 |
.llseek = seq_lseek, |
1993 |
.llseek = seq_lseek, |
1969 |
.release = single_release, |
1994 |
.release = single_release, |
1970 |
}; |
1995 |
}; |
1971 |
|
1996 |
#else |
|
|
1997 |
static const struct proc_ops xpp_proc_read_ops = { |
1998 |
.proc_open = xpp_proc_read_open, |
1999 |
.proc_read = seq_read, |
2000 |
.proc_lseek = seq_lseek, |
2001 |
.proc_release = single_release, |
2002 |
}; |
2003 |
#endif |
1972 |
#endif |
2004 |
#endif |
1973 |
|
2005 |
|
1974 |
static void transport_init(xbus_t *xbus, struct xbus_ops *ops, |
2006 |
static void transport_init(xbus_t *xbus, struct xbus_ops *ops, |