if (status < 0)
return status;
if (status != size) {
- dbg("%s - wanted to write %d, but only wrote %d",
- __func__, size, status);
+ dev_dbg(&dev->dev, "%s - wanted to write %d, but only wrote %d\n",
+ __func__, size, status);
return -ECOMM;
}
return 0;
if (status < 0)
return status;
if (status != size) {
- dbg("%s - wanted to write %d, but only wrote %d",
- __func__, size, status);
+ dev_dbg(&dev->dev, "%s - wanted to write %d, but only wrote %d\n",
+ __func__, size, status);
return -ECOMM;
}
return 0;
{
int port_number = port->number - port->serial->minor;
- dbg("%s - port %d, mask %x", __func__, port_number, mask);
+ dev_dbg(&port->dev, "%s - port %d, mask %x\n", __func__, port_number, mask);
return send_cmd(port->serial->dev,
UMPC_PURGE_PORT,
__u8 read_length;
__be16 be_start_address;
- dbg("%s - @ %x for %d", __func__, start_address, length);
+ dev_dbg(&dev->dev, "%s - @ %x for %d\n", __func__, start_address, length);
/* Read in blocks of 64 bytes
* (TI firmware can't handle more than 64 byte reads)
read_length = (__u8)length;
if (read_length > 1) {
- dbg("%s - @ %x for %d", __func__,
- start_address, read_length);
+ dev_dbg(&dev->dev, "%s - @ %x for %d\n", __func__, start_address, read_length);
}
be_start_address = cpu_to_be16(start_address);
status = ti_vread_sync(dev, UMPC_MEMORY_READ,
buffer, read_length);
if (status) {
- dbg("%s - ERROR %x", __func__, status);
+ dev_dbg(&dev->dev, "%s - ERROR %x\n", __func__, status);
return status;
}
UMPC_MEMORY_READ, serial->TI_I2C_Type,
(__u16)(start_address+i), &buffer[i], 0x01);
if (status) {
- dbg("%s - ERROR %x", __func__, status);
+ dev_dbg(&serial->serial->dev->dev, "%s - ERROR %x\n", __func__, status);
return status;
}
}
- dbg("%s - start_address = %x, length = %d",
- __func__, start_address, length);
+ dev_dbg(&serial->serial->dev->dev, "%s - start_address = %x, length = %d\n",
+ __func__, start_address, length);
usb_serial_debug_data(debug, &serial->serial->dev->dev,
__func__, length, buffer);
return status;
}
- dbg("%s - start_sddr = %x, length = %d",
- __func__, start_address, length);
+ dev_dbg(&serial->serial->dev->dev, "%s - start_sddr = %x, length = %d\n", __func__, start_address, length);
usb_serial_debug_data(debug, &serial->serial->dev->dev,
__func__, length, buffer);
static int write_i2c_mem(struct edgeport_serial *serial,
int start_address, int length, __u8 address_type, __u8 *buffer)
{
+ struct device *dev = &serial->serial->dev->dev;
int status = 0;
int write_length;
__be16 be_start_address;
if (write_length > length)
write_length = length;
- dbg("%s - BytesInFirstPage Addr = %x, length = %d",
- __func__, start_address, write_length);
- usb_serial_debug_data(debug, &serial->serial->dev->dev,
- __func__, write_length, buffer);
+ dev_dbg(dev, "%s - BytesInFirstPage Addr = %x, length = %d\n",
+ __func__, start_address, write_length);
+ usb_serial_debug_data(debug, dev, __func__, write_length, buffer);
/* Write first page */
be_start_address = cpu_to_be16(start_address);
(__force __u16)be_start_address,
buffer, write_length);
if (status) {
- dbg("%s - ERROR %d", __func__, status);
+ dev_dbg(dev, "%s - ERROR %d\n", __func__, status);
return status;
}
else
write_length = length;
- dbg("%s - Page Write Addr = %x, length = %d",
- __func__, start_address, write_length);
- usb_serial_debug_data(debug, &serial->serial->dev->dev,
- __func__, write_length, buffer);
+ dev_dbg(dev, "%s - Page Write Addr = %x, length = %d\n",
+ __func__, start_address, write_length);
+ usb_serial_debug_data(debug, dev, __func__, write_length, buffer);
/* Write next page */
be_start_address = cpu_to_be16(start_address);
(__force __u16)be_start_address,
buffer, write_length);
if (status) {
- dev_err(&serial->serial->dev->dev, "%s - ERROR %d\n",
- __func__, status);
+ dev_err(dev, "%s - ERROR %d\n", __func__, status);
return status;
}
if (status)
goto exit_is_tx_active;
- dbg("%s - XByteCount 0x%X", __func__, oedb->XByteCount);
+ dev_dbg(&port->port->dev, "%s - XByteCount 0x%X\n", __func__, oedb->XByteCount);
/* and the LSR */
status = read_ram(port->port->serial->dev,
if (status)
goto exit_is_tx_active;
- dbg("%s - LSR = 0x%X", __func__, *lsr);
+ dev_dbg(&port->port->dev, "%s - LSR = 0x%X\n", __func__, *lsr);
/* If either buffer has data or we are transmitting then return TRUE */
if ((oedb->XByteCount & 0x80) != 0)
/* We return Not Active if we get any kind of error */
exit_is_tx_active:
- dbg("%s - return %d", __func__, bytes_left);
+ dev_dbg(&port->port->dev, "%s - return %d\n", __func__, bytes_left);
kfree(lsr);
kfree(oedb);
* configuration # 1, which is Config Descriptor 0.
*/
- dbg("%s - Number of Interfaces = %d",
- __func__, dev->config->desc.bNumInterfaces);
- dbg("%s - MAX Power = %d",
- __func__, dev->config->desc.bMaxPower * 2);
+ dev_dbg(&dev->dev, "%s - Number of Interfaces = %d\n",
+ __func__, dev->config->desc.bNumInterfaces);
+ dev_dbg(&dev->dev, "%s - MAX Power = %d\n",
+ __func__, dev->config->desc.bMaxPower * 2);
if (dev->config->desc.bNumInterfaces != 1) {
- dev_err(&dev->dev, "%s - bNumInterfaces is not 1, ERROR!\n",
- __func__);
+ dev_err(&dev->dev, "%s - bNumInterfaces is not 1, ERROR!\n", __func__);
return -ENODEV;
}
cs = (__u8)(cs + buffer[i]);
if (cs != rom_desc->CheckSum) {
- dbg("%s - Mismatch %x - %x", __func__, rom_desc->CheckSum, cs);
+ pr_debug("%s - Mismatch %x - %x", __func__, rom_desc->CheckSum, cs);
return -EINVAL;
}
return 0;
if ((start_address + sizeof(struct ti_i2c_desc) +
rom_desc->Size) > TI_MAX_I2C_SIZE) {
status = -ENODEV;
- dbg("%s - structure too big, erroring out.", __func__);
+ dev_dbg(dev, "%s - structure too big, erroring out.\n", __func__);
break;
}
- dbg("%s Type = 0x%x", __func__, rom_desc->Type);
+ dev_dbg(dev, "%s Type = 0x%x\n", __func__, rom_desc->Type);
/* Skip type 2 record */
ttype = rom_desc->Type & 0x0f;
int start_address;
struct ti_i2c_desc *rom_desc;
struct edge_ti_manuf_descriptor *desc;
+ struct device *dev = &serial->serial->dev->dev;
rom_desc = kmalloc(sizeof(*rom_desc), GFP_KERNEL);
if (!rom_desc) {
- dev_err(&serial->serial->dev->dev, "%s - out of memory\n",
- __func__);
+ dev_err(dev, "%s - out of memory\n", __func__);
return -ENOMEM;
}
start_address = get_descriptor_addr(serial, I2C_DESC_TYPE_ION,
rom_desc);
if (!start_address) {
- dbg("%s - Edge Descriptor not found in I2C", __func__);
+ dev_dbg(dev, "%s - Edge Descriptor not found in I2C\n", __func__);
status = -ENODEV;
goto exit;
}
status = valid_csum(rom_desc, buffer);
desc = (struct edge_ti_manuf_descriptor *)buffer;
- dbg("%s - IonConfig 0x%x", __func__, desc->IonConfig);
- dbg("%s - Version %d", __func__, desc->Version);
- dbg("%s - Cpu/Board 0x%x", __func__, desc->CpuRev_BoardRev);
- dbg("%s - NumPorts %d", __func__, desc->NumPorts);
- dbg("%s - NumVirtualPorts %d", __func__, desc->NumVirtualPorts);
- dbg("%s - TotalPorts %d", __func__, desc->TotalPorts);
+ dev_dbg(dev, "%s - IonConfig 0x%x\n", __func__, desc->IonConfig);
+ dev_dbg(dev, "%s - Version %d\n", __func__, desc->Version);
+ dev_dbg(dev, "%s - Cpu/Board 0x%x\n", __func__, desc->CpuRev_BoardRev);
+ dev_dbg(dev, "%s - NumPorts %d\n", __func__, desc->NumPorts);
+ dev_dbg(dev, "%s - NumVirtualPorts %d\n", __func__, desc->NumVirtualPorts);
+ dev_dbg(dev, "%s - TotalPorts %d\n", __func__, desc->TotalPorts);
exit:
kfree(rom_desc);
/* Try to figure out what type of I2c we have */
static int i2c_type_bootmode(struct edgeport_serial *serial)
{
+ struct device *dev = &serial->serial->dev->dev;
int status;
u8 *data;
data = kmalloc(1, GFP_KERNEL);
if (!data) {
- dev_err(&serial->serial->dev->dev,
- "%s - out of memory\n", __func__);
+ dev_err(dev, "%s - out of memory\n", __func__);
return -ENOMEM;
}
status = ti_vread_sync(serial->serial->dev, UMPC_MEMORY_READ,
DTK_ADDR_SPACE_I2C_TYPE_II, 0, data, 0x01);
if (status)
- dbg("%s - read 2 status error = %d", __func__, status);
+ dev_dbg(dev, "%s - read 2 status error = %d\n", __func__, status);
else
- dbg("%s - read 2 data = 0x%x", __func__, *data);
+ dev_dbg(dev, "%s - read 2 data = 0x%x\n", __func__, *data);
if ((!status) && (*data == UMP5152 || *data == UMP3410)) {
- dbg("%s - ROM_TYPE_II", __func__);
+ dev_dbg(dev, "%s - ROM_TYPE_II\n", __func__);
serial->TI_I2C_Type = DTK_ADDR_SPACE_I2C_TYPE_II;
goto out;
}
status = ti_vread_sync(serial->serial->dev, UMPC_MEMORY_READ,
DTK_ADDR_SPACE_I2C_TYPE_III, 0, data, 0x01);
if (status)
- dbg("%s - read 3 status error = %d", __func__, status);
+ dev_dbg(dev, "%s - read 3 status error = %d\n", __func__, status);
else
- dbg("%s - read 2 data = 0x%x", __func__, *data);
+ dev_dbg(dev, "%s - read 2 data = 0x%x\n", __func__, *data);
if ((!status) && (*data == UMP5152 || *data == UMP3410)) {
- dbg("%s - ROM_TYPE_III", __func__);
+ dev_dbg(dev, "%s - ROM_TYPE_III\n", __func__);
serial->TI_I2C_Type = DTK_ADDR_SPACE_I2C_TYPE_III;
goto out;
}
- dbg("%s - Unknown", __func__);
+ dev_dbg(dev, "%s - Unknown\n", __func__);
serial->TI_I2C_Type = DTK_ADDR_SPACE_I2C_TYPE_II;
status = -ENODEV;
out:
if (serial->product_info.TiMode == TI_MODE_DOWNLOAD) {
struct ti_i2c_desc *rom_desc;
- dbg("%s - RUNNING IN DOWNLOAD MODE", __func__);
+ dev_dbg(dev, "%s - RUNNING IN DOWNLOAD MODE\n", __func__);
status = check_i2c_image(serial);
if (status) {
- dbg("%s - DOWNLOAD MODE -- BAD I2C", __func__);
+ dev_dbg(dev, "%s - DOWNLOAD MODE -- BAD I2C\n", __func__);
return status;
}
/* Check version number of ION descriptor */
if (!ignore_cpu_rev && ti_cpu_rev(ti_manuf_desc) < 2) {
- dbg("%s - Wrong CPU Rev %d (Must be 2)",
+ dev_dbg(dev, "%s - Wrong CPU Rev %d (Must be 2)\n",
__func__, ti_cpu_rev(ti_manuf_desc));
kfree(ti_manuf_desc);
return -EINVAL;
struct ti_i2c_firmware_rec *firmware_version;
u8 *record;
- dbg("%s - Found Type FIRMWARE (Type 2) record",
- __func__);
+ dev_dbg(dev, "%s - Found Type FIRMWARE (Type 2) record\n", __func__);
firmware_version = kmalloc(sizeof(*firmware_version),
GFP_KERNEL);
download_new_ver = (OperationalMajorVersion << 8) +
(OperationalMinorVersion);
- dbg("%s - >> FW Versions Device %d.%d Driver %d.%d",
- __func__,
- firmware_version->Ver_Major,
- firmware_version->Ver_Minor,
- OperationalMajorVersion,
- OperationalMinorVersion);
+ dev_dbg(dev, "%s - >> FW Versions Device %d.%d Driver %d.%d\n",
+ __func__, firmware_version->Ver_Major,
+ firmware_version->Ver_Minor,
+ OperationalMajorVersion,
+ OperationalMinorVersion);
/* Check if we have an old version in the I2C and
update if necessary */
if (download_cur_ver < download_new_ver) {
- dbg("%s - Update I2C dld from %d.%d to %d.%d",
- __func__,
- firmware_version->Ver_Major,
- firmware_version->Ver_Minor,
- OperationalMajorVersion,
- OperationalMinorVersion);
+ dev_dbg(dev, "%s - Update I2C dld from %d.%d to %d.%d\n",
+ __func__,
+ firmware_version->Ver_Major,
+ firmware_version->Ver_Minor,
+ OperationalMajorVersion,
+ OperationalMinorVersion);
record = kmalloc(1, GFP_KERNEL);
if (!record) {
}
if (*record != I2C_DESC_TYPE_FIRMWARE_BLANK) {
- dev_err(dev,
- "%s - error resetting device\n",
- __func__);
+ dev_err(dev, "%s - error resetting device\n", __func__);
kfree(record);
kfree(firmware_version);
kfree(rom_desc);
return -ENODEV;
}
- dbg("%s - HARDWARE RESET", __func__);
+ dev_dbg(dev, "%s - HARDWARE RESET\n", __func__);
/* Reset UMP -- Back to BOOT MODE */
status = ti_vsend_sync(serial->serial->dev,
UMPC_HARDWARE_RESET,
0, 0, NULL, 0);
- dbg("%s - HARDWARE RESET return %d",
- __func__, status);
+ dev_dbg(dev, "%s - HARDWARE RESET return %d\n", __func__, status);
/* return an error on purpose. */
kfree(record);
return -ENOMEM;
}
- dbg("%s - Found Type BLANK FIRMWARE (Type F2) record",
- __func__);
+ dev_dbg(dev, "%s - Found Type BLANK FIRMWARE (Type F2) record\n", __func__);
/*
* In order to update the I2C firmware we must change
HEADER_SIZE, vheader);
if (status) {
- dbg("%s - can't read header back", __func__);
+ dev_dbg(dev, "%s - can't read header back\n", __func__);
kfree(vheader);
kfree(header);
kfree(rom_desc);
return status;
}
if (memcmp(vheader, header, HEADER_SIZE)) {
- dbg("%s - write download record failed",
- __func__);
+ dev_dbg(dev, "%s - write download record failed\n", __func__);
kfree(vheader);
kfree(header);
kfree(rom_desc);
kfree(vheader);
kfree(header);
- dbg("%s - Start firmware update", __func__);
+ dev_dbg(dev, "%s - Start firmware update\n", __func__);
/* Tell firmware to copy download image into I2C */
status = ti_vsend_sync(serial->serial->dev,
UMPC_COPY_DNLD_TO_I2C, 0, 0, NULL, 0);
- dbg("%s - Update complete 0x%x", __func__, status);
+ dev_dbg(dev, "%s - Update complete 0x%x\n", __func__, status);
if (status) {
dev_err(dev,
"%s - UMPC_COPY_DNLD_TO_I2C failed\n",
/********************************************************************/
/* Boot Mode */
/********************************************************************/
- dbg("%s - RUNNING IN BOOT MODE", __func__);
+ dev_dbg(dev, "%s - RUNNING IN BOOT MODE\n", __func__);
/* Configure the TI device so we can use the BULK pipes for download */
status = config_boot_dev(serial->serial->dev);
if (le16_to_cpu(serial->serial->dev->descriptor.idVendor)
!= USB_VENDOR_ID_ION) {
- dbg("%s - VID = 0x%x", __func__,
- le16_to_cpu(serial->serial->dev->descriptor.idVendor));
+ dev_dbg(dev, "%s - VID = 0x%x\n", __func__,
+ le16_to_cpu(serial->serial->dev->descriptor.idVendor));
serial->TI_I2C_Type = DTK_ADDR_SPACE_I2C_TYPE_II;
goto stayinbootmode;
}
/* Check for version 2 */
if (!ignore_cpu_rev && ti_cpu_rev(ti_manuf_desc) < 2) {
- dbg("%s - Wrong CPU Rev %d (Must be 2)",
- __func__, ti_cpu_rev(ti_manuf_desc));
+ dev_dbg(dev, "%s - Wrong CPU Rev %d (Must be 2)\n",
+ __func__, ti_cpu_rev(ti_manuf_desc));
kfree(ti_manuf_desc);
goto stayinbootmode;
}
header->CheckSum = cs;
/* Download the operational code */
- dbg("%s - Downloading operational code image (TI UMP)",
- __func__);
+ dev_dbg(dev, "%s - Downloading operational code image (TI UMP)\n", __func__);
status = download_code(serial, buffer, buffer_size);
kfree(buffer);
if (status) {
- dbg("%s - Error downloading operational code image",
- __func__);
+ dev_dbg(dev, "%s - Error downloading operational code image\n", __func__);
return status;
}
/* Device will reboot */
serial->product_info.TiMode = TI_MODE_TRANSITIONING;
- dbg("%s - Download successful -- Device rebooting...",
- __func__);
+ dev_dbg(dev, "%s - Download successful -- Device rebooting...\n", __func__);
/* return an error on purpose */
return -ENODEV;
stayinbootmode:
/* Eprom is invalid or blank stay in boot mode */
- dbg("%s - STAYING IN BOOT MODE", __func__);
+ dev_dbg(dev, "%s - STAYING IN BOOT MODE\n", __func__);
serial->product_info.TiMode = TI_MODE_BOOT;
return 0;
{
int status = 0;
- dbg("%s - %x", __func__, mcr);
+ dev_dbg(&port->port->dev, "%s - %x\n", __func__, mcr);
status = ti_do_config(port, UMPC_SET_CLR_DTR, mcr & MCR_DTR);
if (status)
struct async_icount *icount;
struct tty_struct *tty;
- dbg("%s - %02x", __func__, msr);
+ dev_dbg(&edge_port->port->dev, "%s - %02x\n", __func__, msr);
if (msr & (EDGEPORT_MSR_DELTA_CTS | EDGEPORT_MSR_DELTA_DSR |
EDGEPORT_MSR_DELTA_RI | EDGEPORT_MSR_DELTA_CD)) {
LSR_FRM_ERR | LSR_BREAK));
struct tty_struct *tty;
- dbg("%s - %02x", __func__, new_lsr);
+ dev_dbg(&edge_port->port->dev, "%s - %02x\n", __func__, new_lsr);
edge_port->shadow_lsr = lsr;
struct edgeport_serial *edge_serial = urb->context;
struct usb_serial_port *port;
struct edgeport_port *edge_port;
+ struct device *dev;
unsigned char *data = urb->transfer_buffer;
int length = urb->actual_length;
int port_number;
__u8 msr;
int status = urb->status;
- dbg("%s", __func__);
-
switch (status) {
case 0:
/* success */
case -ENOENT:
case -ESHUTDOWN:
/* this urb is terminated, clean up */
- dbg("%s - urb shutting down with status: %d",
+ dev_dbg(&urb->dev->dev, "%s - urb shutting down with status: %d\n",
__func__, status);
return;
default:
}
if (!length) {
- dbg("%s - no data in urb", __func__);
+ dev_dbg(&urb->dev->dev, "%s - no data in urb\n", __func__);
goto exit;
}
- usb_serial_debug_data(debug, &edge_serial->serial->dev->dev,
- __func__, length, data);
+ dev = &edge_serial->serial->dev->dev;
+ usb_serial_debug_data(debug, dev, __func__, length, data);
if (length != 2) {
- dbg("%s - expecting packet of size 2, got %d",
- __func__, length);
+ dev_dbg(dev, "%s - expecting packet of size 2, got %d\n", __func__, length);
goto exit;
}
port_number = TIUMP_GET_PORT_FROM_CODE(data[0]);
function = TIUMP_GET_FUNC_FROM_CODE(data[0]);
- dbg("%s - port_number %d, function %d, info 0x%x",
- __func__, port_number, function, data[1]);
+ dev_dbg(dev, "%s - port_number %d, function %d, info 0x%x\n", __func__,
+ port_number, function, data[1]);
port = edge_serial->serial->port[port_number];
edge_port = usb_get_serial_port_data(port);
if (!edge_port) {
- dbg("%s - edge_port not found", __func__);
+ dev_dbg(dev, "%s - edge_port not found\n", __func__);
return;
}
switch (function) {
if (lsr & UMP_UART_LSR_DATA_MASK) {
/* Save the LSR event for bulk read
completion routine */
- dbg("%s - LSR Event Port %u LSR Status = %02x",
- __func__, port_number, lsr);
+ dev_dbg(dev, "%s - LSR Event Port %u LSR Status = %02x\n",
+ __func__, port_number, lsr);
edge_port->lsr_event = 1;
edge_port->lsr_mask = lsr;
} else {
- dbg("%s - ===== Port %d LSR Status = %02x ======",
- __func__, port_number, lsr);
+ dev_dbg(dev, "%s - ===== Port %d LSR Status = %02x ======\n",
+ __func__, port_number, lsr);
handle_new_lsr(edge_port, 0, lsr, 0);
}
break;
case TIUMP_INTERRUPT_CODE_MSR: /* MSR */
/* Copy MSR from UMP */
msr = data[1];
- dbg("%s - ===== Port %u MSR Status = %02x ======",
- __func__, port_number, msr);
+ dev_dbg(dev, "%s - ===== Port %u MSR Status = %02x ======\n",
+ __func__, port_number, msr);
handle_new_msr(edge_port, msr);
break;
static void edge_bulk_in_callback(struct urb *urb)
{
struct edgeport_port *edge_port = urb->context;
+ struct device *dev = &edge_port->port->dev;
unsigned char *data = urb->transfer_buffer;
struct tty_struct *tty;
int retval = 0;
int port_number;
int status = urb->status;
- dbg("%s", __func__);
-
switch (status) {
case 0:
/* success */
case -ENOENT:
case -ESHUTDOWN:
/* this urb is terminated, clean up */
- dbg("%s - urb shutting down with status: %d",
- __func__, status);
+ dev_dbg(&urb->dev->dev, "%s - urb shutting down with status: %d\n", __func__, status);
return;
default:
- dev_err(&urb->dev->dev,
- "%s - nonzero read bulk status received: %d\n",
- __func__, status);
+ dev_err(&urb->dev->dev, "%s - nonzero read bulk status received: %d\n", __func__, status);
}
if (status == -EPIPE)
if (edge_port->lsr_event) {
edge_port->lsr_event = 0;
- dbg("%s ===== Port %u LSR Status = %02x, Data = %02x ======",
- __func__, port_number, edge_port->lsr_mask, *data);
+ dev_dbg(dev, "%s ===== Port %u LSR Status = %02x, Data = %02x ======\n",
+ __func__, port_number, edge_port->lsr_mask, *data);
handle_new_lsr(edge_port, 1, edge_port->lsr_mask, *data);
/* Adjust buffer length/pointer */
--urb->actual_length;
tty = tty_port_tty_get(&edge_port->port->port);
if (tty && urb->actual_length) {
- usb_serial_debug_data(debug, &edge_port->port->dev,
- __func__, urb->actual_length, data);
+ usb_serial_debug_data(debug, dev, __func__, urb->actual_length, data);
if (edge_port->close_pending)
- dbg("%s - close pending, dropping data on the floor",
+ dev_dbg(dev, "%s - close pending, dropping data on the floor\n",
__func__);
else
- edge_tty_recv(&edge_port->port->dev, tty, data,
- urb->actual_length);
+ edge_tty_recv(dev, tty, data, urb->actual_length);
edge_port->icount.rx += urb->actual_length;
}
tty_kref_put(tty);
spin_unlock(&edge_port->ep_lock);
if (retval)
- dev_err(&urb->dev->dev,
- "%s - usb_submit_urb failed with result %d\n",
- __func__, retval);
+ dev_err(dev, "%s - usb_submit_urb failed with result %d\n", __func__, retval);
}
static void edge_tty_recv(struct device *dev, struct tty_struct *tty,
int status = urb->status;
struct tty_struct *tty;
- dbg("%s - port %d", __func__, port->number);
-
edge_port->ep_write_urb_in_use = 0;
switch (status) {
case -ENOENT:
case -ESHUTDOWN:
/* this urb is terminated, clean up */
- dbg("%s - urb shutting down with status: %d",
+ dev_dbg(&urb->dev->dev, "%s - urb shutting down with status: %d\n",
__func__, status);
return;
default:
u16 open_settings;
u8 transaction_timeout;
- dbg("%s - port %d", __func__, port->number);
-
if (edge_port == NULL)
return -ENODEV;
return -ENODEV;
}
- dbg("%s - port_number = %d, uart_base = %04x, dma_address = %04x",
- __func__, port_number, edge_port->uart_base,
- edge_port->dma_address);
+ dev_dbg(&port->dev, "%s - port_number = %d, uart_base = %04x, dma_address = %04x\n",
+ __func__, port_number, edge_port->uart_base, edge_port->dma_address);
dev = port->serial->dev;
UMP_PIPE_TRANS_TIMEOUT_ENA |
(transaction_timeout << 2));
- dbg("%s - Sending UMPC_OPEN_PORT", __func__);
+ dev_dbg(&port->dev, "%s - Sending UMPC_OPEN_PORT\n", __func__);
/* Tell TI to open and start the port */
status = send_cmd(dev, UMPC_OPEN_PORT,
return status;
}
- dbg("ShadowMSR 0x%X", edge_port->shadow_msr);
+ dev_dbg(&port->dev, "ShadowMSR 0x%X\n", edge_port->shadow_msr);
/* Set Initial MCR */
edge_port->shadow_mcr = MCR_RTS | MCR_DTR;
- dbg("ShadowMCR 0x%X", edge_port->shadow_mcr);
+ dev_dbg(&port->dev, "ShadowMCR 0x%X\n", edge_port->shadow_mcr);
edge_serial = edge_port->edge_serial;
if (mutex_lock_interruptible(&edge_serial->es_lock))
++edge_serial->num_ports_open;
- dbg("%s - exited", __func__);
-
goto release_es_lock;
unlink_int_urb:
struct usb_serial *serial = port->serial;
int port_number;
- dbg("%s - port %d", __func__, port->number);
-
edge_serial = usb_get_serial_data(port->serial);
edge_port = usb_get_serial_port_data(port);
if (edge_serial == NULL || edge_port == NULL)
/* assuming we can still talk to the device,
* send a close port command to it */
- dbg("%s - send umpc_close_port", __func__);
+ dev_dbg(&port->dev, "%s - send umpc_close_port\n", __func__);
port_number = port->number - port->serial->minor;
mutex_lock(&serial->disc_mutex);
}
mutex_unlock(&edge_serial->es_lock);
edge_port->close_pending = 0;
-
- dbg("%s - exited", __func__);
}
static int edge_write(struct tty_struct *tty, struct usb_serial_port *port,
{
struct edgeport_port *edge_port = usb_get_serial_port_data(port);
- dbg("%s - port %d", __func__, port->number);
-
if (count == 0) {
- dbg("%s - write request of 0 bytes", __func__);
+ dev_dbg(&port->dev, "%s - write request of 0 bytes\n", __func__);
return 0;
}
struct edgeport_port *edge_port = usb_get_serial_port_data(port);
unsigned long flags;
-
- dbg("%s - port %d", __func__, port->number);
-
spin_lock_irqsave(&edge_port->ep_lock, flags);
if (edge_port->ep_write_urb_in_use) {
int room = 0;
unsigned long flags;
- dbg("%s - port %d", __func__, port->number);
-
if (edge_port == NULL)
return 0;
if (edge_port->close_pending == 1)
room = kfifo_avail(&edge_port->write_fifo);
spin_unlock_irqrestore(&edge_port->ep_lock, flags);
- dbg("%s - returns %d", __func__, room);
+ dev_dbg(&port->dev, "%s - returns %d\n", __func__, room);
return room;
}
int chars = 0;
unsigned long flags;
- dbg("%s - port %d", __func__, port->number);
-
if (edge_port == NULL)
return 0;
if (edge_port->close_pending == 1)
chars = kfifo_len(&edge_port->write_fifo);
spin_unlock_irqrestore(&edge_port->ep_lock, flags);
- dbg("%s - returns %d", __func__, chars);
+ dev_dbg(&port->dev, "%s - returns %d\n", __func__, chars);
return chars;
}
struct edgeport_port *edge_port = usb_get_serial_port_data(port);
int status;
- dbg("%s - port %d", __func__, port->number);
-
if (edge_port == NULL)
return;
struct edgeport_port *edge_port = usb_get_serial_port_data(port);
int status;
- dbg("%s - port %d", __func__, port->number);
-
if (edge_port == NULL)
return;
static void change_port_settings(struct tty_struct *tty,
struct edgeport_port *edge_port, struct ktermios *old_termios)
{
+ struct device *dev = &edge_port->port->dev;
struct ump_uart_config *config;
int baud;
unsigned cflag;
int port_number = edge_port->port->number -
edge_port->port->serial->minor;
- dbg("%s - port %d", __func__, edge_port->port->number);
+ dev_dbg(dev, "%s - port %d\n", __func__, edge_port->port->number);
config = kmalloc (sizeof (*config), GFP_KERNEL);
if (!config) {
*tty->termios = *old_termios;
- dev_err(&edge_port->port->dev, "%s - out of memory\n",
- __func__);
+ dev_err(dev, "%s - out of memory\n", __func__);
return;
}
switch (cflag & CSIZE) {
case CS5:
config->bDataBits = UMP_UART_CHAR5BITS;
- dbg("%s - data bits = 5", __func__);
+ dev_dbg(dev, "%s - data bits = 5\n", __func__);
break;
case CS6:
config->bDataBits = UMP_UART_CHAR6BITS;
- dbg("%s - data bits = 6", __func__);
+ dev_dbg(dev, "%s - data bits = 6\n", __func__);
break;
case CS7:
config->bDataBits = UMP_UART_CHAR7BITS;
- dbg("%s - data bits = 7", __func__);
+ dev_dbg(dev, "%s - data bits = 7\n", __func__);
break;
default:
case CS8:
config->bDataBits = UMP_UART_CHAR8BITS;
- dbg("%s - data bits = 8", __func__);
+ dev_dbg(dev, "%s - data bits = 8\n", __func__);
break;
}
if (cflag & PARODD) {
config->wFlags |= UMP_MASK_UART_FLAGS_PARITY;
config->bParity = UMP_UART_ODDPARITY;
- dbg("%s - parity = odd", __func__);
+ dev_dbg(dev, "%s - parity = odd\n", __func__);
} else {
config->wFlags |= UMP_MASK_UART_FLAGS_PARITY;
config->bParity = UMP_UART_EVENPARITY;
- dbg("%s - parity = even", __func__);
+ dev_dbg(dev, "%s - parity = even\n", __func__);
}
} else {
config->bParity = UMP_UART_NOPARITY;
- dbg("%s - parity = none", __func__);
+ dev_dbg(dev, "%s - parity = none\n", __func__);
}
if (cflag & CSTOPB) {
config->bStopBits = UMP_UART_STOPBIT2;
- dbg("%s - stop bits = 2", __func__);
+ dev_dbg(dev, "%s - stop bits = 2\n", __func__);
} else {
config->bStopBits = UMP_UART_STOPBIT1;
- dbg("%s - stop bits = 1", __func__);
+ dev_dbg(dev, "%s - stop bits = 1\n", __func__);
}
/* figure out the flow control settings */
if (cflag & CRTSCTS) {
config->wFlags |= UMP_MASK_UART_FLAGS_OUT_X_CTS_FLOW;
config->wFlags |= UMP_MASK_UART_FLAGS_RTS_FLOW;
- dbg("%s - RTS/CTS is enabled", __func__);
+ dev_dbg(dev, "%s - RTS/CTS is enabled\n", __func__);
} else {
- dbg("%s - RTS/CTS is disabled", __func__);
+ dev_dbg(dev, "%s - RTS/CTS is disabled\n", __func__);
tty->hw_stopped = 0;
restart_read(edge_port);
}
/* if we are implementing INBOUND XON/XOFF */
if (I_IXOFF(tty)) {
config->wFlags |= UMP_MASK_UART_FLAGS_IN_X;
- dbg("%s - INBOUND XON/XOFF is enabled, XON = %2x, XOFF = %2x",
- __func__, config->cXon, config->cXoff);
+ dev_dbg(dev, "%s - INBOUND XON/XOFF is enabled, XON = %2x, XOFF = %2x\n",
+ __func__, config->cXon, config->cXoff);
} else
- dbg("%s - INBOUND XON/XOFF is disabled", __func__);
+ dev_dbg(dev, "%s - INBOUND XON/XOFF is disabled\n", __func__);
/* if we are implementing OUTBOUND XON/XOFF */
if (I_IXON(tty)) {
config->wFlags |= UMP_MASK_UART_FLAGS_OUT_X;
- dbg("%s - OUTBOUND XON/XOFF is enabled, XON = %2x, XOFF = %2x",
- __func__, config->cXon, config->cXoff);
+ dev_dbg(dev, "%s - OUTBOUND XON/XOFF is enabled, XON = %2x, XOFF = %2x\n",
+ __func__, config->cXon, config->cXoff);
} else
- dbg("%s - OUTBOUND XON/XOFF is disabled", __func__);
+ dev_dbg(dev, "%s - OUTBOUND XON/XOFF is disabled\n", __func__);
tty->termios->c_cflag &= ~CMSPAR;
/* FIXME: Recompute actual baud from divisor here */
- dbg("%s - baud rate = %d, wBaudRate = %d", __func__, baud,
- config->wBaudRate);
+ dev_dbg(dev, "%s - baud rate = %d, wBaudRate = %d\n", __func__, baud, config->wBaudRate);
- dbg("wBaudRate: %d", (int)(461550L / config->wBaudRate));
- dbg("wFlags: 0x%x", config->wFlags);
- dbg("bDataBits: %d", config->bDataBits);
- dbg("bParity: %d", config->bParity);
- dbg("bStopBits: %d", config->bStopBits);
- dbg("cXon: %d", config->cXon);
- dbg("cXoff: %d", config->cXoff);
- dbg("bUartMode: %d", config->bUartMode);
+ dev_dbg(dev, "wBaudRate: %d\n", (int)(461550L / config->wBaudRate));
+ dev_dbg(dev, "wFlags: 0x%x\n", config->wFlags);
+ dev_dbg(dev, "bDataBits: %d\n", config->bDataBits);
+ dev_dbg(dev, "bParity: %d\n", config->bParity);
+ dev_dbg(dev, "bStopBits: %d\n", config->bStopBits);
+ dev_dbg(dev, "cXon: %d\n", config->cXon);
+ dev_dbg(dev, "cXoff: %d\n", config->cXoff);
+ dev_dbg(dev, "bUartMode: %d\n", config->bUartMode);
/* move the word values into big endian mode */
cpu_to_be16s(&config->wFlags);
(__u8)(UMPM_UART1_PORT + port_number),
0, (__u8 *)config, sizeof(*config));
if (status)
- dbg("%s - error %d when trying to write config to device",
- __func__, status);
+ dev_dbg(dev, "%s - error %d when trying to write config to device\n",
+ __func__, status);
kfree(config);
}
cflag = tty->termios->c_cflag;
- dbg("%s - clfag %08x iflag %08x", __func__,
- tty->termios->c_cflag, tty->termios->c_iflag);
- dbg("%s - old clfag %08x old iflag %08x", __func__,
- old_termios->c_cflag, old_termios->c_iflag);
- dbg("%s - port %d", __func__, port->number);
+ dev_dbg(&port->dev, "%s - clfag %08x iflag %08x\n", __func__,
+ tty->termios->c_cflag, tty->termios->c_iflag);
+ dev_dbg(&port->dev, "%s - old clfag %08x old iflag %08x\n", __func__,
+ old_termios->c_cflag, old_termios->c_iflag);
+ dev_dbg(&port->dev, "%s - port %d\n", __func__, port->number);
if (edge_port == NULL)
return;
unsigned int mcr;
unsigned long flags;
- dbg("%s - port %d", __func__, port->number);
-
spin_lock_irqsave(&edge_port->ep_lock, flags);
mcr = edge_port->shadow_mcr;
if (set & TIOCM_RTS)
unsigned int mcr;
unsigned long flags;
- dbg("%s - port %d", __func__, port->number);
-
spin_lock_irqsave(&edge_port->ep_lock, flags);
msr = edge_port->shadow_msr;
| ((msr & EDGEPORT_MSR_DSR) ? TIOCM_DSR: 0); /* 0x100 */
- dbg("%s -- %x", __func__, result);
+ dev_dbg(&port->dev, "%s -- %x\n", __func__, result);
spin_unlock_irqrestore(&edge_port->ep_lock, flags);
return result;
struct async_icount cnow;
struct async_icount cprev;
- dbg("%s - port %d, cmd = 0x%x", __func__, port->number, cmd);
+ dev_dbg(&port->dev, "%s - port %d, cmd = 0x%x\n", __func__, port->number, cmd);
switch (cmd) {
case TIOCGSERIAL:
- dbg("%s - (%d) TIOCGSERIAL", __func__, port->number);
+ dev_dbg(&port->dev, "%s - TIOCGSERIAL\n", __func__);
return get_serial_info(edge_port,
(struct serial_struct __user *) arg);
case TIOCMIWAIT:
- dbg("%s - (%d) TIOCMIWAIT", __func__, port->number);
+ dev_dbg(&port->dev, "%s - TIOCMIWAIT\n", __func__);
cprev = edge_port->icount;
while (1) {
interruptible_sleep_on(&edge_port->delta_msr_wait);
int status;
int bv = 0; /* Off */
- dbg("%s - state = %d", __func__, break_state);
-
/* chase the port close */
chase_port(edge_port, 0, 0);
bv = 1; /* On */
status = ti_do_config(edge_port, UMPC_SET_CLR_BREAK, bv);
if (status)
- dbg("%s - error %d sending break set/clear command.",
- __func__, status);
+ dev_dbg(&port->dev, "%s - error %d sending break set/clear command.\n",
+ __func__, status);
}
static int edge_startup(struct usb_serial *serial)
static void edge_disconnect(struct usb_serial *serial)
{
- dbg("%s", __func__);
}
static void edge_release(struct usb_serial *serial)
int i;
struct edgeport_port *edge_port;
- dbg("%s", __func__);
-
for (i = 0; i < serial->num_ports; ++i) {
edge_port = usb_get_serial_port_data(serial->port[i]);
kfifo_free(&edge_port->write_fifo);
struct edgeport_port *edge_port = usb_get_serial_port_data(port);
unsigned int v = simple_strtoul(valbuf, NULL, 0);
- dbg("%s: setting uart_mode = %d", __func__, v);
+ dev_dbg(dev, "%s: setting uart_mode = %d\n", __func__, v);
if (v < 256)
edge_port->bUartMode = v;