Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Side by Side Diff: drivers/net/usb/gobi/qmidevice.c

Issue 6731002: CHROMIUM: Hide packet dumps behind a flag. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/kernel.git@master
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* qmidevice.c - gobi QMI device 1 /* qmidevice.c - gobi QMI device
2 * Copyright (c) 2010, Code Aurora Forum. All rights reserved. 2 * Copyright (c) 2010, Code Aurora Forum. All rights reserved.
3 3
4 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and 5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation. 6 * only version 2 as published by the Free Software Foundation.
7 7
8 * This program is distributed in the hope that it will be useful, 8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 if (urb->status) { 159 if (urb->status) {
160 DBG("Read status = %d\n", urb->status); 160 DBG("Read status = %d\n", urb->status);
161 return; 161 return;
162 } 162 }
163 163
164 DBG("Read %d bytes\n", urb->actual_length); 164 DBG("Read %d bytes\n", urb->actual_length);
165 165
166 data = urb->transfer_buffer; 166 data = urb->transfer_buffer;
167 size = urb->actual_length; 167 size = urb->actual_length;
168 168
169 » print_hex_dump(KERN_INFO, "gobi-read: ", DUMP_PREFIX_OFFSET, 169 » if (qcusbnet_debug)
170 » » 16, 1, data, size, true); 170 » » print_hex_dump(KERN_INFO, "gobi-read: ", DUMP_PREFIX_OFFSET,
171 » » 16, 1, data, size, true);
171 172
172 result = qmux_parse(&cid, data, size); 173 result = qmux_parse(&cid, data, size);
173 if (result < 0) { 174 if (result < 0) {
174 DBG("Read error parsing QMUX %d\n", result); 175 DBG("Read error parsing QMUX %d\n", result);
175 return; 176 return;
176 } 177 }
177 178
178 if (size < result + 3) { 179 if (size < result + 3) {
179 DBG("Data buffer too small to parse\n"); 180 DBG("Data buffer too small to parse\n");
180 return; 181 return;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 if ((*(u32 *)(urb->transfer_buffer + 8) == 0) || 249 if ((*(u32 *)(urb->transfer_buffer + 8) == 0) ||
249 (*(u32 *)(urb->transfer_buffer + 12) == 0)) { 250 (*(u32 *)(urb->transfer_buffer + 12) == 0)) {
250 qc_setdown(dev, DOWN_CDC_CONNECTION_SPEED); 251 qc_setdown(dev, DOWN_CDC_CONNECTION_SPEED);
251 DBG("traffic stopping due to CONNECTION_SPEED_CH ANGE\n"); 252 DBG("traffic stopping due to CONNECTION_SPEED_CH ANGE\n");
252 } else { 253 } else {
253 qc_cleardown(dev, DOWN_CDC_CONNECTION_SPEED); 254 qc_cleardown(dev, DOWN_CDC_CONNECTION_SPEED);
254 DBG("resuming traffic due to CONNECTION_SPEED_CH ANGE\n"); 255 DBG("resuming traffic due to CONNECTION_SPEED_CH ANGE\n");
255 } 256 }
256 } else { 257 } else {
257 DBG("ignoring invalid interrupt in packet\n"); 258 DBG("ignoring invalid interrupt in packet\n");
258 » » » print_hex_dump(KERN_INFO, "gobi-int: ", 259 » » » if (qcusbnet_debug)
259 » » » » DUMP_PREFIX_OFFSET, 16, 1, 260 » » » » print_hex_dump(KERN_INFO, "gobi-int: ",
260 » » » » urb->transfer_buffer, 261 » » » » DUMP_PREFIX_OFFSET, 16, 1,
261 » » » » urb->actual_length, true); 262 » » » » urb->transfer_buffer,
263 » » » » urb->actual_length, true);
262 } 264 }
263 } 265 }
264 266
265 interval = (dev->usbnet->udev->speed == USB_SPEED_HIGH) ? 7 : 3; 267 interval = (dev->usbnet->udev->speed == USB_SPEED_HIGH) ? 7 : 3;
266 268
267 usb_fill_int_urb(urb, urb->dev, urb->pipe, urb->transfer_buffer, 269 usb_fill_int_urb(urb, urb->dev, urb->pipe, urb->transfer_buffer,
268 urb->transfer_buffer_length, urb->complete, 270 urb->transfer_buffer_length, urb->complete,
269 urb->context, interval); 271 urb->context, interval);
270 status = usb_submit_urb(urb, GFP_ATOMIC); 272 status = usb_submit_urb(urb, GFP_ATOMIC);
271 if (status) 273 if (status)
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 setup.index = 0; 518 setup.index = 0;
517 setup.len = 0; 519 setup.len = 0;
518 setup.len = size; 520 setup.len = size;
519 521
520 usb_fill_control_urb(urb, dev->usbnet->udev, 522 usb_fill_control_urb(urb, dev->usbnet->udev,
521 usb_sndctrlpipe(dev->usbnet->udev, 0), 523 usb_sndctrlpipe(dev->usbnet->udev, 0),
522 (unsigned char *)&setup, (void *)buf, size, 524 (unsigned char *)&setup, (void *)buf, size,
523 NULL, dev); 525 NULL, dev);
524 526
525 DBG("Actual Write:\n"); 527 DBG("Actual Write:\n");
526 » print_hex_dump(KERN_INFO, "gobi-write: ", DUMP_PREFIX_OFFSET, 528 » if (qcusbnet_debug)
527 » » 16, 1, buf, size, true); 529 » » print_hex_dump(KERN_INFO, "gobi-write: ", DUMP_PREFIX_OFFSET,
530 » » 16, 1, buf, size, true);
528 531
529 sema_init(&sem, 0); 532 sema_init(&sem, 0);
530 533
531 urb->complete = write_callback; 534 urb->complete = write_callback;
532 urb->context = &sem; 535 urb->context = &sem;
533 536
534 result = usb_autopm_get_interface(dev->iface); 537 result = usb_autopm_get_interface(dev->iface);
535 if (result < 0) { 538 if (result < 0) {
536 DBG("unable to resume interface: %d\n", result); 539 DBG("unable to resume interface: %d\n", result);
537 if (result == -EPERM) { 540 if (result == -EPERM) {
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after
1534 DBG("bad get MEID resp\n"); 1537 DBG("bad get MEID resp\n");
1535 memset(&dev->meid[0], '0', 14); 1538 memset(&dev->meid[0], '0', 14);
1536 } 1539 }
1537 1540
1538 client_free(dev, cid); 1541 client_free(dev, cid);
1539 return 0; 1542 return 0;
1540 } 1543 }
1541 1544
1542 module_param(qcusbnet2k_fwdelay, int, S_IRUGO | S_IWUSR); 1545 module_param(qcusbnet2k_fwdelay, int, S_IRUGO | S_IWUSR);
1543 MODULE_PARM_DESC(qcusbnet2k_fwdelay, "Delay for old firmware"); 1546 MODULE_PARM_DESC(qcusbnet2k_fwdelay, "Delay for old firmware");
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698