RE: some fixes of the sierra driver
Hi Oliver, I will get to testing this and get back to you with the results asap. I expect that this will work as I have seen it implemented this way before. Thanks, -Kevin -Original Message- From: Oliver Neukum [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 30, 2008 3:22 AM To: Linux Development Group; linux-usb@vger.kernel.org Subject: some fixes of the sierra driver Hi, while I was adding autosuspend to that driver I noticed a few issues. You were having DMAed buffers as a part of a structure. This will fail on platforms that are not DMA-coherent (arm, sparc, ppc, ...) Please test this patch to fix it. Regards Oliver --- linux-2.6.24-sierra/drivers/usb/serial/sierra.c.alt2 2008-01-30 12:03:57.0 +0100 +++ linux-2.6.24-sierra/drivers/usb/serial/sierra.c 2008-01-30 12:11:39.0 +0100 @@ -56,9 +56,9 @@ struct sierra_port_private { int outstanding_urbs; /* number of out urbs in flight */ struct usb_anchor transmit_urbs; - /* Input endpoints and buffer for this port */ + /* Input endpoints and buffers for this port */ struct urb *in_urbs[N_IN_URB]; - char in_buffer[N_IN_URB][IN_BUFLEN]; + char *in_buffer[N_IN_URB]; /* Settings for the port */ int rts_state; /* Handshaking pins (outputs) */ @@ -714,6 +714,15 @@ static int sierra_startup(struct usb_ser } spin_lock_init(&portdata->lock); init_usb_anchor(&portdata->transmit_urbs); + for (j = 0; j < N_IN_URB; j++) { + portdata->in_buffer[j] = kmalloc(IN_BUFLEN, GFP_KERNEL); + if (!portdata->in_buffer[j]) { + for ( --j; j >= 0; j--) + kfree(portdata->in_buffer[j]); + kfree(portdata); + return -ENOMEM; + } + } usb_set_serial_port_data(port, portdata); @@ -757,7 +766,7 @@ static void sierra_shutdown(struct usb_s for (j = 0; j < N_IN_URB; j++) { usb_kill_urb(portdata->in_urbs[j]); usb_free_urb(portdata->in_urbs[j]); - portdata->in_urbs[j] = NULL; + kfree(portdata->in_buffer[j]); } kfree(portdata); usb_set_serial_port_data(port, NULL); - To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: testers sought: USB autosuspend for sierra
Oliver, Thank you for this patch, we will get to testing it and respond with results. -Kevin -Original Message- From: Oliver Neukum [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 30, 2008 1:32 AM To: Linux Development Group; linux-usb@vger.kernel.org Subject: testers sought: USB autosuspend for sierra Hi, this should implement USB autosuspend and hence some power savings if enabled for devices using the sierra driver. Please test. Regards Oliver --- linux-2.6.24-sierra/drivers/usb/serial/sierra.c.alt 2008-01-29 19:34:49.0 +0100 +++ linux-2.6.24-sierra/drivers/usb/serial/sierra.c 2008-01-30 10:23:24.0 +0100 @@ -42,6 +42,7 @@ static int debug; static int nmea; static int truinstall = 1; +static DEFINE_MUTEX(open_suspend_lock); enum devicetype { DEVICE_3_PORT = 0, @@ -49,6 +50,25 @@ enum devicetype { DEVICE_INSTALLER = 2, }; + +struct sierra_port_private { + spinlock_t lock;/* lock the structure */ + int outstanding_urbs; /* number of out urbs in flight */ + struct usb_anchor transmit_urbs; + + /* Input endpoints and buffer for this port */ + struct urb *in_urbs[N_IN_URB]; + char in_buffer[N_IN_URB][IN_BUFLEN]; + + /* Settings for the port */ + int rts_state; /* Handshaking pins (outputs) */ + int dtr_state; + int cts_state; /* Handshaking pins (inputs) */ + int dsr_state; + int dcd_state; + int ri_state; +}; + static int sierra_set_power_state(struct usb_device *udev, __u16 swiState) { int result; @@ -146,6 +166,68 @@ static int sierra_probe(struct usb_seria return result; } +static int sierra_suspend(struct usb_interface *intf, pm_message_t message) +{ + struct usb_serial *serial = usb_get_intfdata(intf); + struct usb_serial_port *port; + struct sierra_port_private *portdata; + struct urb *u; + int i, j; + + mutex_lock(&open_suspend_lock); + + for (i = 0; i < serial->num_port_pointers; i++) { + port = serial->port[i]; + portdata = usb_get_serial_port_data(port); + usb_kill_urb(port->interrupt_in_urb); + for (j = 0; j < N_IN_URB; j++) { + u = portdata->in_urbs[j]; + usb_kill_urb(u); + } + usb_kill_anchored_urbs(&portdata->transmit_urbs); + } + + mutex_unlock(&open_suspend_lock); + return 0; +} + +static int sierra_resume (struct usb_interface *intf) +{ + struct usb_serial *serial = usb_get_intfdata(intf); + struct usb_serial_port *port; + struct sierra_port_private *portdata; + struct urb *u; + int i, j, err = 0; + + mutex_lock(&open_suspend_lock); + for (i = 0; i < serial->num_port_pointers; i++) { + port = serial->port[i]; + portdata = usb_get_serial_port_data(port); + if (port->open_count) { + for (j = 0; j < N_IN_URB; j++) { + u = portdata->in_urbs[j]; + err = usb_submit_urb(u, GFP_NOIO); + if (err < 0) { +error_kill: + for (j = N_IN_URB - 1; j >= 0; j--) { + u = portdata->in_urbs[j]; + usb_kill_urb(u); + } + goto error_bail_out; + } + } + if (port->interrupt_in_urb) { + err = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO); + if (err < 0) + goto error_kill; + } + } + } +error_bail_out: + mutex_unlock(&open_suspend_lock); + return err; +} + static struct usb_device_id id_table [] = { { USB_DEVICE(0x1199, 0x0017) }, /* Sierra Wireless EM5625 */ { USB_DEVICE(0x1199, 0x0018) }, /* Sierra Wireless MC5720 */ @@ -189,25 +271,11 @@ static struct usb_driver sierra_driver = .name = "sierra", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, + .suspend= sierra_suspend, + .resume = sierra_resume, .id_table = id_table, .no_dynamic_id =1, -}; - -struct sierra_port_private { - spinlock_t lock;/* lock the structure */ - int outstanding_urbs; /* number of out urbs in flight */ - - /* Input endpoints and buffer for this port */ - struct urb *in_urbs[N_IN_URB]; - char in_buffer[N_IN_URB][IN_BUFLEN]; - - /* Settings for the port */ - int rts_state; /* Handshaking pins (outputs) */ - int dtr_state; - int cts_state; /* Handsha
RE: [PATCH] Add kyocera 680 to airprime
Hi Dan, Actually the Sierra driver is becoming less and less generic as we continue to add vendor specific feature support to the driver. I believe the option driver has maintained a very generic implementation. -Kevin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dan Williams Sent: Monday, February 04, 2008 9:16 AM To: Greg KH Cc: linux-usb@vger.kernel.org Subject: Re: [PATCH] Add kyocera 680 to airprime On Mon, 2008-02-04 at 08:03 -0800, Greg KH wrote: > On Mon, Feb 04, 2008 at 09:05:34AM -0500, Dan Williams wrote: > > Signed-off-by: Dan Williams <[EMAIL PROTECTED]> > > > > diff --git a/drivers/usb/serial/airprime.c b/drivers/usb/serial/airprime.c > > index 77bb893..16ce823 100644 > > --- a/drivers/usb/serial/airprime.c > > +++ b/drivers/usb/serial/airprime.c > > @@ -18,6 +18,7 @@ > > > > static struct usb_device_id id_table [] = { > > { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */ > > + { USB_DEVICE(0x0c88, 0x180a) }, /* Kyocera Wireless KPC680 */ > > Hm, are you sure that the sierra driver will not work instead? I want > to get rid of the airprime driver as I don't think it is needed, sierra > should work for these instead. > > Or maybe the option driver, if that is the chip inside of it. Now with more Sierra goodness, and less airprime suckage. Is sierra pretty generic? I honestly have no idea what's really inside this card, but it does seem to work with sierra at about the same speeds as with airprime. Signed-off-by: Dan Williams <[EMAIL PROTECTED]> diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index c295d04..b8f39e1 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c @@ -117,6 +117,7 @@ static struct usb_device_id id_table [] = { { USB_DEVICE(0x1199, 0x6851) }, /* Sierra Wireless AirCard 881 */ { USB_DEVICE(0x1199, 0x6852) }, /* Sierra Wireless AirCard 880 E */ { USB_DEVICE(0x1199, 0x6853) }, /* Sierra Wireless AirCard 881 E */ + { USB_DEVICE(0x0c88, 0x180a) }, /* Kyocera KPC680 */ { USB_DEVICE(0x1199, 0x0112), .driver_info = DEVICE_1_PORT }, /* Sierra Wireless AirCard 580 */ { USB_DEVICE(0x0F3D, 0x0112), .driver_info = DEVICE_1_PORT }, /* Airprime/Sierra PC 5220 */ @@ -155,6 +156,7 @@ static struct usb_device_id id_table_3port [] = { { USB_DEVICE(0x1199, 0x6851) }, /* Sierra Wireless AirCard 881 */ { USB_DEVICE(0x1199, 0x6852) }, /* Sierra Wireless AirCard 880E */ { USB_DEVICE(0x1199, 0x6853) }, /* Sierra Wireless AirCard 881E */ + { USB_DEVICE(0x0c88, 0x180a) }, /* Kyocera KPC680 */ { } }; - To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html - To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 011/128] USB: sierra: add support for Onda H600/Zte MF330 datacard to USB Driver for Sierra Wireless
Hi Greg & Bruno, As you can probably tell the Sierra driver is becoming less and less generic and more Sierra device specific. I am not sure if we want to include non-sierra devices in this driver, as I am not sure whether our vendor-specific messages will negatively impact other devices. What do you guys think? -Kevin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Greg Kroah-Hartman Sent: Friday, February 01, 2008 3:17 PM To: linux-usb@vger.kernel.org Cc: Bruno Redondi; stable; Greg Kroah-Hartman Subject: [PATCH 011/128] USB: sierra: add support for Onda H600/Zte MF330 datacard to USB Driver for Sierra Wireless From: Bruno Redondi <[EMAIL PROTECTED]> Added support for Onda H600/Zte MF330 GPRS/UMTS/HSDPA datacard Cc: stable <[EMAIL PROTECTED]> Signed-off-by: Bruno Redondi <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/usb/serial/sierra.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index 47bce35..b4d7ac9 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c @@ -126,6 +126,7 @@ static struct usb_device_id id_table [] = { { USB_DEVICE(0x1199, 0x0112), .driver_info = DEVICE_1_PORT }, /* Sierra Wireless AirCard 580 */ { USB_DEVICE(0x0F3D, 0x0112), .driver_info = DEVICE_1_PORT }, /* Airprime/Sierra PC 5220 */ + { USB_DEVICE(0x05C6, 0x6613), .driver_info = DEVICE_1_PORT }, /* Onda H600/ZTE MF330 */ { USB_DEVICE(0x1199, 0x0FFF), .driver_info = DEVICE_INSTALLER}, { } @@ -135,6 +136,7 @@ MODULE_DEVICE_TABLE(usb, id_table); static struct usb_device_id id_table_1port [] = { { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless AirCard 580 */ { USB_DEVICE(0x0F3D, 0x0112) }, /* AirPrime/Sierra PC 5220 */ + { USB_DEVICE(0x05C6, 0x6613) }, /* Onda H600/ZTE MF330 */ { } }; -- 1.5.3.8 - To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html - To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 011/128] USB: sierra: add support for Onda H600/ZteMF330 datacard to USB Driver for Sierra Wireless
Great. The only devices that I am aware of that have been submitted that are not Sierra Wireless devices are: - Onda H600/Zte MF330 (0x05C6, 0x6613) (from Bruno Redondi) - Kyocera Wireless KPC680 (0x0c88, 0x180a) (from Dan Williams) We could probably move the Kyocera KPC650 from the airprime driver to the option driver (or whatever the new name is, maybe generic_wwan?). This is the last device in the airprime driver and would allow us to finally delete it all together (as you have suggested). -Kevin - To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [Patch] USB/Serial (sierra.c): Add Support For AT&T 881U
Hi David, A patch has already been submitted and accepted to add this device (See PATCH005/128 from Greg KH on 2/1/2008). -Kevin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Sent: Thursday, February 07, 2008 4:02 AM To: linux-usb@vger.kernel.org Subject: [Patch] USB/Serial (sierra.c): Add Support For AT&T 881U - Add Support For AT&T 881U. - I Have been testing patch for sometime with out any issues. Signed-off-by: David Roth <[EMAIL PROTECTED]> --- --- sierra.c 2008-01-28 05:52:14.0 -0600 +++ ../Working/sierra/sierra.c 2008-01-26 20:34:48.0 -0600 @@ -117,6 +117,7 @@ { USB_DEVICE(0x1199, 0x6851) }, /* Sierra Wireless AirCard 881 */ { USB_DEVICE(0x1199, 0x6852) }, /* Sierra Wireless AirCard 880 E */ { USB_DEVICE(0x1199, 0x6853) }, /* Sierra Wireless AirCard 881 E */ + { USB_DEVICE(0x1199, 0x6856) }, /* Sierra Wireless AirCard 881 U */ { USB_DEVICE(0x1199, 0x0112), .driver_info = DEVICE_1_PORT }, /* Sierra Wireless AirCard 580 */ { USB_DEVICE(0x0F3D, 0x0112), .driver_info = DEVICE_1_PORT }, /* Airprime/Sierra PC 5220 */ @@ -155,6 +156,7 @@ { USB_DEVICE(0x1199, 0x6851) }, /* Sierra Wireless AirCard 881 */ { USB_DEVICE(0x1199, 0x6852) }, /* Sierra Wireless AirCard 880E */ { USB_DEVICE(0x1199, 0x6853) }, /* Sierra Wireless AirCard 881E */ + { USB_DEVICE(0x1199, 0x6856) }, /* Sierra Wireless AirCard 881U */ { } }; - To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html - To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [patch 13/45] USB: sierra: add support for Onda H600/Zte MF330datacard to USB Driver for Sierra Wireless
> 2.6.24-stable review patch. If anyone has any objections, please let us > know. > > -- > From: Bruno Redondi <[EMAIL PROTECTED]> > > Added support for Onda H600/Zte MF330 GPRS/UMTS/HSDPA datacard Per our earlier discussion we probably don't want to have this one in the Sierra driver. - To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [patch 13/45] USB: sierra: add support for Onda H600/ZteMF330datacard to USB Driver for Sierra Wireless
> For now, yes, we should mirror what is going to be in the 2.6.25 kernel > release. I see the split happening for 2.6.26. So I say leave this for > now, it adds support for users of these devices. It's not that big a of a deal and I'm not sure how much of a pain it would be to change it, but if the end plan is to have it in the option.c driver and it is a one line change we might just want to get it done now? -Kevin - To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] usb: serial: move zte MF330 from sierra to option
From: Kevin Lloyd <[EMAIL PROTECTED]> Moves the Onda H600/ZTE MF33 device from the sierra driver to the option driver. Signed-off-by: Kevin Lloyd <[EMAIL PROTECTED]> --- drivers/usb/serial/sierra.c | 1 - drivers/usb/serial/option.c | 2 + 2 files changed, 2 insertions(+), 1 deletion(-) --- linux-2.6.25-rc1/drivers/usb/serial/sierra.c.orig 2008-02-11 11:34:06.0 -0800 +++ linux-2.6.25-rc1/drivers/usb/serial/sierra.c2008-02-11 11:34:36.0 -0800 @@ -178,7 +178,6 @@ static struct usb_device_id id_table [] { USB_DEVICE(0x1199, 0x0112), .driver_info = DEVICE_1_PORT }, /* Sierra Wireless AirCard 580 */ { USB_DEVICE(0x0F3D, 0x0112), .driver_info = DEVICE_1_PORT }, /* Airprime/Sierra PC 5220 */ - { USB_DEVICE(0x05C6, 0x6613), .driver_info = DEVICE_1_PORT }, /* Onda H600/ZTE MF330 */ { USB_DEVICE(0x1199, 0x0FFF), .driver_info = DEVICE_INSTALLER}, { } --- linux-2.6.25-rc1/drivers/usb/serial/option.c.orig 2008-02-11 11:42:10.0 -0800 +++ linux-2.6.25-rc1/drivers/usb/serial/option.c2008-02-11 11:42:18.0 -0800 @@ -121,6 +121,8 @@ static int option_send_setup(struct usb #define BANDRICH_PRODUCT_C100_1 0x1002 #define BANDRICH_PRODUCT_C100_2 0x1003 +#define QUALCOMM_VENDOR_ID 0x05C6 + static struct usb_device_id option_ids[] = { { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_RICOLA) }, @@ -186,6 +188,7 @@ static struct usb_device_id option_ids[] { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_1) }, { USB_DEVICE(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_C100_2) }, + { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ { } /* Terminating entry */ }; MODULE_DEVICE_TABLE(usb, option_ids); - To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: Question regarding usb-serial based driver.
> > The sierra device has pair of endpoints (bulk in and bulk out) that > > sends the multiplexed protocols data packets ( two protocols data > > packets encapsulated in one). Lets call that endpoint pair as EP1. The > > one of the multiplexed protocol is DM and other is command and status. > > EP1 is attached to ttyUSB1. Our application reads from ttyUSB1 and > > ignores DM packets and considers only command and status packets. > > However to get DM stream working another application has to read/write > > to ttyUSB1 concurrently which is as tricky. Thus, I am trying to setup > > another virtual serial port called ttyUSB3 that can read/write to EP1 > > concurrently so that we get two duplicate streams. One of the stream > > (ttyUSB1) can be used by our existing application and another stream > > (ttyUSB3) can be used to set up DM logging.Internally however they > > will talk to same endpoint pair EP1. Is it doable? > > Yes, for something like this, a modification of the sierra driver would > be needed to allow for two buffers like this. > > But, you might want to work with the current developers of the sierra > driver, as I'm pretty sure they are working to add this kind of > functionality (alternate ways to control the card) to the driver for > this very reason. > > Is there a reason you have not just contacted them already? Hi Greg et al., Chetan is actually helping Sierra out with this feature and I was not able to be of much help regarding finding a solution in the kernel space. I saw that the network driver framework has the ability to register packet handlers to devices data streams via the dev_add_pack command, I was hoping that the usb_serial drivers might have similar functionality (I couldn't find any). -Kevin - To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: Question regarding usb-serial based driver.
> Then please, let us know this kind of information in the beginning, > without me having to drag it out of you all over the course of a week > and 9 email exchanges. Don't be vague, it doesn't help anyone out, and > wastes people's time. Right, miscommunication on our part. > > I saw that the network driver framework has the ability to register > > packet handlers to devices data streams via the dev_add_pack command, I > > was hoping that the usb_serial drivers might have similar functionality > > (I couldn't find any). > > No, the tty layer doesn't let you do this. Well, it could, if you > create a new line discipline, but I really think you don't want to do > that, it's quite difficult. > > Why not just use what Alan suggested? Do all of this logic in a > userspace program? We were hoping to have the DM stream output from a virtual serial port for easy & direct access for 3rd party developers (file handles are simple and straightforward to read/write from). My thought is that implementing this in a userspace daemon/program requires cross-process communication which I feel is a bit more complex (or is there a standard way for a userspace program to output to a virtual serial port to obtain the same net effect). Thanks, -Kevin - To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] usb-serial: Sierra driver - add devices and update dtr
From: Kevin Lloyd <[EMAIL PROTECTED]> This patch is targeted for the 2.6.24-rc7 kernel. The following improvements were made: - Added new product support: MC5725, AC 880 U, MP 3G (UMTS & CDMA) - Fixed control line issue where asserting DTR on ep5 would close ep2 - Added support for calc_num_ports (will help support future composite devices) This also covers the devices added by [EMAIL PROTECTED] and [EMAIL PROTECTED] since their patches were not committed to the 2.6.23-rc7 kernel. Signed-off-by: Kevin Lloyd <[EMAIL PROTECTED]> --- --- /home/shared/kernels/linux-2.6.24-rc7-final/drivers/usb/serial/sierra.c.orig 2008-01-09 17:37:40.0 -0800 +++ /home/shared/kernels/linux-2.6.24-rc7-final/drivers/usb/serial/sierra.c 2008-01-10 11:08:57.0 -0800 @@ -1,7 +1,7 @@ /* USB Driver for Sierra Wireless - Copyright (C) 2006, 2007 Kevin Lloyd <[EMAIL PROTECTED]> + Copyright (C) 2008 Kevin Lloyd <[EMAIL PROTECTED]> IMPORTANT DISCLAIMER: This driver is not commercially supported by Sierra Wireless. Use at your own risk. @@ -14,7 +14,7 @@ Whom based his on the Keyspan driver by Hugh Blemings <[EMAIL PROTECTED]> */ -#define DRIVER_VERSION "v.1.2.5b" +#define DRIVER_VERSION "v.1.2.7" #define DRIVER_AUTHOR "Kevin Lloyd <[EMAIL PROTECTED]>" #define DRIVER_DESC "USB Driver for Sierra Wireless USB modems" @@ -26,10 +26,12 @@ #include #include #include +#include +#define SWIMS_USB_REQUEST_SetPower 0x00 +#define SWIMS_USB_REQUEST_SetNmea 0x07 #define SWIMS_USB_REQUEST_SetMode 0x0B -#define SWIMS_USB_REQUEST_TYPE_SetMode 0x40 -#define SWIMS_USB_INDEX_SetMode0x +#define SWIMS_USB_REQUEST_TYPE_VSC_SET 0x40 #define SWIMS_SET_MODE_Modem 0x0001 /* per port private data */ @@ -38,6 +40,8 @@ #define IN_BUFLEN 4096 static int debug; +static int nmea = 0; +static int truinstall = 1; enum devicetype { DEVICE_3_PORT = 0, @@ -50,48 +54,90 @@ static int sierra_set_power_state(struct int result; dev_dbg(&udev->dev, "%s", "SET POWER STATE"); result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), - 0x00, /* __u8 request */ - 0x40, /* __u8 request type */ - swiState, /* __u16 value */ - 0, /* __u16 index */ - NULL, /* void *data*/ - 0, /* __u16 size*/ - USB_CTRL_SET_TIMEOUT); /* int timeout */ + SWIMS_USB_REQUEST_SetPower, /* __u8 request */ + SWIMS_USB_REQUEST_TYPE_VSC_SET, /* __u8 request type */ + swiState, /* __u16 value */ + 0, /* __u16 index */ + NULL, /* void *data*/ + 0, /* __u16 size*/ + USB_CTRL_SET_TIMEOUT); /* int timeout */ return result; } -static int sierra_set_ms_mode(struct usb_device *udev, __u16 eSocMode) +static int sierra_set_ms_mode(struct usb_device *udev, __u16 eSWocMode) { int result; dev_dbg(&udev->dev, "%s", "DEVICE MODE SWITCH"); result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), SWIMS_USB_REQUEST_SetMode, /* __u8 request */ - SWIMS_USB_REQUEST_TYPE_SetMode, /* __u8 request type */ - eSocMode, /* __u16 value */ - SWIMS_USB_INDEX_SetMode,/* __u16 index */ + SWIMS_USB_REQUEST_TYPE_VSC_SET, /* __u8 request type */ + eSWocMode, /* __u16 value */ + 0x, /* __u16 index */ NULL, /* void *data*/ 0, /* __u16 size*/ USB_CTRL_SET_TIMEOUT); /* int timeout */ return result; } -static int sierra_probe(struct usb_interface *iface, - const struct usb_device_id *id) +int sierra_vsc_set_nmea(struct usb_device *udev, __u16 enable) { int result; + dev_dbg(&udev->dev, "%s", "NMEA Enable sent"); + result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), + SWIMS_USB_REQUEST_SetNmea, /* __u8 request */ + SWIMS_USB_REQUEST_TYPE_VSC_SET, /* __u8
RE: [PATCH] usb-serial: Sierra driver - add devices and update dtr
> Those device ids are already in my tree, as it was my understanding that > you would not be sending me patches for them :) You're right, I normally wouldn't, but since someone else already had, I figured it would be alright. > I'll split this patch up into something that updates the device ids and > then does all of the other changes. The device ids can go into 2.6.24 > (and -stable if I miss the merge window), but the other changes should > wait until 2.6.25. > > Any objection to this? Actually some of the added functionality (calc_num_ports) is required for device 0x0023 and will be necessary for future devices (should someone want to add the VID/PID of a new device it will likely require the added support). So my preference would be to please include the other changes in the 2.6.24 release. Thanks, -Kevin - To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH] usb-serial: Sierra driver - add devices and update dtr
> Hm, no, the intrusion into the driver is just too much this late in the > release cycle to allow this. > > Now I will be glad to only add the new device ids for the devices that > do not rely on the new changes right now, but that's it. > > So, right now I have a separate patch split out of your original one > that is below. Should I modify it and not include some of these device > ids right now? You mention 0023, is that the only one I should remove > from this patch? Correct, the 0x0023 is the only newly added device that requires the new features. When do you expect the other changes will be propagated to the kernel? Would it be in a 2.6.24.x point release or will they have to wait until 2.6.25? Thanks, -Kevin - From: Kevin Lloyd <[EMAIL PROTECTED]> Subject: USB: sierra driver - add devices From: Kevin Lloyd <[EMAIL PROTECTED]> The following improvements were made: - Added new product support: MC5725, AC 880 U, MP 3G (UMTS & CDMA) Signed-off-by: Kevin Lloyd <[EMAIL PROTECTED]> Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]> --- drivers/usb/serial/sierra.c |9 + 1 file changed, 9 insertions(+) --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c @@ -104,6 +104,7 @@ static struct usb_device_id id_table [] { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */ { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */ { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless USB Dongle 595U */ + { USB_DEVICE(0x1199, 0x0023) }, /* Sierra Wireless AirCard */ { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */ { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */ @@ -117,8 +118,12 @@ static struct usb_device_id id_table [] { USB_DEVICE(0x1199, 0x6851) }, /* Sierra Wireless AirCard 881 */ { USB_DEVICE(0x1199, 0x6852) }, /* Sierra Wireless AirCard 880 E */ { USB_DEVICE(0x1199, 0x6853) }, /* Sierra Wireless AirCard 881 E */ + { USB_DEVICE(0x1199, 0x6855) }, /* Sierra Wireless AirCard 880 U */ { USB_DEVICE(0x1199, 0x6856) }, /* Sierra Wireless AirCard 881 U */ + { USB_DEVICE(0x1199, 0x6468) }, /* Sierra Wireless MP3G - EVDO */ + { USB_DEVICE(0x1199, 0x6469) }, /* Sierra Wireless MP3G - UMTS/HSPA */ + { USB_DEVICE(0x1199, 0x0112), .driver_info = DEVICE_1_PORT }, /* Sierra Wireless AirCard 580 */ { USB_DEVICE(0x0F3D, 0x0112), .driver_info = DEVICE_1_PORT }, /* Airprime/Sierra PC 5220 */ @@ -143,6 +148,7 @@ static struct usb_device_id id_table_3po { USB_DEVICE(0x1199, 0x0019) }, /* Sierra Wireless AirCard 595 */ { USB_DEVICE(0x1199, 0x0021) }, /* Sierra Wireless AirCard 597E */ { USB_DEVICE(0x1199, 0x0120) }, /* Sierra Wireless USB Dongle 595U*/ + { USB_DEVICE(0x1199, 0x0023) }, /* Sierra Wireless AirCard */ { USB_DEVICE(0x1199, 0x6802) }, /* Sierra Wireless MC8755 */ { USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */ @@ -156,7 +162,10 @@ static struct usb_device_id id_table_3po { USB_DEVICE(0x1199, 0x6851) }, /* Sierra Wireless AirCard 881 */ { USB_DEVICE(0x1199, 0x6852) }, /* Sierra Wireless AirCard 880E */ { USB_DEVICE(0x1199, 0x6853) }, /* Sierra Wireless AirCard 881E */ + { USB_DEVICE(0x1199, 0x6855) }, /* Sierra Wireless AirCard 880 U */ { USB_DEVICE(0x1199, 0x6856) }, /* Sierra Wireless AirCard 881U */ + { USB_DEVICE(0x1199, 0x6468) }, /* Sierra Wireless MP3G - EVDO */ + { USB_DEVICE(0x1199, 0x6469) }, /* Sierra Wireless MP3G - UMTS/HSPA */ { } }; - To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH] usb-serial: Sierra driver - add devices and update dtr
> > Correct, the 0x0023 is the only newly added device that requires the new > > features. > > Does that mean things will not work for this device if it is added to > the device table, without the code updates? Adding the device will not break the driver (assuming you remove the tag). > And is this device even public yet? No, but we are trying to add native support for devices into kernels well before they are released in an effort give better native support to end-users. > > When do you expect the other changes will be propagated to the kernel? > > Would it be in a 2.6.24.x point release or will they have to wait until > > 2.6.25? > > They will have to wait until 2.6.25, they are too big to go into 2.6.24 > (we are in severe bug-fix mode only right now for .24). Darn. Thanks, -Kevin - To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html