android 2.3 bluetooth 移植的一些问题记录
来源:互联网 发布:卡通农场怎么恢复数据 编辑:程序博客网 时间:2024/04/28 10:29
模块:marvel 8787
内核:2.6.35
我的模块是wifi和蓝牙共用的,蓝牙的移植部分没啥好说的,把ko文件装载上去就可
以用,到是做电源管理时出现了问题。由于我的的wifi模块电源是受控的,也就是说,统
睡眠时,模块会断电,而这会导致蓝牙的驱动,每次唤醒的时候都会被重新加载,驱动
注册所创建的文件夹 rfkill0 会变为 rfkill1、 rfkill2 、rfkill2 ...... 。
这会导致android上层找不到设备文件,还有个问题,就是android上层要对rfkill中的
一个状态标志文件读写,可只有root用户才有写权限,android上层的bluetooth服务进程
是 bluetooth 用户所以无法访问。
解决办法:
文件路径:kernel_imx/net/rfkill/core.c
1、 在rfkill_dev_attrs 结构体中将 state 中S_IWUSR改为S_IWUGO
static struct device_attribute rfkill_dev_attrs[] = {
__ATTR(name, S_IRUGO, rfkill_name_show, NULL),
__ATTR(type, S_IRUGO, rfkill_type_show, NULL),
__ATTR(index, S_IRUGO, rfkill_idx_show, NULL),
__ATTR(persistent, S_IRUGO, rfkill_persistent_show, NULL),
__ATTR(state,S_IRUGO|S_IWUGO/*S_IWUSR*/,rfkill_state_show,rfkill_state_store)
__ATTR(claim, S_IRUGO|S_IWUSR, rfkill_claim_show, rfkill_claim_store),
__ATTR(soft, S_IRUGO|S_IWUSR, rfkill_soft_show, rfkill_soft_store),
__ATTR(hard, S_IRUGO, rfkill_hard_show, NULL),
__ATTR_NULL
};
2、在rfkill_register函数中添加:rfkill_no = 0 ,位置如下
int __must_check rfkill_register(struct rfkill *rfkill)
{
static unsigned long rfkill_no;
struct device *dev = &rfkill->dev;
int error;
BUG_ON(!rfkill);
mutex_lock(&rfkill_global_mutex);
if (rfkill->registered) {
error = -EALREADY;
goto unlock;
}
rfkill_no = 0; // 强制把创建文件名限定为 rfkill0
rfkill->idx = rfkill_no;
dev_set_name(dev, "rfkill%lu", rfkill_no);
。。。。。。。。。。。。。。。。。。
}
对于第2部分文件名改变的问题,可以在硬件抽象层 bluetooth.c 。
- android 2.3 bluetooth 移植的一些问题记录
- android-bluetooth移植碰到的问题
- android-bluetooth移植碰到的问题
- android-bluetooth移植碰到的问题
- Android Bluetooth 移植(下)
- Android Bluetooth 移植(下)
- android bluetooth蓝牙移植
- Android Bluetooth 移植
- android camera开发的一些问题记录
- android遇到的一些问题记录
- Android Bluetooth 移植(上)
- Android Bluetooth 移植(上)
- android bluetooth 移植相关注意事项
- android bluetooth 移植相关注意事项
- android bluetooth 移植相关注意事项
- android bluetooth 移植相关注意事项
- android bluetooth 移植相关注意事项
- android bluetooth 移植相关注意事项
- 批处理for命令详解
- 深入浅出Windows驱动开发:栈的忧虑(图)
- Android开发环境配置
- & | ^ << >> 操作符在程序中的应用
- win7 Vista下让程序默认以管理员权限运行
- android 2.3 bluetooth 移植的一些问题记录
- poj 1456 Supermarket 贪心,我已开始用dp,没做出来,惭愧!!
- Android 开发中的 Handler ,Thread ,Message ,Runnable 的综合使用方法
- 网络通讯框架mina和xscocket的简单比较
- linux下ss工具简介
- 专家畅谈ASP.NET与PHP的未来
- set map list
- qemu 使用
- 邮件头分析