I come to you with questions about Quectel's BG96 drivers installation on Ubuntu. I tried on 14.4, 16.04, 18.04, 20.04 but none of these see the BG96 that I plugged into PCi on my PC. I followed the instruction on https://www.quectel.com/UploadImage/Downlad/Quectel_WCDMA<E_Linux_USB_Driver_User_Guide_V1.8.pdf
but to no avail. Everything stops when I want to issue
sudo make -C /lib/modules/`uname -r`/build M=`pwd`/drivers/usb/serial obj-m=option.o modules
After I issue that command these errors show up
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'
And these are the files that I placed into my /lib/modules/4.15.0-45-generic/drivers/usb/serial/
option.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;
}