type stringclasses 5
values | content stringlengths 9 163k |
|---|---|
functions | int msm_batt_modify_client(u32 client_handle, u32 desired_batt_voltage,
u32 voltage_direction, u32 batt_cb_id, u32 cb_data)
{
int rc;
struct batt_modify_client_req req;
struct batt_modify_client_rep rep;
req.client_handle = client_handle;
req.desired_batt_voltage = desired_batt_voltage;
req.voltage_direc... |
functions | void msm_batt_early_suspend(struct early_suspend *h)
{
int rc;
pr_debug("%s: enter\n", __func__);
if (msm_batt_info.batt_handle != INVALID_BATT_HANDLE) {
rc = msm_batt_modify_client(msm_batt_info.batt_handle,
BATTERY_LOW, BATTERY_VOLTAGE_BELOW_THIS_LEVEL,
BATTERY_CB_ID_LOW_VOL, BATTERY_LOW);
if (rc < ... |
functions | void msm_batt_late_resume(struct early_suspend *h)
{
int rc;
pr_debug("%s: enter\n", __func__);
if (msm_batt_info.batt_handle != INVALID_BATT_HANDLE) {
rc = msm_batt_modify_client(msm_batt_info.batt_handle,
BATTERY_LOW, BATTERY_ALL_ACTIVITY,
BATTERY_CB_ID_ALL_ACTIV, BATTERY_ALL_ACTIVITY);
if (rc ... |
functions | int msm_batt_filter_arg_func(struct msm_rpc_client *batt_client,
void *buf, void *data)
{
struct msm_batt_vbatt_filter_req *vbatt_filter_req =
(struct msm_batt_vbatt_filter_req *)data;
u32 *req = (u32 *)buf;
int size = 0;
*req = cpu_to_be32(vbatt_filter_req->batt_handle);
size += sizeof(u32);
req++;
*req ... |
functions | int msm_batt_filter_ret_func(struct msm_rpc_client *batt_client,
void *buf, void *data)
{
struct msm_batt_vbatt_filter_rep *data_ptr, *buf_ptr;
data_ptr = (struct msm_batt_vbatt_filter_rep *)data;
buf_ptr = (struct msm_batt_vbatt_filter_rep *)buf;
data_ptr->result = be32_to_cpu(buf_ptr->result);
retu... |
functions | int msm_batt_enable_filter(u32 vbatt_filter)
{
int rc;
struct msm_batt_vbatt_filter_req vbatt_filter_req;
struct msm_batt_vbatt_filter_rep vbatt_filter_rep;
vbatt_filter_req.batt_handle = msm_batt_info.batt_handle;
vbatt_filter_req.enable_filter = 1;
vbatt_filter_req.vbatt_filter = vbatt_filter;
rc = msm_r... |
functions | int msm_batt_register_arg_func(struct msm_rpc_client *batt_client,
void *buf, void *data)
{
struct batt_client_registration_req *batt_reg_req =
(struct batt_client_registration_req *)data;
u32 *req = (u32 *)buf;
int size = 0;
if (msm_batt_info.batt_api_version == BATTERY_RPC_VER_4_1) {
*req = cpu_... |
functions | int msm_batt_register_ret_func(struct msm_rpc_client *batt_client,
void *buf, void *data)
{
struct batt_client_registration_rep *data_ptr, *buf_ptr;
struct batt_client_registration_rep_4_1 *data_ptr_4_1, *buf_ptr_4_1;
if (msm_batt_info.batt_api_version == BATTERY_RPC_VER_4_1) {
data_ptr_4_1 = (struct b... |
functions | int msm_batt_register(u32 desired_batt_voltage,
u32 voltage_direction, u32 batt_cb_id, u32 cb_data)
{
struct batt_client_registration_req batt_reg_req;
struct batt_client_registration_req_4_1 batt_reg_req_4_1;
struct batt_client_registration_rep batt_reg_rep;
struct batt_client_registration_rep_4_1 batt_reg... |
functions | int msm_batt_deregister_arg_func(struct msm_rpc_client *batt_client,
void *buf, void *data)
{
struct batt_client_deregister_req *deregister_req =
(struct batt_client_deregister_req *)data;
u32 *req = (u32 *)buf;
int size = 0;
*req = cpu_to_be32(deregister_req->batt_handle);
size += sizeof(u32);
re... |
functions | int msm_batt_deregister_ret_func(struct msm_rpc_client *batt_client,
void *buf, void *data)
{
struct batt_client_deregister_rep *data_ptr, *buf_ptr;
data_ptr = (struct batt_client_deregister_rep *)data;
buf_ptr = (struct batt_client_deregister_rep *)buf;
data_ptr->batt_error = be32_to_cpu(buf_ptr->batt... |
functions | int msm_batt_deregister(u32 batt_handle)
{
int rc;
struct batt_client_deregister_req req;
struct batt_client_deregister_rep rep;
req.batt_handle = batt_handle;
rc = msm_rpc_client_req(msm_batt_info.batt_client,
BATTERY_DEREGISTER_CLIENT_PROC,
msm_batt_deregister_arg_func, &req,
msm_batt_deregister_ret_f... |
functions | int msm_batt_cleanup(void)
{
int rc = 0;
#ifndef CONFIG_BATTERY_MSM_FAKE
if (msm_batt_info.batt_handle != INVALID_BATT_HANDLE) {
rc = msm_batt_deregister(msm_batt_info.batt_handle);
if (rc < 0)
pr_err("%s: FAIL: msm_batt_deregister. rc=%d\n",
__func__, rc);
} |
functions | CONFIG_BATTERY_MSM_FAKE
if (msm_batt_info.chg_ep) {
rc = msm_rpc_close(msm_batt_info.chg_ep);
if (rc < 0) {
pr_err("%s: FAIL. msm_rpc_close(chg_ep). rc=%d\n",
__func__, rc);
} |
functions | u32 msm_batt_capacity(u32 current_voltage)
{
u32 low_voltage = msm_batt_info.voltage_min_design;
u32 high_voltage = msm_batt_info.voltage_max_design;
if (current_voltage <= low_voltage)
return 0;
else if (current_voltage >= high_voltage)
return 100;
else
return (current_voltage - low_voltage) * 100
/ (hi... |
functions | int msm_batt_get_charger_api_version(void)
{
int rc ;
struct rpc_reply_hdr *reply;
struct rpc_req_chg_api_ver {
struct rpc_request_hdr hdr;
u32 more_data;
} |
functions | int msm_batt_cb_func(struct msm_rpc_client *client,
void *buffer, int in_size)
{
int rc = 0;
struct rpc_request_hdr *req;
u32 procedure;
u32 accept_status;
req = (struct rpc_request_hdr *)buffer;
procedure = be32_to_cpu(req->procedure);
switch (procedure) {
case BATTERY_CB_TYPE_PROC:
accept_status = ... |
functions | __devinit msm_batt_probe(struct platform_device *pdev)
{
int rc;
struct msm_psy_batt_pdata *pdata = pdev->dev.platform_data;
if (pdev->id != -1) {
dev_err(&pdev->dev,
"%s: MSM chipsets Can only support one"
" battery ", __func__);
return -EINVAL;
} |
functions | CONFIG_BATTERY_MSM_FAKE
if (pdata->avail_chg_sources & AC_CHG) {
#else
{
#endif
rc = power_supply_register(&pdev->dev, &msm_psy_ac);
if (rc < 0) {
dev_err(&pdev->dev,
"%s: power_supply_register failed"
" rc = %d\n", __func__, rc);
msm_batt_cleanup();
return rc;
} |
functions | __devexit msm_batt_remove(struct platform_device *pdev)
{
int rc;
rc = msm_batt_cleanup();
if (rc < 0) {
dev_err(&pdev->dev,
"%s: msm_batt_cleanup failed rc=%d\n", __func__, rc);
return rc;
} |
functions | __devinit msm_batt_init_rpc(void)
{
int rc;
#ifdef CONFIG_BATTERY_MSM_FAKE
pr_info("Faking MSM battery\n");
#else
msm_batt_info.chg_ep =
msm_rpc_connect_compatible(CHG_RPC_PROG, CHG_RPC_VER_4_1, 0);
msm_batt_info.chg_api_version = CHG_RPC_VER_4_1;
if (msm_batt_info.chg_ep == NULL) {
pr_err("%s: rpc connect ... |
functions | __init msm_batt_init(void)
{
int rc;
pr_debug("%s: enter\n", __func__);
rc = msm_batt_init_rpc();
if (rc < 0) {
pr_err("%s: FAIL: msm_batt_init_rpc. rc=%d\n", __func__, rc);
msm_batt_cleanup();
return rc;
} |
functions | __exit msm_batt_exit(void)
{
platform_driver_unregister(&msm_batt_driver);
} |
includes | #include <config.h> |
includes |
#include <stdlib.h> |
includes | #include <stdio.h> |
includes | #include <errno.h> |
includes | #include <unistd.h> |
includes | #include <sys/ioctl.h> |
includes | #include <sys/socket.h> |
includes |
#include <bluetooth/bluetooth.h> |
includes | #include <bluetooth/sdp.h> |
includes | #include <bluetooth/sdp_lib.h> |
includes |
#include <glib.h> |
includes |
#include <dbus/dbus.h> |
includes |
#include <gdbus.h> |
functions | dbus_bool_t manager_init(DBusConnection *conn, const char *path)
{
connection = conn;
snprintf(base_path, sizeof(base_path), "/org/bluez/%d", getpid());
return g_dbus_register_interface(conn, "/", MANAGER_INTERFACE,
manager_methods, manager_signals,
NULL, NULL, NULL);
} |
functions | void manager_update_adapters(void)
{
GSList *list;
char **array;
int i;
array = g_new0(char *, g_slist_length(adapters) + 1);
for (i = 0, list = adapters; list; list = list->next) {
struct btd_adapter *adapter = list->data;
array[i] = (char *) adapter_get_path(adapter);
i++;
} |
functions | void manager_set_default_adapter(int id)
{
struct btd_adapter *adapter;
const gchar *path;
default_adapter_id = id;
adapter = manager_find_adapter_by_id(id);
if (!adapter)
return;
path = adapter_get_path(adapter);
g_dbus_emit_signal(connection, "/",
MANAGER_INTERFACE,
"DefaultAdapterChanged",
DBUS... |
functions | void manager_remove_adapter(struct btd_adapter *adapter)
{
uint16_t dev_id = adapter_get_dev_id(adapter);
const gchar *path = adapter_get_path(adapter);
adapters = g_slist_remove(adapters, adapter);
manager_update_adapters();
if (default_adapter_id == dev_id || default_adapter_id < 0) {
int new_default = hci_... |
functions | void manager_cleanup(DBusConnection *conn, const char *path)
{
while (adapters) {
struct btd_adapter *adapter = adapters->data;
adapters = g_slist_remove(adapters, adapter);
adapter_remove(adapter);
btd_adapter_unref(adapter);
} |
functions | gint adapter_id_cmp(gconstpointer a, gconstpointer b)
{
struct btd_adapter *adapter = (struct btd_adapter *) a;
uint16_t id = GPOINTER_TO_UINT(b);
uint16_t dev_id = adapter_get_dev_id(adapter);
return dev_id == id ? 0 : -1;
} |
functions | gint adapter_cmp(gconstpointer a, gconstpointer b)
{
struct btd_adapter *adapter = (struct btd_adapter *) a;
const bdaddr_t *bdaddr = b;
bdaddr_t src;
adapter_get_address(adapter, &src);
return bacmp(&src, bdaddr);
} |
functions | void manager_foreach_adapter(adapter_cb func, gpointer user_data)
{
g_slist_foreach(adapters, (GFunc) func, user_data);
} |
functions | void manager_add_adapter(const char *path)
{
g_dbus_emit_signal(connection, "/",
MANAGER_INTERFACE, "AdapterAdded",
DBUS_TYPE_OBJECT_PATH, &path,
DBUS_TYPE_INVALID);
manager_update_adapters();
btd_stop_exit_timer();
} |
functions | int btd_manager_unregister_adapter(int id)
{
struct btd_adapter *adapter;
const gchar *path;
adapter = manager_find_adapter_by_id(id);
if (!adapter)
return -1;
path = adapter_get_path(adapter);
info("Unregister path: %s", path);
manager_remove_adapter(adapter);
return 0;
} |
functions | void btd_manager_set_did(uint16_t vendor, uint16_t product, uint16_t version)
{
GSList *l;
for (l = adapters; l != NULL; l = g_slist_next(l)) {
struct btd_adapter *adapter = l->data;
btd_adapter_set_did(adapter, vendor, product, version);
} |
includes |
#include <linux/syscalls.h> |
includes | #include <linux/slab.h> |
includes | #include <linux/sched.h> |
includes | #include <linux/smp_lock.h> |
includes | #include <linux/init.h> |
includes | #include <linux/kernel.h> |
includes | #include <linux/acct.h> |
includes | #include <linux/capability.h> |
includes | #include <linux/cpumask.h> |
includes | #include <linux/module.h> |
includes | #include <linux/sysfs.h> |
includes | #include <linux/seq_file.h> |
includes | #include <linux/mnt_namespace.h> |
includes | #include <linux/namei.h> |
includes | #include <linux/nsproxy.h> |
includes | #include <linux/security.h> |
includes | #include <linux/mount.h> |
includes | #include <linux/ramfs.h> |
includes | #include <linux/log2.h> |
includes | #include <linux/idr.h> |
includes | #include <linux/fs_struct.h> |
includes | #include <asm/uaccess.h> |
includes | #include <asm/unistd.h> |
defines |
#define HASH_SHIFT ilog2(PAGE_SIZE / sizeof(struct list_head)) |
defines | #define HASH_SIZE (1UL << HASH_SHIFT) |
defines |
#define MNT_WRITER_UNDERFLOW_LIMIT -(1<<16) |
structs | struct proc_fs_info {
int flag;
const char *str;
}; |
functions | long hash(struct vfsmount *mnt, struct dentry *dentry)
{
unsigned long tmp = ((unsigned long)mnt / L1_CACHE_BYTES);
tmp += ((unsigned long)dentry / L1_CACHE_BYTES);
tmp = tmp + (tmp >> HASH_SHIFT);
return tmp & (HASH_SIZE - 1);
} |
functions | int mnt_alloc_id(struct vfsmount *mnt)
{
int res;
retry:
ida_pre_get(&mnt_id_ida, GFP_KERNEL);
spin_lock(&vfsmount_lock);
res = ida_get_new_above(&mnt_id_ida, mnt_id_start, &mnt->mnt_id);
if (!res)
mnt_id_start = mnt->mnt_id + 1;
spin_unlock(&vfsmount_lock);
if (res == -EAGAIN)
goto retry;
return res;
} |
functions | void mnt_free_id(struct vfsmount *mnt)
{
int id = mnt->mnt_id;
spin_lock(&vfsmount_lock);
ida_remove(&mnt_id_ida, id);
if (mnt_id_start > id)
mnt_id_start = id;
spin_unlock(&vfsmount_lock);
} |
functions | int mnt_alloc_group_id(struct vfsmount *mnt)
{
int res;
if (!ida_pre_get(&mnt_group_ida, GFP_KERNEL))
return -ENOMEM;
res = ida_get_new_above(&mnt_group_ida,
mnt_group_start,
&mnt->mnt_group_id);
if (!res)
mnt_group_start = mnt->mnt_group_id + 1;
return res;
} |
functions | void mnt_release_group_id(struct vfsmount *mnt)
{
int id = mnt->mnt_group_id;
ida_remove(&mnt_group_ida, id);
if (mnt_group_start > id)
mnt_group_start = id;
mnt->mnt_group_id = 0;
} |
functions | int __mnt_is_readonly(struct vfsmount *mnt)
{
if (mnt->mnt_flags & MNT_READONLY)
return 1;
if (mnt->mnt_sb->s_flags & MS_RDONLY)
return 1;
return 0;
} |
functions | void inc_mnt_writers(struct vfsmount *mnt)
{
#ifdef CONFIG_SMP
(*per_cpu_ptr(mnt->mnt_writers, smp_processor_id()))++;
#else
mnt->mnt_writers++;
#endif
} |
functions | void dec_mnt_writers(struct vfsmount *mnt)
{
#ifdef CONFIG_SMP
(*per_cpu_ptr(mnt->mnt_writers, smp_processor_id()))--;
#else
mnt->mnt_writers--;
#endif
} |
functions | int count_mnt_writers(struct vfsmount *mnt)
{
#ifdef CONFIG_SMP
unsigned int count = 0;
int cpu;
for_each_possible_cpu(cpu) {
count += *per_cpu_ptr(mnt->mnt_writers, cpu);
} |
functions | int mnt_want_write(struct vfsmount *mnt)
{
int ret = 0;
preempt_disable();
inc_mnt_writers(mnt);
/*
* The store to inc_mnt_writers must be visible before we pass
* MNT_WRITE_HOLD loop below, so that the slowpath can see our
* incremented count after it has set MNT_WRITE_HOLD.
*/
smp_mb();
preempt_enable(... |
functions | int mnt_clone_write(struct vfsmount *mnt)
{
/* superblock may be r/o */
if (__mnt_is_readonly(mnt))
return -EROFS;
preempt_disable();
inc_mnt_writers(mnt);
preempt_enable();
return 0;
} |
functions | int mnt_want_write_file(struct file *file)
{
struct inode *inode = file->f_dentry->d_inode;
if (!(file->f_mode & FMODE_WRITE) || special_file(inode->i_mode))
return mnt_want_write(file->f_path.mnt);
else
return mnt_clone_write(file->f_path.mnt);
} |
functions | void mnt_drop_write(struct vfsmount *mnt)
{
preempt_disable();
dec_mnt_writers(mnt);
preempt_enable();
} |
functions | int mnt_make_readonly(struct vfsmount *mnt)
{
int ret = 0;
spin_lock(&vfsmount_lock);
mnt->mnt_flags |= MNT_WRITE_HOLD;
/*
* After storing MNT_WRITE_HOLD, we'll read the counters. This store
* should be visible before we do.
*/
smp_mb();
/*
* With writers on hold, if this value is zero, then there are
... |
functions | void __mnt_unmake_readonly(struct vfsmount *mnt)
{
spin_lock(&vfsmount_lock);
mnt->mnt_flags &= ~MNT_READONLY;
spin_unlock(&vfsmount_lock);
} |
functions | void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb)
{
mnt->mnt_sb = sb;
mnt->mnt_root = dget(sb->s_root);
} |
functions | void free_vfsmnt(struct vfsmount *mnt)
{
kfree(mnt->mnt_devname);
mnt_free_id(mnt);
#ifdef CONFIG_SMP
free_percpu(mnt->mnt_writers);
#endif
kmem_cache_free(mnt_cache, mnt);
} |
functions | int check_mnt(struct vfsmount *mnt)
{
return mnt->mnt_ns == current->nsproxy->mnt_ns;
} |
functions | void touch_mnt_namespace(struct mnt_namespace *ns)
{
if (ns) {
ns->event = ++event;
wake_up_interruptible(&ns->poll);
} |
functions | void __touch_mnt_namespace(struct mnt_namespace *ns)
{
if (ns && ns->event != event) {
ns->event = event;
wake_up_interruptible(&ns->poll);
} |
functions | void detach_mnt(struct vfsmount *mnt, struct path *old_path)
{
old_path->dentry = mnt->mnt_mountpoint;
old_path->mnt = mnt->mnt_parent;
mnt->mnt_parent = mnt;
mnt->mnt_mountpoint = mnt->mnt_root;
list_del_init(&mnt->mnt_child);
list_del_init(&mnt->mnt_hash);
old_path->dentry->d_mounted--;
} |
functions | void mnt_set_mountpoint(struct vfsmount *mnt, struct dentry *dentry,
struct vfsmount *child_mnt)
{
child_mnt->mnt_parent = mntget(mnt);
child_mnt->mnt_mountpoint = dget(dentry);
dentry->d_mounted++;
} |
functions | void attach_mnt(struct vfsmount *mnt, struct path *path)
{
mnt_set_mountpoint(path->mnt, path->dentry, mnt);
list_add_tail(&mnt->mnt_hash, mount_hashtable +
hash(path->mnt, path->dentry));
list_add_tail(&mnt->mnt_child, &path->mnt->mnt_mounts);
} |
functions | void commit_tree(struct vfsmount *mnt)
{
struct vfsmount *parent = mnt->mnt_parent;
struct vfsmount *m;
LIST_HEAD(head);
struct mnt_namespace *n = parent->mnt_ns;
BUG_ON(parent == mnt);
list_add_tail(&head, &mnt->mnt_list);
list_for_each_entry(m, &head, mnt_list)
m->mnt_ns = n;
list_splice(&head, n->list.pr... |
functions | void __mntput(struct vfsmount *mnt)
{
struct super_block *sb = mnt->mnt_sb;
/*
* This probably indicates that somebody messed
* up a mnt_want/drop_write() pair. If this
* happens, the filesystem was probably unable
* to make r/w->r/o transitions.
*/
/*
* atomic_dec_and_lock() used to deal with ->mnt_cou... |
functions | void mntput_no_expire(struct vfsmount *mnt)
{
repeat:
if (atomic_dec_and_lock(&mnt->mnt_count, &vfsmount_lock)) {
if (likely(!mnt->mnt_pinned)) {
spin_unlock(&vfsmount_lock);
__mntput(mnt);
return;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.