--- drivers/blazer_usb.c.orig	2010-12-24 14:24:29.000000000 +0100
+++ drivers/blazer_usb.c	2011-05-09 08:42:41.956459432 +0200
@@ -274,6 +274,100 @@
 }
 
 
+/* Clone from the krauler_command, forcing the lang ID to 0x4095 for buggy generic UPS */
+static int ldlc_command(const char *cmd, char *buf, size_t buflen)
+{
+	/*
+	 * Still not implemented:
+	 * 0x6	T<n>	(don't know how to pass the parameter)
+	 * 0x68 and 0x69 both cause shutdown after an undefined interval
+	*/
+	const struct {
+		const char	*str;		/* Megatec command */
+		const int	index;	/* Krauler string index for this command */
+		const char	prefix;	/* character to replace the first byte in reply */
+	}  command[] = {
+		{ "Q1\r", 0x03, '(' },
+		{ "F\r",  0x0d, '#' },
+		{ "I\r",  0x0c, '#' },
+		{ "T\r",  0x04, '\r' },
+		{ "TL\r", 0x05, '\r' },
+		{ "Q\r",  0x07, '\r' },
+		{ "C\r",  0x0b, '\r' },
+		{ "CT\r", 0x0b, '\r' },
+		{ NULL }
+	};
+
+	int	i;
+
+	upsdebugx(3, "send: %.*s", (int)strcspn(cmd, "\r"), cmd);
+
+	for (i = 0; command[i].str; i++) {
+		int	retry;
+		int	ret = 0;
+
+		if (strcmp(cmd, command[i].str)) {
+			continue;
+		}
+
+		for (retry = 0; retry < 10; retry++) {
+
+			upsdebugx(3, "index: %x", command[i].index);
+			/* Hardcode lang to 0x4095 */
+			ret = usb_get_string(udev, command[i].index, 0x4095, buf, buflen);
+
+			if (ret <= 0) {
+				upsdebugx(3, "read: %s", ret ? usb_strerror() : "timeout");
+				continue;
+			}
+
+			/* Invalid receive size - message corrupted */
+			if (ret != buf[0]) 
+			{
+				upsdebugx(1, "size mismatch: %d / %d", ret, buf[0]);
+				continue;
+			}
+
+			/* Simple unicode -> ASCII inplace conversion */
+			unsigned int di, si, size = buf[0];
+			for (di = 0, si = 2; si < size; si += 2) {
+				if (di >= (buflen - 1))
+					break;
+
+				if (buf[si + 1]) /* high byte */
+					buf[di++] = '?';
+				else
+					buf[di++] = buf[si];
+			}
+			buf[di] = 0;
+			ret = di;
+
+			/* "UPS No Ack" has a special meaning */
+			if (!strcasecmp(buf, "UPS No Ack")) {
+				continue;
+			}
+
+			/* Replace the first byte of what we received with the correct one */
+			buf[0] = command[i].prefix;
+
+			return ret;
+		}
+		
+		if (ret <= 0) {
+			upsdebugx(3, "read: %s", ret ? usb_strerror() : "timeout");
+			return ret;
+		}
+
+		upsdebugx(3, "read: %.*s", (int)strcspn(buf, "\r"), buf);
+		return 0;
+	}
+
+	/* echo the unknown command back */
+	upsdebugx(3, "read: %.*s", (int)strcspn(cmd, "\r"), cmd);
+	return snprintf(buf, buflen, "%s", cmd);
+}
+
+
 static void *cypress_subdriver(void)
 {
 	subdriver_command = &cypress_command;
@@ -288,6 +382,7 @@
 }
 
 
+
 static void *krauler_subdriver(void)
 {
 	subdriver_command = &krauler_command;
@@ -455,6 +550,7 @@
 		{ "phoenix", &phoenix_command },
 		{ "ippon", &ippon_command },
 		{ "krauler", &krauler_command },
+		{ "ldlc", &ldlc_command },
 		{ NULL }
 	};
 
