Re: Edgeport UPS Monitoring Problems
"Adam Kropelin" <[email protected]>
| Newsgroups | gmane.linux.usb.devel,gmane.linux.kernel |
|---|---|
| Message-ID | <[email protected]> |
From: "Nick Pasich" <[email protected]> > Here's the dmesg output ...... > > [...] > Jul 29 05:20:07 NICK2 kernel: drivers/usb/serial/io_edgeport.c: LCR - > write to send_cmd_write_uart_register register 0x03 > Jul 29 05:20:07 NICK2 kernel: drivers/usb/serial/io_edgeport.c: > SendCmdWriteUartReg - Not writing to MCR Register > Jul 29 05:20:07 NICK2 kernel: drivers/usb/serial/io_edgeport.c: MCR - > write to send_cmd_write_uart_register register 0x0b > Jul 29 05:20:07 NICK2 kernel: drivers/usb/serial/io_edgeport.c: > SendCmdWriteUartReg - Not writing to MCR Register > Jul 29 05:20:07 NICK2 kernel: drivers/usb/serial/io_edgeport.c: > change_port_settings - baud rate = 9600 > Jul 29 05:20:07 NICK2 kernel: drivers/usb/serial/io_edgeport.c: > SendCmdWriteBaudRate - NOT Setting baud rate for port = 0, baud = 9600 Yup, there's what I expected. Not setting the baud rate and not writing status registers is unlikely to produce working results. This 9600 must be the default setting being applied. > Jul 29 05:20:07 NICK2 kernel: drivers/usb/serial/io_edgeport.c: > SendCmdWriteUartReg - Not writing to MCR Register > Jul 29 05:20:07 NICK2 kernel: drivers/usb/serial/io_edgeport.c: MCR - > write to send_cmd_write_uart_register register 0x0b > Jul 29 05:20:07 NICK2 kernel: drivers/usb/serial/io_edgeport.c: > SendCmdWriteUartReg - Not writing to MCR Register > Jul 29 05:20:07 NICK2 kernel: drivers/usb/serial/io_edgeport.c: > change_port_settings - baud rate = 2400 > Jul 29 05:20:07 NICK2 kernel: drivers/usb/serial/io_edgeport.c: > SendCmdWriteBaudRate - NOT Setting baud rate for port = 0, baud = 2400 Here's apcupsd trying to set 2400 baud. Please try the attached patch (against 2.6.22.1). This will allow writing to the baud rate and MCR/LCR registers on non-EPIC adapters. I suspect the previous code was a copy-paste error. --Adam ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
usb-serial-edgeport-non-epic-baud-rate-fix.patch
(application/octet-stream, 1.5 KB)
--- linux-2.6.22.1/drivers/usb/serial/io_edgeport.c 2007-07-10 14:56:30.000000000 -0400
+++ linux-2.6.22.1.new/drivers/usb/serial/io_edgeport.c 2007-07-29 09:45:18.000000000 -0400
@@ -2366,9 +2366,8 @@
int status;
unsigned char number = edge_port->port->number - edge_port->port->serial->minor;
- if ((!edge_serial->is_epic) ||
- ((edge_serial->is_epic) &&
- (!edge_serial->epic_descriptor.Supports.IOSPSetBaudRate))) {
+ if (edge_serial->is_epic &&
+ !edge_serial->epic_descriptor.Supports.IOSPSetBaudRate) {
dbg("SendCmdWriteBaudRate - NOT Setting baud rate for port = %d, baud = %d",
edge_port->port->number, baudRate);
return 0;
@@ -2461,18 +2460,16 @@
dbg("%s - write to %s register 0x%02x", (regNum == MCR) ? "MCR" : "LCR", __FUNCTION__, regValue);
- if ((!edge_serial->is_epic) ||
- ((edge_serial->is_epic) &&
- (!edge_serial->epic_descriptor.Supports.IOSPWriteMCR) &&
- (regNum == MCR))) {
+ if (edge_serial->is_epic &&
+ !edge_serial->epic_descriptor.Supports.IOSPWriteMCR &&
+ regNum == MCR) {
dbg("SendCmdWriteUartReg - Not writing to MCR Register");
return 0;
}
- if ((!edge_serial->is_epic) ||
- ((edge_serial->is_epic) &&
- (!edge_serial->epic_descriptor.Supports.IOSPWriteLCR) &&
- (regNum == LCR))) {
+ if (edge_serial->is_epic &&
+ !edge_serial->epic_descriptor.Supports.IOSPWriteLCR &&
+ regNum == LCR) {
dbg ("SendCmdWriteUartReg - Not writing to LCR Register");
return 0;
}