[PATCH] Novatel MC760

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is my first attempt at any sort of kernel patch, though I have
plenty of experience with user-space application coding.

I have a Novatel MC760 and I'm looking to improve the support of it in
Linux. It's one of these devices that can appear as one of two different
products. It first appears as a mass storage device (specifically, a CD
drive). If you call /usr/bin/eject on it, it then disconnects and
reappears as a serial device and is fully functional. (It also presents
as a card reader; it has a micro SD slot in it. I haven't tested this
functionality.)

In researching how to deal with this device, I came across the
usb-modeswitch program, which uses libusb to deal with these "flip flop"
devices in userspace. Someone in #ubuntu-devel told me the desired trend
was to deal with these in the kernel.

The patch below is purely code-cosmetic. It simply identifies a product
that was previously marked as a "future Novatel product". I thought I'd
start here.

Are there other devices that are currently supported that behave in this
way (eject triggers the change)? How should I proceed in patching this?

Thanks,
Richard

lsusb BEFORE EJECT:
Bus 002 Device 002: ID 1410:5030 Novatel Wireless

lsusb AFTER EJECT:
Bus 002 Device 003: ID 1410:6000 Novatel Wireless

dmesg BEFORE EJECT:
[ 8752.248686] Initializing USB Mass Storage driver...
[ 8752.250694] scsi6 : SCSI emulation for USB Mass Storage devices
[ 8752.252732] usb-storage: device found at 2
[ 8752.252737] usb-storage: waiting for device to settle before scanning
[ 8752.255098] scsi7 : SCSI emulation for USB Mass Storage devices
[ 8752.273236] usbcore: registered new interface driver usb-storage
[ 8752.273245] USB Mass Storage support registered.
[ 8752.275508] usb-storage: device found at 2
[ 8752.275513] usb-storage: waiting for device to settle before scanning
[ 8757.251133] usb-storage: device scan complete
[ 8757.258015] scsi 6:0:0:0: CD-ROM            Novatel  Mass Storage     1.00 PQ: 0 ANSI: 2
[ 8757.317966] usb-storage: device scan complete
[ 8757.326600] scsi 7:0:0:0: Direct-Access     Novatel  MMC Storage      2.31 PQ: 0 ANSI: 2
[ 8757.353041] sr1: scsi-1 drive
[ 8757.353242] sr 6:0:0:0: Attached scsi CD-ROM sr1
[ 8757.353370] sr 6:0:0:0: Attached scsi generic sg3 type 5
[ 8757.379174] sd 7:0:0:0: [sdc] Attached SCSI removable disk
[ 8757.379296] sd 7:0:0:0: Attached scsi generic sg4 type 0
[ 8760.017479] sr1: CDROM (ioctl) error, command: Get configuration 46 00 00 00 00 00 00 00 20 00
[ 8760.017504] sr: Sense Key : No Sense [current] 
[ 8760.017512] sr: Add. Sense: No additional sense information
[ 8761.033551] sr1: CDROM (ioctl) error, command: Get configuration 46 00 00 00 00 00 00 00 20 00
[ 8761.033568] sr: Sense Key : No Sense [current] 
[ 8761.033572] sr: Add. Sense: No additional sense information
[ 8761.041551] sr1: CDROM (ioctl) error, command: Get configuration 46 00 00 28 00 00 00 00 10 00
[ 8761.041570] sr: Sense Key : No Sense [current] 
[ 8761.041576] sr: Add. Sense: No additional sense information
[ 8761.048584] sr1: CDROM (ioctl) error, command: Get configuration 46 00 00 20 00 00 00 00 18 00
[ 8761.048603] sr: Sense Key : No Sense [current] 
[ 8761.048609] sr: Add. Sense: No additional sense information
[ 8761.075578] sr1: CDROM (ioctl) error, command: Get configuration 46 00 00 00 00 00 00 00 20 00
[ 8761.075600] sr: Sense Key : No Sense [current] 
[ 8761.075606] sr: Add. Sense: No additional sense information

dmesg AFTER EJECT:
[ 8886.504108] usb 2-1: USB disconnect, address 2
[ 8887.984077] usb 2-1: new full speed USB device using uhci_hcd and address 3
[ 8888.163591] usb 2-1: configuration #1 chosen from 1 choice
[ 8888.192499] scsi8 : SCSI emulation for USB Mass Storage devices
[ 8888.205199] usb-storage: device found at 3
[ 8888.205205] usb-storage: waiting for device to settle before scanning
[ 8888.267188] USB Serial support registered for GSM modem (1-port)
[ 8888.267241] option 2-1:1.0: GSM modem (1-port) converter detected
[ 8888.267333] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 8888.267349] option 2-1:1.1: GSM modem (1-port) converter detected
[ 8888.267396] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 8888.267411] option 2-1:1.2: GSM modem (1-port) converter detected
[ 8888.267454] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB2
[ 8888.267468] option 2-1:1.3: GSM modem (1-port) converter detected
[ 8888.267510] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB3
[ 8888.267526] usbcore: registered new interface driver option
[ 8888.267528] option: v0.7.2:USB Driver for GSM modems
[ 8893.224495] usb-storage: device scan complete
[ 8893.228469] scsi 8:0:0:0: Direct-Access     Novatel  MMC Storage      2.31 PQ: 0 ANSI: 2
[ 8893.299428] sd 8:0:0:0: [sdc] Attached SCSI removable disk
[ 8893.299571] sd 8:0:0:0: Attached scsi generic sg3 type 0

--- drivers/usb/serial/option.c	2009-04-22 12:36:31.000000000 -0500
+++ drivers/usb/serial/option.c	2009-04-22 13:54:07.000000000 -0500
@@ -199,9 +199,9 @@
 #define NOVATELWIRELESS_PRODUCT_MC727		0x4100
 #define NOVATELWIRELESS_PRODUCT_MC950D		0x4400
 #define NOVATELWIRELESS_PRODUCT_U727		0x5010
+#define NOVATELWIRELESS_PRODUCT_U760		0x6000
 
 /* FUTURE NOVATEL PRODUCTS */
-#define NOVATELWIRELESS_PRODUCT_EVDO_FULLSPEED	0X6000
 #define NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED	0X6001
 #define NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED	0X7000
 #define NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED	0X7001
@@ -413,7 +415,7 @@
 	{ USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC950D) }, /* Novatel MC930D/MC950D */
 	{ USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727) }, /* Novatel MC727/U727/USB727 */
 	{ USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U727) }, /* Novatel MC727/U727/USB727 */
-	{ USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_FULLSPEED) }, /* Novatel EVDO product */
+	{ USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U760) }, /* Novatel MC760/U760/USB760 */
 	{ USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED) }, /* Novatel HSPA product */
 	{ USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED) }, /* Novatel EVDO Embedded product */
 	{ USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED) }, /* Novatel HSPA Embedded product */


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux