type
stringclasses
5 values
content
stringlengths
9
163k
defines
#define MAX_CMDLINECONSOLES 8
defines
#define PRINTK_BUF_SIZE 512
defines
#define PRINTK_PENDING_WAKEUP 0x01
defines
#define PRINTK_PENDING_SCHED 0x02
structs
struct console_cmdline { char name[16]; /* Name of the driver */ int index; /* Minor dev. to use */ char *options; /* Options for the driver */ #ifdef CONFIG_A11Y_BRAILLE_CONSOLE char *brl_options; /* Options for braille driver */ #endif };
functions
void log_buf_kexec_setup(void) { VMCOREINFO_SYMBOL(log_buf); VMCOREINFO_SYMBOL(log_end); VMCOREINFO_SYMBOL(log_buf_len); VMCOREINFO_SYMBOL(logged_chars); }
functions
__init log_buf_len_setup(char *str) { unsigned size = memparse(str, &str); if (size) size = roundup_pow_of_two(size); if (size > log_buf_len) new_log_buf_len = size; return 0; }
functions
__init setup_log_buf(int early) { unsigned long flags; unsigned start, dest_idx, offset; char *new_log_buf; int free; if (!new_log_buf_len) return; if (early) { unsigned long mem; mem = memblock_alloc(new_log_buf_len, PAGE_SIZE); if (!mem) return; new_log_buf = __va(mem); }
functions
__init boot_delay_setup(char *str) { unsigned long lpj; lpj = preset_lpj ? preset_lpj : 1000000; /* some guess */ loops_per_msec = (unsigned long long)lpj / 1000 * HZ; get_option(&str, &boot_delay); if (boot_delay > 10 * 1000) boot_delay = 0; pr_debug("boot_delay: %u, preset_lpj: %ld, lpj: %lu, " "HZ: %d, ...
functions
void boot_delay_msec(void) { unsigned long long k; unsigned long timeout; if (boot_delay == 0 || system_state != SYSTEM_BOOTING) return; k = (unsigned long long)loops_per_msec * boot_delay; timeout = jiffies + msecs_to_jiffies(boot_delay); while (k) { k--; cpu_relax(); /* * use (volatile) jiffies to...
functions
void boot_delay_msec(void) { }
functions
int syslog_action_restricted(int type) { if (dmesg_restrict) return 1; /* Unless restricted, we allow "read all" and "get buffer size" for everybody */ return type != SYSLOG_ACTION_READ_ALL && type != SYSLOG_ACTION_SIZE_BUFFER; }
functions
int check_syslog_permissions(int type, bool from_file) { /* * If this is from /proc/kmsg and we've already opened it, then we've * already done the capabilities checks at open time. */ if (from_file && type != SYSLOG_ACTION_OPEN) return 0; if (syslog_action_restricted(type)) { if (capable(CAP_SYSLOG)) ...
functions
int do_syslog(int type, char __user *buf, int len, bool from_file) { unsigned i, j, limit, count; int do_clear = 0; char c; int error; error = check_syslog_permissions(type, from_file); if (error) goto out; error = security_syslog(type); if (error) return error; switch (type) { case SYSLOG_ACTION_CLOSE...
functions
void kdb_syslog_data(char *syslog_data[4]) { syslog_data[0] = log_buf; syslog_data[1] = log_buf + log_buf_len; syslog_data[2] = log_buf + log_end - (logged_chars < log_buf_len ? logged_chars : log_buf_len); syslog_data[3] = log_buf + log_end; }
functions
void __call_console_drivers(unsigned start, unsigned end) { struct console *con; for_each_console(con) { if (exclusive_console && con != exclusive_console) continue; if ((con->flags & CON_ENABLED) && con->write && (cpu_online(smp_processor_id()) || (con->flags & CON_ANYTIME))) con->write(con, &LOG_...
functions
__init ignore_loglevel_setup(char *str) { ignore_loglevel = 1; printk(KERN_INFO "debug: ignoring loglevel setting.\n"); return 0; }
functions
void _call_console_drivers(unsigned start, unsigned end, int msg_log_level) { trace_console(&LOG_BUF(0), start, end, log_buf_len); if ((msg_log_level < console_loglevel || ignore_loglevel) && console_drivers && start != end) { if ((start & LOG_BUF_MASK) > (end & LOG_BUF_MASK)) { /* wrapped write */ __...
functions
size_t log_prefix(const char *p, unsigned int *level, char *special) { unsigned int lev = 0; char sp = '\0'; size_t len; if (p[0] != '<' || !p[1]) return 0; if (p[2] == '>') { /* usual single digit level number or special char */ switch (p[1]) { case '0' ... '7': lev = p[1] - '0'; break; case 'c':...
functions
void call_console_drivers(unsigned start, unsigned end) { unsigned cur_index, start_print; static int msg_level = -1; BUG_ON(((int)(start - end)) > 0); cur_index = start; start_print = start; while (cur_index != end) { if (msg_level < 0 && ((end - cur_index) > 2)) { /* * prepare buf_prefix, as a contig...
functions
void emit_log_char(char c) { LOG_BUF(log_end) = c; log_end++; if (log_end - log_start > log_buf_len) log_start = log_end - log_buf_len; if (log_end - con_start > log_buf_len) con_start = log_end - log_buf_len; if (logged_chars < log_buf_len) logged_chars++; }
functions
void zap_locks(void) { static unsigned long oops_timestamp; if (time_after_eq(jiffies, oops_timestamp) && !time_after(jiffies, oops_timestamp + 30 * HZ)) return; oops_timestamp = jiffies; debug_locks_off(); /* If a crash is occurring, make sure we can't deadlock */ raw_spin_lock_init(&logbuf_lock); /* An...
functions
int have_callable_console(void) { struct console *con; for_each_console(con) if (con->flags & CON_ANYTIME) return 1; return 0; }
functions
int printk(const char *fmt, ...) { va_list args; int r; #ifdef CONFIG_MSM_RTB void *caller = __builtin_return_address(0); uncached_logk_pc(LOGK_LOGBUF, caller, (void *)log_end); #endif #ifdef CONFIG_KGDB_KDB if (unlikely(kdb_trap_printk)) { va_start(args, fmt); r = vkdb_printf(fmt, args); va_end(args); r...
functions
int can_use_console(unsigned int cpu) { return cpu_online(cpu) || have_callable_console(); }
functions
void printk_delay(void) { if (unlikely(printk_delay_msec)) { int m = printk_delay_msec; while (m--) { mdelay(1); touch_nmi_watchdog(); }
functions
int vprintk(const char *fmt, va_list args) { int printed_len = 0; int current_log_level = default_message_loglevel; unsigned long flags; int this_cpu; char *p; size_t plen; char special; boot_delay_msec(); printk_delay(); /* This stops the holder of console_sem just where we want him */ local_irq_save(flag...
functions
void call_console_drivers(unsigned start, unsigned end) { }
functions
int __add_preferred_console(char *name, int idx, char *options, char *brl_options) { struct console_cmdline *c; int i; /* * See if this tty is not yet registered, and * if we have a slot free. */ for (i = 0; i < MAX_CMDLINECONSOLES && console_cmdline[i].name[0]; i++) if (strcmp(console_cmdline[i].na...
functions
__init console_setup(char *str) { char buf[sizeof(console_cmdline[0].name) + 4]; /* 4 for index */ char *s, *options, *brl_options = NULL; int idx; #ifdef CONFIG_A11Y_BRAILLE_CONSOLE if (!memcmp(str, "brl,", 4)) { brl_options = ""; str += 4; }
functions
int add_preferred_console(char *name, int idx, char *options) { return __add_preferred_console(name, idx, options, NULL); }
functions
int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options) { struct console_cmdline *c; int i; for (i = 0; i < MAX_CMDLINECONSOLES && console_cmdline[i].name[0]; i++) if (strcmp(console_cmdline[i].name, name) == 0 && console_cmdline[i].index == idx) { c = &console_cmdline...
functions
__init console_suspend_disable(char *str) { console_suspend_enabled = 0; return 1; }
functions
int is_console_suspended(void) { return console_suspended; }
functions
void suspend_console(void) { if (!console_suspend_enabled) return; printk("Suspending console(s) (use no_console_suspend to debug)\n"); console_lock(); console_suspended = 1; up(&console_sem); }
functions
void resume_console(void) { if (!console_suspend_enabled) return; down(&console_sem); console_suspended = 0; console_unlock(); }
functions
__cpuinit console_flush(struct work_struct *work) { console_lock(); console_unlock(); }
functions
__cpuinit console_cpu_notify(struct notifier_block *self, unsigned long action, void *hcpu) { switch (action) { case CPU_DEAD: case CPU_DOWN_FAILED: case CPU_UP_CANCELED: console_lock(); console_unlock(); break; case CPU_ONLINE: case CPU_DYING: /* invoked with preemption disabled, so defer */ if (!cons...
functions
void console_lock(void) { BUG_ON(in_interrupt()); down(&console_sem); if (console_suspended) return; console_locked = 1; console_may_schedule = 1; }
functions
int console_trylock(void) { if (down_trylock(&console_sem)) return 0; if (console_suspended) { up(&console_sem); return 0; }
functions
int is_console_locked(void) { return console_locked; }
functions
void printk_tick(void) { if (__this_cpu_read(printk_pending)) { int pending = __this_cpu_xchg(printk_pending, 0); if (pending & PRINTK_PENDING_SCHED) { char *buf = __get_cpu_var(printk_sched_buf); printk(KERN_WARNING "[sched_delayed] %s", buf); }
functions
int printk_needs_cpu(int cpu) { if (cpu_is_offline(cpu)) printk_tick(); return __this_cpu_read(printk_pending); }
functions
void wake_up_klogd(void) { if (waitqueue_active(&log_wait)) this_cpu_or(printk_pending, PRINTK_PENDING_WAKEUP); }
functions
void console_unlock(void) { unsigned long flags; unsigned _con_start, _log_end; unsigned wake_klogd = 0, retry = 0; if (console_suspended) { up(&console_sem); return; }
functions
__sched console_conditional_schedule(void) { if (console_may_schedule) cond_resched(); }
functions
void console_unblank(void) { struct console *c; /* * console_unblank can no longer be called in interrupt context unless * oops_in_progress is set to 1.. */ if (oops_in_progress) { if (down_trylock(&console_sem) != 0) return; }
functions
void console_stop(struct console *console) { console_lock(); console->flags &= ~CON_ENABLED; console_unlock(); }
functions
void console_start(struct console *console) { console_lock(); console->flags |= CON_ENABLED; console_unlock(); }
functions
__init keep_bootcon_setup(char *str) { keep_bootcon = 1; printk(KERN_INFO "debug: skip boot console de-registration.\n"); return 0; }
functions
void register_console(struct console *newcon) { int i; unsigned long flags; struct console *bcon = NULL; /* * before we register a new CON_BOOT console, make sure we don't * already have a valid console */ if (console_drivers && newcon->flags & CON_BOOT) { /* find the last or real console */ for_each_co...
functions
CONFIG_A11Y_BRAILLE_CONSOLE if (console_cmdline[i].brl_options) { newcon->flags |= CON_BRL; braille_register_console(newcon, console_cmdline[i].index, console_cmdline[i].options, console_cmdline[i].brl_options); return; }
functions
int unregister_console(struct console *console) { struct console *a, *b; int res = 1; #ifdef CONFIG_A11Y_BRAILLE_CONSOLE if (console->flags & CON_BRL) return braille_unregister_console(console); #endif console_lock(); if (console_drivers == console) { console_drivers=console->next; res = 0; }
functions
else if (console_drivers) { for (a=console_drivers->next, b=console_drivers ; a; b=a, a=b->next) { if (a == console) { b->next = a->next; res = 0; break; }
functions
__init printk_late_init(void) { struct console *con; for_each_console(con) { if (!keep_bootcon && con->flags & CON_BOOT) { printk(KERN_INFO "turn off boot console %s%d\n", con->name, con->index); unregister_console(con); }
functions
int printk_deferred(const char *fmt, ...) { unsigned long flags; va_list args; char *buf; int r; local_irq_save(flags); buf = __get_cpu_var(printk_sched_buf); va_start(args, fmt); r = vsnprintf(buf, PRINTK_BUF_SIZE, fmt, args); va_end(args); __this_cpu_or(printk_pending, PRINTK_PENDING_SCHED); local_irq_r...
functions
int __printk_ratelimit(const char *func) { return ___ratelimit(&printk_ratelimit_state, func); }
functions
bool printk_timed_ratelimit(unsigned long *caller_jiffies, unsigned int interval_msecs) { if (*caller_jiffies == 0 || !time_in_range(jiffies, *caller_jiffies, *caller_jiffies + msecs_to_jiffies(interval_msecs))) { *caller_jiffies = jiffies; return true; }
functions
int kmsg_dump_register(struct kmsg_dumper *dumper) { unsigned long flags; int err = -EBUSY; /* The dump callback needs to be set */ if (!dumper->dump) return -EINVAL; spin_lock_irqsave(&dump_list_lock, flags); /* Don't allow registering multiple times */ if (!dumper->registered) { dumper->registered = 1; ...
functions
int kmsg_dump_unregister(struct kmsg_dumper *dumper) { unsigned long flags; int err = -EINVAL; spin_lock_irqsave(&dump_list_lock, flags); if (dumper->registered) { dumper->registered = 0; list_del_rcu(&dumper->list); err = 0; }
functions
void kmsg_dump(enum kmsg_dump_reason reason) { unsigned long end; unsigned chars; struct kmsg_dumper *dumper; const char *s1, *s2; unsigned long l1, l2; unsigned long flags; if ((reason > KMSG_DUMP_OOPS) && !always_kmsg_dump) return; /* Theoretically, the log could move on after we do this, but there's ...
includes
#include <glib/gi18n.h>
includes
#include <NetworkManager.h>
includes
#include <net/if_arp.h>
structs
struct _CEPageWifi { GtkGrid parent; GtkComboBoxText *bssid_combo; GtkComboBoxText *cloned_mac_combo; GtkComboBoxText *mac_combo; GtkEntry *ssid_entry; NMClient *client; NMSettingWireless *setting; };
functions
void connect_wifi_page (CEPageWifi *self) { GBytes *ssid; g_autofree gchar *utf8_ssid = NULL; GPtrArray *bssid_array; gchar **bssid_list; const char *s_bssid_str; gchar **mac_list; const gchar *s_mac_str; const gchar *cloned_mac; gint i; s...
functions
void ui_to_setting (CEPageWifi *self) { g_autoptr(GBytes) ssid = NULL; const gchar *utf8_ssid, *bssid; GtkWidget *entry; g_autofree gchar *device_mac = NULL; g_autofree gchar *cloned_mac = NULL; utf8_ssid = gtk_entry_get_text (self->ssid_entry); if (!utf8_ssid ||...
functions
gboolean ce_page_wifi_class_validate (CEPage *parent, NMConnection *connection, GError **error) { CEPageWifi *self = (CEPageWifi *) parent; GtkWidget *entry; gboolean ret = TRUE; entry = gtk_bin_get_child (GTK_BIN (...
functions
void ce_page_wifi_init (CEPageWifi *self) { gtk_widget_init_template (GTK_WIDGET (self)); }
functions
void ce_page_wifi_class_init (CEPageWifiClass *klass) { GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/network/wifi-page.ui"); gtk_widget_class_bind_template_child (widget_class, CEPageWifi, bssid_c...
functions
void ce_page_iface_init (CEPageInterface *iface) { iface->get_title = ce_page_wifi_get_title; iface->validate = ce_page_wifi_class_validate; }
includes
#include <linux/kernel.h>
includes
#include <linux/errno.h>
includes
#include <linux/module.h>
includes
#include <linux/moduleparam.h>
includes
#include <linux/completion.h>
includes
#include <linux/sched.h>
includes
#include <linux/list.h>
includes
#include <linux/slab.h>
includes
#include <linux/ioctl.h>
includes
#include <linux/usb.h>
includes
#include <linux/usbdevice_fs.h>
includes
#include <linux/usb/hcd.h>
includes
#include <linux/kthread.h>
includes
#include <linux/mutex.h>
includes
#include <linux/freezer.h>
includes
#include <asm/uaccess.h>
includes
#include <asm/byteorder.h>
defines
#define CONFIG_USB_ANNOUNCE_NEW_DEVICES
defines
#define HUB_DEBOUNCE_TIMEOUT 1500
defines
#define HUB_DEBOUNCE_STEP 25
defines
#define HUB_DEBOUNCE_STABLE 100
defines
#define LED_CYCLE_PERIOD ((2*HZ)/3)
defines
#define USB_STS_TIMEOUT 1000
defines
#define USB_STS_RETRIES 5
defines
#define PORT_RESET_TRIES 5
defines
#define SET_ADDRESS_TRIES 2
defines
#define GET_DESCRIPTOR_TRIES 2
defines
#define SET_CONFIG_TRIES (2 * (use_both_schemes + 1))
defines
#define USE_NEW_SCHEME(i) ((i) / 2 == old_scheme_first)