Kernel中uart接口的bluetooth driver初始化分析

本文深入探讨了Linux内核中针对蓝牙设备的UART驱动初始化过程。从kernel/drivers/bluetooth/hci_ldisc.c文件开始,分析了module_init(hci_uart_init)函数,揭示了如何注册HCI线路规程,并根据不同的蓝牙方案注册proto,确保数据经过处理后正确发送到蓝牙控制器。
摘要由CSDN通过智能技术生成

在前面几篇文章中,我们把kernelbluetooth stack相关的初始化分析完成,今天晓东带大家来一起分析uart接口的bluetooth driver的初始化。首先,我们来到kernel/drivers/bluetooth目录,看hci_ldisc.c文件。又见到我们熟悉的module_init

module_init(hci_uart_init);好吧,动手来看吧:

static int __init hci_uart_init(void)
{
	static struct tty_ldisc_ops hci_uart_ldisc;
	int err;
	BT_INFO("HCI UART driver ver %s", VERSION);
	/* Register the tty discipline */
	memset(&hci_uart_ldisc, 0, sizeof (hci_uart_ldisc));
	hci_uart_ldisc.magic		= TTY_LDISC_MAGIC;
	hci_uart_
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值