我来问您有关在 Ubuntu 上安装移远通信的 BG96 驱动程序的问题。我在 14.4、16.04、18.04、20.04 上进行了尝试,但这些都没有看到我在 PC 上插入 PCi 的 BG96。我按照说明进行操作,https://www.quectel.com/UploadImage/Downlad/Quectel_WCDMA<E_Linux_USB_Driver_User_Guide_V1.8.pdf
但无济于事。当我想发行时,一切都停止了
sudo make -C /lib/modules/`uname -r`/build M=`pwd`/drivers/usb/serial obj-m=option.o modules
在我发出该命令后,这些错误就会出现
make: Entering directory '/usr/src/linux-headers-4.15.0-45-generic'
scripts/Makefile.build:45: /lib/modules/4.15.0-45-generic/drivers/usb/serial/Makefile: No such file or directory
make[1]: *** No rule to make target '/lib/modules/4.15.0-45-generic/drivers/usb/serial/Makefile'. Stop.
Makefile:1551: recipe for target '_module_/lib/modules/4.15.0-45-generic/drivers/usb/serial' failed
make: *** [_module_/lib/modules/4.15.0-45-generic/drivers/usb/serial] Error 2
make: Leaving directory '/usr/src/linux-headers-4.15.0-45-generic'
这些是我放入我的文件/lib/modules/4.15.0-45-generic/drivers/usb/serial/
选项.c
static const struct usb_device_id option_ids[]={
#if 1
{ USB_DEVICE(0x2C7C, 0x0296) },
#endif
}
static struct usb_serial_driver option_1port_device = {
#ifdef CONFIG_PM
.suspend = usb_wwan_suspend,
.resume = usb_wwan_resume,
#if 1
.reset_resume = usb_wwan_resume,
#endif
#endif
};
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, but, len, callback, ctx);
#if 1
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;
}