树莓派4B移植5G模块驱动 (RG200U-CN)

相关文档下载

https://download.csdn.net/download/u014492512/88301241

1、查看Linux内核版本

uname -r

在这里插入图片描述

2、根据内核版本在Github上下载Linux内核源码(最好再Github上确定一下有没有这个分支)

git clone --depth=1 https://github.com/raspberrypi/linux --branch rpi-5.15.y

3、下载依赖库

sudo apt-get update
sudo apt-get install raspberrypi-kernel-headers
sudo apt-get install bc libncurses5-dev bison flex libssl-dev make libc6-dev

4、配置

cd linux

(1)修改第1个文件(从#if 1 到 #endif)

sudo nano drivers/usb/serial/option.c
static const struct usb_device_id option_ids[] = {
#if 1 //Added by Quectel
{ USB_DEVICE_AND_INTERFACE_INFO(0x2c7c, 0x0900, 0xff, 0x00, 0x00) },
#endif
static struct usb_serial_driver option_1port_device = {
......

#ifdef CONFIG_PM
.suspend = usb_wwan_suspend,
.resume = usb_wwan_resume,
#if 1 //Added by Quectel
.reset_resume = usb_wwan_resume,
#endif
#endif
};

(2)修改第2个文件(从#if 1 到 #endif)

sudo nano drivers/usb/serial/usb_wwan.c
static struct urb *usb_wwan_setup_urb(struct usb_serial *serial, int endpoint,
 int dir, void *ctx, char *buf, int len,void (*callback) (struct urb *))
{
	......
	
	usb_fill_bulk_urb(urb, serial->dev,usb_sndbulkpipe(serial->dev, endpoint) | dir,buf, len, callback, ctx);
	#if 1 //Added by Quectel for zero packet
	if (dir == USB_DIR_OUT)
	{
		struct usb_device_descriptor *desc = &serial->dev->descriptor;
		if (desc->idVendor == cpu_to_le16(0x2C7C))
		{
			urb->transfer_flags |= URB_ZERO_PACKET;
		}
	}
	#endif
	return urb;
}

5、编译

KERNEL=kernel8  
sudo make bcm2711_defconfig
sudo make -j4 modules 
sudo make modules_install 
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值