USB: remove use of err() in drivers/usb/serial
err() is going away, so switch to dev_err() or printk() if it's really needed. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
@@ -220,8 +220,8 @@ static void aircable_send(struct usb_serial_port *port)
|
|||||||
|
|
||||||
buf = kzalloc(count + HCI_HEADER_LENGTH, GFP_ATOMIC);
|
buf = kzalloc(count + HCI_HEADER_LENGTH, GFP_ATOMIC);
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
err("%s- kzalloc(%d) failed.", __func__,
|
dev_err(&port->dev, "%s- kzalloc(%d) failed.\n",
|
||||||
count + HCI_HEADER_LENGTH);
|
__func__, count + HCI_HEADER_LENGTH);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,7 +276,7 @@ static void aircable_read(struct work_struct *work)
|
|||||||
|
|
||||||
if (!tty) {
|
if (!tty) {
|
||||||
schedule_work(&priv->rx_work);
|
schedule_work(&priv->rx_work);
|
||||||
err("%s - No tty available", __func__);
|
dev_err(&port->dev, "%s - No tty available\n", __func__);
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -336,7 +336,7 @@ static int aircable_attach(struct usb_serial *serial)
|
|||||||
|
|
||||||
priv = kzalloc(sizeof(struct aircable_private), GFP_KERNEL);
|
priv = kzalloc(sizeof(struct aircable_private), GFP_KERNEL);
|
||||||
if (!priv) {
|
if (!priv) {
|
||||||
err("%s- kmalloc(%Zd) failed.", __func__,
|
dev_err(&port->dev, "%s- kmalloc(%Zd) failed.\n", __func__,
|
||||||
sizeof(struct aircable_private));
|
sizeof(struct aircable_private));
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
@@ -228,7 +228,7 @@ static int belkin_sa_open(struct tty_struct *tty,
|
|||||||
port->read_urb->dev = port->serial->dev;
|
port->read_urb->dev = port->serial->dev;
|
||||||
retval = usb_submit_urb(port->read_urb, GFP_KERNEL);
|
retval = usb_submit_urb(port->read_urb, GFP_KERNEL);
|
||||||
if (retval) {
|
if (retval) {
|
||||||
err("usb_submit_urb(read bulk) failed");
|
dev_err(&port->dev, "usb_submit_urb(read bulk) failed\n");
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,7 +236,7 @@ static int belkin_sa_open(struct tty_struct *tty,
|
|||||||
retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
|
retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
|
||||||
if (retval) {
|
if (retval) {
|
||||||
usb_kill_urb(port->read_urb);
|
usb_kill_urb(port->read_urb);
|
||||||
err(" usb_submit_urb(read int) failed");
|
dev_err(&port->dev, "usb_submit_urb(read int) failed\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
@@ -342,8 +342,8 @@ static void belkin_sa_read_int_callback(struct urb *urb)
|
|||||||
exit:
|
exit:
|
||||||
retval = usb_submit_urb(urb, GFP_ATOMIC);
|
retval = usb_submit_urb(urb, GFP_ATOMIC);
|
||||||
if (retval)
|
if (retval)
|
||||||
err("%s - usb_submit_urb failed with result %d",
|
dev_err(&port->dev, "%s - usb_submit_urb failed with "
|
||||||
__func__, retval);
|
"result %d\n", __func__, retval);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void belkin_sa_set_termios(struct tty_struct *tty,
|
static void belkin_sa_set_termios(struct tty_struct *tty,
|
||||||
@@ -382,12 +382,12 @@ static void belkin_sa_set_termios(struct tty_struct *tty,
|
|||||||
if ((old_cflag & CBAUD) == B0) {
|
if ((old_cflag & CBAUD) == B0) {
|
||||||
control_state |= (TIOCM_DTR|TIOCM_RTS);
|
control_state |= (TIOCM_DTR|TIOCM_RTS);
|
||||||
if (BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, 1) < 0)
|
if (BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, 1) < 0)
|
||||||
err("Set DTR error");
|
dev_err(&port->dev, "Set DTR error\n");
|
||||||
/* don't set RTS if using hardware flow control */
|
/* don't set RTS if using hardware flow control */
|
||||||
if (!(old_cflag & CRTSCTS))
|
if (!(old_cflag & CRTSCTS))
|
||||||
if (BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST
|
if (BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST
|
||||||
, 1) < 0)
|
, 1) < 0)
|
||||||
err("Set RTS error");
|
dev_err(&port->dev, "Set RTS error\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -403,18 +403,18 @@ static void belkin_sa_set_termios(struct tty_struct *tty,
|
|||||||
/* Report the actual baud rate back to the caller */
|
/* Report the actual baud rate back to the caller */
|
||||||
tty_encode_baud_rate(tty, baud, baud);
|
tty_encode_baud_rate(tty, baud, baud);
|
||||||
if (BSA_USB_CMD(BELKIN_SA_SET_BAUDRATE_REQUEST, urb_value) < 0)
|
if (BSA_USB_CMD(BELKIN_SA_SET_BAUDRATE_REQUEST, urb_value) < 0)
|
||||||
err("Set baudrate error");
|
dev_err(&port->dev, "Set baudrate error\n");
|
||||||
} else {
|
} else {
|
||||||
/* Disable flow control */
|
/* Disable flow control */
|
||||||
if (BSA_USB_CMD(BELKIN_SA_SET_FLOW_CTRL_REQUEST,
|
if (BSA_USB_CMD(BELKIN_SA_SET_FLOW_CTRL_REQUEST,
|
||||||
BELKIN_SA_FLOW_NONE) < 0)
|
BELKIN_SA_FLOW_NONE) < 0)
|
||||||
err("Disable flowcontrol error");
|
dev_err(&port->dev, "Disable flowcontrol error\n");
|
||||||
/* Drop RTS and DTR */
|
/* Drop RTS and DTR */
|
||||||
control_state &= ~(TIOCM_DTR | TIOCM_RTS);
|
control_state &= ~(TIOCM_DTR | TIOCM_RTS);
|
||||||
if (BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, 0) < 0)
|
if (BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, 0) < 0)
|
||||||
err("DTR LOW error");
|
dev_err(&port->dev, "DTR LOW error\n");
|
||||||
if (BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST, 0) < 0)
|
if (BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST, 0) < 0)
|
||||||
err("RTS LOW error");
|
dev_err(&port->dev, "RTS LOW error\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set the parity */
|
/* set the parity */
|
||||||
@@ -425,7 +425,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty,
|
|||||||
else
|
else
|
||||||
urb_value = BELKIN_SA_PARITY_NONE;
|
urb_value = BELKIN_SA_PARITY_NONE;
|
||||||
if (BSA_USB_CMD(BELKIN_SA_SET_PARITY_REQUEST, urb_value) < 0)
|
if (BSA_USB_CMD(BELKIN_SA_SET_PARITY_REQUEST, urb_value) < 0)
|
||||||
err("Set parity error");
|
dev_err(&port->dev, "Set parity error\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set the number of data bits */
|
/* set the number of data bits */
|
||||||
@@ -448,7 +448,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (BSA_USB_CMD(BELKIN_SA_SET_DATA_BITS_REQUEST, urb_value) < 0)
|
if (BSA_USB_CMD(BELKIN_SA_SET_DATA_BITS_REQUEST, urb_value) < 0)
|
||||||
err("Set data bits error");
|
dev_err(&port->dev, "Set data bits error\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set the number of stop bits */
|
/* set the number of stop bits */
|
||||||
@@ -457,7 +457,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty,
|
|||||||
: BELKIN_SA_STOP_BITS(1);
|
: BELKIN_SA_STOP_BITS(1);
|
||||||
if (BSA_USB_CMD(BELKIN_SA_SET_STOP_BITS_REQUEST,
|
if (BSA_USB_CMD(BELKIN_SA_SET_STOP_BITS_REQUEST,
|
||||||
urb_value) < 0)
|
urb_value) < 0)
|
||||||
err("Set stop bits error");
|
dev_err(&port->dev, "Set stop bits error\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set flow control */
|
/* Set flow control */
|
||||||
@@ -478,7 +478,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty,
|
|||||||
urb_value &= ~(BELKIN_SA_FLOW_IRTS);
|
urb_value &= ~(BELKIN_SA_FLOW_IRTS);
|
||||||
|
|
||||||
if (BSA_USB_CMD(BELKIN_SA_SET_FLOW_CTRL_REQUEST, urb_value) < 0)
|
if (BSA_USB_CMD(BELKIN_SA_SET_FLOW_CTRL_REQUEST, urb_value) < 0)
|
||||||
err("Set flow control error");
|
dev_err(&port->dev, "Set flow control error\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* save off the modified port settings */
|
/* save off the modified port settings */
|
||||||
@@ -494,7 +494,7 @@ static void belkin_sa_break_ctl(struct tty_struct *tty, int break_state)
|
|||||||
struct usb_serial *serial = port->serial;
|
struct usb_serial *serial = port->serial;
|
||||||
|
|
||||||
if (BSA_USB_CMD(BELKIN_SA_SET_BREAK_REQUEST, break_state ? 1 : 0) < 0)
|
if (BSA_USB_CMD(BELKIN_SA_SET_BREAK_REQUEST, break_state ? 1 : 0) < 0)
|
||||||
err("Set break_ctl %d", break_state);
|
dev_err(&port->dev, "Set break_ctl %d\n", break_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -554,13 +554,13 @@ static int belkin_sa_tiocmset(struct tty_struct *tty, struct file *file,
|
|||||||
|
|
||||||
retval = BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST, rts);
|
retval = BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST, rts);
|
||||||
if (retval < 0) {
|
if (retval < 0) {
|
||||||
err("Set RTS error %d", retval);
|
dev_err(&port->dev, "Set RTS error %d\n", retval);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, dtr);
|
retval = BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, dtr);
|
||||||
if (retval < 0) {
|
if (retval < 0) {
|
||||||
err("Set DTR error %d", retval);
|
dev_err(&port->dev, "Set DTR error %d\n", retval);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
exit:
|
exit:
|
||||||
|
@@ -141,7 +141,8 @@ static int cyberjack_startup(struct usb_serial *serial)
|
|||||||
result = usb_submit_urb(serial->port[i]->interrupt_in_urb,
|
result = usb_submit_urb(serial->port[i]->interrupt_in_urb,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (result)
|
if (result)
|
||||||
err(" usb_submit_urb(read int) failed");
|
dev_err(&serial->dev->dev,
|
||||||
|
"usb_submit_urb(read int) failed\n");
|
||||||
dbg("%s - usb_submit_urb(int urb)", __func__);
|
dbg("%s - usb_submit_urb(int urb)", __func__);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -274,8 +275,9 @@ static int cyberjack_write(struct tty_struct *tty,
|
|||||||
/* send the data out the bulk port */
|
/* send the data out the bulk port */
|
||||||
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
|
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
|
||||||
if (result) {
|
if (result) {
|
||||||
err("%s - failed submitting write urb, error %d",
|
dev_err(&port->dev,
|
||||||
__func__, result);
|
"%s - failed submitting write urb, error %d",
|
||||||
|
__func__, result);
|
||||||
/* Throw away data. No better idea what to do with it. */
|
/* Throw away data. No better idea what to do with it. */
|
||||||
priv->wrfilled = 0;
|
priv->wrfilled = 0;
|
||||||
priv->wrsent = 0;
|
priv->wrsent = 0;
|
||||||
@@ -351,7 +353,9 @@ static void cyberjack_read_int_callback(struct urb *urb)
|
|||||||
port->read_urb->dev = port->serial->dev;
|
port->read_urb->dev = port->serial->dev;
|
||||||
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
|
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
|
||||||
if (result)
|
if (result)
|
||||||
err("%s - failed resubmitting read urb, error %d", __func__, result);
|
dev_err(&port->dev, "%s - failed resubmitting "
|
||||||
|
"read urb, error %d\n",
|
||||||
|
__func__, result);
|
||||||
dbg("%s - usb_submit_urb(read urb)", __func__);
|
dbg("%s - usb_submit_urb(read urb)", __func__);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -360,7 +364,7 @@ resubmit:
|
|||||||
port->interrupt_in_urb->dev = port->serial->dev;
|
port->interrupt_in_urb->dev = port->serial->dev;
|
||||||
result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
|
result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
|
||||||
if (result)
|
if (result)
|
||||||
err(" usb_submit_urb(read int) failed");
|
dev_err(&port->dev, "usb_submit_urb(read int) failed\n");
|
||||||
dbg("%s - usb_submit_urb(int urb)", __func__);
|
dbg("%s - usb_submit_urb(int urb)", __func__);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -414,8 +418,8 @@ static void cyberjack_read_bulk_callback(struct urb *urb)
|
|||||||
port->read_urb->dev = port->serial->dev;
|
port->read_urb->dev = port->serial->dev;
|
||||||
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
|
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
|
||||||
if (result)
|
if (result)
|
||||||
err("%s - failed resubmitting read urb, error %d",
|
dev_err(&port->dev, "%s - failed resubmitting read "
|
||||||
__func__, result);
|
"urb, error %d\n", __func__, result);
|
||||||
dbg("%s - usb_submit_urb(read urb)", __func__);
|
dbg("%s - usb_submit_urb(read urb)", __func__);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -462,8 +466,9 @@ static void cyberjack_write_bulk_callback(struct urb *urb)
|
|||||||
/* send the data out the bulk port */
|
/* send the data out the bulk port */
|
||||||
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
|
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
|
||||||
if (result) {
|
if (result) {
|
||||||
err("%s - failed submitting write urb, error %d",
|
dev_err(&port->dev,
|
||||||
__func__, result);
|
"%s - failed submitting write urb, error %d\n",
|
||||||
|
__func__, result);
|
||||||
/* Throw away data. No better idea what to do with it. */
|
/* Throw away data. No better idea what to do with it. */
|
||||||
priv->wrfilled = 0;
|
priv->wrfilled = 0;
|
||||||
priv->wrsent = 0;
|
priv->wrsent = 0;
|
||||||
|
@@ -404,8 +404,8 @@ static int cypress_serial_control(struct tty_struct *tty,
|
|||||||
retval != -ENODEV);
|
retval != -ENODEV);
|
||||||
|
|
||||||
if (retval != sizeof(feature_buffer)) {
|
if (retval != sizeof(feature_buffer)) {
|
||||||
err("%s - failed sending serial line settings - %d",
|
dev_err(&port->dev, "%s - failed sending serial "
|
||||||
__func__, retval);
|
"line settings - %d\n", __func__, retval);
|
||||||
cypress_set_dead(port);
|
cypress_set_dead(port);
|
||||||
} else {
|
} else {
|
||||||
spin_lock_irqsave(&priv->lock, flags);
|
spin_lock_irqsave(&priv->lock, flags);
|
||||||
@@ -443,7 +443,8 @@ static int cypress_serial_control(struct tty_struct *tty,
|
|||||||
&& retval != -ENODEV);
|
&& retval != -ENODEV);
|
||||||
|
|
||||||
if (retval != sizeof(feature_buffer)) {
|
if (retval != sizeof(feature_buffer)) {
|
||||||
err("%s - failed to retrieve serial line settings - %d", __func__, retval);
|
dev_err(&port->dev, "%s - failed to retrieve serial "
|
||||||
|
"line settings - %d\n", __func__, retval);
|
||||||
cypress_set_dead(port);
|
cypress_set_dead(port);
|
||||||
return retval;
|
return retval;
|
||||||
} else {
|
} else {
|
||||||
@@ -476,8 +477,8 @@ static void cypress_set_dead(struct usb_serial_port *port)
|
|||||||
priv->comm_is_ok = 0;
|
priv->comm_is_ok = 0;
|
||||||
spin_unlock_irqrestore(&priv->lock, flags);
|
spin_unlock_irqrestore(&priv->lock, flags);
|
||||||
|
|
||||||
err("cypress_m8 suspending failing port %d - interval might be too short",
|
dev_err(&port->dev, "cypress_m8 suspending failing port %d - "
|
||||||
port->number);
|
"interval might be too short\n", port->number);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -679,7 +680,8 @@ static int cypress_open(struct tty_struct *tty,
|
|||||||
|
|
||||||
/* setup the port and start reading from the device */
|
/* setup the port and start reading from the device */
|
||||||
if (!port->interrupt_in_urb) {
|
if (!port->interrupt_in_urb) {
|
||||||
err("%s - interrupt_in_urb is empty!", __func__);
|
dev_err(&port->dev, "%s - interrupt_in_urb is empty!\n",
|
||||||
|
__func__);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1107,8 +1109,8 @@ static void cypress_set_termios(struct tty_struct *tty,
|
|||||||
data_bits = 3;
|
data_bits = 3;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
err("%s - CSIZE was set, but not CS5-CS8",
|
dev_err(&port->dev, "%s - CSIZE was set, but not CS5-CS8\n",
|
||||||
__func__);
|
__func__);
|
||||||
data_bits = 3;
|
data_bits = 3;
|
||||||
}
|
}
|
||||||
spin_lock_irqsave(&priv->lock, flags);
|
spin_lock_irqsave(&priv->lock, flags);
|
||||||
|
@@ -661,7 +661,8 @@ static int digi_write_oob_command(struct usb_serial_port *port,
|
|||||||
}
|
}
|
||||||
spin_unlock_irqrestore(&oob_priv->dp_port_lock, flags);
|
spin_unlock_irqrestore(&oob_priv->dp_port_lock, flags);
|
||||||
if (ret)
|
if (ret)
|
||||||
err("%s: usb_submit_urb failed, ret=%d", __func__, ret);
|
dev_err(&port->dev, "%s: usb_submit_urb failed, ret=%d\n",
|
||||||
|
__func__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -743,7 +744,8 @@ static int digi_write_inb_command(struct usb_serial_port *port,
|
|||||||
spin_unlock_irqrestore(&priv->dp_port_lock, flags);
|
spin_unlock_irqrestore(&priv->dp_port_lock, flags);
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
err("%s: usb_submit_urb failed, ret=%d, port=%d",
|
dev_err(&port->dev,
|
||||||
|
"%s: usb_submit_urb failed, ret=%d, port=%d\n",
|
||||||
__func__, ret, priv->dp_port_num);
|
__func__, ret, priv->dp_port_num);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -812,7 +814,8 @@ static int digi_set_modem_signals(struct usb_serial_port *port,
|
|||||||
spin_unlock(&port_priv->dp_port_lock);
|
spin_unlock(&port_priv->dp_port_lock);
|
||||||
spin_unlock_irqrestore(&oob_priv->dp_port_lock, flags);
|
spin_unlock_irqrestore(&oob_priv->dp_port_lock, flags);
|
||||||
if (ret)
|
if (ret)
|
||||||
err("%s: usb_submit_urb failed, ret=%d", __func__, ret);
|
dev_err(&port->dev, "%s: usb_submit_urb failed, ret=%d\n",
|
||||||
|
__func__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -907,7 +910,8 @@ static void digi_rx_unthrottle(struct tty_struct *tty)
|
|||||||
spin_unlock_irqrestore(&priv->dp_port_lock, flags);
|
spin_unlock_irqrestore(&priv->dp_port_lock, flags);
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
err("%s: usb_submit_urb failed, ret=%d, port=%d",
|
dev_err(&port->dev,
|
||||||
|
"%s: usb_submit_urb failed, ret=%d, port=%d\n",
|
||||||
__func__, ret, priv->dp_port_num);
|
__func__, ret, priv->dp_port_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1214,7 +1218,8 @@ static int digi_write(struct tty_struct *tty, struct usb_serial_port *port,
|
|||||||
/* return length of new data written, or error */
|
/* return length of new data written, or error */
|
||||||
spin_unlock_irqrestore(&priv->dp_port_lock, flags);
|
spin_unlock_irqrestore(&priv->dp_port_lock, flags);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
err("%s: usb_submit_urb failed, ret=%d, port=%d",
|
dev_err(&port->dev,
|
||||||
|
"%s: usb_submit_urb failed, ret=%d, port=%d\n",
|
||||||
__func__, ret, priv->dp_port_num);
|
__func__, ret, priv->dp_port_num);
|
||||||
dbg("digi_write: returning %d", ret);
|
dbg("digi_write: returning %d", ret);
|
||||||
return ret;
|
return ret;
|
||||||
@@ -1235,14 +1240,16 @@ static void digi_write_bulk_callback(struct urb *urb)
|
|||||||
|
|
||||||
/* port and serial sanity check */
|
/* port and serial sanity check */
|
||||||
if (port == NULL || (priv = usb_get_serial_port_data(port)) == NULL) {
|
if (port == NULL || (priv = usb_get_serial_port_data(port)) == NULL) {
|
||||||
err("%s: port or port->private is NULL, status=%d",
|
dev_err(&port->dev,
|
||||||
__func__, status);
|
"%s: port or port->private is NULL, status=%d\n",
|
||||||
|
__func__, status);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
serial = port->serial;
|
serial = port->serial;
|
||||||
if (serial == NULL || (serial_priv = usb_get_serial_data(serial)) == NULL) {
|
if (serial == NULL || (serial_priv = usb_get_serial_data(serial)) == NULL) {
|
||||||
err("%s: serial or serial->private is NULL, status=%d",
|
dev_err(&port->dev,
|
||||||
__func__, status);
|
"%s: serial or serial->private is NULL, status=%d\n",
|
||||||
|
__func__, status);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1284,7 +1291,8 @@ static void digi_write_bulk_callback(struct urb *urb)
|
|||||||
|
|
||||||
spin_unlock(&priv->dp_port_lock);
|
spin_unlock(&priv->dp_port_lock);
|
||||||
if (ret)
|
if (ret)
|
||||||
err("%s: usb_submit_urb failed, ret=%d, port=%d",
|
dev_err(&port->dev,
|
||||||
|
"%s: usb_submit_urb failed, ret=%d, port=%d\n",
|
||||||
__func__, ret, priv->dp_port_num);
|
__func__, ret, priv->dp_port_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1518,8 +1526,9 @@ static int digi_startup_device(struct usb_serial *serial)
|
|||||||
port->write_urb->dev = port->serial->dev;
|
port->write_urb->dev = port->serial->dev;
|
||||||
ret = usb_submit_urb(port->read_urb, GFP_KERNEL);
|
ret = usb_submit_urb(port->read_urb, GFP_KERNEL);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
err("%s: usb_submit_urb failed, ret=%d, port=%d",
|
dev_err(&port->dev,
|
||||||
__func__, ret, i);
|
"%s: usb_submit_urb failed, ret=%d, port=%d\n",
|
||||||
|
__func__, ret, i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1618,22 +1627,26 @@ static void digi_read_bulk_callback(struct urb *urb)
|
|||||||
dbg("digi_read_bulk_callback: TOP");
|
dbg("digi_read_bulk_callback: TOP");
|
||||||
|
|
||||||
/* port sanity check, do not resubmit if port is not valid */
|
/* port sanity check, do not resubmit if port is not valid */
|
||||||
if (port == NULL || (priv = usb_get_serial_port_data(port)) == NULL) {
|
if (port == NULL)
|
||||||
err("%s: port or port->private is NULL, status=%d",
|
return;
|
||||||
__func__, status);
|
priv = usb_get_serial_port_data(port);
|
||||||
|
if (priv == NULL) {
|
||||||
|
dev_err(&port->dev, "%s: port->private is NULL, status=%d\n",
|
||||||
|
__func__, status);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (port->serial == NULL ||
|
if (port->serial == NULL ||
|
||||||
(serial_priv = usb_get_serial_data(port->serial)) == NULL) {
|
(serial_priv = usb_get_serial_data(port->serial)) == NULL) {
|
||||||
err("%s: serial is bad or serial->private is NULL, status=%d",
|
dev_err(&port->dev, "%s: serial is bad or serial->private "
|
||||||
__func__, status);
|
"is NULL, status=%d\n", __func__, status);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* do not resubmit urb if it has any status error */
|
/* do not resubmit urb if it has any status error */
|
||||||
if (status) {
|
if (status) {
|
||||||
err("%s: nonzero read bulk status: status=%d, port=%d",
|
dev_err(&port->dev,
|
||||||
__func__, status, priv->dp_port_num);
|
"%s: nonzero read bulk status: status=%d, port=%d\n",
|
||||||
|
__func__, status, priv->dp_port_num);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1650,8 +1663,9 @@ static void digi_read_bulk_callback(struct urb *urb)
|
|||||||
urb->dev = port->serial->dev;
|
urb->dev = port->serial->dev;
|
||||||
ret = usb_submit_urb(urb, GFP_ATOMIC);
|
ret = usb_submit_urb(urb, GFP_ATOMIC);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
err("%s: failed resubmitting urb, ret=%d, port=%d",
|
dev_err(&port->dev,
|
||||||
__func__, ret, priv->dp_port_num);
|
"%s: failed resubmitting urb, ret=%d, port=%d\n",
|
||||||
|
__func__, ret, priv->dp_port_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1687,10 +1701,11 @@ static int digi_read_inb_callback(struct urb *urb)
|
|||||||
|
|
||||||
/* short/multiple packet check */
|
/* short/multiple packet check */
|
||||||
if (urb->actual_length != len + 2) {
|
if (urb->actual_length != len + 2) {
|
||||||
err("%s: INCOMPLETE OR MULTIPLE PACKET, urb->status=%d, "
|
dev_err(&port->dev, "%s: INCOMPLETE OR MULTIPLE PACKET, "
|
||||||
"port=%d, opcode=%d, len=%d, actual_length=%d, "
|
"urb->status=%d, port=%d, opcode=%d, len=%d, "
|
||||||
"status=%d", __func__, status, priv->dp_port_num,
|
"actual_length=%d, status=%d\n", __func__, status,
|
||||||
opcode, len, urb->actual_length, port_status);
|
priv->dp_port_num, opcode, len, urb->actual_length,
|
||||||
|
port_status);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -416,7 +416,7 @@ static int empeg_startup(struct usb_serial *serial)
|
|||||||
dbg("%s", __func__);
|
dbg("%s", __func__);
|
||||||
|
|
||||||
if (serial->dev->actconfig->desc.bConfigurationValue != 1) {
|
if (serial->dev->actconfig->desc.bConfigurationValue != 1) {
|
||||||
err("active config #%d != 1 ??",
|
dev_err(&serial->dev->dev, "active config #%d != 1 ??\n",
|
||||||
serial->dev->actconfig->desc.bConfigurationValue);
|
serial->dev->actconfig->desc.bConfigurationValue);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
@@ -499,15 +499,15 @@ static int __init empeg_init(void)
|
|||||||
urb = usb_alloc_urb(0, GFP_KERNEL);
|
urb = usb_alloc_urb(0, GFP_KERNEL);
|
||||||
write_urb_pool[i] = urb;
|
write_urb_pool[i] = urb;
|
||||||
if (urb == NULL) {
|
if (urb == NULL) {
|
||||||
err("No more urbs???");
|
printk(KERN_ERR "empeg: No more urbs???\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
urb->transfer_buffer = kmalloc(URB_TRANSFER_BUFFER_SIZE,
|
urb->transfer_buffer = kmalloc(URB_TRANSFER_BUFFER_SIZE,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!urb->transfer_buffer) {
|
if (!urb->transfer_buffer) {
|
||||||
err("%s - out of memory for urb buffers.",
|
printk(KERN_ERR "empeg: %s - out of memory for urb "
|
||||||
__func__);
|
"buffers.", __func__);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -28,7 +28,8 @@ int ezusb_writememory(struct usb_serial *serial, int address,
|
|||||||
|
|
||||||
/* dbg("ezusb_writememory %x, %d", address, length); */
|
/* dbg("ezusb_writememory %x, %d", address, length); */
|
||||||
if (!serial->dev) {
|
if (!serial->dev) {
|
||||||
err("%s - no physical device present, failing.", __func__);
|
printk(KERN_ERR "ezusb: %s - no physical device present, "
|
||||||
|
"failing.\n", __func__);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1327,7 +1327,7 @@ static int ftdi_sio_port_probe(struct usb_serial_port *port)
|
|||||||
|
|
||||||
priv = kzalloc(sizeof(struct ftdi_private), GFP_KERNEL);
|
priv = kzalloc(sizeof(struct ftdi_private), GFP_KERNEL);
|
||||||
if (!priv) {
|
if (!priv) {
|
||||||
err("%s- kmalloc(%Zd) failed.", __func__,
|
dev_err(&port->dev, "%s- kmalloc(%Zd) failed.\n", __func__,
|
||||||
sizeof(struct ftdi_private));
|
sizeof(struct ftdi_private));
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
@@ -1524,8 +1524,9 @@ static int ftdi_open(struct tty_struct *tty,
|
|||||||
ftdi_read_bulk_callback, port);
|
ftdi_read_bulk_callback, port);
|
||||||
result = usb_submit_urb(port->read_urb, GFP_KERNEL);
|
result = usb_submit_urb(port->read_urb, GFP_KERNEL);
|
||||||
if (result)
|
if (result)
|
||||||
err("%s - failed submitting read urb, error %d",
|
dev_err(&port->dev,
|
||||||
__func__, result);
|
"%s - failed submitting read urb, error %d\n",
|
||||||
|
__func__, result);
|
||||||
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@@ -1559,7 +1560,7 @@ static void ftdi_close(struct tty_struct *tty,
|
|||||||
FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE,
|
FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE,
|
||||||
0, priv->interface, buf, 0,
|
0, priv->interface, buf, 0,
|
||||||
WDR_TIMEOUT) < 0) {
|
WDR_TIMEOUT) < 0) {
|
||||||
err("error from flowcontrol urb");
|
dev_err(&port->dev, "error from flowcontrol urb\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* drop RTS and DTR */
|
/* drop RTS and DTR */
|
||||||
@@ -1624,14 +1625,15 @@ static int ftdi_write(struct tty_struct *tty, struct usb_serial_port *port,
|
|||||||
|
|
||||||
buffer = kmalloc(transfer_size, GFP_ATOMIC);
|
buffer = kmalloc(transfer_size, GFP_ATOMIC);
|
||||||
if (!buffer) {
|
if (!buffer) {
|
||||||
err("%s ran out of kernel memory for urb ...", __func__);
|
dev_err(&port->dev,
|
||||||
|
"%s ran out of kernel memory for urb ...\n", __func__);
|
||||||
count = -ENOMEM;
|
count = -ENOMEM;
|
||||||
goto error_no_buffer;
|
goto error_no_buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
urb = usb_alloc_urb(0, GFP_ATOMIC);
|
urb = usb_alloc_urb(0, GFP_ATOMIC);
|
||||||
if (!urb) {
|
if (!urb) {
|
||||||
err("%s - no more free urbs", __func__);
|
dev_err(&port->dev, "%s - no more free urbs\n", __func__);
|
||||||
count = -ENOMEM;
|
count = -ENOMEM;
|
||||||
goto error_no_urb;
|
goto error_no_urb;
|
||||||
}
|
}
|
||||||
@@ -1675,8 +1677,9 @@ static int ftdi_write(struct tty_struct *tty, struct usb_serial_port *port,
|
|||||||
|
|
||||||
status = usb_submit_urb(urb, GFP_ATOMIC);
|
status = usb_submit_urb(urb, GFP_ATOMIC);
|
||||||
if (status) {
|
if (status) {
|
||||||
err("%s - failed submitting write urb, error %d",
|
dev_err(&port->dev,
|
||||||
__func__, status);
|
"%s - failed submitting write urb, error %d\n",
|
||||||
|
__func__, status);
|
||||||
count = status;
|
count = status;
|
||||||
goto error;
|
goto error;
|
||||||
} else {
|
} else {
|
||||||
@@ -1783,7 +1786,8 @@ static int ftdi_chars_in_buffer(struct tty_struct *tty)
|
|||||||
buffered = (int)priv->tx_outstanding_bytes;
|
buffered = (int)priv->tx_outstanding_bytes;
|
||||||
spin_unlock_irqrestore(&priv->tx_lock, flags);
|
spin_unlock_irqrestore(&priv->tx_lock, flags);
|
||||||
if (buffered < 0) {
|
if (buffered < 0) {
|
||||||
err("%s outstanding tx bytes is negative!", __func__);
|
dev_err(&port->dev, "%s outstanding tx bytes is negative!\n",
|
||||||
|
__func__);
|
||||||
buffered = 0;
|
buffered = 0;
|
||||||
}
|
}
|
||||||
return buffered;
|
return buffered;
|
||||||
@@ -1799,11 +1803,12 @@ static void ftdi_read_bulk_callback(struct urb *urb)
|
|||||||
int status = urb->status;
|
int status = urb->status;
|
||||||
|
|
||||||
if (urb->number_of_packets > 0) {
|
if (urb->number_of_packets > 0) {
|
||||||
err("%s transfer_buffer_length %d actual_length %d number of packets %d",
|
dev_err(&port->dev, "%s transfer_buffer_length %d "
|
||||||
__func__,
|
"actual_length %d number of packets %d\n", __func__,
|
||||||
urb->transfer_buffer_length,
|
urb->transfer_buffer_length,
|
||||||
urb->actual_length, urb->number_of_packets);
|
urb->actual_length, urb->number_of_packets);
|
||||||
err("%s transfer_flags %x ", __func__, urb->transfer_flags);
|
dev_err(&port->dev, "%s transfer_flags %x\n", __func__,
|
||||||
|
urb->transfer_flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
dbg("%s - port %d", __func__, port->number);
|
dbg("%s - port %d", __func__, port->number);
|
||||||
@@ -1824,7 +1829,7 @@ static void ftdi_read_bulk_callback(struct urb *urb)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (urb != port->read_urb)
|
if (urb != port->read_urb)
|
||||||
err("%s - Not my urb!", __func__);
|
dev_err(&port->dev, "%s - Not my urb!\n", __func__);
|
||||||
|
|
||||||
if (status) {
|
if (status) {
|
||||||
/* This will happen at close every time so it is a dbg not an
|
/* This will happen at close every time so it is a dbg not an
|
||||||
@@ -1927,7 +1932,8 @@ static void ftdi_process_read(struct work_struct *work)
|
|||||||
|
|
||||||
length = min(PKTSZ, urb->actual_length-packet_offset)-2;
|
length = min(PKTSZ, urb->actual_length-packet_offset)-2;
|
||||||
if (length < 0) {
|
if (length < 0) {
|
||||||
err("%s - bad packet length: %d", __func__, length+2);
|
dev_err(&port->dev, "%s - bad packet length: %d\n",
|
||||||
|
__func__, length+2);
|
||||||
length = 0;
|
length = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2042,8 +2048,9 @@ static void ftdi_process_read(struct work_struct *work)
|
|||||||
|
|
||||||
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
|
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
|
||||||
if (result)
|
if (result)
|
||||||
err("%s - failed resubmitting read urb, error %d",
|
dev_err(&port->dev,
|
||||||
__func__, result);
|
"%s - failed resubmitting read urb, error %d\n",
|
||||||
|
__func__, result);
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
tty_kref_put(tty);
|
tty_kref_put(tty);
|
||||||
@@ -2072,8 +2079,8 @@ static void ftdi_break_ctl(struct tty_struct *tty, int break_state)
|
|||||||
FTDI_SIO_SET_DATA_REQUEST_TYPE,
|
FTDI_SIO_SET_DATA_REQUEST_TYPE,
|
||||||
urb_value , priv->interface,
|
urb_value , priv->interface,
|
||||||
buf, 0, WDR_TIMEOUT) < 0) {
|
buf, 0, WDR_TIMEOUT) < 0) {
|
||||||
err("%s FAILED to enable/disable break state (state was %d)",
|
dev_err(&port->dev, "%s FAILED to enable/disable break state "
|
||||||
__func__, break_state);
|
"(state was %d)\n", __func__, break_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
dbg("%s break state is %d - urb is %d", __func__,
|
dbg("%s break state is %d - urb is %d", __func__,
|
||||||
@@ -2145,7 +2152,7 @@ static void ftdi_set_termios(struct tty_struct *tty,
|
|||||||
case CS7: urb_value |= 7; dbg("Setting CS7"); break;
|
case CS7: urb_value |= 7; dbg("Setting CS7"); break;
|
||||||
case CS8: urb_value |= 8; dbg("Setting CS8"); break;
|
case CS8: urb_value |= 8; dbg("Setting CS8"); break;
|
||||||
default:
|
default:
|
||||||
err("CSIZE was set but not CS5-CS8");
|
dev_err(&port->dev, "CSIZE was set but not CS5-CS8\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2158,7 +2165,8 @@ static void ftdi_set_termios(struct tty_struct *tty,
|
|||||||
FTDI_SIO_SET_DATA_REQUEST_TYPE,
|
FTDI_SIO_SET_DATA_REQUEST_TYPE,
|
||||||
urb_value , priv->interface,
|
urb_value , priv->interface,
|
||||||
buf, 0, WDR_SHORT_TIMEOUT) < 0) {
|
buf, 0, WDR_SHORT_TIMEOUT) < 0) {
|
||||||
err("%s FAILED to set databits/stopbits/parity", __func__);
|
dev_err(&port->dev, "%s FAILED to set "
|
||||||
|
"databits/stopbits/parity\n", __func__);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now do the baudrate */
|
/* Now do the baudrate */
|
||||||
@@ -2169,14 +2177,17 @@ static void ftdi_set_termios(struct tty_struct *tty,
|
|||||||
FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE,
|
FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE,
|
||||||
0, priv->interface,
|
0, priv->interface,
|
||||||
buf, 0, WDR_TIMEOUT) < 0) {
|
buf, 0, WDR_TIMEOUT) < 0) {
|
||||||
err("%s error from disable flowcontrol urb", __func__);
|
dev_err(&port->dev,
|
||||||
|
"%s error from disable flowcontrol urb\n",
|
||||||
|
__func__);
|
||||||
}
|
}
|
||||||
/* Drop RTS and DTR */
|
/* Drop RTS and DTR */
|
||||||
clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
|
clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
|
||||||
} else {
|
} else {
|
||||||
/* set the baudrate determined before */
|
/* set the baudrate determined before */
|
||||||
if (change_speed(tty, port))
|
if (change_speed(tty, port))
|
||||||
err("%s urb failed to set baudrate", __func__);
|
dev_err(&port->dev, "%s urb failed to set baudrate\n",
|
||||||
|
__func__);
|
||||||
/* Ensure RTS and DTR are raised when baudrate changed from 0 */
|
/* Ensure RTS and DTR are raised when baudrate changed from 0 */
|
||||||
if (!old_termios || (old_termios->c_cflag & CBAUD) == B0)
|
if (!old_termios || (old_termios->c_cflag & CBAUD) == B0)
|
||||||
set_mctrl(port, TIOCM_DTR | TIOCM_RTS);
|
set_mctrl(port, TIOCM_DTR | TIOCM_RTS);
|
||||||
@@ -2192,7 +2203,8 @@ static void ftdi_set_termios(struct tty_struct *tty,
|
|||||||
FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE,
|
FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE,
|
||||||
0 , (FTDI_SIO_RTS_CTS_HS | priv->interface),
|
0 , (FTDI_SIO_RTS_CTS_HS | priv->interface),
|
||||||
buf, 0, WDR_TIMEOUT) < 0) {
|
buf, 0, WDR_TIMEOUT) < 0) {
|
||||||
err("urb failed to set to rts/cts flow control");
|
dev_err(&port->dev,
|
||||||
|
"urb failed to set to rts/cts flow control\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -2223,7 +2235,8 @@ static void ftdi_set_termios(struct tty_struct *tty,
|
|||||||
urb_value , (FTDI_SIO_XON_XOFF_HS
|
urb_value , (FTDI_SIO_XON_XOFF_HS
|
||||||
| priv->interface),
|
| priv->interface),
|
||||||
buf, 0, WDR_TIMEOUT) < 0) {
|
buf, 0, WDR_TIMEOUT) < 0) {
|
||||||
err("urb failed to set to xon/xoff flow control");
|
dev_err(&port->dev, "urb failed to set to "
|
||||||
|
"xon/xoff flow control\n");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* else clause to only run if cflag ! CRTSCTS and iflag
|
/* else clause to only run if cflag ! CRTSCTS and iflag
|
||||||
@@ -2236,7 +2249,8 @@ static void ftdi_set_termios(struct tty_struct *tty,
|
|||||||
FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE,
|
FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE,
|
||||||
0, priv->interface,
|
0, priv->interface,
|
||||||
buf, 0, WDR_TIMEOUT) < 0) {
|
buf, 0, WDR_TIMEOUT) < 0) {
|
||||||
err("urb failed to clear flow control");
|
dev_err(&port->dev,
|
||||||
|
"urb failed to clear flow control\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3109,13 +3109,13 @@ static int edge_startup(struct usb_serial *serial)
|
|||||||
edge_serial->interrupt_read_urb =
|
edge_serial->interrupt_read_urb =
|
||||||
usb_alloc_urb(0, GFP_KERNEL);
|
usb_alloc_urb(0, GFP_KERNEL);
|
||||||
if (!edge_serial->interrupt_read_urb) {
|
if (!edge_serial->interrupt_read_urb) {
|
||||||
err("out of memory");
|
dev_err(&dev->dev, "out of memory\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
edge_serial->interrupt_in_buffer =
|
edge_serial->interrupt_in_buffer =
|
||||||
kmalloc(buffer_size, GFP_KERNEL);
|
kmalloc(buffer_size, GFP_KERNEL);
|
||||||
if (!edge_serial->interrupt_in_buffer) {
|
if (!edge_serial->interrupt_in_buffer) {
|
||||||
err("out of memory");
|
dev_err(&dev->dev, "out of memory\n");
|
||||||
usb_free_urb(edge_serial->interrupt_read_urb);
|
usb_free_urb(edge_serial->interrupt_read_urb);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
@@ -3146,13 +3146,13 @@ static int edge_startup(struct usb_serial *serial)
|
|||||||
edge_serial->read_urb =
|
edge_serial->read_urb =
|
||||||
usb_alloc_urb(0, GFP_KERNEL);
|
usb_alloc_urb(0, GFP_KERNEL);
|
||||||
if (!edge_serial->read_urb) {
|
if (!edge_serial->read_urb) {
|
||||||
err("out of memory");
|
dev_err(&dev->dev, "out of memory\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
edge_serial->bulk_in_buffer =
|
edge_serial->bulk_in_buffer =
|
||||||
kmalloc(buffer_size, GFP_KERNEL);
|
kmalloc(buffer_size, GFP_KERNEL);
|
||||||
if (!edge_serial->bulk_in_buffer) {
|
if (!edge_serial->bulk_in_buffer) {
|
||||||
err("out of memory");
|
dev_err(&dev->dev, "out of memory\n");
|
||||||
usb_free_urb(edge_serial->read_urb);
|
usb_free_urb(edge_serial->read_urb);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
@@ -3181,7 +3181,8 @@ static int edge_startup(struct usb_serial *serial)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!interrupt_in_found || !bulk_in_found || !bulk_out_found) {
|
if (!interrupt_in_found || !bulk_in_found || !bulk_out_found) {
|
||||||
err("Error - the proper endpoints were not found!");
|
dev_err(&dev->dev, "Error - the proper endpoints "
|
||||||
|
"were not found!\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3190,8 +3191,9 @@ static int edge_startup(struct usb_serial *serial)
|
|||||||
response = usb_submit_urb(edge_serial->interrupt_read_urb,
|
response = usb_submit_urb(edge_serial->interrupt_read_urb,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (response)
|
if (response)
|
||||||
err("%s - Error %d submitting control urb",
|
dev_err(&dev->dev,
|
||||||
__func__, response);
|
"%s - Error %d submitting control urb\n",
|
||||||
|
__func__, response);
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
@@ -608,7 +608,7 @@ static int ipaq_open(struct tty_struct *tty,
|
|||||||
bytes_out = 0;
|
bytes_out = 0;
|
||||||
priv = kmalloc(sizeof(struct ipaq_private), GFP_KERNEL);
|
priv = kmalloc(sizeof(struct ipaq_private), GFP_KERNEL);
|
||||||
if (priv == NULL) {
|
if (priv == NULL) {
|
||||||
err("%s - Out of memory", __func__);
|
dev_err(&port->dev, "%s - Out of memory\n", __func__);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
usb_set_serial_port_data(port, priv);
|
usb_set_serial_port_data(port, priv);
|
||||||
@@ -693,8 +693,7 @@ static int ipaq_open(struct tty_struct *tty,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!retries && result) {
|
if (!retries && result) {
|
||||||
err("%s - failed doing control urb, error %d", __func__,
|
dev_err(&port->dev, "%s - failed doing control urb, error %d\n", __func__, result);
|
||||||
result);
|
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -707,8 +706,9 @@ static int ipaq_open(struct tty_struct *tty,
|
|||||||
|
|
||||||
result = usb_submit_urb(port->read_urb, GFP_KERNEL);
|
result = usb_submit_urb(port->read_urb, GFP_KERNEL);
|
||||||
if (result) {
|
if (result) {
|
||||||
err("%s - failed submitting read urb, error %d",
|
dev_err(&port->dev,
|
||||||
__func__, result);
|
"%s - failed submitting read urb, error %d\n",
|
||||||
|
__func__, result);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -716,7 +716,7 @@ static int ipaq_open(struct tty_struct *tty,
|
|||||||
|
|
||||||
enomem:
|
enomem:
|
||||||
result = -ENOMEM;
|
result = -ENOMEM;
|
||||||
err("%s - Out of memory", __func__);
|
dev_err(&port->dev, "%s - Out of memory\n", __func__);
|
||||||
error:
|
error:
|
||||||
ipaq_destroy_lists(port);
|
ipaq_destroy_lists(port);
|
||||||
kfree(priv);
|
kfree(priv);
|
||||||
@@ -781,8 +781,9 @@ static void ipaq_read_bulk_callback(struct urb *urb)
|
|||||||
ipaq_read_bulk_callback, port);
|
ipaq_read_bulk_callback, port);
|
||||||
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
|
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
|
||||||
if (result)
|
if (result)
|
||||||
err("%s - failed resubmitting read urb, error %d",
|
dev_err(&port->dev,
|
||||||
__func__, result);
|
"%s - failed resubmitting read urb, error %d\n",
|
||||||
|
__func__, result);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -847,7 +848,8 @@ static int ipaq_write_bulk(struct usb_serial_port *port,
|
|||||||
spin_unlock_irqrestore(&write_list_lock, flags);
|
spin_unlock_irqrestore(&write_list_lock, flags);
|
||||||
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
|
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
|
||||||
if (result)
|
if (result)
|
||||||
err("%s - failed submitting write urb, error %d",
|
dev_err(&port->dev,
|
||||||
|
"%s - failed submitting write urb, error %d\n",
|
||||||
__func__, result);
|
__func__, result);
|
||||||
} else {
|
} else {
|
||||||
spin_unlock_irqrestore(&write_list_lock, flags);
|
spin_unlock_irqrestore(&write_list_lock, flags);
|
||||||
@@ -909,8 +911,9 @@ static void ipaq_write_bulk_callback(struct urb *urb)
|
|||||||
spin_unlock_irqrestore(&write_list_lock, flags);
|
spin_unlock_irqrestore(&write_list_lock, flags);
|
||||||
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
|
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
|
||||||
if (result)
|
if (result)
|
||||||
err("%s - failed submitting write urb, error %d",
|
dev_err(&port->dev,
|
||||||
__func__, result);
|
"%s - failed submitting write urb, error %d\n",
|
||||||
|
__func__, result);
|
||||||
} else {
|
} else {
|
||||||
priv->active = 0;
|
priv->active = 0;
|
||||||
spin_unlock_irqrestore(&write_list_lock, flags);
|
spin_unlock_irqrestore(&write_list_lock, flags);
|
||||||
@@ -957,7 +960,7 @@ static int ipaq_startup(struct usb_serial *serial)
|
|||||||
{
|
{
|
||||||
dbg("%s", __func__);
|
dbg("%s", __func__);
|
||||||
if (serial->dev->actconfig->desc.bConfigurationValue != 1) {
|
if (serial->dev->actconfig->desc.bConfigurationValue != 1) {
|
||||||
err("active config #%d != 1 ??",
|
dev_err(&serial->dev->dev, "active config #%d != 1 ??\n",
|
||||||
serial->dev->actconfig->desc.bConfigurationValue);
|
serial->dev->actconfig->desc.bConfigurationValue);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
@@ -742,11 +742,13 @@ static int keyspan_pda_fake_startup(struct usb_serial *serial)
|
|||||||
fw_name = "keyspan_pda/xircom_pgs.fw";
|
fw_name = "keyspan_pda/xircom_pgs.fw";
|
||||||
#endif
|
#endif
|
||||||
else {
|
else {
|
||||||
err("%s: unknown vendor, aborting.", __func__);
|
dev_err(&serial->dev->dev, "%s: unknown vendor, aborting.\n",
|
||||||
|
__func__);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
if (request_ihex_firmware(&fw, fw_name, &serial->dev->dev)) {
|
if (request_ihex_firmware(&fw, fw_name, &serial->dev->dev)) {
|
||||||
err("failed to load firmware \"%s\"\n", fw_name);
|
dev_err(&serial->dev->dev, "failed to load firmware \"%s\"\n",
|
||||||
|
fw_name);
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
record = (const struct ihex_binrec *)fw->data;
|
record = (const struct ihex_binrec *)fw->data;
|
||||||
@@ -756,10 +758,10 @@ static int keyspan_pda_fake_startup(struct usb_serial *serial)
|
|||||||
(unsigned char *)record->data,
|
(unsigned char *)record->data,
|
||||||
be16_to_cpu(record->len), 0xa0);
|
be16_to_cpu(record->len), 0xa0);
|
||||||
if (response < 0) {
|
if (response < 0) {
|
||||||
err("ezusb_writememory failed for Keyspan PDA "
|
dev_err(&serial->dev->dev, "ezusb_writememory failed "
|
||||||
"firmware (%d %04X %p %d)",
|
"for Keyspan PDA firmware (%d %04X %p %d)\n",
|
||||||
response, be32_to_cpu(record->addr),
|
response, be32_to_cpu(record->addr),
|
||||||
record->data, be16_to_cpu(record->len));
|
record->data, be16_to_cpu(record->len));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
record = ihex_next_binrec(record);
|
record = ihex_next_binrec(record);
|
||||||
|
@@ -182,7 +182,8 @@ static int klsi_105_chg_port_settings(struct usb_serial_port *port,
|
|||||||
sizeof(struct klsi_105_port_settings),
|
sizeof(struct klsi_105_port_settings),
|
||||||
KLSI_TIMEOUT);
|
KLSI_TIMEOUT);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
err("Change port settings failed (error = %d)", rc);
|
dev_err(&port->dev,
|
||||||
|
"Change port settings failed (error = %d)\n", rc);
|
||||||
dev_info(&port->serial->dev->dev,
|
dev_info(&port->serial->dev->dev,
|
||||||
"%d byte block, baudrate %x, databits %d, u1 %d, u2 %d\n",
|
"%d byte block, baudrate %x, databits %d, u1 %d, u2 %d\n",
|
||||||
settings->pktlen, settings->baudrate, settings->databits,
|
settings->pktlen, settings->baudrate, settings->databits,
|
||||||
@@ -225,7 +226,8 @@ static int klsi_105_get_line_state(struct usb_serial_port *port,
|
|||||||
10000
|
10000
|
||||||
);
|
);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
err("Reading line status failed (error = %d)", rc);
|
dev_err(&port->dev, "Reading line status failed (error = %d)\n",
|
||||||
|
rc);
|
||||||
else {
|
else {
|
||||||
status = get_unaligned_le16(status_buf);
|
status = get_unaligned_le16(status_buf);
|
||||||
|
|
||||||
@@ -279,15 +281,16 @@ static int klsi_105_startup(struct usb_serial *serial)
|
|||||||
|
|
||||||
priv->write_urb_pool[j] = urb;
|
priv->write_urb_pool[j] = urb;
|
||||||
if (urb == NULL) {
|
if (urb == NULL) {
|
||||||
err("No more urbs???");
|
dev_err(&serial->dev->dev, "No more urbs???\n");
|
||||||
goto err_cleanup;
|
goto err_cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
urb->transfer_buffer =
|
urb->transfer_buffer =
|
||||||
kmalloc(URB_TRANSFER_BUFFER_SIZE, GFP_KERNEL);
|
kmalloc(URB_TRANSFER_BUFFER_SIZE, GFP_KERNEL);
|
||||||
if (!urb->transfer_buffer) {
|
if (!urb->transfer_buffer) {
|
||||||
err("%s - out of memory for urb buffers.",
|
dev_err(&serial->dev->dev,
|
||||||
__func__);
|
"%s - out of memory for urb buffers.\n",
|
||||||
|
__func__);
|
||||||
goto err_cleanup;
|
goto err_cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -408,7 +411,8 @@ static int klsi_105_open(struct tty_struct *tty,
|
|||||||
|
|
||||||
rc = usb_submit_urb(port->read_urb, GFP_KERNEL);
|
rc = usb_submit_urb(port->read_urb, GFP_KERNEL);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
err("%s - failed submitting read urb, error %d", __func__, rc);
|
dev_err(&port->dev, "%s - failed submitting read urb, "
|
||||||
|
"error %d\n", __func__, rc);
|
||||||
retval = rc;
|
retval = rc;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
@@ -423,7 +427,7 @@ static int klsi_105_open(struct tty_struct *tty,
|
|||||||
0,
|
0,
|
||||||
KLSI_TIMEOUT);
|
KLSI_TIMEOUT);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
err("Enabling read failed (error = %d)", rc);
|
dev_err(&port->dev, "Enabling read failed (error = %d)\n", rc);
|
||||||
retval = rc;
|
retval = rc;
|
||||||
} else
|
} else
|
||||||
dbg("%s - enabled reading", __func__);
|
dbg("%s - enabled reading", __func__);
|
||||||
@@ -463,7 +467,8 @@ static void klsi_105_close(struct tty_struct *tty,
|
|||||||
NULL, 0,
|
NULL, 0,
|
||||||
KLSI_TIMEOUT);
|
KLSI_TIMEOUT);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
err("Disabling read failed (error = %d)", rc);
|
dev_err(&port->dev,
|
||||||
|
"Disabling read failed (error = %d)\n", rc);
|
||||||
}
|
}
|
||||||
mutex_unlock(&port->serial->disc_mutex);
|
mutex_unlock(&port->serial->disc_mutex);
|
||||||
|
|
||||||
@@ -522,7 +527,9 @@ static int klsi_105_write(struct tty_struct *tty,
|
|||||||
urb->transfer_buffer =
|
urb->transfer_buffer =
|
||||||
kmalloc(URB_TRANSFER_BUFFER_SIZE, GFP_ATOMIC);
|
kmalloc(URB_TRANSFER_BUFFER_SIZE, GFP_ATOMIC);
|
||||||
if (urb->transfer_buffer == NULL) {
|
if (urb->transfer_buffer == NULL) {
|
||||||
err("%s - no more kernel memory...", __func__);
|
dev_err(&port->dev,
|
||||||
|
"%s - no more kernel memory...\n",
|
||||||
|
__func__);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -549,8 +556,9 @@ static int klsi_105_write(struct tty_struct *tty,
|
|||||||
/* send the data out the bulk port */
|
/* send the data out the bulk port */
|
||||||
result = usb_submit_urb(urb, GFP_ATOMIC);
|
result = usb_submit_urb(urb, GFP_ATOMIC);
|
||||||
if (result) {
|
if (result) {
|
||||||
err("%s - failed submitting write urb, error %d",
|
dev_err(&port->dev,
|
||||||
__func__, result);
|
"%s - failed submitting write urb, error %d\n",
|
||||||
|
__func__, result);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
buf += size;
|
buf += size;
|
||||||
@@ -694,8 +702,9 @@ static void klsi_105_read_bulk_callback(struct urb *urb)
|
|||||||
port);
|
port);
|
||||||
rc = usb_submit_urb(port->read_urb, GFP_ATOMIC);
|
rc = usb_submit_urb(port->read_urb, GFP_ATOMIC);
|
||||||
if (rc)
|
if (rc)
|
||||||
err("%s - failed resubmitting read urb, error %d",
|
dev_err(&port->dev,
|
||||||
__func__, rc);
|
"%s - failed resubmitting read urb, error %d\n",
|
||||||
|
__func__, rc);
|
||||||
} /* klsi_105_read_bulk_callback */
|
} /* klsi_105_read_bulk_callback */
|
||||||
|
|
||||||
|
|
||||||
@@ -799,7 +808,8 @@ static void klsi_105_set_termios(struct tty_struct *tty,
|
|||||||
priv->cfg.databits = kl5kusb105a_dtb_8;
|
priv->cfg.databits = kl5kusb105a_dtb_8;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
err("CSIZE was not CS5-CS8, using default of 8");
|
dev_err(&port->dev,
|
||||||
|
"CSIZE was not CS5-CS8, using default of 8\n");
|
||||||
priv->cfg.databits = kl5kusb105a_dtb_8;
|
priv->cfg.databits = kl5kusb105a_dtb_8;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -886,7 +896,8 @@ static int klsi_105_tiocmget(struct tty_struct *tty, struct file *file)
|
|||||||
|
|
||||||
rc = klsi_105_get_line_state(port, &line_state);
|
rc = klsi_105_get_line_state(port, &line_state);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
err("Reading line control failed (error = %d)", rc);
|
dev_err(&port->dev,
|
||||||
|
"Reading line control failed (error = %d)\n", rc);
|
||||||
/* better return value? EAGAIN? */
|
/* better return value? EAGAIN? */
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@@ -944,8 +955,9 @@ static void klsi_105_unthrottle(struct tty_struct *tty)
|
|||||||
port->read_urb->dev = port->serial->dev;
|
port->read_urb->dev = port->serial->dev;
|
||||||
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
|
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
|
||||||
if (result)
|
if (result)
|
||||||
err("%s - failed submitting read urb, error %d", __func__,
|
dev_err(&port->dev,
|
||||||
result);
|
"%s - failed submitting read urb, error %d\n",
|
||||||
|
__func__, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -246,7 +246,8 @@ static int mct_u232_set_baud_rate(struct tty_struct *tty,
|
|||||||
0, 0, &divisor, MCT_U232_SET_BAUD_RATE_SIZE,
|
0, 0, &divisor, MCT_U232_SET_BAUD_RATE_SIZE,
|
||||||
WDR_TIMEOUT);
|
WDR_TIMEOUT);
|
||||||
if (rc < 0) /*FIXME: What value speed results */
|
if (rc < 0) /*FIXME: What value speed results */
|
||||||
err("Set BAUD RATE %d failed (error = %d)", value, rc);
|
dev_err(&port->dev, "Set BAUD RATE %d failed (error = %d)\n",
|
||||||
|
value, rc);
|
||||||
else
|
else
|
||||||
tty_encode_baud_rate(tty, speed, speed);
|
tty_encode_baud_rate(tty, speed, speed);
|
||||||
dbg("set_baud_rate: value: 0x%x, divisor: 0x%x", value, divisor);
|
dbg("set_baud_rate: value: 0x%x, divisor: 0x%x", value, divisor);
|
||||||
@@ -274,8 +275,9 @@ static int mct_u232_set_baud_rate(struct tty_struct *tty,
|
|||||||
0, 0, &zero_byte, MCT_U232_SET_UNKNOWN1_SIZE,
|
0, 0, &zero_byte, MCT_U232_SET_UNKNOWN1_SIZE,
|
||||||
WDR_TIMEOUT);
|
WDR_TIMEOUT);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
err("Sending USB device request code %d failed (error = %d)",
|
dev_err(&port->dev, "Sending USB device request code %d "
|
||||||
MCT_U232_SET_UNKNOWN1_REQUEST, rc);
|
"failed (error = %d)\n", MCT_U232_SET_UNKNOWN1_REQUEST,
|
||||||
|
rc);
|
||||||
|
|
||||||
if (port && C_CRTSCTS(tty))
|
if (port && C_CRTSCTS(tty))
|
||||||
cts_enable_byte = 1;
|
cts_enable_byte = 1;
|
||||||
@@ -288,8 +290,8 @@ static int mct_u232_set_baud_rate(struct tty_struct *tty,
|
|||||||
0, 0, &cts_enable_byte, MCT_U232_SET_CTS_SIZE,
|
0, 0, &cts_enable_byte, MCT_U232_SET_CTS_SIZE,
|
||||||
WDR_TIMEOUT);
|
WDR_TIMEOUT);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
err("Sending USB device request code %d failed (error = %d)",
|
dev_err(&port->dev, "Sending USB device request code %d "
|
||||||
MCT_U232_SET_CTS_REQUEST, rc);
|
"failed (error = %d)\n", MCT_U232_SET_CTS_REQUEST, rc);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
} /* mct_u232_set_baud_rate */
|
} /* mct_u232_set_baud_rate */
|
||||||
@@ -303,7 +305,8 @@ static int mct_u232_set_line_ctrl(struct usb_serial *serial, unsigned char lcr)
|
|||||||
0, 0, &lcr, MCT_U232_SET_LINE_CTRL_SIZE,
|
0, 0, &lcr, MCT_U232_SET_LINE_CTRL_SIZE,
|
||||||
WDR_TIMEOUT);
|
WDR_TIMEOUT);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
err("Set LINE CTRL 0x%x failed (error = %d)", lcr, rc);
|
dev_err(&serial->dev->dev,
|
||||||
|
"Set LINE CTRL 0x%x failed (error = %d)\n", lcr, rc);
|
||||||
dbg("set_line_ctrl: 0x%x", lcr);
|
dbg("set_line_ctrl: 0x%x", lcr);
|
||||||
return rc;
|
return rc;
|
||||||
} /* mct_u232_set_line_ctrl */
|
} /* mct_u232_set_line_ctrl */
|
||||||
@@ -325,7 +328,8 @@ static int mct_u232_set_modem_ctrl(struct usb_serial *serial,
|
|||||||
0, 0, &mcr, MCT_U232_SET_MODEM_CTRL_SIZE,
|
0, 0, &mcr, MCT_U232_SET_MODEM_CTRL_SIZE,
|
||||||
WDR_TIMEOUT);
|
WDR_TIMEOUT);
|
||||||
if (rc < 0)
|
if (rc < 0)
|
||||||
err("Set MODEM CTRL 0x%x failed (error = %d)", mcr, rc);
|
dev_err(&serial->dev->dev,
|
||||||
|
"Set MODEM CTRL 0x%x failed (error = %d)\n", mcr, rc);
|
||||||
dbg("set_modem_ctrl: state=0x%x ==> mcr=0x%x", control_state, mcr);
|
dbg("set_modem_ctrl: state=0x%x ==> mcr=0x%x", control_state, mcr);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
@@ -341,7 +345,8 @@ static int mct_u232_get_modem_stat(struct usb_serial *serial,
|
|||||||
0, 0, msr, MCT_U232_GET_MODEM_STAT_SIZE,
|
0, 0, msr, MCT_U232_GET_MODEM_STAT_SIZE,
|
||||||
WDR_TIMEOUT);
|
WDR_TIMEOUT);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
err("Get MODEM STATus failed (error = %d)", rc);
|
dev_err(&serial->dev->dev,
|
||||||
|
"Get MODEM STATus failed (error = %d)\n", rc);
|
||||||
*msr = 0;
|
*msr = 0;
|
||||||
}
|
}
|
||||||
dbg("get_modem_stat: 0x%x", *msr);
|
dbg("get_modem_stat: 0x%x", *msr);
|
||||||
@@ -470,8 +475,9 @@ static int mct_u232_open(struct tty_struct *tty,
|
|||||||
port->read_urb->dev = port->serial->dev;
|
port->read_urb->dev = port->serial->dev;
|
||||||
retval = usb_submit_urb(port->read_urb, GFP_KERNEL);
|
retval = usb_submit_urb(port->read_urb, GFP_KERNEL);
|
||||||
if (retval) {
|
if (retval) {
|
||||||
err("usb_submit_urb(read bulk) failed pipe 0x%x err %d",
|
dev_err(&port->dev,
|
||||||
port->read_urb->pipe, retval);
|
"usb_submit_urb(read bulk) failed pipe 0x%x err %d\n",
|
||||||
|
port->read_urb->pipe, retval);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -479,8 +485,9 @@ static int mct_u232_open(struct tty_struct *tty,
|
|||||||
retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
|
retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
|
||||||
if (retval) {
|
if (retval) {
|
||||||
usb_kill_urb(port->read_urb);
|
usb_kill_urb(port->read_urb);
|
||||||
err(" usb_submit_urb(read int) failed pipe 0x%x err %d",
|
dev_err(&port->dev,
|
||||||
port->interrupt_in_urb->pipe, retval);
|
"usb_submit_urb(read int) failed pipe 0x%x err %d",
|
||||||
|
port->interrupt_in_urb->pipe, retval);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -612,8 +619,9 @@ static void mct_u232_read_int_callback(struct urb *urb)
|
|||||||
exit:
|
exit:
|
||||||
retval = usb_submit_urb(urb, GFP_ATOMIC);
|
retval = usb_submit_urb(urb, GFP_ATOMIC);
|
||||||
if (retval)
|
if (retval)
|
||||||
err("%s - usb_submit_urb failed with result %d",
|
dev_err(&port->dev,
|
||||||
__func__, retval);
|
"%s - usb_submit_urb failed with result %d\n",
|
||||||
|
__func__, retval);
|
||||||
} /* mct_u232_read_int_callback */
|
} /* mct_u232_read_int_callback */
|
||||||
|
|
||||||
static void mct_u232_set_termios(struct tty_struct *tty,
|
static void mct_u232_set_termios(struct tty_struct *tty,
|
||||||
@@ -680,7 +688,8 @@ static void mct_u232_set_termios(struct tty_struct *tty,
|
|||||||
case CS8:
|
case CS8:
|
||||||
last_lcr |= MCT_U232_DATA_BITS_8; break;
|
last_lcr |= MCT_U232_DATA_BITS_8; break;
|
||||||
default:
|
default:
|
||||||
err("CSIZE was not CS5-CS8, using default of 8");
|
dev_err(&port->dev,
|
||||||
|
"CSIZE was not CS5-CS8, using default of 8\n");
|
||||||
last_lcr |= MCT_U232_DATA_BITS_8;
|
last_lcr |= MCT_U232_DATA_BITS_8;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -355,14 +355,16 @@ static int mos7720_open(struct tty_struct *tty,
|
|||||||
mos7720_port->write_urb_pool[j] = urb;
|
mos7720_port->write_urb_pool[j] = urb;
|
||||||
|
|
||||||
if (urb == NULL) {
|
if (urb == NULL) {
|
||||||
err("No more urbs???");
|
dev_err(&port->dev, "No more urbs???\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
urb->transfer_buffer = kmalloc(URB_TRANSFER_BUFFER_SIZE,
|
urb->transfer_buffer = kmalloc(URB_TRANSFER_BUFFER_SIZE,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!urb->transfer_buffer) {
|
if (!urb->transfer_buffer) {
|
||||||
err("%s-out of memory for urb buffers.", __func__);
|
dev_err(&port->dev,
|
||||||
|
"%s-out of memory for urb buffers.\n",
|
||||||
|
__func__);
|
||||||
usb_free_urb(mos7720_port->write_urb_pool[j]);
|
usb_free_urb(mos7720_port->write_urb_pool[j]);
|
||||||
mos7720_port->write_urb_pool[j] = NULL;
|
mos7720_port->write_urb_pool[j] = NULL;
|
||||||
continue;
|
continue;
|
||||||
@@ -694,7 +696,8 @@ static int mos7720_write(struct tty_struct *tty, struct usb_serial_port *port,
|
|||||||
urb->transfer_buffer = kmalloc(URB_TRANSFER_BUFFER_SIZE,
|
urb->transfer_buffer = kmalloc(URB_TRANSFER_BUFFER_SIZE,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (urb->transfer_buffer == NULL) {
|
if (urb->transfer_buffer == NULL) {
|
||||||
err("%s no more kernel memory...", __func__);
|
dev_err(&port->dev, "%s no more kernel memory...\n",
|
||||||
|
__func__);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -714,8 +717,8 @@ static int mos7720_write(struct tty_struct *tty, struct usb_serial_port *port,
|
|||||||
/* send it down the pipe */
|
/* send it down the pipe */
|
||||||
status = usb_submit_urb(urb, GFP_ATOMIC);
|
status = usb_submit_urb(urb, GFP_ATOMIC);
|
||||||
if (status) {
|
if (status) {
|
||||||
err("%s - usb_submit_urb(write bulk) failed with status = %d",
|
dev_err(&port->dev, "%s - usb_submit_urb(write bulk) failed "
|
||||||
__func__, status);
|
"with status = %d\n", __func__, status);
|
||||||
bytes_sent = status;
|
bytes_sent = status;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
@@ -975,7 +978,7 @@ static int send_cmd_write_baud_rate(struct moschip_port *mos7720_port,
|
|||||||
/* Calculate the Divisor */
|
/* Calculate the Divisor */
|
||||||
status = calc_baud_rate_divisor(baudrate, &divisor);
|
status = calc_baud_rate_divisor(baudrate, &divisor);
|
||||||
if (status) {
|
if (status) {
|
||||||
err("%s - bad baud rate", __func__);
|
dev_err(&port->dev, "%s - bad baud rate\n", __func__);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1478,7 +1481,7 @@ static int mos7720_startup(struct usb_serial *serial)
|
|||||||
/* create our private serial structure */
|
/* create our private serial structure */
|
||||||
mos7720_serial = kzalloc(sizeof(struct moschip_serial), GFP_KERNEL);
|
mos7720_serial = kzalloc(sizeof(struct moschip_serial), GFP_KERNEL);
|
||||||
if (mos7720_serial == NULL) {
|
if (mos7720_serial == NULL) {
|
||||||
err("%s - Out of memory", __func__);
|
dev_err(&dev->dev, "%s - Out of memory\n", __func__);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1491,7 +1494,7 @@ static int mos7720_startup(struct usb_serial *serial)
|
|||||||
for (i = 0; i < serial->num_ports; ++i) {
|
for (i = 0; i < serial->num_ports; ++i) {
|
||||||
mos7720_port = kzalloc(sizeof(struct moschip_port), GFP_KERNEL);
|
mos7720_port = kzalloc(sizeof(struct moschip_port), GFP_KERNEL);
|
||||||
if (mos7720_port == NULL) {
|
if (mos7720_port == NULL) {
|
||||||
err("%s - Out of memory", __func__);
|
dev_err(&dev->dev, "%s - Out of memory\n", __func__);
|
||||||
usb_set_serial_data(serial, NULL);
|
usb_set_serial_data(serial, NULL);
|
||||||
kfree(mos7720_serial);
|
kfree(mos7720_serial);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
@@ -844,7 +844,7 @@ static int mos7840_open(struct tty_struct *tty,
|
|||||||
mos7840_port->write_urb_pool[j] = urb;
|
mos7840_port->write_urb_pool[j] = urb;
|
||||||
|
|
||||||
if (urb == NULL) {
|
if (urb == NULL) {
|
||||||
err("No more urbs???");
|
dev_err(&port->dev, "No more urbs???\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -853,7 +853,9 @@ static int mos7840_open(struct tty_struct *tty,
|
|||||||
if (!urb->transfer_buffer) {
|
if (!urb->transfer_buffer) {
|
||||||
usb_free_urb(urb);
|
usb_free_urb(urb);
|
||||||
mos7840_port->write_urb_pool[j] = NULL;
|
mos7840_port->write_urb_pool[j] = NULL;
|
||||||
err("%s-out of memory for urb buffers.", __func__);
|
dev_err(&port->dev,
|
||||||
|
"%s-out of memory for urb buffers.\n",
|
||||||
|
__func__);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1021,8 +1023,8 @@ static int mos7840_open(struct tty_struct *tty,
|
|||||||
usb_submit_urb(serial->port[0]->interrupt_in_urb,
|
usb_submit_urb(serial->port[0]->interrupt_in_urb,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (response) {
|
if (response) {
|
||||||
err("%s - Error %d submitting interrupt urb",
|
dev_err(&port->dev, "%s - Error %d submitting "
|
||||||
__func__, response);
|
"interrupt urb\n", __func__, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1055,8 +1057,8 @@ static int mos7840_open(struct tty_struct *tty,
|
|||||||
port->bulk_in_endpointAddress);
|
port->bulk_in_endpointAddress);
|
||||||
response = usb_submit_urb(mos7840_port->read_urb, GFP_KERNEL);
|
response = usb_submit_urb(mos7840_port->read_urb, GFP_KERNEL);
|
||||||
if (response) {
|
if (response) {
|
||||||
err("%s - Error %d submitting control urb", __func__,
|
dev_err(&port->dev, "%s - Error %d submitting control urb\n",
|
||||||
response);
|
__func__, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* initialize our wait queues */
|
/* initialize our wait queues */
|
||||||
@@ -1492,7 +1494,8 @@ static int mos7840_write(struct tty_struct *tty, struct usb_serial_port *port,
|
|||||||
kmalloc(URB_TRANSFER_BUFFER_SIZE, GFP_KERNEL);
|
kmalloc(URB_TRANSFER_BUFFER_SIZE, GFP_KERNEL);
|
||||||
|
|
||||||
if (urb->transfer_buffer == NULL) {
|
if (urb->transfer_buffer == NULL) {
|
||||||
err("%s no more kernel memory...", __func__);
|
dev_err(&port->dev, "%s no more kernel memory...\n",
|
||||||
|
__func__);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1517,8 +1520,8 @@ static int mos7840_write(struct tty_struct *tty, struct usb_serial_port *port,
|
|||||||
|
|
||||||
if (status) {
|
if (status) {
|
||||||
mos7840_port->busy[i] = 0;
|
mos7840_port->busy[i] = 0;
|
||||||
err("%s - usb_submit_urb(write bulk) failed with status = %d",
|
dev_err(&port->dev, "%s - usb_submit_urb(write bulk) failed "
|
||||||
__func__, status);
|
"with status = %d\n", __func__, status);
|
||||||
bytes_sent = status;
|
bytes_sent = status;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
@@ -1856,8 +1859,7 @@ static int mos7840_send_cmd_write_baud_rate(struct moschip_port *mos7840_port,
|
|||||||
/* Calculate the Divisor */
|
/* Calculate the Divisor */
|
||||||
|
|
||||||
if (status) {
|
if (status) {
|
||||||
err("%s - bad baud rate", __func__);
|
dev_err(&port->dev, "%s - bad baud rate\n", __func__);
|
||||||
dbg("%s\n", "bad baud rate");
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
/* Enable access to divisor latch */
|
/* Enable access to divisor latch */
|
||||||
@@ -2446,7 +2448,7 @@ static int mos7840_startup(struct usb_serial *serial)
|
|||||||
for (i = 0; i < serial->num_ports; ++i) {
|
for (i = 0; i < serial->num_ports; ++i) {
|
||||||
mos7840_port = kzalloc(sizeof(struct moschip_port), GFP_KERNEL);
|
mos7840_port = kzalloc(sizeof(struct moschip_port), GFP_KERNEL);
|
||||||
if (mos7840_port == NULL) {
|
if (mos7840_port == NULL) {
|
||||||
err("%s - Out of memory", __func__);
|
dev_err(&dev->dev, "%s - Out of memory\n", __func__);
|
||||||
status = -ENOMEM;
|
status = -ENOMEM;
|
||||||
i--; /* don't follow NULL pointer cleaning up */
|
i--; /* don't follow NULL pointer cleaning up */
|
||||||
goto error;
|
goto error;
|
||||||
|
@@ -154,8 +154,8 @@ static int omninet_attach(struct usb_serial *serial)
|
|||||||
|
|
||||||
od = kmalloc(sizeof(struct omninet_data), GFP_KERNEL);
|
od = kmalloc(sizeof(struct omninet_data), GFP_KERNEL);
|
||||||
if (!od) {
|
if (!od) {
|
||||||
err("%s- kmalloc(%Zd) failed.",
|
dev_err(&port->dev, "%s- kmalloc(%Zd) failed.\n",
|
||||||
__func__, sizeof(struct omninet_data));
|
__func__, sizeof(struct omninet_data));
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
usb_set_serial_port_data(port, od);
|
usb_set_serial_port_data(port, od);
|
||||||
@@ -183,8 +183,9 @@ static int omninet_open(struct tty_struct *tty,
|
|||||||
omninet_read_bulk_callback, port);
|
omninet_read_bulk_callback, port);
|
||||||
result = usb_submit_urb(port->read_urb, GFP_KERNEL);
|
result = usb_submit_urb(port->read_urb, GFP_KERNEL);
|
||||||
if (result)
|
if (result)
|
||||||
err("%s - failed submitting read urb, error %d",
|
dev_err(&port->dev,
|
||||||
__func__, result);
|
"%s - failed submitting read urb, error %d\n",
|
||||||
|
__func__, result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,8 +245,9 @@ static void omninet_read_bulk_callback(struct urb *urb)
|
|||||||
omninet_read_bulk_callback, port);
|
omninet_read_bulk_callback, port);
|
||||||
result = usb_submit_urb(urb, GFP_ATOMIC);
|
result = usb_submit_urb(urb, GFP_ATOMIC);
|
||||||
if (result)
|
if (result)
|
||||||
err("%s - failed resubmitting read urb, error %d",
|
dev_err(&port->dev,
|
||||||
__func__, result);
|
"%s - failed resubmitting read urb, error %d\n",
|
||||||
|
__func__, result);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -298,8 +300,9 @@ static int omninet_write(struct tty_struct *tty, struct usb_serial_port *port,
|
|||||||
result = usb_submit_urb(wport->write_urb, GFP_ATOMIC);
|
result = usb_submit_urb(wport->write_urb, GFP_ATOMIC);
|
||||||
if (result) {
|
if (result) {
|
||||||
wport->write_urb_busy = 0;
|
wport->write_urb_busy = 0;
|
||||||
err("%s - failed submitting write urb, error %d",
|
dev_err(&port->dev,
|
||||||
__func__, result);
|
"%s - failed submitting write urb, error %d\n",
|
||||||
|
__func__, result);
|
||||||
} else
|
} else
|
||||||
result = count;
|
result = count;
|
||||||
|
|
||||||
|
@@ -256,11 +256,12 @@ static void safe_read_bulk_callback(struct urb *urb)
|
|||||||
data, actual_length);
|
data, actual_length);
|
||||||
tty_flip_buffer_push(tty);
|
tty_flip_buffer_push(tty);
|
||||||
} else {
|
} else {
|
||||||
err("%s - inconsistent lengths %d:%d",
|
dev_err(&port->dev,
|
||||||
|
"%s - inconsistent lengths %d:%d\n",
|
||||||
__func__, actual_length, length);
|
__func__, actual_length, length);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
err("%s - bad CRC %x", __func__, fcs);
|
dev_err(&port->dev, "%s - bad CRC %x\n", __func__, fcs);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tty_insert_flip_string(tty, data, length);
|
tty_insert_flip_string(tty, data, length);
|
||||||
@@ -277,8 +278,9 @@ static void safe_read_bulk_callback(struct urb *urb)
|
|||||||
|
|
||||||
result = usb_submit_urb(urb, GFP_ATOMIC);
|
result = usb_submit_urb(urb, GFP_ATOMIC);
|
||||||
if (result)
|
if (result)
|
||||||
err("%s - failed resubmitting read urb, error %d",
|
dev_err(&port->dev,
|
||||||
__func__, result);
|
"%s - failed resubmitting read urb, error %d\n",
|
||||||
|
__func__, result);
|
||||||
/* FIXME: Need a mechanism to retry later if this happens */
|
/* FIXME: Need a mechanism to retry later if this happens */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -369,8 +371,9 @@ static int safe_write(struct tty_struct *tty, struct usb_serial_port *port,
|
|||||||
result = usb_submit_urb(port->write_urb, GFP_KERNEL);
|
result = usb_submit_urb(port->write_urb, GFP_KERNEL);
|
||||||
if (result) {
|
if (result) {
|
||||||
port->write_urb_busy = 0;
|
port->write_urb_busy = 0;
|
||||||
err("%s - failed submitting write urb, error %d",
|
dev_err(&port->dev,
|
||||||
__func__, result);
|
"%s - failed submitting write urb, error %d\n",
|
||||||
|
__func__, result);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
dbg("%s urb: %p submitted", __func__, port->write_urb);
|
dbg("%s urb: %p submitted", __func__, port->write_urb);
|
||||||
|
@@ -589,8 +589,8 @@ static void spcp8x5_set_termios(struct tty_struct *tty,
|
|||||||
case 1000000:
|
case 1000000:
|
||||||
buf[0] = 0x0b; break;
|
buf[0] = 0x0b; break;
|
||||||
default:
|
default:
|
||||||
err("spcp825 driver does not support the baudrate "
|
dev_err(&port->dev, "spcp825 driver does not support the "
|
||||||
"requested, using default of 9600.");
|
"baudrate requested, using default of 9600.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set Data Length : 00:5bit, 01:6bit, 10:7bit, 11:8bit */
|
/* Set Data Length : 00:5bit, 01:6bit, 10:7bit, 11:8bit */
|
||||||
@@ -629,7 +629,8 @@ static void spcp8x5_set_termios(struct tty_struct *tty,
|
|||||||
SET_UART_FORMAT_TYPE, SET_UART_FORMAT,
|
SET_UART_FORMAT_TYPE, SET_UART_FORMAT,
|
||||||
uartdata, 0, NULL, 0, 100);
|
uartdata, 0, NULL, 0, 100);
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
err("Set UART format %#x failed (error = %d)", uartdata, i);
|
dev_err(&port->dev, "Set UART format %#x failed (error = %d)\n",
|
||||||
|
uartdata, i);
|
||||||
dbg("0x21:0x40:0:0 %d\n", i);
|
dbg("0x21:0x40:0:0 %d\n", i);
|
||||||
|
|
||||||
if (cflag & CRTSCTS) {
|
if (cflag & CRTSCTS) {
|
||||||
|
@@ -1121,7 +1121,8 @@ static int __init usb_serial_init(void)
|
|||||||
|
|
||||||
result = bus_register(&usb_serial_bus_type);
|
result = bus_register(&usb_serial_bus_type);
|
||||||
if (result) {
|
if (result) {
|
||||||
err("%s - registering bus driver failed", __func__);
|
printk(KERN_ERR "usb-serial: %s - registering bus driver "
|
||||||
|
"failed\n", __func__);
|
||||||
goto exit_bus;
|
goto exit_bus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1142,21 +1143,24 @@ static int __init usb_serial_init(void)
|
|||||||
tty_set_operations(usb_serial_tty_driver, &serial_ops);
|
tty_set_operations(usb_serial_tty_driver, &serial_ops);
|
||||||
result = tty_register_driver(usb_serial_tty_driver);
|
result = tty_register_driver(usb_serial_tty_driver);
|
||||||
if (result) {
|
if (result) {
|
||||||
err("%s - tty_register_driver failed", __func__);
|
printk(KERN_ERR "usb-serial: %s - tty_register_driver failed\n",
|
||||||
|
__func__);
|
||||||
goto exit_reg_driver;
|
goto exit_reg_driver;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* register the USB driver */
|
/* register the USB driver */
|
||||||
result = usb_register(&usb_serial_driver);
|
result = usb_register(&usb_serial_driver);
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
err("%s - usb_register failed", __func__);
|
printk(KERN_ERR "usb-serial: %s - usb_register failed\n",
|
||||||
|
__func__);
|
||||||
goto exit_tty;
|
goto exit_tty;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* register the generic driver, if we should */
|
/* register the generic driver, if we should */
|
||||||
result = usb_serial_generic_register(debug);
|
result = usb_serial_generic_register(debug);
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
err("%s - registering generic driver failed", __func__);
|
printk(KERN_ERR "usb-serial: %s - registering generic "
|
||||||
|
"driver failed\n", __func__);
|
||||||
goto exit_generic;
|
goto exit_generic;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1174,7 +1178,8 @@ exit_reg_driver:
|
|||||||
bus_unregister(&usb_serial_bus_type);
|
bus_unregister(&usb_serial_bus_type);
|
||||||
|
|
||||||
exit_bus:
|
exit_bus:
|
||||||
err("%s - returning with error %d", __func__, result);
|
printk(KERN_ERR "usb-serial: %s - returning with error %d\n",
|
||||||
|
__func__, result);
|
||||||
put_tty_driver(usb_serial_tty_driver);
|
put_tty_driver(usb_serial_tty_driver);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -1233,8 +1238,8 @@ int usb_serial_register(struct usb_serial_driver *driver)
|
|||||||
|
|
||||||
retval = usb_serial_bus_register(driver);
|
retval = usb_serial_bus_register(driver);
|
||||||
if (retval) {
|
if (retval) {
|
||||||
err("problem %d when registering driver %s",
|
printk(KERN_ERR "usb-serial: problem %d when registering "
|
||||||
retval, driver->description);
|
"driver %s\n", retval, driver->description);
|
||||||
list_del(&driver->driver_list);
|
list_del(&driver->driver_list);
|
||||||
} else
|
} else
|
||||||
printk(KERN_INFO "USB Serial support registered for %s\n",
|
printk(KERN_INFO "USB Serial support registered for %s\n",
|
||||||
|
@@ -768,7 +768,7 @@ static int visor_probe(struct usb_serial *serial,
|
|||||||
dbg("%s", __func__);
|
dbg("%s", __func__);
|
||||||
|
|
||||||
if (serial->dev->actconfig->desc.bConfigurationValue != 1) {
|
if (serial->dev->actconfig->desc.bConfigurationValue != 1) {
|
||||||
err("active config #%d != 1 ??",
|
dev_err(&serial->dev->dev, "active config #%d != 1 ??\n",
|
||||||
serial->dev->actconfig->desc.bConfigurationValue);
|
serial->dev->actconfig->desc.bConfigurationValue);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
@@ -303,12 +303,15 @@ static int whiteheat_firmware_download(struct usb_serial *serial,
|
|||||||
|
|
||||||
if (request_ihex_firmware(&firmware_fw, "whiteheat.fw",
|
if (request_ihex_firmware(&firmware_fw, "whiteheat.fw",
|
||||||
&serial->dev->dev)) {
|
&serial->dev->dev)) {
|
||||||
err("%s - request \"whiteheat.fw\" failed", __func__);
|
dev_err(&serial->dev->dev,
|
||||||
|
"%s - request \"whiteheat.fw\" failed\n", __func__);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (request_ihex_firmware(&loader_fw, "whiteheat_loader.fw",
|
if (request_ihex_firmware(&loader_fw, "whiteheat_loader.fw",
|
||||||
&serial->dev->dev)) {
|
&serial->dev->dev)) {
|
||||||
err("%s - request \"whiteheat_loader.fw\" failed", __func__);
|
dev_err(&serial->dev->dev,
|
||||||
|
"%s - request \"whiteheat_loader.fw\" failed\n",
|
||||||
|
__func__);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
ret = 0;
|
ret = 0;
|
||||||
@@ -320,9 +323,10 @@ static int whiteheat_firmware_download(struct usb_serial *serial,
|
|||||||
(unsigned char *)record->data,
|
(unsigned char *)record->data,
|
||||||
be16_to_cpu(record->len), 0xa0);
|
be16_to_cpu(record->len), 0xa0);
|
||||||
if (response < 0) {
|
if (response < 0) {
|
||||||
err("%s - ezusb_writememory failed for loader (%d %04X %p %d)",
|
dev_err(&serial->dev->dev, "%s - ezusb_writememory "
|
||||||
__func__, response, be32_to_cpu(record->addr),
|
"failed for loader (%d %04X %p %d)\n",
|
||||||
record->data, be16_to_cpu(record->len));
|
__func__, response, be32_to_cpu(record->addr),
|
||||||
|
record->data, be16_to_cpu(record->len));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
record = ihex_next_binrec(record);
|
record = ihex_next_binrec(record);
|
||||||
@@ -338,9 +342,11 @@ static int whiteheat_firmware_download(struct usb_serial *serial,
|
|||||||
(unsigned char *)record->data,
|
(unsigned char *)record->data,
|
||||||
be16_to_cpu(record->len), 0xa3);
|
be16_to_cpu(record->len), 0xa3);
|
||||||
if (response < 0) {
|
if (response < 0) {
|
||||||
err("%s - ezusb_writememory failed for first firmware step (%d %04X %p %d)",
|
dev_err(&serial->dev->dev, "%s - ezusb_writememory "
|
||||||
__func__, response, be32_to_cpu(record->addr),
|
"failed for first firmware step "
|
||||||
record->data, be16_to_cpu(record->len));
|
"(%d %04X %p %d)\n", __func__, response,
|
||||||
|
be32_to_cpu(record->addr), record->data,
|
||||||
|
be16_to_cpu(record->len));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
++record;
|
++record;
|
||||||
@@ -354,9 +360,11 @@ static int whiteheat_firmware_download(struct usb_serial *serial,
|
|||||||
(unsigned char *)record->data,
|
(unsigned char *)record->data,
|
||||||
be16_to_cpu(record->len), 0xa0);
|
be16_to_cpu(record->len), 0xa0);
|
||||||
if (response < 0) {
|
if (response < 0) {
|
||||||
err("%s - ezusb_writememory failed for second firmware step (%d %04X %p %d)",
|
dev_err(&serial->dev->dev, "%s - ezusb_writememory "
|
||||||
__func__, response, be32_to_cpu(record->addr),
|
"failed for second firmware step "
|
||||||
record->data, be16_to_cpu(record->len));
|
"(%d %04X %p %d)\n", __func__, response,
|
||||||
|
be32_to_cpu(record->addr), record->data,
|
||||||
|
be16_to_cpu(record->len));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
++record;
|
++record;
|
||||||
@@ -421,12 +429,12 @@ static int whiteheat_attach(struct usb_serial *serial)
|
|||||||
ret = usb_bulk_msg(serial->dev, pipe, command, 2,
|
ret = usb_bulk_msg(serial->dev, pipe, command, 2,
|
||||||
&alen, COMMAND_TIMEOUT_MS);
|
&alen, COMMAND_TIMEOUT_MS);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
err("%s: Couldn't send command [%d]",
|
dev_err(&serial->dev->dev, "%s: Couldn't send command [%d]\n",
|
||||||
serial->type->description, ret);
|
serial->type->description, ret);
|
||||||
goto no_firmware;
|
goto no_firmware;
|
||||||
} else if (alen != 2) {
|
} else if (alen != 2) {
|
||||||
err("%s: Send command incomplete [%d]",
|
dev_err(&serial->dev->dev, "%s: Send command incomplete [%d]\n",
|
||||||
serial->type->description, alen);
|
serial->type->description, alen);
|
||||||
goto no_firmware;
|
goto no_firmware;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -437,16 +445,16 @@ static int whiteheat_attach(struct usb_serial *serial)
|
|||||||
ret = usb_bulk_msg(serial->dev, pipe, result,
|
ret = usb_bulk_msg(serial->dev, pipe, result,
|
||||||
sizeof(*hw_info) + 1, &alen, COMMAND_TIMEOUT_MS);
|
sizeof(*hw_info) + 1, &alen, COMMAND_TIMEOUT_MS);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
err("%s: Couldn't get results [%d]",
|
dev_err(&serial->dev->dev, "%s: Couldn't get results [%d]\n",
|
||||||
serial->type->description, ret);
|
serial->type->description, ret);
|
||||||
goto no_firmware;
|
goto no_firmware;
|
||||||
} else if (alen != sizeof(*hw_info) + 1) {
|
} else if (alen != sizeof(*hw_info) + 1) {
|
||||||
err("%s: Get results incomplete [%d]",
|
dev_err(&serial->dev->dev, "%s: Get results incomplete [%d]\n",
|
||||||
serial->type->description, alen);
|
serial->type->description, alen);
|
||||||
goto no_firmware;
|
goto no_firmware;
|
||||||
} else if (result[0] != command[0]) {
|
} else if (result[0] != command[0]) {
|
||||||
err("%s: Command failed [%d]",
|
dev_err(&serial->dev->dev, "%s: Command failed [%d]\n",
|
||||||
serial->type->description, result[0]);
|
serial->type->description, result[0]);
|
||||||
goto no_firmware;
|
goto no_firmware;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -461,8 +469,9 @@ static int whiteheat_attach(struct usb_serial *serial)
|
|||||||
|
|
||||||
info = kmalloc(sizeof(struct whiteheat_private), GFP_KERNEL);
|
info = kmalloc(sizeof(struct whiteheat_private), GFP_KERNEL);
|
||||||
if (info == NULL) {
|
if (info == NULL) {
|
||||||
err("%s: Out of memory for port structures\n",
|
dev_err(&port->dev,
|
||||||
serial->type->description);
|
"%s: Out of memory for port structures\n",
|
||||||
|
serial->type->description);
|
||||||
goto no_private;
|
goto no_private;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -482,18 +491,20 @@ static int whiteheat_attach(struct usb_serial *serial)
|
|||||||
for (j = 0; j < urb_pool_size; j++) {
|
for (j = 0; j < urb_pool_size; j++) {
|
||||||
urb = usb_alloc_urb(0, GFP_KERNEL);
|
urb = usb_alloc_urb(0, GFP_KERNEL);
|
||||||
if (!urb) {
|
if (!urb) {
|
||||||
err("No free urbs available");
|
dev_err(&port->dev, "No free urbs available\n");
|
||||||
goto no_rx_urb;
|
goto no_rx_urb;
|
||||||
}
|
}
|
||||||
buf_size = port->read_urb->transfer_buffer_length;
|
buf_size = port->read_urb->transfer_buffer_length;
|
||||||
urb->transfer_buffer = kmalloc(buf_size, GFP_KERNEL);
|
urb->transfer_buffer = kmalloc(buf_size, GFP_KERNEL);
|
||||||
if (!urb->transfer_buffer) {
|
if (!urb->transfer_buffer) {
|
||||||
err("Couldn't allocate urb buffer");
|
dev_err(&port->dev,
|
||||||
|
"Couldn't allocate urb buffer\n");
|
||||||
goto no_rx_buf;
|
goto no_rx_buf;
|
||||||
}
|
}
|
||||||
wrap = kmalloc(sizeof(*wrap), GFP_KERNEL);
|
wrap = kmalloc(sizeof(*wrap), GFP_KERNEL);
|
||||||
if (!wrap) {
|
if (!wrap) {
|
||||||
err("Couldn't allocate urb wrapper");
|
dev_err(&port->dev,
|
||||||
|
"Couldn't allocate urb wrapper\n");
|
||||||
goto no_rx_wrap;
|
goto no_rx_wrap;
|
||||||
}
|
}
|
||||||
usb_fill_bulk_urb(urb, serial->dev,
|
usb_fill_bulk_urb(urb, serial->dev,
|
||||||
@@ -506,18 +517,20 @@ static int whiteheat_attach(struct usb_serial *serial)
|
|||||||
|
|
||||||
urb = usb_alloc_urb(0, GFP_KERNEL);
|
urb = usb_alloc_urb(0, GFP_KERNEL);
|
||||||
if (!urb) {
|
if (!urb) {
|
||||||
err("No free urbs available");
|
dev_err(&port->dev, "No free urbs available\n");
|
||||||
goto no_tx_urb;
|
goto no_tx_urb;
|
||||||
}
|
}
|
||||||
buf_size = port->write_urb->transfer_buffer_length;
|
buf_size = port->write_urb->transfer_buffer_length;
|
||||||
urb->transfer_buffer = kmalloc(buf_size, GFP_KERNEL);
|
urb->transfer_buffer = kmalloc(buf_size, GFP_KERNEL);
|
||||||
if (!urb->transfer_buffer) {
|
if (!urb->transfer_buffer) {
|
||||||
err("Couldn't allocate urb buffer");
|
dev_err(&port->dev,
|
||||||
|
"Couldn't allocate urb buffer\n");
|
||||||
goto no_tx_buf;
|
goto no_tx_buf;
|
||||||
}
|
}
|
||||||
wrap = kmalloc(sizeof(*wrap), GFP_KERNEL);
|
wrap = kmalloc(sizeof(*wrap), GFP_KERNEL);
|
||||||
if (!wrap) {
|
if (!wrap) {
|
||||||
err("Couldn't allocate urb wrapper");
|
dev_err(&port->dev,
|
||||||
|
"Couldn't allocate urb wrapper\n");
|
||||||
goto no_tx_wrap;
|
goto no_tx_wrap;
|
||||||
}
|
}
|
||||||
usb_fill_bulk_urb(urb, serial->dev,
|
usb_fill_bulk_urb(urb, serial->dev,
|
||||||
@@ -535,8 +548,9 @@ static int whiteheat_attach(struct usb_serial *serial)
|
|||||||
command_info = kmalloc(sizeof(struct whiteheat_command_private),
|
command_info = kmalloc(sizeof(struct whiteheat_command_private),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (command_info == NULL) {
|
if (command_info == NULL) {
|
||||||
err("%s: Out of memory for port structures\n",
|
dev_err(&serial->dev->dev,
|
||||||
serial->type->description);
|
"%s: Out of memory for port structures\n",
|
||||||
|
serial->type->description);
|
||||||
goto no_command_private;
|
goto no_command_private;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -553,12 +567,15 @@ static int whiteheat_attach(struct usb_serial *serial)
|
|||||||
|
|
||||||
no_firmware:
|
no_firmware:
|
||||||
/* Firmware likely not running */
|
/* Firmware likely not running */
|
||||||
err("%s: Unable to retrieve firmware version, try replugging\n",
|
dev_err(&serial->dev->dev,
|
||||||
serial->type->description);
|
"%s: Unable to retrieve firmware version, try replugging\n",
|
||||||
err("%s: If the firmware is not running (status led not blinking)\n",
|
serial->type->description);
|
||||||
serial->type->description);
|
dev_err(&serial->dev->dev,
|
||||||
err("%s: please contact support@connecttech.com\n",
|
"%s: If the firmware is not running (status led not blinking)\n",
|
||||||
serial->type->description);
|
serial->type->description);
|
||||||
|
dev_err(&serial->dev->dev,
|
||||||
|
"%s: please contact support@connecttech.com\n",
|
||||||
|
serial->type->description);
|
||||||
kfree(result);
|
kfree(result);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
@@ -681,8 +698,9 @@ static int whiteheat_open(struct tty_struct *tty,
|
|||||||
/* Start reading from the device */
|
/* Start reading from the device */
|
||||||
retval = start_port_read(port);
|
retval = start_port_read(port);
|
||||||
if (retval) {
|
if (retval) {
|
||||||
err("%s - failed submitting read urb, error %d",
|
dev_err(&port->dev,
|
||||||
__func__, retval);
|
"%s - failed submitting read urb, error %d\n",
|
||||||
|
__func__, retval);
|
||||||
firm_close(port);
|
firm_close(port);
|
||||||
stop_command_port(port->serial);
|
stop_command_port(port->serial);
|
||||||
goto exit;
|
goto exit;
|
||||||
@@ -807,8 +825,9 @@ static int whiteheat_write(struct tty_struct *tty,
|
|||||||
urb->transfer_buffer_length = bytes;
|
urb->transfer_buffer_length = bytes;
|
||||||
result = usb_submit_urb(urb, GFP_ATOMIC);
|
result = usb_submit_urb(urb, GFP_ATOMIC);
|
||||||
if (result) {
|
if (result) {
|
||||||
err("%s - failed submitting write urb, error %d",
|
dev_err(&port->dev,
|
||||||
__func__, result);
|
"%s - failed submitting write urb, error %d\n",
|
||||||
|
__func__, result);
|
||||||
sent = result;
|
sent = result;
|
||||||
spin_lock_irqsave(&info->lock, flags);
|
spin_lock_irqsave(&info->lock, flags);
|
||||||
list_add(tmp, &info->tx_urbs_free);
|
list_add(tmp, &info->tx_urbs_free);
|
||||||
@@ -1076,7 +1095,7 @@ static void whiteheat_read_callback(struct urb *urb)
|
|||||||
wrap = urb_to_wrap(urb, &info->rx_urbs_submitted);
|
wrap = urb_to_wrap(urb, &info->rx_urbs_submitted);
|
||||||
if (!wrap) {
|
if (!wrap) {
|
||||||
spin_unlock(&info->lock);
|
spin_unlock(&info->lock);
|
||||||
err("%s - Not my urb!", __func__);
|
dev_err(&port->dev, "%s - Not my urb!\n", __func__);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
list_del(&wrap->list);
|
list_del(&wrap->list);
|
||||||
@@ -1120,7 +1139,7 @@ static void whiteheat_write_callback(struct urb *urb)
|
|||||||
wrap = urb_to_wrap(urb, &info->tx_urbs_submitted);
|
wrap = urb_to_wrap(urb, &info->tx_urbs_submitted);
|
||||||
if (!wrap) {
|
if (!wrap) {
|
||||||
spin_unlock(&info->lock);
|
spin_unlock(&info->lock);
|
||||||
err("%s - Not my urb!", __func__);
|
dev_err(&port->dev, "%s - Not my urb!\n", __func__);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
list_move(&wrap->list, &info->tx_urbs_free);
|
list_move(&wrap->list, &info->tx_urbs_free);
|
||||||
@@ -1384,8 +1403,9 @@ static int start_command_port(struct usb_serial *serial)
|
|||||||
command_port->read_urb->dev = serial->dev;
|
command_port->read_urb->dev = serial->dev;
|
||||||
retval = usb_submit_urb(command_port->read_urb, GFP_KERNEL);
|
retval = usb_submit_urb(command_port->read_urb, GFP_KERNEL);
|
||||||
if (retval) {
|
if (retval) {
|
||||||
err("%s - failed submitting read urb, error %d",
|
dev_err(&serial->dev->dev,
|
||||||
__func__, retval);
|
"%s - failed submitting read urb, error %d\n",
|
||||||
|
__func__, retval);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1523,7 +1543,8 @@ static void rx_data_softint(struct work_struct *work)
|
|||||||
urb->dev = port->serial->dev;
|
urb->dev = port->serial->dev;
|
||||||
result = usb_submit_urb(urb, GFP_ATOMIC);
|
result = usb_submit_urb(urb, GFP_ATOMIC);
|
||||||
if (result) {
|
if (result) {
|
||||||
err("%s - failed resubmitting read urb, error %d",
|
dev_err(&port->dev,
|
||||||
|
"%s - failed resubmitting read urb, error %d\n",
|
||||||
__func__, result);
|
__func__, result);
|
||||||
spin_lock_irqsave(&info->lock, flags);
|
spin_lock_irqsave(&info->lock, flags);
|
||||||
list_add(tmp, &info->rx_urbs_free);
|
list_add(tmp, &info->rx_urbs_free);
|
||||||
|
Reference in New Issue
Block a user