Пример #1
0
static int hcismd_set_enable(const char *val, struct kernel_param *kp)
{
#if 1 /* HTC_BT modify */
	/* note: add get parameter value feature */
	int ret = 0;
	unsigned long enable;

	ret = strict_strtoul(val, 10, &enable);
	if (ret)
		return ret;

	if ( hcismd_set == enable )
		return 0;

	mutex_lock(&hci_smd_enable);

	switch (enable) {

	case 1:
		if (0 == hci_smd_register_dev(&hs))
			hcismd_set = 1;
	break;
	case 0:
		hci_smd_deregister_dev(&hs);
		hcismd_set = 0;
	break;
	default:
		ret = -EFAULT;
	}

	mutex_unlock(&hci_smd_enable);
	return ret;
#else /* QCT original */
	int ret = 0;

	mutex_lock(&hci_smd_enable);

	ret = param_set_int(val, kp);

	if (ret)
		goto done;

	switch (hcismd_set) {

	case 1:
		hci_smd_register_dev(&hs);
	break;
	case 0:
		hci_smd_deregister_dev(&hs);
	break;
	default:
		ret = -EFAULT;
	}

done:
	mutex_unlock(&hci_smd_enable);
	return ret;
#endif /* HTC_BT modify */
}
Пример #2
0
static int hcismd_set_enable(const char *val, struct kernel_param *kp)
{
#if 1 
	
	int ret = 0;
	unsigned long enable;

	ret = strict_strtoul(val, 10, &enable);
	if (ret)
		return ret;

	if ( hcismd_set == enable )
		return 0;

	mutex_lock(&hci_smd_enable);

	switch (enable) {

	case 1:
		if (0 == hci_smd_register_smd(&hs))
			hcismd_set = 1;
	break;
	case 0:
		hci_smd_deregister_dev(&hs);
		hcismd_set = 0;
	break;
	default:
		ret = -EFAULT;
	}

	mutex_unlock(&hci_smd_enable);
	return ret;
#else 
	int ret = 0;

	mutex_lock(&hci_smd_enable);

	ret = param_set_int(val, kp);

	if (ret)
		goto done;

	switch (hcismd_set) {

	case 1:
		hci_smd_register_smd(&hs);
	break;
	case 0:
		hci_smd_deregister_dev(&hs);
	break;
	default:
		ret = -EFAULT;
	}

done:
	mutex_unlock(&hci_smd_enable);
	return ret;
#endif 
}
Пример #3
0
static int hcismd_set_enable(const char *val, struct kernel_param *kp)
{
	int ret = 0;

	pr_err("hcismd_set_enable %d", hcismd_set);

	down(&hci_smd_enable);

	ret = param_set_int(val, kp);

	if (ret)
		goto done;

	switch (hcismd_set) {

	case 1:
		if (hs.hdev == NULL)
			hci_smd_register_smd(&hs);
	break;
	case 0:
		hci_smd_deregister_dev(&hs);
	break;
	default:
		ret = -EFAULT;
	}

done:
	up(&hci_smd_enable);
	return ret;
}
Пример #4
0
static int hcismd_set_enable(const char *val, struct kernel_param *kp)
{
	int ret = 0;

	mutex_lock(&hci_smd_enable);

	ret = param_set_int(val, kp);

	if (ret)
		goto done;

	switch (hcismd_set) {

	case 1:
		hci_smd_register_dev(&hs);
	break;
	case 0:
		hci_smd_deregister_dev(&hs);
	break;
	default:
		ret = -EFAULT;
	}

done:
	mutex_unlock(&hci_smd_enable);
	return ret;
}
static void hci_dev_restart(struct work_struct *worker)
{
	mutex_lock(&hci_smd_enable);
	hci_smd_deregister_dev(&hs);
	hci_smd_register_smd(&hs);
	mutex_unlock(&hci_smd_enable);
	kfree(worker);
}
Пример #6
0
static void hci_dev_restart(struct work_struct *worker)
{
	down(&hci_smd_enable);
	restart_in_progress = 1;
	hci_smd_deregister_dev(&hs);
	hci_smd_register_smd(&hs);
	up(&hci_smd_enable);
	kfree(worker);
}
Пример #7
0
static void hci_dev_restart(struct work_struct *worker)
{
	down(&hci_smd_enable);
	restart_in_progress = 1;
	BT_DBG("SSR state is : %x", ssr_state);

	if (ssr_state == STATE_SSR_ON) {
		ssr_state = STATE_SSR_START;
		BT_INFO("SSR state is : %x", ssr_state);
	} else {
		BT_ERR("restart triggered in wrong context");
		up(&hci_smd_enable);
		kfree(worker);
		return;
	}
	hci_smd_deregister_dev(&hs);
	hci_smd_register_smd(&hs);
	up(&hci_smd_enable);
	kfree(worker);

}
Пример #8
0
static int hcismd_set_enable(const char *val, struct kernel_param *kp)
{
	int ret = 0;

	pr_err("hcismd_set_enable %d", hcismd_set);

	down(&hci_smd_enable);

	ret = param_set_int(val, kp);

	if (ret)
		goto done;

	/* Ignore the all incomming register de-register requests in case of
	 * SSR is in-progress
	 */
	switch (hcismd_set) {

	case 1:
		if ((hs.hdev == NULL) && (ssr_state == STATE_SSR_OFF))
			hci_smd_register_smd(&hs);
		else if (ssr_state)
			BT_ERR("SSR is in progress,state is : %x", ssr_state);

	break;
	case 0:
		if (ssr_state == STATE_SSR_OFF)
			hci_smd_deregister_dev(&hs);
		else if (ssr_state)
			BT_ERR("SSR is in progress,state is : %x", ssr_state);
	break;
	default:
		ret = -EFAULT;
	}

done:
	up(&hci_smd_enable);
	return ret;
}