dbg("%s", __FUNCTION__);
- if (serial_paranoia_check (edge_serial->serial, __FUNCTION__)) {
- return;
- }
-
switch (urb->status) {
case 0:
/* success */
txCredits = data[position] | (data[position+1] << 8);
if (txCredits) {
port = edge_serial->serial->port[portNumber];
- if (port_paranoia_check (port, __FUNCTION__) == 0) {
- edge_port = usb_get_serial_port_data(port);
- if (edge_port->open) {
- edge_port->txCredits += txCredits;
- dbg("%s - txcredits for port%d = %d", __FUNCTION__, portNumber, edge_port->txCredits);
+ edge_port = usb_get_serial_port_data(port);
+ if (edge_port->open) {
+ edge_port->txCredits += txCredits;
+ dbg("%s - txcredits for port%d = %d", __FUNCTION__, portNumber, edge_port->txCredits);
- /* tell the tty driver that something has changed */
- if (edge_port->port->tty)
- wake_up_interruptible(&edge_port->port->tty->write_wait);
+ /* tell the tty driver that something has changed */
+ if (edge_port->port->tty)
+ wake_up_interruptible(&edge_port->port->tty->write_wait);
- // Since we have more credit, check if more data can be sent
- send_more_port_data(edge_serial, edge_port);
- }
+ // Since we have more credit, check if more data can be sent
+ send_more_port_data(edge_serial, edge_port);
}
}
position += 2;
dbg("%s", __FUNCTION__);
- if (serial_paranoia_check (edge_serial->serial, __FUNCTION__)) {
- return;
- }
-
if (urb->status) {
dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status);
return;
dbg("%s", __FUNCTION__);
- if (port_paranoia_check (edge_port->port, __FUNCTION__)) {
- return;
- }
-
if (urb->status) {
dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status);
}
/* Free the command urb */
usb_free_urb (urb);
- if (port_paranoia_check (edge_port->port, __FUNCTION__)) {
- return;
- }
-
if (status) {
dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, status);
return;
int response;
int timeout;
- if (port_paranoia_check (port, __FUNCTION__))
- return -ENODEV;
-
dbg("%s - port %d", __FUNCTION__, port->number);
if (edge_port == NULL)
*****************************************************************************/
static void edge_close (struct usb_serial_port *port, struct file * filp)
{
- struct usb_serial *serial;
struct edgeport_serial *edge_serial;
struct edgeport_port *edge_port;
int status;
- if (port_paranoia_check (port, __FUNCTION__))
- return;
-
dbg("%s - port %d", __FUNCTION__, port->number);
- serial = get_usb_serial (port, __FUNCTION__);
- if (!serial)
- return;
-
- edge_serial = usb_get_serial_data(serial);
+ edge_serial = usb_get_serial_data(port->serial);
edge_port = usb_get_serial_port_data(port);
if ((edge_serial == NULL) || (edge_port == NULL))
return;
- if (serial->dev) {
- // block until tx is empty
- block_until_tx_empty(edge_port);
+ // block until tx is empty
+ block_until_tx_empty(edge_port);
- edge_port->closePending = TRUE;
+ edge_port->closePending = TRUE;
- /* flush and chase */
- edge_port->chaseResponsePending = TRUE;
+ /* flush and chase */
+ edge_port->chaseResponsePending = TRUE;
- dbg("%s - Sending IOSP_CMD_CHASE_PORT", __FUNCTION__);
- status = send_iosp_ext_cmd (edge_port, IOSP_CMD_CHASE_PORT, 0);
- if (status == 0) {
- // block until chase finished
- block_until_chase_response(edge_port);
- } else {
- edge_port->chaseResponsePending = FALSE;
- }
+ dbg("%s - Sending IOSP_CMD_CHASE_PORT", __FUNCTION__);
+ status = send_iosp_ext_cmd (edge_port, IOSP_CMD_CHASE_PORT, 0);
+ if (status == 0) {
+ // block until chase finished
+ block_until_chase_response(edge_port);
+ } else {
+ edge_port->chaseResponsePending = FALSE;
+ }
- /* close the port */
- dbg("%s - Sending IOSP_CMD_CLOSE_PORT", __FUNCTION__);
- send_iosp_ext_cmd (edge_port, IOSP_CMD_CLOSE_PORT, 0);
+ /* close the port */
+ dbg("%s - Sending IOSP_CMD_CLOSE_PORT", __FUNCTION__);
+ send_iosp_ext_cmd (edge_port, IOSP_CMD_CLOSE_PORT, 0);
- //port->close = TRUE;
- edge_port->closePending = FALSE;
- edge_port->open = FALSE;
- edge_port->openPending = FALSE;
+ //port->close = TRUE;
+ edge_port->closePending = FALSE;
+ edge_port->open = FALSE;
+ edge_port->openPending = FALSE;
- if (edge_port->write_urb) {
- usb_unlink_urb (edge_port->write_urb);
- }
+ if (edge_port->write_urb) {
+ usb_unlink_urb (edge_port->write_urb);
}
if (edge_port->write_urb) {
/* spit this data back into the tty driver if this port is open */
if (rxLen) {
port = edge_serial->serial->port[edge_serial->rxPort];
- if (port_paranoia_check (port, __FUNCTION__) == 0) {
- edge_port = usb_get_serial_port_data(port);
- if (edge_port->open) {
- tty = edge_port->port->tty;
- if (tty) {
- dbg("%s - Sending %d bytes to TTY for port %d", __FUNCTION__, rxLen, edge_serial->rxPort);
- for (i = 0; i < rxLen ; ++i) {
- /* if we insert more than TTY_FLIPBUF_SIZE characters, we drop them. */
- if(tty->flip.count >= TTY_FLIPBUF_SIZE) {
- tty_flip_buffer_push(tty);
- }
- /* this doesn't actually push the data through unless tty->low_latency is set */
- tty_insert_flip_char(tty, buffer[i], 0);
+ edge_port = usb_get_serial_port_data(port);
+ if (edge_port->open) {
+ tty = edge_port->port->tty;
+ if (tty) {
+ dbg("%s - Sending %d bytes to TTY for port %d", __FUNCTION__, rxLen, edge_serial->rxPort);
+ for (i = 0; i < rxLen ; ++i) {
+ /* if we insert more than TTY_FLIPBUF_SIZE characters, we drop them. */
+ if(tty->flip.count >= TTY_FLIPBUF_SIZE) {
+ tty_flip_buffer_push(tty);
}
- tty_flip_buffer_push(tty);
+ /* this doesn't actually push the data through unless tty->low_latency is set */
+ tty_insert_flip_char(tty, buffer[i], 0);
}
- edge_port->icount.rx += rxLen;
+ tty_flip_buffer_push(tty);
}
+ edge_port->icount.rx += rxLen;
}
buffer += rxLen;
}
/* switch the port pointer to the one being currently talked about */
port = edge_serial->serial->port[edge_serial->rxPort];
- if (port_paranoia_check (port, __FUNCTION__)) {
- return;
- }
edge_port = usb_get_serial_port_data(port);
if (edge_port == NULL) {
dev_err(&edge_serial->serial->dev->dev, "%s - edge_port == NULL for port %d\n", __FUNCTION__, edge_serial->rxPort);