# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.541 -> 1.542 # drivers/usb/serial/io_edgeport.c 1.29 -> 1.30 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 02/08/28 greg@kroah.com 1.542 # USB: io_edgeport driver: fixed __FUNCTION__ usages. # -------------------------------------------- # diff -Nru a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c --- a/drivers/usb/serial/io_edgeport.c Wed Aug 28 23:20:47 2002 +++ b/drivers/usb/serial/io_edgeport.c Wed Aug 28 23:20:47 2002 @@ -590,7 +590,7 @@ struct usb_string_descriptor StringDesc; struct usb_string_descriptor *pStringDesc; - dbg(__FUNCTION__ " - USB String ID = %d", Id ); + dbg("%s - USB String ID = %d", __FUNCTION__, Id ); if (!usb_get_descriptor(dev, USB_DT_STRING, Id, &StringDesc, sizeof(StringDesc))) { return 0; @@ -625,7 +625,7 @@ struct usb_string_descriptor StringDesc; struct usb_string_descriptor *pStringDesc; - dbg(__FUNCTION__ " - USB String ID = %d", Id ); + dbg("%s - USB String ID = %d", __FUNCTION__, Id ); if (!usb_get_descriptor(dev, USB_DT_STRING, Id, &StringDesc, sizeof(StringDesc))) { return 0; @@ -760,14 +760,14 @@ int portNumber; int result; - dbg(__FUNCTION__); + dbg("%s", __FUNCTION__); if (serial_paranoia_check (edge_serial->serial, __FUNCTION__)) { return; } if (urb->status) { - dbg(__FUNCTION__" - nonzero control read status received: %d", urb->status); + dbg("%s - nonzero control read status received: %d", __FUNCTION__, urb->status); return; } @@ -779,7 +779,7 @@ bytes_avail = data[0] | (data[1] << 8); if (bytes_avail) { edge_serial->rxBytesAvail += bytes_avail; - dbg(__FUNCTION__" - bytes_avail = %d, rxBytesAvail %d", bytes_avail, edge_serial->rxBytesAvail); + dbg("%s - bytes_avail = %d, rxBytesAvail %d", __FUNCTION__, bytes_avail, edge_serial->rxBytesAvail); if ((edge_serial->rxBytesAvail > 0) && (edge_serial->read_urb->status != -EINPROGRESS)) { @@ -789,7 +789,7 @@ edge_serial->read_urb->dev = edge_serial->serial->dev; result = usb_submit_urb(edge_serial->read_urb, GFP_ATOMIC); if (result) { - dbg(__FUNCTION__" - usb_submit_urb(read bulk) failed with result = %d", result); + dbg("%s - usb_submit_urb(read bulk) failed with result = %d", __FUNCTION__, result); } } } @@ -805,7 +805,7 @@ edge_port = (struct edgeport_port *)port->private; if (edge_port->open) { edge_port->txCredits += txCredits; - dbg(__FUNCTION__" - txcredits for port%d = %d", portNumber, edge_port->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) @@ -835,14 +835,14 @@ int status; __u16 raw_data_length; - dbg(__FUNCTION__); + dbg("%s", __FUNCTION__); if (serial_paranoia_check (edge_serial->serial, __FUNCTION__)) { return; } if (urb->status) { - dbg(__FUNCTION__" - nonzero read bulk status received: %d", urb->status); + dbg("%s - nonzero read bulk status received: %d", __FUNCTION__, urb->status); return; } @@ -854,7 +854,7 @@ /* decrement our rxBytes available by the number that we just got */ edge_serial->rxBytesAvail -= raw_data_length; - dbg(__FUNCTION__" - Received = %d, rxBytesAvail %d", raw_data_length, edge_serial->rxBytesAvail); + dbg("%s - Received = %d, rxBytesAvail %d", __FUNCTION__, raw_data_length, edge_serial->rxBytesAvail); process_rcvd_data (edge_serial, data, urb->actual_length); @@ -867,7 +867,7 @@ edge_serial->read_urb->dev = edge_serial->serial->dev; status = usb_submit_urb(edge_serial->read_urb, GFP_ATOMIC); if (status) { - err(__FUNCTION__" - usb_submit_urb(read bulk) failed, status = %d", status); + err("%s - usb_submit_urb(read bulk) failed, status = %d", __FUNCTION__, status); } } } @@ -884,14 +884,14 @@ struct edgeport_port *edge_port = (struct edgeport_port *)urb->context; struct tty_struct *tty; - dbg(__FUNCTION__); + dbg("%s", __FUNCTION__); if (port_paranoia_check (edge_port->port, __FUNCTION__)) { return; } if (urb->status) { - dbg(__FUNCTION__" - nonzero write bulk status received: %d", urb->status); + dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status); } tty = edge_port->port->tty; @@ -925,10 +925,10 @@ struct tty_struct *tty; int status = urb->status; - dbg(__FUNCTION__); + dbg("%s", __FUNCTION__); CmdUrbs--; - dbg(__FUNCTION__" - FREE URB %p (outstanding %d)", urb, CmdUrbs); + dbg("%s - FREE URB %p (outstanding %d)", __FUNCTION__, urb, CmdUrbs); /* clean up the transfer buffer */ @@ -945,7 +945,7 @@ } if (status) { - dbg(__FUNCTION__" - nonzero write bulk status received: %d", status); + dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, status); return; } @@ -983,7 +983,7 @@ if (port_paranoia_check (port, __FUNCTION__)) return -ENODEV; - dbg(__FUNCTION__ " - port %d", port->number); + dbg("%s - port %d", __FUNCTION__, port->number); if (edge_port == NULL) return -ENODEV; @@ -1034,7 +1034,7 @@ * this interrupt will continue as long as the edgeport is connected */ response = usb_submit_urb (edge_serial->interrupt_read_urb, GFP_KERNEL); if (response) { - err(__FUNCTION__" - Error %d submitting control urb", response); + err("%s - Error %d submitting control urb", __FUNCTION__, response); } } @@ -1058,7 +1058,7 @@ response = send_iosp_ext_cmd (edge_port, IOSP_CMD_OPEN_PORT, 0); if (response < 0) { - err(__FUNCTION__" - error sending open port command"); + err("%s - error sending open port command", __FUNCTION__); edge_port->openPending = FALSE; return -ENODEV; } @@ -1071,7 +1071,7 @@ if (edge_port->open == FALSE) { /* open timed out */ - dbg(__FUNCTION__" - open timedout"); + dbg("%s - open timedout", __FUNCTION__); edge_port->openPending = FALSE; return -ENODEV; } @@ -1084,7 +1084,7 @@ edge_port->txfifo.fifo = kmalloc (edge_port->maxTxCredits, GFP_KERNEL); if (!edge_port->txfifo.fifo) { - dbg(__FUNCTION__" - no memory"); + dbg("%s - no memory", __FUNCTION__); edge_close (port, filp); return -ENOMEM; } @@ -1093,14 +1093,14 @@ edge_port->write_urb = usb_alloc_urb (0, GFP_KERNEL); if (!edge_port->write_urb) { - dbg(__FUNCTION__" - no memory"); + dbg("%s - no memory", __FUNCTION__); edge_close (port, filp); return -ENOMEM; } - dbg(__FUNCTION__"(%d) - Initialize TX fifo to %d bytes", port->number, edge_port->maxTxCredits); + dbg("%s(%d) - Initialize TX fifo to %d bytes", __FUNCTION__, port->number, edge_port->maxTxCredits); - dbg(__FUNCTION__" exited"); + dbg("%s exited", __FUNCTION__); return 0; } @@ -1128,11 +1128,11 @@ // Did we get our Chase response if (edge_port->chaseResponsePending == FALSE) { - dbg(__FUNCTION__" - Got Chase Response"); + dbg("%s - Got Chase Response", __FUNCTION__); // did we get all of our credit back? if (edge_port->txCredits == edge_port->maxTxCredits ) { - dbg(__FUNCTION__" - Got all credits"); + dbg("%s - Got all credits", __FUNCTION__); return; } } @@ -1145,12 +1145,12 @@ wait--; if (wait == 0) { edge_port->chaseResponsePending = FALSE; - dbg(__FUNCTION__" - Chase TIMEOUT"); + dbg("%s - Chase TIMEOUT", __FUNCTION__); return; } } else { // Reset timout value back to 10 seconds - dbg(__FUNCTION__" - Last %d, Current %d", lastCredits, edge_port->txCredits); + dbg("%s - Last %d, Current %d", __FUNCTION__, lastCredits, edge_port->txCredits); wait = 10; } } @@ -1180,20 +1180,20 @@ // Is the Edgeport Buffer empty? if (lastCount == 0) { - dbg(__FUNCTION__" - TX Buffer Empty"); + dbg("%s - TX Buffer Empty", __FUNCTION__); return; } // Block the thread for a while interruptible_sleep_on_timeout (&edge_port->wait_chase, timeout); - dbg(__FUNCTION__ " wait"); + dbg("%s wait", __FUNCTION__); if (lastCount == fifo->count) { // No activity.. count down. wait--; if (wait == 0) { - dbg(__FUNCTION__" - TIMEOUT"); + dbg("%s - TIMEOUT", __FUNCTION__); return; } } else { @@ -1218,7 +1218,7 @@ if (port_paranoia_check (port, __FUNCTION__)) return; - dbg(__FUNCTION__ " - port %d", port->number); + dbg("%s - port %d", __FUNCTION__, port->number); serial = get_usb_serial (port, __FUNCTION__); if (!serial) @@ -1238,7 +1238,7 @@ /* flush and chase */ edge_port->chaseResponsePending = TRUE; - dbg(__FUNCTION__" - Sending IOSP_CMD_CHASE_PORT"); + 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 @@ -1248,7 +1248,7 @@ } /* close the port */ - dbg(__FUNCTION__" - Sending IOSP_CMD_CLOSE_PORT"); + dbg("%s - Sending IOSP_CMD_CLOSE_PORT", __FUNCTION__); send_iosp_ext_cmd (edge_port, IOSP_CMD_CLOSE_PORT, 0); //port->close = TRUE; @@ -1272,7 +1272,7 @@ kfree(edge_port->txfifo.fifo); } - dbg(__FUNCTION__" exited"); + dbg("%s exited", __FUNCTION__); } /***************************************************************************** @@ -1291,7 +1291,7 @@ int firsthalf; int secondhalf; - dbg(__FUNCTION__ " - port %d", port->number); + dbg("%s - port %d", __FUNCTION__, port->number); if (edge_port == NULL) return -ENODEV; @@ -1302,12 +1302,12 @@ // calculate number of bytes to put in fifo copySize = min ((unsigned int)count, (edge_port->txCredits - fifo->count)); - dbg(__FUNCTION__"(%d) of %d byte(s) Fifo room %d -- will copy %d bytes", + dbg("%s(%d) of %d byte(s) Fifo room %d -- will copy %d bytes", __FUNCTION__, port->number, count, edge_port->txCredits - fifo->count, copySize); /* catch writes of 0 bytes which the tty driver likes to give us, and when txCredits is empty */ if (copySize == 0) { - dbg (__FUNCTION__" - copySize = Zero"); + dbg("%s - copySize = Zero", __FUNCTION__); return 0; } @@ -1319,7 +1319,7 @@ bytesleft = fifo->size - fifo->head; firsthalf = min (bytesleft, copySize); - dbg (__FUNCTION__" - copy %d bytes of %d into fifo ", firsthalf, bytesleft); + dbg("%s - copy %d bytes of %d into fifo ", __FUNCTION__, firsthalf, bytesleft); /* now copy our data */ if (from_user) { @@ -1341,7 +1341,7 @@ secondhalf = copySize-firsthalf; if (secondhalf) { - dbg (__FUNCTION__" - copy rest of data %d", secondhalf); + dbg("%s - copy rest of data %d", __FUNCTION__, secondhalf); if (from_user) { if (copy_from_user(&fifo->fifo[fifo->head], &data[firsthalf], secondhalf)) return -EFAULT; @@ -1360,7 +1360,7 @@ send_more_port_data((struct edgeport_serial *)port->serial->private, edge_port); - dbg(__FUNCTION__" wrote %d byte(s) TxCredits %d, Fifo %d", copySize, edge_port->txCredits, fifo->count); + dbg("%s wrote %d byte(s) TxCredits %d, Fifo %d", __FUNCTION__, copySize, edge_port->txCredits, fifo->count); return copySize; } @@ -1390,12 +1390,12 @@ int firsthalf; int secondhalf; - dbg(__FUNCTION__"(%d)", edge_port->port->number); + dbg("%s(%d)", __FUNCTION__, edge_port->port->number); if (edge_port->write_in_progress || !edge_port->open || (fifo->count == 0)) { - dbg(__FUNCTION__"(%d) EXIT - fifo %d, PendingWrite = %d", edge_port->port->number, fifo->count, edge_port->write_in_progress); + dbg("%s(%d) EXIT - fifo %d, PendingWrite = %d", __FUNCTION__, edge_port->port->number, fifo->count, edge_port->write_in_progress); return; } @@ -1407,7 +1407,7 @@ // it's better to wait for more credits so we can do a larger // write. if (edge_port->txCredits < EDGE_FW_GET_TX_CREDITS_SEND_THRESHOLD(edge_port->maxTxCredits)) { - dbg(__FUNCTION__"(%d) Not enough credit - fifo %d TxCredit %d", edge_port->port->number, fifo->count, edge_port->txCredits ); + dbg("%s(%d) Not enough credit - fifo %d TxCredit %d", __FUNCTION__, edge_port->port->number, fifo->count, edge_port->txCredits ); return; } @@ -1427,7 +1427,7 @@ count = fifo->count; buffer = kmalloc (count+2, GFP_ATOMIC); if (buffer == NULL) { - err(__FUNCTION__" - no more kernel memory..."); + err("%s - no more kernel memory...", __FUNCTION__); edge_port->write_in_progress = FALSE; return; } @@ -1464,14 +1464,14 @@ status = usb_submit_urb(urb, GFP_ATOMIC); if (status) { /* something went wrong */ - dbg(__FUNCTION__" - usb_submit_urb(write bulk) failed"); + dbg("%s - usb_submit_urb(write bulk) failed", __FUNCTION__); edge_port->write_in_progress = FALSE; } else { /* decrement the number of credits we have by the number we just sent */ edge_port->txCredits -= count; edge_port->icount.tx += count; } - dbg(__FUNCTION__" wrote %d byte(s) TxCredit %d, Fifo %d", count, edge_port->txCredits, fifo->count); + dbg("%s wrote %d byte(s) TxCredit %d, Fifo %d", __FUNCTION__, count, edge_port->txCredits, fifo->count); } @@ -1488,24 +1488,24 @@ struct edgeport_port *edge_port = (struct edgeport_port *)(port->private); int room; - dbg(__FUNCTION__); + dbg("%s", __FUNCTION__); if (edge_port == NULL) return -ENODEV; if (edge_port->closePending == TRUE) return -ENODEV; - dbg(__FUNCTION__" - port %d", port->number); + dbg("%s - port %d", __FUNCTION__, port->number); if (!edge_port->open) { - dbg (__FUNCTION__" - port not opened"); + dbg("%s - port not opened", __FUNCTION__); return -EINVAL; } // total of both buffers is still txCredit room = edge_port->txCredits - edge_port->txfifo.count; - dbg(__FUNCTION__" - returns %d", room); + dbg("%s - returns %d", __FUNCTION__, room); return room; } @@ -1524,7 +1524,7 @@ struct edgeport_port *edge_port = (struct edgeport_port *)(port->private); int num_chars; - dbg(__FUNCTION__); + dbg("%s", __FUNCTION__); if (edge_port == NULL) return -ENODEV; @@ -1532,13 +1532,13 @@ return -ENODEV; if (!edge_port->open) { - dbg (__FUNCTION__" - port not opened"); + dbg("%s - port not opened", __FUNCTION__); return -EINVAL; } num_chars = edge_port->maxTxCredits - edge_port->txCredits + edge_port->txfifo.count; if (num_chars) { - dbg(__FUNCTION__"(port %d) - returns %d", port->number, num_chars); + dbg("%s(port %d) - returns %d", __FUNCTION__, port->number, num_chars); } return num_chars; @@ -1556,13 +1556,13 @@ struct tty_struct *tty; int status; - dbg(__FUNCTION__" - port %d", port->number); + dbg("%s - port %d", __FUNCTION__, port->number); if (edge_port == NULL) return; if (!edge_port->open) { - dbg (__FUNCTION__" - port not opened"); + dbg("%s - port not opened", __FUNCTION__); return; } @@ -1605,13 +1605,13 @@ struct tty_struct *tty; int status; - dbg(__FUNCTION__" - port %d", port->number); + dbg("%s - port %d", __FUNCTION__, port->number); if (edge_port == NULL) return; if (!edge_port->open) { - dbg (__FUNCTION__" - port not opened"); + dbg("%s - port not opened", __FUNCTION__); return; } @@ -1663,7 +1663,7 @@ if (old_termios) { if ((cflag == old_termios->c_cflag) && (RELEVANT_IFLAG(tty->termios->c_iflag) == RELEVANT_IFLAG(old_termios->c_iflag))) { - dbg(__FUNCTION__" - nothing to change"); + dbg("%s - nothing to change", __FUNCTION__); return; } } @@ -1677,13 +1677,13 @@ RELEVANT_IFLAG(old_termios->c_iflag)); } - dbg(__FUNCTION__" - port %d", port->number); + dbg("%s - port %d", __FUNCTION__, port->number); if (edge_port == NULL) return; if (!edge_port->open) { - dbg (__FUNCTION__" - port not opened"); + dbg("%s - port not opened", __FUNCTION__); return; } @@ -1710,7 +1710,7 @@ if (edge_port->maxTxCredits == edge_port->txCredits && edge_port->txfifo.count == 0) { - dbg(__FUNCTION__" -- Empty"); + dbg("%s -- Empty", __FUNCTION__); result = TIOCSER_TEMT; } @@ -1729,7 +1729,7 @@ result = tty->read_cnt; - dbg(__FUNCTION__"(%d) = %d", edge_port->port->number, result); + dbg("%s(%d) = %d", __FUNCTION__, edge_port->port->number, result); if (copy_to_user(value, &result, sizeof(int))) return -EFAULT; //return 0; @@ -1794,7 +1794,7 @@ | ((msr & MSR_DSR) ? TIOCM_DSR: 0); /* 0x100 */ - dbg(__FUNCTION__" -- %x", result); + dbg("%s -- %x", __FUNCTION__, result); if (copy_to_user(value, &result, sizeof(int))) return -EFAULT; @@ -1845,40 +1845,40 @@ struct serial_icounter_struct icount; - dbg(__FUNCTION__" - port %d, cmd = 0x%x", port->number, cmd); + dbg("%s - port %d, cmd = 0x%x", __FUNCTION__, port->number, cmd); switch (cmd) { // return number of bytes available case TIOCINQ: - dbg(__FUNCTION__" (%d) TIOCINQ", port->number); + dbg("%s (%d) TIOCINQ", __FUNCTION__, port->number); return get_number_bytes_avail(edge_port, (unsigned int *) arg); break; case TIOCSERGETLSR: - dbg(__FUNCTION__" (%d) TIOCSERGETLSR", port->number); + dbg("%s (%d) TIOCSERGETLSR", __FUNCTION__, port->number); return get_lsr_info(edge_port, (unsigned int *) arg); return 0; case TIOCMBIS: case TIOCMBIC: case TIOCMSET: - dbg(__FUNCTION__" (%d) TIOCMSET/TIOCMBIC/TIOCMSET", port->number); + dbg("%s (%d) TIOCMSET/TIOCMBIC/TIOCMSET", __FUNCTION__, port->number); return set_modem_info(edge_port, cmd, (unsigned int *) arg); case TIOCMGET: - dbg(__FUNCTION__" (%d) TIOCMGET", port->number); + dbg("%s (%d) TIOCMGET", __FUNCTION__, port->number); return get_modem_info(edge_port, (unsigned int *) arg); case TIOCGSERIAL: - dbg(__FUNCTION__" (%d) TIOCGSERIAL", port->number); + dbg("%s (%d) TIOCGSERIAL", __FUNCTION__, port->number); return get_serial_info(edge_port, (struct serial_struct *) arg); case TIOCSSERIAL: - dbg(__FUNCTION__" (%d) TIOCSSERIAL", port->number); + dbg("%s (%d) TIOCSSERIAL", __FUNCTION__, port->number); break; case TIOCMIWAIT: - dbg(__FUNCTION__" (%d) TIOCMIWAIT", port->number); + dbg("%s (%d) TIOCMIWAIT", __FUNCTION__, port->number); cprev = edge_port->icount; while (1) { interruptible_sleep_on(&edge_port->delta_msr_wait); @@ -1914,7 +1914,7 @@ icount.brk = cnow.brk; icount.buf_overrun = cnow.buf_overrun; - dbg(__FUNCTION__" (%d) TIOCGICOUNT RX=%d, TX=%d", port->number, icount.rx, icount.tx ); + dbg("%s (%d) TIOCGICOUNT RX=%d, TX=%d", __FUNCTION__, port->number, icount.rx, icount.tx ); if (copy_to_user((void *)arg, &icount, sizeof(icount))) return -EFAULT; return 0; @@ -1936,7 +1936,7 @@ /* flush and chase */ edge_port->chaseResponsePending = TRUE; - dbg(__FUNCTION__" - Sending IOSP_CMD_CHASE_PORT"); + 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 @@ -1946,14 +1946,14 @@ } if (break_state == -1) { - dbg(__FUNCTION__" - Sending IOSP_CMD_SET_BREAK"); + dbg("%s - Sending IOSP_CMD_SET_BREAK", __FUNCTION__); status = send_iosp_ext_cmd (edge_port, IOSP_CMD_SET_BREAK, 0); } else { - dbg(__FUNCTION__" - Sending IOSP_CMD_CLEAR_BREAK"); + dbg("%s - Sending IOSP_CMD_CLEAR_BREAK", __FUNCTION__); status = send_iosp_ext_cmd (edge_port, IOSP_CMD_CLEAR_BREAK, 0); } if (status) { - dbg(__FUNCTION__" - error sending break set/clear command."); + dbg("%s - error sending break set/clear command.", __FUNCTION__); } return; @@ -1973,14 +1973,14 @@ __u16 rxLen; int i; - dbg(__FUNCTION__); + dbg("%s", __FUNCTION__); lastBufferLength = bufferLength + 1; while (bufferLength > 0) { /* failsafe incase we get a message that we don't understand */ if (lastBufferLength == bufferLength) { - dbg(__FUNCTION__" - stuck in loop, exiting it."); + dbg("%s - stuck in loop, exiting it.", __FUNCTION__); break; } lastBufferLength = bufferLength; @@ -2002,7 +2002,7 @@ ++buffer; --bufferLength; - dbg(__FUNCTION__" - Hdr1=%02X Hdr2=%02X", edge_serial->rxHeader1, edge_serial->rxHeader2); + dbg("%s - Hdr1=%02X Hdr2=%02X", __FUNCTION__, edge_serial->rxHeader1, edge_serial->rxHeader2); // Process depending on whether this header is // data or status @@ -2033,7 +2033,7 @@ edge_serial->rxPort = IOSP_GET_HDR_PORT(edge_serial->rxHeader1); edge_serial->rxBytesRemaining = IOSP_GET_HDR_DATA_LEN(edge_serial->rxHeader1, edge_serial->rxHeader2); - dbg(__FUNCTION__" - Data for Port %u Len %u", edge_serial->rxPort, edge_serial->rxBytesRemaining); + dbg("%s - Data for Port %u Len %u", __FUNCTION__, edge_serial->rxPort, edge_serial->rxBytesRemaining); //ASSERT( DevExt->RxPort < DevExt->NumPorts ); //ASSERT( DevExt->RxBytesRemaining < IOSP_MAX_DATA_LENGTH ); @@ -2067,7 +2067,7 @@ if (edge_port->open) { tty = edge_port->port->tty; if (tty) { - dbg (__FUNCTION__" - Sending %d bytes to TTY for port %d", rxLen, edge_serial->rxPort); + 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) { @@ -2120,17 +2120,17 @@ } edge_port = (struct edgeport_port *)port->private; if (edge_port == NULL) { - err (__FUNCTION__ " - edge_port == NULL for port %d", edge_serial->rxPort); + err("%s - edge_port == NULL for port %d", __FUNCTION__, edge_serial->rxPort); return; } - dbg(__FUNCTION__" - port %d", edge_serial->rxPort); + dbg("%s - port %d", __FUNCTION__, edge_serial->rxPort); if (code == IOSP_EXT_STATUS) { switch (byte2) { case IOSP_EXT_STATUS_CHASE_RSP: // we want to do EXT status regardless of port open/closed - dbg(__FUNCTION__" - Port %u EXT CHASE_RSP Data = %02x", edge_serial->rxPort, byte3 ); + dbg("%s - Port %u EXT CHASE_RSP Data = %02x", __FUNCTION__, edge_serial->rxPort, byte3 ); // Currently, the only EXT_STATUS is Chase, so process here instead of one more call // to one more subroutine. If/when more EXT_STATUS, there'll be more work to do. // Also, we currently clear flag and close the port regardless of content of above's Byte3. @@ -2141,7 +2141,7 @@ return; case IOSP_EXT_STATUS_RX_CHECK_RSP: - dbg( __FUNCTION__" ========== Port %u CHECK_RSP Sequence = %02x =============\n", edge_serial->rxPort, byte3 ); + dbg("%s ========== Port %u CHECK_RSP Sequence = %02x =============\n", __FUNCTION__, edge_serial->rxPort, byte3 ); //Port->RxCheckRsp = TRUE; return; } @@ -2150,7 +2150,7 @@ if (code == IOSP_STATUS_OPEN_RSP) { edge_port->txCredits = GET_TX_BUFFER_SIZE(byte3); edge_port->maxTxCredits = edge_port->txCredits; - dbg (__FUNCTION__" - Port %u Open Response Inital MSR = %02x TxBufferSize = %d", edge_serial->rxPort, byte2, edge_port->txCredits); + dbg("%s - Port %u Open Response Inital MSR = %02x TxBufferSize = %d", __FUNCTION__, edge_serial->rxPort, byte2, edge_port->txCredits); handle_new_msr (edge_port, byte2); /* send the current line settings to the port so we are in sync with any further termios calls */ @@ -2174,23 +2174,23 @@ switch (code) { // Not currently sent by Edgeport case IOSP_STATUS_LSR: - dbg(__FUNCTION__" - Port %u LSR Status = %02x", edge_serial->rxPort, byte2); + dbg("%s - Port %u LSR Status = %02x", __FUNCTION__, edge_serial->rxPort, byte2); handle_new_lsr (edge_port, FALSE, byte2, 0); break; case IOSP_STATUS_LSR_DATA: - dbg(__FUNCTION__" - Port %u LSR Status = %02x, Data = %02x", edge_serial->rxPort, byte2, byte3); + dbg("%s - Port %u LSR Status = %02x, Data = %02x", __FUNCTION__, edge_serial->rxPort, byte2, byte3); // byte2 is LSR Register // byte3 is broken data byte handle_new_lsr (edge_port, TRUE, byte2, byte3); break; // // case IOSP_EXT_4_STATUS: - // dbg(__FUNCTION__" - Port %u LSR Status = %02x Data = %02x", edge_serial->rxPort, byte2, byte3); + // dbg("%s - Port %u LSR Status = %02x Data = %02x", __FUNCTION__, edge_serial->rxPort, byte2, byte3); // break; // case IOSP_STATUS_MSR: - dbg(__FUNCTION__" - Port %u MSR Status = %02x", edge_serial->rxPort, byte2); + dbg("%s - Port %u MSR Status = %02x", __FUNCTION__, edge_serial->rxPort, byte2); // Process this new modem status and generate appropriate // events, etc, based on the new status. This routine @@ -2199,7 +2199,7 @@ break; default: - dbg(__FUNCTION__" - Unrecognized IOSP status code %u\n", code); + dbg("%s - Unrecognized IOSP status code %u\n", __FUNCTION__, code); break; } @@ -2215,7 +2215,7 @@ { struct async_icount *icount; - dbg(__FUNCTION__" %02x", newMsr); + dbg("%s %02x", __FUNCTION__, newMsr); if (newMsr & (MSR_DELTA_CTS | MSR_DELTA_DSR | MSR_DELTA_RI | MSR_DELTA_CD)) { icount = &edge_port->icount; @@ -2252,7 +2252,7 @@ __u8 newLsr = (__u8)(lsr & (__u8)(LSR_OVER_ERR | LSR_PAR_ERR | LSR_FRM_ERR | LSR_BREAK)); struct async_icount *icount; - dbg(__FUNCTION__" - %02x", newLsr); + dbg("%s - %02x", __FUNCTION__, newLsr); edge_port->shadowLSR = lsr; @@ -2303,11 +2303,11 @@ __u16 current_length; unsigned char *transfer_buffer; -// dbg (__FUNCTION__" - %x, %x, %d", extAddr, addr, length); +// dbg("%s - %x, %x, %d", __FUNCTION__, extAddr, addr, length); transfer_buffer = kmalloc (64, GFP_KERNEL); if (!transfer_buffer) { - err(__FUNCTION__" - kmalloc(%d) failed.\n", 64); + err("%s - kmalloc(%d) failed.\n", __FUNCTION__, 64); return -ENOMEM; } @@ -2319,7 +2319,7 @@ } else { current_length = length; } -// dbg (__FUNCTION__" - writing %x, %x, %d", extAddr, addr, current_length); +// dbg("%s - writing %x, %x, %d", __FUNCTION__, extAddr, addr, current_length); memcpy (transfer_buffer, data, current_length); result = usb_control_msg (serial->dev, usb_sndctrlpipe(serial->dev, 0), USB_REQUEST_ION_WRITE_RAM, 0x40, addr, extAddr, transfer_buffer, current_length, 300); @@ -2348,11 +2348,11 @@ __u16 current_length; unsigned char *transfer_buffer; -// dbg (__FUNCTION__" - %x, %x, %d", extAddr, addr, length); +// dbg("%s - %x, %x, %d", __FUNCTION__, extAddr, addr, length); transfer_buffer = kmalloc (64, GFP_KERNEL); if (!transfer_buffer) { - err(__FUNCTION__" - kmalloc(%d) failed.\n", 64); + err("%s - kmalloc(%d) failed.\n", __FUNCTION__, 64); return -ENOMEM; } @@ -2364,7 +2364,7 @@ } else { current_length = length; } -// dbg (__FUNCTION__" - writing %x, %x, %d", extAddr, addr, current_length); +// dbg("%s - writing %x, %x, %d", __FUNCTION__, extAddr, addr, current_length); memcpy (transfer_buffer, data, current_length); result = usb_control_msg (serial->dev, usb_sndctrlpipe(serial->dev, 0), USB_REQUEST_ION_WRITE_ROM, 0x40, addr, extAddr, transfer_buffer, current_length, 300); @@ -2393,11 +2393,11 @@ __u16 current_length; unsigned char *transfer_buffer; - dbg (__FUNCTION__" - %x, %x, %d", extAddr, addr, length); + dbg("%s - %x, %x, %d", __FUNCTION__, extAddr, addr, length); transfer_buffer = kmalloc (64, GFP_KERNEL); if (!transfer_buffer) { - err(__FUNCTION__" - kmalloc(%d) failed.\n", 64); + err("%s - kmalloc(%d) failed.\n", __FUNCTION__, 64); return -ENOMEM; } @@ -2409,7 +2409,7 @@ } else { current_length = length; } -// dbg (__FUNCTION__" - %x, %x, %d", extAddr, addr, current_length); +// dbg("%s - %x, %x, %d", __FUNCTION__, extAddr, addr, current_length); result = usb_control_msg (serial->dev, usb_rcvctrlpipe(serial->dev, 0), USB_REQUEST_ION_READ_ROM, 0xC0, addr, extAddr, transfer_buffer, current_length, 300); if (result < 0) @@ -2436,11 +2436,11 @@ int length = 0; int status = 0; - dbg(__FUNCTION__" - %d, %d", command, param); + dbg("%s - %d, %d", __FUNCTION__, command, param); buffer = kmalloc (10, GFP_ATOMIC); if (!buffer) { - err(__FUNCTION__" - kmalloc(%d) failed.\n", 10); + err("%s - kmalloc(%d) failed.\n", __FUNCTION__, 10); return -ENOMEM; } @@ -2479,7 +2479,7 @@ return -ENOMEM; CmdUrbs++; - dbg(__FUNCTION__" - ALLOCATE URB %p (outstanding %d)", urb, CmdUrbs); + dbg("%s - ALLOCATE URB %p (outstanding %d)", __FUNCTION__, urb, CmdUrbs); FILL_BULK_URB (urb, edge_serial->serial->dev, usb_sndbulkpipe(edge_serial->serial->dev, edge_serial->bulk_out_endpoint), @@ -2490,7 +2490,7 @@ if (status) { /* something went wrong */ - dbg(__FUNCTION__" - usb_submit_urb(write bulk) failed"); + dbg("%s - usb_submit_urb(write bulk) failed", __FUNCTION__); usb_unlink_urb (urb); usb_free_urb (urb); return status; @@ -2505,7 +2505,7 @@ if (edge_port->commandPending == TRUE) { /* command timed out */ - dbg(__FUNCTION__" - command timed out"); + dbg("%s - command timed out", __FUNCTION__); status = -EINVAL; } #endif @@ -2527,18 +2527,18 @@ int status; unsigned char number = edge_port->port->number - edge_port->port->serial->minor; - dbg(__FUNCTION__" - port = %d, baud = %d", edge_port->port->number, baudRate); + dbg("%s - port = %d, baud = %d", __FUNCTION__, edge_port->port->number, baudRate); status = calc_baud_rate_divisor (baudRate, &divisor); if (status) { - err(__FUNCTION__" - bad baud rate"); + err("%s - bad baud rate", __FUNCTION__); return status; } // Alloc memory for the string of commands. cmdBuffer = kmalloc (0x100, GFP_ATOMIC); if (!cmdBuffer) { - err(__FUNCTION__" - kmalloc(%d) failed.\n", 0x100); + err("%s - kmalloc(%d) failed.\n", __FUNCTION__, 0x100); return -ENOMEM; } currCmd = cmdBuffer; @@ -2576,7 +2576,7 @@ __u16 round; - dbg(__FUNCTION__" - %d", baudrate); + dbg("%s - %d", __FUNCTION__, baudrate); for (i = 0; i < NUM_ENTRIES(divisor_table); i++) { if ( divisor_table[i].BaudRate == baudrate ) { @@ -2600,7 +2600,7 @@ } *divisor = custom; - dbg(__FUNCTION__" - Baud %d = %d\n", baudrate, custom); + dbg("%s - Baud %d = %d\n", __FUNCTION__, baudrate, custom); return 0; } @@ -2619,7 +2619,7 @@ unsigned long cmdLen = 0; int status; - dbg (__FUNCTION__" - write to %s register 0x%02x", (regNum == MCR) ? "MCR" : "LCR", regValue); + dbg("%s - write to %s register 0x%02x", (regNum == MCR) ? "MCR" : "LCR", __FUNCTION__, regValue); // Alloc memory for the string of commands. cmdBuffer = kmalloc (0x10, GFP_ATOMIC); @@ -2662,50 +2662,50 @@ __u8 txFlow; int status; - dbg(__FUNCTION__" - port %d", edge_port->port->number); + dbg("%s - port %d", __FUNCTION__, edge_port->port->number); if ((!edge_port->open) && (!edge_port->openPending)) { - dbg(__FUNCTION__" - port not opened"); + dbg("%s - port not opened", __FUNCTION__); return; } tty = edge_port->port->tty; if ((!tty) || (!tty->termios)) { - dbg(__FUNCTION__" - no tty structures"); + dbg("%s - no tty structures", __FUNCTION__); return; } cflag = tty->termios->c_cflag; switch (cflag & CSIZE) { - case CS5: lData = LCR_BITS_5; mask = 0x1f; dbg(__FUNCTION__" - data bits = 5"); break; - case CS6: lData = LCR_BITS_6; mask = 0x3f; dbg(__FUNCTION__" - data bits = 6"); break; - case CS7: lData = LCR_BITS_7; mask = 0x7f; dbg(__FUNCTION__" - data bits = 7"); break; + case CS5: lData = LCR_BITS_5; mask = 0x1f; dbg("%s - data bits = 5", __FUNCTION__); break; + case CS6: lData = LCR_BITS_6; mask = 0x3f; dbg("%s - data bits = 6", __FUNCTION__); break; + case CS7: lData = LCR_BITS_7; mask = 0x7f; dbg("%s - data bits = 7", __FUNCTION__); break; default: - case CS8: lData = LCR_BITS_8; dbg(__FUNCTION__" - data bits = 8"); break; + case CS8: lData = LCR_BITS_8; dbg("%s - data bits = 8", __FUNCTION__); break; } lParity = LCR_PAR_NONE; if (cflag & PARENB) { if (cflag & PARODD) { lParity = LCR_PAR_ODD; - dbg(__FUNCTION__" - parity = odd"); + dbg("%s - parity = odd", __FUNCTION__); } else { lParity = LCR_PAR_EVEN; - dbg(__FUNCTION__" - parity = even"); + dbg("%s - parity = even", __FUNCTION__); } } else { - dbg(__FUNCTION__" - parity = none"); + dbg("%s - parity = none", __FUNCTION__); } if (cflag & CSTOPB) { lStop = LCR_STOP_2; - dbg(__FUNCTION__" - stop bits = 2"); + dbg("%s - stop bits = 2", __FUNCTION__); } else { lStop = LCR_STOP_1; - dbg(__FUNCTION__" - stop bits = 1"); + dbg("%s - stop bits = 1", __FUNCTION__); } /* figure out the flow control settings */ @@ -2713,9 +2713,9 @@ if (cflag & CRTSCTS) { rxFlow |= IOSP_RX_FLOW_RTS; txFlow |= IOSP_TX_FLOW_CTS; - dbg(__FUNCTION__" - RTS/CTS is enabled"); + dbg("%s - RTS/CTS is enabled", __FUNCTION__); } else { - dbg(__FUNCTION__" - RTS/CTS is disabled"); + dbg("%s - RTS/CTS is disabled", __FUNCTION__); } /* if we are implementing XON/XOFF, set the start and stop character in the device */ @@ -2729,17 +2729,17 @@ /* if we are implementing INBOUND XON/XOFF */ if (I_IXOFF(tty)) { rxFlow |= IOSP_RX_FLOW_XON_XOFF; - dbg(__FUNCTION__" - INBOUND XON/XOFF is enabled, XON = %2x, XOFF = %2x", start_char, stop_char); + dbg("%s - INBOUND XON/XOFF is enabled, XON = %2x, XOFF = %2x", __FUNCTION__, start_char, stop_char); } else { - dbg(__FUNCTION__" - INBOUND XON/XOFF is disabled"); + dbg("%s - INBOUND XON/XOFF is disabled", __FUNCTION__); } /* if we are implementing OUTBOUND XON/XOFF */ if (I_IXON(tty)) { txFlow |= IOSP_TX_FLOW_XON_XOFF; - dbg(__FUNCTION__" - OUTBOUND XON/XOFF is enabled, XON = %2x, XOFF = %2x", start_char, stop_char); + dbg("%s - OUTBOUND XON/XOFF is enabled, XON = %2x, XOFF = %2x", __FUNCTION__, start_char, stop_char); } else { - dbg(__FUNCTION__" - OUTBOUND XON/XOFF is disabled"); + dbg("%s - OUTBOUND XON/XOFF is disabled", __FUNCTION__); } } @@ -2776,7 +2776,7 @@ baud = 9600; } - dbg(__FUNCTION__ " - baud rate = %d", baud); + dbg("%s - baud rate = %d", __FUNCTION__, baud); status = send_cmd_write_baud_rate (edge_port, baud); return; @@ -2951,7 +2951,7 @@ /* create our private serial structure */ edge_serial = kmalloc (sizeof(struct edgeport_serial), GFP_KERNEL); if (edge_serial == NULL) { - err(__FUNCTION__" - Out of memory"); + err("%s - Out of memory", __FUNCTION__); return -ENOMEM; } memset (edge_serial, 0, sizeof(struct edgeport_serial)); @@ -2978,22 +2978,23 @@ /* set the number of ports from the manufacturing description */ /* serial->num_ports = serial->product_info.NumPorts; */ if (edge_serial->product_info.NumPorts != serial->num_ports) { - warn(__FUNCTION__ " - Device Reported %d serial ports vs core " + warn("%s - Device Reported %d serial ports vs core " "thinking we have %d ports, email greg@kroah.com this info.", - edge_serial->product_info.NumPorts, serial->num_ports); + __FUNCTION__, edge_serial->product_info.NumPorts, + serial->num_ports); } - dbg(__FUNCTION__ " - time 1 %ld", jiffies); + dbg("%s - time 1 %ld", __FUNCTION__, jiffies); /* now load the application firmware into this device */ load_application_firmware (edge_serial); - dbg(__FUNCTION__ " - time 2 %ld", jiffies); + dbg("%s - time 2 %ld", __FUNCTION__, jiffies); /* Check current Edgeport EEPROM and update if necessary */ update_edgeport_E2PROM (edge_serial); - dbg(__FUNCTION__ " - time 3 %ld", jiffies); + dbg("%s - time 3 %ld", __FUNCTION__, jiffies); /* set the configuration to use #1 */ // dbg("set_configuration 1"); @@ -3006,7 +3007,7 @@ for (i = 0; i < serial->num_ports; ++i) { edge_port = kmalloc (sizeof(struct edgeport_port), GFP_KERNEL); if (edge_port == NULL) { - err(__FUNCTION__" - Out of memory"); + err("%s - Out of memory", __FUNCTION__); return -ENOMEM; } memset (edge_port, 0, sizeof(struct edgeport_port)); @@ -3027,7 +3028,7 @@ { int i; - dbg (__FUNCTION__); + dbg("%s", __FUNCTION__); /* stop reads and writes on all ports */ for (i=0; i < serial->num_ports; ++i) {