Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 195388
b: refs/heads/master
c: 3d7e59a
h: refs/heads/master
v: v3
  • Loading branch information
Matthew Garrett authored and Greg Kroah-Hartman committed May 20, 2010
1 parent b5c614d commit 2396aaa
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8b4c6a3ab596961b784659c71dc24b341f938a1a
refs/heads/master: 3d7e59ad88fdb6bc50ae9b7e822d4bb5f68b68f9
1 change: 1 addition & 0 deletions trunk/drivers/usb/serial/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ config USB_SERIAL_QCAUX

config USB_SERIAL_QUALCOMM
tristate "USB Qualcomm Serial modem"
select USB_SERIAL_WWAN
help
Say Y here if you have a Qualcomm USB modem device. These are
usually wireless cellular modems.
Expand Down
22 changes: 22 additions & 0 deletions trunk/drivers/usb/serial/qcserial.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#include <linux/tty_flip.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>
#include <linux/slab.h>
#include "usb-wwan.h"

#define DRIVER_AUTHOR "Qualcomm Inc"
#define DRIVER_DESC "Qualcomm USB Serial driver"
Expand Down Expand Up @@ -92,6 +94,7 @@ static struct usb_driver qcdriver = {

static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
{
struct usb_wwan_intf_private *data;
int retval = -ENODEV;
__u8 nintf;
__u8 ifnum;
Expand All @@ -103,6 +106,13 @@ static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
ifnum = serial->interface->cur_altsetting->desc.bInterfaceNumber;
dbg("This Interface = %d", ifnum);

data = serial->private = kzalloc(sizeof(struct usb_wwan_intf_private),
GFP_KERNEL);
if (!data)
return -ENOMEM;

spin_lock_init(&data->susp_lock);

switch (nintf) {
case 1:
/* QDL mode */
Expand Down Expand Up @@ -161,6 +171,18 @@ static struct usb_serial_driver qcdevice = {
.usb_driver = &qcdriver,
.num_ports = 1,
.probe = qcprobe,
.open = usb_wwan_open,
.close = usb_wwan_close,
.write = usb_wwan_write,
.write_room = usb_wwan_write_room,
.chars_in_buffer = usb_wwan_chars_in_buffer,
.attach = usb_wwan_startup,
.disconnect = usb_wwan_disconnect,
.release = usb_wwan_release,
#ifdef CONFIG_PM
.suspend = usb_wwan_suspend,
.resume = usb_wwan_resume,
#endif
};

static int __init qcinit(void)
Expand Down

0 comments on commit 2396aaa

Please sign in to comment.