Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264890
b: refs/heads/master
c: 53e77df
h: refs/heads/master
v: v3
  • Loading branch information
Oliver Neukum authored and Greg Kroah-Hartman committed Aug 22, 2011
1 parent 79c48b4 commit 29da6ab
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f02fe890ece7d695a5744b20525d45312382e6e4
refs/heads/master: 53e77df25f64567ee1f55e7d76b8843689c79d9e
33 changes: 31 additions & 2 deletions trunk/drivers/usb/serial/ipw.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include <linux/usb.h>
#include <linux/usb/serial.h>
#include <linux/uaccess.h>
#include "usb-wwan.h"

/*
* Version Information
Expand Down Expand Up @@ -185,7 +186,7 @@ static int ipw_open(struct tty_struct *tty, struct usb_serial_port *port)

/*--2: Start reading from the device */
dbg("%s: setting up bulk read callback", __func__);
usb_serial_generic_open(tty, port);
usb_wwan_open(tty, port);

/*--3: Tell the modem to open the floodgates on the rx bulk channel */
dbg("%s:asking modem for RxRead (RXBULK_ON)", __func__);
Expand Down Expand Up @@ -219,6 +220,29 @@ static int ipw_open(struct tty_struct *tty, struct usb_serial_port *port)
return 0;
}

/* fake probe - only to allocate data structures */
static int ipw_probe(struct usb_serial *serial, const struct usb_device_id *id)
{
struct usb_wwan_intf_private *data;

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

spin_lock_init(&data->susp_lock);
usb_set_serial_data(serial, data);
return 0;
}

static void ipw_release(struct usb_serial *serial)
{
struct usb_wwan_intf_private *data = usb_get_serial_data(serial);

usb_wwan_release(serial);
usb_set_serial_data(serial, NULL);
kfree(data);
}

static void ipw_dtr_rts(struct usb_serial_port *port, int on)
{
struct usb_device *dev = port->serial->dev;
Expand Down Expand Up @@ -285,7 +309,7 @@ static void ipw_close(struct usb_serial_port *port)
dev_err(&port->dev,
"Disabling bulk RxRead failed (error = %d)\n", result);

usb_serial_generic_close(port);
usb_wwan_close(port);
}

static struct usb_serial_driver ipw_device = {
Expand All @@ -297,9 +321,14 @@ static struct usb_serial_driver ipw_device = {
.usb_driver = &usb_ipw_driver,
.id_table = usb_ipw_ids,
.num_ports = 1,
.disconnect = usb_wwan_disconnect,
.open = ipw_open,
.close = ipw_close,
.probe = ipw_probe,
.attach = usb_wwan_startup,
.release = ipw_release,
.dtr_rts = ipw_dtr_rts,
.write = usb_wwan_write,
};


Expand Down

0 comments on commit 29da6ab

Please sign in to comment.