Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Thomas Horsten <thh@lasat.com> |
| 3 | * Copyright (C) 2000 LASAT Networks A/S. |
| 4 | * |
| 5 | * This program is free software; you can distribute it and/or modify it |
| 6 | * under the terms of the GNU General Public License (Version 2) as |
| 7 | * published by the Free Software Foundation. |
| 8 | * |
| 9 | * This program is distributed in the hope it will be useful, but WITHOUT |
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 12 | * for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License along |
| 15 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 16 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. |
| 17 | * |
| 18 | * Routines specific to the LASAT boards |
| 19 | */ |
| 20 | #include <linux/types.h> |
| 21 | #include <asm/lasat/lasat.h> |
| 22 | |
| 23 | #include <linux/config.h> |
| 24 | #include <linux/module.h> |
| 25 | #include <linux/sysctl.h> |
| 26 | #include <linux/stddef.h> |
| 27 | #include <linux/init.h> |
| 28 | #include <linux/fs.h> |
| 29 | #include <linux/ctype.h> |
| 30 | #include <linux/string.h> |
| 31 | #include <linux/net.h> |
| 32 | #include <linux/inet.h> |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 33 | #include <linux/mutex.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | #include <asm/uaccess.h> |
| 35 | |
| 36 | #include "sysctl.h" |
| 37 | #include "ds1603.h" |
| 38 | |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 39 | static DEFINE_MUTEX(lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | |
Ralf Baechle | 42a3b4f | 2005-09-03 15:56:17 -0700 | [diff] [blame] | 41 | /* Strategy function to write EEPROM after changing string entry */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | int sysctl_lasatstring(ctl_table *table, int *name, int nlen, |
| 43 | void *oldval, size_t *oldlenp, |
| 44 | void *newval, size_t newlen, void **context) |
| 45 | { |
| 46 | int r; |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 47 | mutex_lock(&lasat_info_mutex); |
Ralf Baechle | 42a3b4f | 2005-09-03 15:56:17 -0700 | [diff] [blame] | 48 | r = sysctl_string(table, name, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | nlen, oldval, oldlenp, newval, newlen, context); |
| 50 | if (r < 0) { |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 51 | mutex_unlock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | return r; |
| 53 | } |
| 54 | if (newval && newlen) { |
| 55 | lasat_write_eeprom_info(); |
| 56 | } |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 57 | mutex_unlock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | return 1; |
| 59 | } |
| 60 | |
| 61 | |
| 62 | /* And the same for proc */ |
| 63 | int proc_dolasatstring(ctl_table *table, int write, struct file *filp, |
| 64 | void *buffer, size_t *lenp, loff_t *ppos) |
| 65 | { |
| 66 | int r; |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 67 | mutex_lock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 68 | r = proc_dostring(table, write, filp, buffer, lenp, ppos); |
| 69 | if ( (!write) || r) { |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 70 | mutex_unlock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 71 | return r; |
| 72 | } |
| 73 | lasat_write_eeprom_info(); |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 74 | mutex_unlock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | return 0; |
| 76 | } |
| 77 | |
Ralf Baechle | 42a3b4f | 2005-09-03 15:56:17 -0700 | [diff] [blame] | 78 | /* proc function to write EEPROM after changing int entry */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | int proc_dolasatint(ctl_table *table, int write, struct file *filp, |
| 80 | void *buffer, size_t *lenp, loff_t *ppos) |
| 81 | { |
| 82 | int r; |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 83 | mutex_lock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 84 | r = proc_dointvec(table, write, filp, buffer, lenp, ppos); |
| 85 | if ( (!write) || r) { |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 86 | mutex_unlock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 87 | return r; |
| 88 | } |
| 89 | lasat_write_eeprom_info(); |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 90 | mutex_unlock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 91 | return 0; |
| 92 | } |
| 93 | |
| 94 | static int rtctmp; |
| 95 | |
| 96 | #ifdef CONFIG_DS1603 |
Ralf Baechle | 42a3b4f | 2005-09-03 15:56:17 -0700 | [diff] [blame] | 97 | /* proc function to read/write RealTime Clock */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | int proc_dolasatrtc(ctl_table *table, int write, struct file *filp, |
| 99 | void *buffer, size_t *lenp, loff_t *ppos) |
| 100 | { |
| 101 | int r; |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 102 | mutex_lock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 103 | if (!write) { |
| 104 | rtctmp = ds1603_read(); |
| 105 | /* check for time < 0 and set to 0 */ |
| 106 | if (rtctmp < 0) |
| 107 | rtctmp = 0; |
| 108 | } |
| 109 | r = proc_dointvec(table, write, filp, buffer, lenp, ppos); |
| 110 | if ( (!write) || r) { |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 111 | mutex_unlock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 112 | return r; |
| 113 | } |
| 114 | ds1603_set(rtctmp); |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 115 | mutex_unlock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 116 | return 0; |
| 117 | } |
| 118 | #endif |
| 119 | |
| 120 | /* Sysctl for setting the IP addresses */ |
| 121 | int sysctl_lasat_intvec(ctl_table *table, int *name, int nlen, |
| 122 | void *oldval, size_t *oldlenp, |
| 123 | void *newval, size_t newlen, void **context) |
| 124 | { |
| 125 | int r; |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 126 | mutex_lock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 127 | r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen, context); |
| 128 | if (r < 0) { |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 129 | mutex_unlock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 130 | return r; |
| 131 | } |
| 132 | if (newval && newlen) { |
| 133 | lasat_write_eeprom_info(); |
| 134 | } |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 135 | mutex_unlock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 136 | return 1; |
| 137 | } |
| 138 | |
| 139 | #ifdef CONFIG_DS1603 |
| 140 | /* Same for RTC */ |
| 141 | int sysctl_lasat_rtc(ctl_table *table, int *name, int nlen, |
| 142 | void *oldval, size_t *oldlenp, |
| 143 | void *newval, size_t newlen, void **context) |
| 144 | { |
| 145 | int r; |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 146 | mutex_lock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 147 | rtctmp = ds1603_read(); |
| 148 | if (rtctmp < 0) |
| 149 | rtctmp = 0; |
| 150 | r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen, context); |
| 151 | if (r < 0) { |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 152 | mutex_unlock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 153 | return r; |
| 154 | } |
| 155 | if (newval && newlen) { |
| 156 | ds1603_set(rtctmp); |
| 157 | } |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 158 | mutex_unlock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 159 | return 1; |
| 160 | } |
| 161 | #endif |
| 162 | |
| 163 | #ifdef CONFIG_INET |
| 164 | static char lasat_bcastaddr[16]; |
| 165 | |
| 166 | void update_bcastaddr(void) |
| 167 | { |
| 168 | unsigned int ip; |
Ralf Baechle | 42a3b4f | 2005-09-03 15:56:17 -0700 | [diff] [blame] | 169 | |
| 170 | ip = (lasat_board_info.li_eeprom_info.ipaddr & |
| 171 | lasat_board_info.li_eeprom_info.netmask) | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 172 | ~lasat_board_info.li_eeprom_info.netmask; |
| 173 | |
| 174 | sprintf(lasat_bcastaddr, "%d.%d.%d.%d", |
| 175 | (ip ) & 0xff, |
| 176 | (ip >> 8) & 0xff, |
| 177 | (ip >> 16) & 0xff, |
| 178 | (ip >> 24) & 0xff); |
| 179 | } |
| 180 | |
| 181 | static char proc_lasat_ipbuf[32]; |
| 182 | /* Parsing of IP address */ |
| 183 | int proc_lasat_ip(ctl_table *table, int write, struct file *filp, |
| 184 | void *buffer, size_t *lenp, loff_t *ppos) |
| 185 | { |
| 186 | int len; |
| 187 | unsigned int ip; |
| 188 | char *p, c; |
| 189 | |
| 190 | if (!table->data || !table->maxlen || !*lenp || |
| 191 | (*ppos && !write)) { |
| 192 | *lenp = 0; |
| 193 | return 0; |
| 194 | } |
| 195 | |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 196 | mutex_lock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 197 | if (write) { |
| 198 | len = 0; |
| 199 | p = buffer; |
| 200 | while (len < *lenp) { |
| 201 | if(get_user(c, p++)) { |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 202 | mutex_unlock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 203 | return -EFAULT; |
| 204 | } |
| 205 | if (c == 0 || c == '\n') |
| 206 | break; |
| 207 | len++; |
| 208 | } |
Ralf Baechle | 42a3b4f | 2005-09-03 15:56:17 -0700 | [diff] [blame] | 209 | if (len >= sizeof(proc_lasat_ipbuf)-1) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 210 | len = sizeof(proc_lasat_ipbuf) - 1; |
| 211 | if (copy_from_user(proc_lasat_ipbuf, buffer, len)) |
| 212 | { |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 213 | mutex_unlock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 214 | return -EFAULT; |
| 215 | } |
| 216 | proc_lasat_ipbuf[len] = 0; |
| 217 | *ppos += *lenp; |
| 218 | /* Now see if we can convert it to a valid IP */ |
| 219 | ip = in_aton(proc_lasat_ipbuf); |
| 220 | *(unsigned int *)(table->data) = ip; |
| 221 | lasat_write_eeprom_info(); |
| 222 | } else { |
| 223 | ip = *(unsigned int *)(table->data); |
| 224 | sprintf(proc_lasat_ipbuf, "%d.%d.%d.%d", |
| 225 | (ip ) & 0xff, |
| 226 | (ip >> 8) & 0xff, |
| 227 | (ip >> 16) & 0xff, |
| 228 | (ip >> 24) & 0xff); |
| 229 | len = strlen(proc_lasat_ipbuf); |
| 230 | if (len > *lenp) |
| 231 | len = *lenp; |
| 232 | if (len) |
| 233 | if(copy_to_user(buffer, proc_lasat_ipbuf, len)) { |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 234 | mutex_unlock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 235 | return -EFAULT; |
| 236 | } |
| 237 | if (len < *lenp) { |
| 238 | if(put_user('\n', ((char *) buffer) + len)) { |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 239 | mutex_unlock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 240 | return -EFAULT; |
| 241 | } |
| 242 | len++; |
| 243 | } |
| 244 | *lenp = len; |
| 245 | *ppos += len; |
| 246 | } |
| 247 | update_bcastaddr(); |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 248 | mutex_unlock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 249 | return 0; |
| 250 | } |
| 251 | #endif /* defined(CONFIG_INET) */ |
| 252 | |
Ralf Baechle | 42a3b4f | 2005-09-03 15:56:17 -0700 | [diff] [blame] | 253 | static int sysctl_lasat_eeprom_value(ctl_table *table, int *name, int nlen, |
| 254 | void *oldval, size_t *oldlenp, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 255 | void *newval, size_t newlen, |
| 256 | void **context) |
| 257 | { |
| 258 | int r; |
| 259 | |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 260 | mutex_lock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 261 | r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen, context); |
| 262 | if (r < 0) { |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 263 | mutex_unlock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 264 | return r; |
| 265 | } |
| 266 | |
| 267 | if (newval && newlen) |
| 268 | { |
| 269 | if (name && *name == LASAT_PRID) |
| 270 | lasat_board_info.li_eeprom_info.prid = *(int*)newval; |
| 271 | |
| 272 | lasat_write_eeprom_info(); |
| 273 | lasat_init_board_info(); |
| 274 | } |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 275 | mutex_unlock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 276 | |
| 277 | return 0; |
| 278 | } |
| 279 | |
| 280 | int proc_lasat_eeprom_value(ctl_table *table, int write, struct file *filp, |
| 281 | void *buffer, size_t *lenp, loff_t *ppos) |
| 282 | { |
| 283 | int r; |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 284 | mutex_lock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 285 | r = proc_dointvec(table, write, filp, buffer, lenp, ppos); |
| 286 | if ( (!write) || r) { |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 287 | mutex_unlock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 288 | return r; |
| 289 | } |
| 290 | if (filp && filp->f_dentry) |
| 291 | { |
| 292 | if (!strcmp(filp->f_dentry->d_name.name, "prid")) |
| 293 | lasat_board_info.li_eeprom_info.prid = lasat_board_info.li_prid; |
| 294 | if (!strcmp(filp->f_dentry->d_name.name, "debugaccess")) |
| 295 | lasat_board_info.li_eeprom_info.debugaccess = lasat_board_info.li_debugaccess; |
| 296 | } |
Ralf Baechle | 42a3b4f | 2005-09-03 15:56:17 -0700 | [diff] [blame] | 297 | lasat_write_eeprom_info(); |
Ingo Molnar | 14cc3e2 | 2006-03-26 01:37:14 -0800 | [diff] [blame] | 298 | mutex_unlock(&lasat_info_mutex); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 299 | return 0; |
| 300 | } |
| 301 | |
| 302 | extern int lasat_boot_to_service; |
| 303 | |
| 304 | #ifdef CONFIG_SYSCTL |
| 305 | |
| 306 | static ctl_table lasat_table[] = { |
| 307 | {LASAT_CPU_HZ, "cpu-hz", &lasat_board_info.li_cpu_hz, sizeof(int), |
| 308 | 0444, NULL, &proc_dointvec, &sysctl_intvec}, |
| 309 | {LASAT_BUS_HZ, "bus-hz", &lasat_board_info.li_bus_hz, sizeof(int), |
| 310 | 0444, NULL, &proc_dointvec, &sysctl_intvec}, |
| 311 | {LASAT_MODEL, "bmid", &lasat_board_info.li_bmid, sizeof(int), |
| 312 | 0444, NULL, &proc_dointvec, &sysctl_intvec}, |
| 313 | {LASAT_PRID, "prid", &lasat_board_info.li_prid, sizeof(int), |
| 314 | 0644, NULL, &proc_lasat_eeprom_value, &sysctl_lasat_eeprom_value}, |
| 315 | #ifdef CONFIG_INET |
| 316 | {LASAT_IPADDR, "ipaddr", &lasat_board_info.li_eeprom_info.ipaddr, sizeof(int), |
| 317 | 0644, NULL, &proc_lasat_ip, &sysctl_lasat_intvec}, |
| 318 | {LASAT_NETMASK, "netmask", &lasat_board_info.li_eeprom_info.netmask, sizeof(int), |
| 319 | 0644, NULL, &proc_lasat_ip, &sysctl_lasat_intvec}, |
Ralf Baechle | 42a3b4f | 2005-09-03 15:56:17 -0700 | [diff] [blame] | 320 | {LASAT_BCAST, "bcastaddr", &lasat_bcastaddr, |
| 321 | sizeof(lasat_bcastaddr), 0600, NULL, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 322 | &proc_dostring, &sysctl_string}, |
| 323 | #endif |
| 324 | {LASAT_PASSWORD, "passwd_hash", &lasat_board_info.li_eeprom_info.passwd_hash, sizeof(lasat_board_info.li_eeprom_info.passwd_hash), |
| 325 | 0600, NULL, &proc_dolasatstring, &sysctl_lasatstring}, |
| 326 | {LASAT_SBOOT, "boot-service", &lasat_boot_to_service, sizeof(int), |
| 327 | 0644, NULL, &proc_dointvec, &sysctl_intvec}, |
| 328 | #ifdef CONFIG_DS1603 |
| 329 | {LASAT_RTC, "rtc", &rtctmp, sizeof(int), |
| 330 | 0644, NULL, &proc_dolasatrtc, &sysctl_lasat_rtc}, |
| 331 | #endif |
| 332 | {LASAT_NAMESTR, "namestr", &lasat_board_info.li_namestr, sizeof(lasat_board_info.li_namestr), |
| 333 | 0444, NULL, &proc_dostring, &sysctl_string}, |
| 334 | {LASAT_TYPESTR, "typestr", &lasat_board_info.li_typestr, sizeof(lasat_board_info.li_typestr), |
| 335 | 0444, NULL, &proc_dostring, &sysctl_string}, |
| 336 | {0} |
| 337 | }; |
| 338 | |
| 339 | #define CTL_LASAT 1 // CTL_ANY ??? |
| 340 | static ctl_table lasat_root_table[] = { |
| 341 | { CTL_LASAT, "lasat", NULL, 0, 0555, lasat_table }, |
| 342 | { 0 } |
| 343 | }; |
| 344 | |
| 345 | static int __init lasat_register_sysctl(void) |
| 346 | { |
| 347 | struct ctl_table_header *lasat_table_header; |
| 348 | |
| 349 | lasat_table_header = |
| 350 | register_sysctl_table(lasat_root_table, 0); |
| 351 | |
| 352 | return 0; |
| 353 | } |
| 354 | |
| 355 | __initcall(lasat_register_sysctl); |
| 356 | #endif /* CONFIG_SYSCTL */ |