369 struct vc_data *vc = (struct vc_data *)tty->driver_data;
370 struct console_font_op op;
371 struct kbd_struct * kbd;
372 unsigned int console;
373 unsigned char ucval;
374 void __user *up = (void __user *)arg;
375 int i, perm;
376 int ret = 0;
377
378 console = vc->vc_num;
379
380 lock_kernel();
381
382 if (!vc_cons_allocated(console)) {
383 ret = -ENOIOCTLCMD;
384 goto out;
385 }
386
387
388
389
390
391
392 perm = 0;
393 if (current->signal->tty == tty || capable(CAP_SYS_TTY_CONFIG))
394 perm = 1;
395
396 kbd = kbd_table + console;
397 switch (cmd) {
398 case TIOCLINUX:
399 return tioclinux(tty, arg);
400 case KIOCSOUND:
401 if (!perm)
402 goto eperm;
403 if (arg)
404 arg = CLOCK_TICK_RATE / arg;
405 kd_mksound(arg, 0);
406 break;
407
408 case KDMKTONE:
409 if (!perm)