|
@@ -313,15 +313,15 @@ static void acm_complete_set_line_coding(struct usb_ep *ep,
|
|
struct usb_composite_dev *cdev = acm->port.func.config->cdev;
|
|
struct usb_composite_dev *cdev = acm->port.func.config->cdev;
|
|
|
|
|
|
if (req->status != 0) {
|
|
if (req->status != 0) {
|
|
- DBG(cdev, "acm ttyGS%d completion, err %d\n",
|
|
|
|
- acm->port_num, req->status);
|
|
|
|
|
|
+ dev_dbg(&cdev->gadget->dev, "acm ttyGS%d completion, err %d\n",
|
|
|
|
+ acm->port_num, req->status);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
/* normal completion */
|
|
/* normal completion */
|
|
if (req->actual != sizeof(acm->port_line_coding)) {
|
|
if (req->actual != sizeof(acm->port_line_coding)) {
|
|
- DBG(cdev, "acm ttyGS%d short resp, len %d\n",
|
|
|
|
- acm->port_num, req->actual);
|
|
|
|
|
|
+ dev_dbg(&cdev->gadget->dev, "acm ttyGS%d short resp, len %d\n",
|
|
|
|
+ acm->port_num, req->actual);
|
|
usb_ep_set_halt(ep);
|
|
usb_ep_set_halt(ep);
|
|
} else {
|
|
} else {
|
|
struct usb_cdc_line_coding *value = req->buf;
|
|
struct usb_cdc_line_coding *value = req->buf;
|
|
@@ -397,14 +397,16 @@ static int acm_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
|
|
|
|
|
|
default:
|
|
default:
|
|
invalid:
|
|
invalid:
|
|
- VDBG(cdev, "invalid control req%02x.%02x v%04x i%04x l%d\n",
|
|
|
|
- ctrl->bRequestType, ctrl->bRequest,
|
|
|
|
- w_value, w_index, w_length);
|
|
|
|
|
|
+ dev_vdbg(&cdev->gadget->dev,
|
|
|
|
+ "invalid control req%02x.%02x v%04x i%04x l%d\n",
|
|
|
|
+ ctrl->bRequestType, ctrl->bRequest,
|
|
|
|
+ w_value, w_index, w_length);
|
|
}
|
|
}
|
|
|
|
|
|
/* respond with data transfer or status phase? */
|
|
/* respond with data transfer or status phase? */
|
|
if (value >= 0) {
|
|
if (value >= 0) {
|
|
- DBG(cdev, "acm ttyGS%d req%02x.%02x v%04x i%04x l%d\n",
|
|
|
|
|
|
+ dev_dbg(&cdev->gadget->dev,
|
|
|
|
+ "acm ttyGS%d req%02x.%02x v%04x i%04x l%d\n",
|
|
acm->port_num, ctrl->bRequestType, ctrl->bRequest,
|
|
acm->port_num, ctrl->bRequestType, ctrl->bRequest,
|
|
w_value, w_index, w_length);
|
|
w_value, w_index, w_length);
|
|
req->zero = 0;
|
|
req->zero = 0;
|
|
@@ -428,10 +430,12 @@ static int acm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
|
|
|
|
|
|
if (intf == acm->ctrl_id) {
|
|
if (intf == acm->ctrl_id) {
|
|
if (acm->notify->driver_data) {
|
|
if (acm->notify->driver_data) {
|
|
- VDBG(cdev, "reset acm control interface %d\n", intf);
|
|
|
|
|
|
+ dev_vdbg(&cdev->gadget->dev,
|
|
|
|
+ "reset acm control interface %d\n", intf);
|
|
usb_ep_disable(acm->notify);
|
|
usb_ep_disable(acm->notify);
|
|
} else {
|
|
} else {
|
|
- VDBG(cdev, "init acm ctrl interface %d\n", intf);
|
|
|
|
|
|
+ dev_vdbg(&cdev->gadget->dev,
|
|
|
|
+ "init acm ctrl interface %d\n", intf);
|
|
if (config_ep_by_speed(cdev->gadget, f, acm->notify))
|
|
if (config_ep_by_speed(cdev->gadget, f, acm->notify))
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
@@ -440,11 +444,13 @@ static int acm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
|
|
|
|
|
|
} else if (intf == acm->data_id) {
|
|
} else if (intf == acm->data_id) {
|
|
if (acm->port.in->driver_data) {
|
|
if (acm->port.in->driver_data) {
|
|
- DBG(cdev, "reset acm ttyGS%d\n", acm->port_num);
|
|
|
|
|
|
+ dev_dbg(&cdev->gadget->dev,
|
|
|
|
+ "reset acm ttyGS%d\n", acm->port_num);
|
|
gserial_disconnect(&acm->port);
|
|
gserial_disconnect(&acm->port);
|
|
}
|
|
}
|
|
if (!acm->port.in->desc || !acm->port.out->desc) {
|
|
if (!acm->port.in->desc || !acm->port.out->desc) {
|
|
- DBG(cdev, "activate acm ttyGS%d\n", acm->port_num);
|
|
|
|
|
|
+ dev_dbg(&cdev->gadget->dev,
|
|
|
|
+ "activate acm ttyGS%d\n", acm->port_num);
|
|
if (config_ep_by_speed(cdev->gadget, f,
|
|
if (config_ep_by_speed(cdev->gadget, f,
|
|
acm->port.in) ||
|
|
acm->port.in) ||
|
|
config_ep_by_speed(cdev->gadget, f,
|
|
config_ep_by_speed(cdev->gadget, f,
|
|
@@ -467,7 +473,7 @@ static void acm_disable(struct usb_function *f)
|
|
struct f_acm *acm = func_to_acm(f);
|
|
struct f_acm *acm = func_to_acm(f);
|
|
struct usb_composite_dev *cdev = f->config->cdev;
|
|
struct usb_composite_dev *cdev = f->config->cdev;
|
|
|
|
|
|
- DBG(cdev, "acm ttyGS%d deactivated\n", acm->port_num);
|
|
|
|
|
|
+ dev_dbg(&cdev->gadget->dev, "acm ttyGS%d deactivated\n", acm->port_num);
|
|
gserial_disconnect(&acm->port);
|
|
gserial_disconnect(&acm->port);
|
|
usb_ep_disable(acm->notify);
|
|
usb_ep_disable(acm->notify);
|
|
acm->notify->driver_data = NULL;
|
|
acm->notify->driver_data = NULL;
|
|
@@ -537,8 +543,8 @@ static int acm_notify_serial_state(struct f_acm *acm)
|
|
|
|
|
|
spin_lock(&acm->lock);
|
|
spin_lock(&acm->lock);
|
|
if (acm->notify_req) {
|
|
if (acm->notify_req) {
|
|
- DBG(cdev, "acm ttyGS%d serial state %04x\n",
|
|
|
|
- acm->port_num, acm->serial_state);
|
|
|
|
|
|
+ dev_dbg(&cdev->gadget->dev, "acm ttyGS%d serial state %04x\n",
|
|
|
|
+ acm->port_num, acm->serial_state);
|
|
status = acm_cdc_notify(acm, USB_CDC_NOTIFY_SERIAL_STATE,
|
|
status = acm_cdc_notify(acm, USB_CDC_NOTIFY_SERIAL_STATE,
|
|
0, &acm->serial_state, sizeof(acm->serial_state));
|
|
0, &acm->serial_state, sizeof(acm->serial_state));
|
|
} else {
|
|
} else {
|
|
@@ -691,12 +697,13 @@ acm_bind(struct usb_configuration *c, struct usb_function *f)
|
|
if (status)
|
|
if (status)
|
|
goto fail;
|
|
goto fail;
|
|
|
|
|
|
- DBG(cdev, "acm ttyGS%d: %s speed IN/%s OUT/%s NOTIFY/%s\n",
|
|
|
|
- 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);
|
|
|
|
|
|
+ dev_dbg(&cdev->gadget->dev,
|
|
|
|
+ "acm ttyGS%d: %s speed IN/%s OUT/%s NOTIFY/%s\n",
|
|
|
|
+ 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);
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
fail:
|
|
fail:
|