type stringclasses 5
values | content stringlengths 9 163k |
|---|---|
functions | int usb_hub_init(void)
{
if (usb_register(&hub_driver) < 0) {
printk(KERN_ERR "%s: can't register hub driver\n",
usbcore_name);
return -1;
} |
functions | void usb_hub_cleanup(void)
{
kthread_stop(khubd_task);
/*
* Hub resources are freed for us by usb_deregister. It calls
* usb_driver_purge on every device which in turn calls that
* devices disconnect function if it is using this driver.
* The hub_disconnect function takes care of releasing the
* individual... |
functions | int descriptors_changed(struct usb_device *udev,
struct usb_device_descriptor *old_device_descriptor)
{
int changed = 0;
unsigned index;
unsigned serial_len = 0;
unsigned len;
unsigned old_length;
int length;
char *buf;
if (memcmp(&udev->descriptor, old_device_descriptor,
sizeof(*old_device_descriptor)... |
functions | int usb_reset_and_verify_device(struct usb_device *udev)
{
struct usb_device *parent_hdev = udev->parent;
struct usb_hub *parent_hub;
struct usb_hcd *hcd = bus_to_hcd(udev->bus);
struct usb_device_descriptor descriptor = udev->descriptor;
int i, ret = 0;
int port1 = udev->portnum;
if (udev->state ==... |
functions | int usb_reset_device(struct usb_device *udev)
{
int ret;
int i;
struct usb_host_config *config = udev->actconfig;
if (udev->state == USB_STATE_NOTATTACHED ||
udev->state == USB_STATE_SUSPENDED) {
dev_dbg(&udev->dev, "device reset not allowed in state %d\n",
udev->state);
return -EINVAL;
} |
functions | void usb_queue_reset_device(struct usb_interface *iface)
{
schedule_work(&iface->reset_ws);
} |
includes |
#include <stdio.h> |
includes | #include <stdlib.h> |
includes | #include <string.h> |
includes | #include <sys/types.h> |
includes | #include <sys/socket.h> |
includes | #include <netinet/in.h> |
includes | #include <arpa/inet.h> |
functions | int
dict_lookup (struct ip_user_dict *first_entry, char *username,
char *address)
{
/* Move the pointer to the first entry of the linked list. */
struct ip_user_dict *current_entry = first_entry;
while (current_entry->username != NULL) {
#ifdef DEBUG
printf ("user: %s\naddr: %lu\nmask: %lu\n\n",
c... |
includes |
#include <sys/syscall.h> |
includes | #include <unistd.h> |
includes | #include <limits.h> |
includes | #include <linux/limits.h> |
includes | #include <stdio.h> |
includes | #include <stdlib.h> |
includes | #include <errno.h> |
includes | #include <sgidefs.h> |
defines | #define __NR_lookup_dcookie 253 |
defines | #define __NR_lookup_dcookie 212 |
defines | #define __NR_lookup_dcookie 235 |
defines | #define __NR_lookup_dcookie 406 |
defines | #define __NR_lookup_dcookie 223 |
defines | #define __NR_lookup_dcookie 1237 |
defines | #define __NR_lookup_dcookie 208 |
defines | #define __NR_lookup_dcookie 110 |
defines | #define __NR_lookup_dcookie (__NR_SYSCALL_BASE+249) |
defines | #define __NR_lookup_dcookie 4247 |
defines | #define __NR_lookup_dcookie 5206 |
defines | #define __NR_lookup_dcookie 6206 |
defines |
#define HASH_SIZE 512 |
defines | #define HASH_BITS (HASH_SIZE - 1) |
structs | struct cookie_entry {
cookie_t value;
char * name;
int ignored;
struct list_head list;
}; |
functions | int lookup_dcookie(cookie_t cookie, char * buf, size_t size)
{
return syscall(__NR_lookup_dcookie, (unsigned long)(cookie >> 32),
(unsigned long)(cookie & 0xffffffff), buf, size);
} |
functions | int lookup_dcookie(cookie_t cookie, char * buf, size_t size)
{
return syscall(__NR_lookup_dcookie, cookie, buf, size);
} |
functions | long hash_cookie(cookie_t cookie)
{
return (cookie >> DCOOKIE_SHIFT) & (HASH_SIZE - 1);
} |
functions | int is_cookie_ignored(cookie_t cookie)
{
unsigned long hash = hash_cookie(cookie);
struct list_head * pos;
struct cookie_entry * entry;
if (cookie == INVALID_COOKIE || cookie == NO_COOKIE)
return 1;
list_for_each(pos, &hashes[hash]) {
entry = list_entry(pos, struct cookie_entry, list);
if (entry->value == ... |
functions | void cookie_init(void)
{
size_t i;
for (i = 0; i < HASH_SIZE; ++i)
list_init(&hashes[i]);
} |
includes |
#include <linux/kernel.h> |
includes | #include <linux/module.h> |
includes | #include <linux/uaccess.h> |
includes | #include <linux/module.h> |
includes | #include <linux/fs.h> |
includes | #include <linux/delay.h> |
includes | #include <linux/list.h> |
includes | #include <linux/io.h> |
includes | #include <linux/kthread.h> |
includes | #include <linux/time.h> |
includes | #include <linux/wakelock.h> |
includes | #include <linux/suspend.h> |
includes | #include <linux/mutex.h> |
includes | #include <linux/slab.h> |
includes | #include <linux/spinlock.h> |
includes | #include <linux/device.h> |
includes | #include <linux/idr.h> |
includes | #include <linux/debugfs.h> |
includes | #include <linux/miscdevice.h> |
includes | #include <linux/interrupt.h> |
includes | #include <linux/of_gpio.h> |
includes |
#include <asm/current.h> |
includes |
#include <mach/socinfo.h> |
includes | #include <mach/subsystem_notif.h> |
includes | #include <mach/subsystem_restart.h> |
includes | #include <mach/lge_handle_panic.h> |
defines |
#define pr_fmt(fmt) "subsys-restart: %s(): " fmt, __func__ |
defines |
#define DEFINE_SINGLE_RESTART_ORDER(name, order) \ |
structs | struct subsys_tracking {
enum p_subsys_state p_state;
spinlock_t s_lock;
enum subsys_state state;
struct mutex lock;
}; |
structs | struct subsys_soc_restart_order {
const char * const *subsystem_list;
int count;
struct subsys_tracking track;
struct subsys_device *subsys_ptrs[];
}; |
structs | struct restart_log {
struct timeval time;
struct subsys_device *dev;
struct list_head list;
}; |
structs | struct subsys_device {
struct subsys_desc *desc;
struct wake_lock wake_lock;
char wlname[64];
struct work_struct work;
struct subsys_tracking track;
void *notify;
struct device dev;
struct module *owner;
int count;
int id;
int restart_level;
struct subsys_soc_restart_order *restart_order;
#ifdef CONFIG_DE... |
functions | ssize_t name_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
return snprintf(buf, PAGE_SIZE, "%s\n", to_subsys(dev)->desc->name);
} |
functions | ssize_t state_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
enum subsys_state state = to_subsys(dev)->track.state;
return snprintf(buf, PAGE_SIZE, "%s\n", subsys_states[state]);
} |
functions | ssize_t
restart_level_show(struct device *dev, struct device_attribute *attr, char *buf)
{
int level = to_subsys(dev)->restart_level;
return snprintf(buf, PAGE_SIZE, "%s\n", restart_levels[level]);
} |
functions | ssize_t restart_level_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
struct subsys_device *subsys = to_subsys(dev);
int i;
const char *p;
p = memchr(buf, '\n', count);
if (p)
count = p - buf;
for (i = 0; i < ARRAY_SIZE(restart_levels); i++)
if (!strncasecmp(buf, ... |
functions | int subsys_get_restart_level(struct subsys_device *dev)
{
return dev->restart_level;
} |
functions | void subsys_set_state(struct subsys_device *subsys,
enum subsys_state state)
{
unsigned long flags;
spin_lock_irqsave(&subsys->track.s_lock, flags);
if (subsys->track.state != state) {
subsys->track.state = state;
spin_unlock_irqrestore(&subsys->track.s_lock, flags);
sysfs_notify(&subsys->dev.kobj, NU... |
functions | void subsys_default_online(struct subsys_device *dev)
{
subsys_set_state(dev, SUBSYS_ONLINE);
} |
functions | void do_epoch_check(struct subsys_device *dev)
{
int n = 0;
struct timeval *time_first = NULL, *curr_time;
struct restart_log *r_log, *temp;
static int max_restarts_check;
static long max_history_time_check;
mutex_lock(&restart_log_mutex);
max_restarts_check = max_restarts;
max_history_time_check = max_histor... |
functions | void notify_each_subsys_device(struct subsys_device **list,
unsigned count,
enum subsys_notif_type notif, void *data)
{
while (count--) {
enum subsys_notif_type type = (enum subsys_notif_type)type;
struct subsys_device *dev = *list++;
if (!dev)
continue;
subsys_notif_queue_notification(dev->notify, noti... |
functions | int wait_for_err_ready(struct subsys_device *subsys)
{
int ret;
if (!subsys->desc->err_ready_irq || enable_debug == 1)
return 0;
ret = wait_for_completion_timeout(&subsys->err_ready,
msecs_to_jiffies(10000));
if (!ret) {
pr_err("[%s]: Error ready timed out\n", subsys->desc->name);
return -ETIMEDOUT;
... |
functions | void subsystem_shutdown(struct subsys_device *dev, void *data)
{
const char *name = dev->desc->name;
pr_info("[%p]: Shutting down %s\n", current, name);
if (dev->desc->shutdown(dev->desc) < 0) {
#ifdef CONFIG_LGE_HANDLE_PANIC
lge_set_magic_subsystem(name, LGE_ERR_SUB_SD);
#endif
panic("subsys-restart: [%p]: Fai... |
functions | void subsystem_ramdump(struct subsys_device *dev, void *data)
{
const char *name = dev->desc->name;
if (dev->desc->ramdump)
if (dev->desc->ramdump(enable_ramdumps, dev->desc) < 0)
pr_warn("%s[%p]: Ramdump failed.\n", name, current);
dev->do_ramdump_on_put = false;
} |
functions | void subsystem_powerup(struct subsys_device *dev, void *data)
{
const char *name = dev->desc->name;
int ret;
pr_info("[%p]: Powering up %s\n", current, name);
init_completion(&dev->err_ready);
if (dev->desc->powerup(dev->desc) < 0) {
#ifdef CONFIG_LGE_HANDLE_PANIC
lge_set_magic_subsystem(name, LGE_ERR_SUB_PWR);... |
functions | int __find_subsys(struct device *dev, void *data)
{
struct subsys_device *subsys = to_subsys(dev);
return !strcmp(subsys->desc->name, data);
} |
functions | int subsys_start(struct subsys_device *subsys)
{
int ret;
init_completion(&subsys->err_ready);
ret = subsys->desc->start(subsys->desc);
if (ret)
return ret;
if (subsys->desc->is_not_loadable) {
subsys_set_state(subsys, SUBSYS_ONLINE);
return 0;
} |
functions | void subsys_stop(struct subsys_device *subsys)
{
subsys->desc->stop(subsys->desc);
subsys_set_state(subsys, SUBSYS_OFFLINE);
} |
functions | void subsystem_put(void *subsystem)
{
struct subsys_device *subsys_d, *subsys = subsystem;
struct subsys_tracking *track;
if (IS_ERR_OR_NULL(subsys))
return;
track = subsys_get_track(subsys);
mutex_lock(&track->lock);
if (WARN(!subsys->count, "%s: %s: Reference count mismatch\n",
subsys->desc->name, __func... |
functions | void subsystem_restart_wq_func(struct work_struct *work)
{
struct subsys_device *dev = container_of(work,
struct subsys_device, work);
struct subsys_device **list;
struct subsys_desc *desc = dev->desc;
struct subsys_soc_restart_order *order = dev->restart_order;
struct subsys_tracking *track;
unsigned count... |
functions | void __subsystem_restart_dev(struct subsys_device *dev)
{
struct subsys_desc *desc = dev->desc;
const char *name = dev->desc->name;
struct subsys_tracking *track;
unsigned long flags;
pr_debug("Restarting %s [level=%s]!\n", desc->name,
restart_levels[dev->restart_level]);
track = subsys_get_track(dev);
/*
... |
functions | int subsystem_restart_dev(struct subsys_device *dev)
{
const char *name;
#ifdef CONFIG_LGE_HANDLE_PANIC
int saved_restart_level = dev->restart_level;
#endif
if (!get_device(&dev->dev))
return -ENODEV;
if (!try_module_get(dev->owner)) {
put_device(&dev->dev);
return -ENODEV;
} |
functions | int subsystem_restart(const char *name)
{
int ret;
struct subsys_device *dev = find_subsys(name);
if (!dev)
return -ENODEV;
ret = subsystem_restart_dev(dev);
put_device(&dev->dev);
return ret;
} |
functions | int subsys_modem_restart(void)
{
int ret;
int rsl;
struct subsys_tracking *track;
struct subsys_device *dev = find_subsys("modem");
if (!dev)
return -ENODEV;
track = subsys_get_track(dev);
if (dev->track.state != SUBSYS_ONLINE ||
track->p_state != SUBSYS_NORMAL)
return -ENODEV;
rsl = dev->restart_lev... |
functions | int subsystem_crashed(const char *name)
{
struct subsys_device *dev = find_subsys(name);
struct subsys_tracking *track;
if (!dev)
return -ENODEV;
if (!get_device(&dev->dev))
return -ENODEV;
track = subsys_get_track(dev);
mutex_lock(&track->lock);
dev->do_ramdump_on_put = true;
/*
* TODO: Make this wor... |
functions | void subsys_set_crash_status(struct subsys_device *dev, bool crashed)
{
dev->crashed = true;
} |
functions | bool subsys_get_crash_status(struct subsys_device *dev)
{
return dev->crashed;
} |
functions | ssize_t subsys_debugfs_read(struct file *filp, char __user *ubuf,
size_t cnt, loff_t *ppos)
{
int r;
char buf[40];
struct subsys_device *subsys = filp->private_data;
r = snprintf(buf, sizeof(buf), "%d\n", subsys->count);
return simple_read_from_buffer(ubuf, cnt, ppos, buf, r);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.