*/
/* #define VERBOSE_DEBUG */
+#ifdef pr_fmt
+#undef pr_fmt
+#endif
+#define pr_fmt(fmt) "["KBUILD_MODNAME"]" fmt
#include <linux/slab.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/err.h>
-
+#include <linux/printk.h>
#include "u_serial.h"
#include "gadget_chips.h"
+#define ACM_LOG "USB_ACM"
+
/*
* This CDC ACM function support just wraps control functions and
* notifications around the generic serial-over-usb code.
* nothing unless we control a real RS232 line.
*/
acm->port_line_coding = *value;
+
+ pr_debug("[XLOG_INFO][USB_ACM] %s: rate=%d, stop=%d, parity=%d, data=%d\n", __func__, \
+ acm->port_line_coding.dwDTERate, acm->port_line_coding.bCharFormat, \
+ acm->port_line_coding.bParityType, acm->port_line_coding.bDataBits);
}
}
* to them by stalling. Options include get/set/clear comm features
* (not that useful) and SEND_BREAK.
*/
+
+ pr_debug("[XLOG_INFO][USB_ACM]%s: ttyGS%d req%02x.%02x v%04x i%04x len=%d\n", __func__, \
+ acm->port_num, ctrl->bRequestType, ctrl->bRequest, w_value, w_index, w_length);
+
switch ((ctrl->bRequestType << 8) | ctrl->bRequest) {
/* SET_LINE_CODING ... just read and save what the host sends */
value = min_t(unsigned, w_length,
sizeof(struct usb_cdc_line_coding));
memcpy(req->buf, &acm->port_line_coding, value);
+
+ pr_debug("[XLOG_INFO][USB_ACM]%s: rate=%d,stop=%d,parity=%d,data=%d\n", __func__, \
+ acm->port_line_coding.dwDTERate, acm->port_line_coding.bCharFormat, \
+ acm->port_line_coding.bParityType, acm->port_line_coding.bDataBits);
+
break;
/* SET_CONTROL_LINE_STATE ... save what the host sent */
struct f_acm *acm = func_to_acm(f);
struct usb_composite_dev *cdev = f->config->cdev;
- DBG(cdev, "acm ttyGS%d deactivated\n", acm->port_num);
+ INFO(cdev, "acm ttyGS%d deactivated\n", acm->port_num);
gserial_disconnect(&acm->port);
usb_ep_disable(acm->notify);
acm->notify->driver_data = NULL;
if (status)
goto fail;
+ pr_debug("[XLOG_INFO][USB_ACM]%s: ttyGS%d: %s speed IN/%s OUT/%s NOTIFY/%s\n", \
+ __func__, acm->port_num, \
+ gadget_is_superspeed(c->cdev->gadget) ? "super" : \
+ gadget_is_dualspeed(c->cdev->gadget) ? "dual" : "full", \
+ acm->port.in->name, acm->port.out->name, acm->notify->name);
+
DBG(cdev, "acm ttyGS%d: %s speed IN/%s OUT/%s NOTIFY/%s\n",
acm->port_num,
gadget_is_superspeed(c->cdev->gadget) ? "super" :