diag: Add HSIC communication support
Add support for relaying the MDM 9k diag traffic over HSIC
to the USB DIAG MDM channel and vice versa. Also modify usb
diag_bridge to use signed parameters for buffer sizes. This
is especially needed for the final parameter of the read
and write callbacks, wherein a negative errno value may be
passed to convey an error.
Change-Id: Ifa516356a5d72597d82929a56d714f8dfb2964de
Signed-off-by: Dixon Peterson <dixonp@codeaurora.org>
diff --git a/drivers/char/diag/diagfwd.c b/drivers/char/diag/diagfwd.c
index d7191c8..6853654 100644
--- a/drivers/char/diag/diagfwd.c
+++ b/drivers/char/diag/diagfwd.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved.
+/* Copyright (c) 2008-2012, Code Aurora Forum. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -248,7 +248,18 @@
write_ptr->buf = buf;
err = usb_diag_write(driver->mdm_ch, write_ptr);
} else
- pr_err("diag: Incorrect data while USB write");
+ pr_err("diag: Incorrect sdio data "
+ "while USB write\n");
+ }
+#endif
+#ifdef CONFIG_DIAG_HSIC_PIPE
+ else if (proc_num == HSIC_DATA) {
+ if (driver->hsic_device_enabled) {
+ write_ptr->buf = buf;
+ err = usb_diag_write(driver->mdm_ch, write_ptr);
+ } else
+ pr_err("diag: Incorrect hsic data "
+ "while USB write\n");
}
#endif
APPEND_DEBUG('d');