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

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

Issue 6672003: CHROMIUM: qcusbnet: Add gobi3k support. (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
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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 if (urb->status) { 158 if (urb->status) {
159 DBG("Read status = %d\n", urb->status); 159 DBG("Read status = %d\n", urb->status);
160 return; 160 return;
161 } 161 }
162 162
163 DBG("Read %d bytes\n", urb->actual_length); 163 DBG("Read %d bytes\n", urb->actual_length);
164 164
165 data = urb->transfer_buffer; 165 data = urb->transfer_buffer;
166 size = urb->actual_length; 166 size = urb->actual_length;
167 167
168 » print_hex_dump(KERN_INFO, "QCUSBNet2k: ", DUMP_PREFIX_OFFSET, 168 » print_hex_dump(KERN_INFO, "gobi-read: ", DUMP_PREFIX_OFFSET,
169 16, 1, data, size, true); 169 16, 1, data, size, true);
170 170
171 result = qmux_parse(&cid, data, size); 171 result = qmux_parse(&cid, data, size);
172 if (result < 0) { 172 if (result < 0) {
173 DBG("Read error parsing QMUX %d\n", result); 173 DBG("Read error parsing QMUX %d\n", result);
174 return; 174 return;
175 } 175 }
176 176
177 if (size < result + 3) { 177 if (size < result + 3) {
178 DBG("Data buffer too small to parse\n"); 178 DBG("Data buffer too small to parse\n");
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 if ((*(u32 *)(urb->transfer_buffer + 8) == 0) || 247 if ((*(u32 *)(urb->transfer_buffer + 8) == 0) ||
248 (*(u32 *)(urb->transfer_buffer + 12) == 0)) { 248 (*(u32 *)(urb->transfer_buffer + 12) == 0)) {
249 qc_setdown(dev, DOWN_CDC_CONNECTION_SPEED); 249 qc_setdown(dev, DOWN_CDC_CONNECTION_SPEED);
250 DBG("traffic stopping due to CONNECTION_SPEED_CH ANGE\n"); 250 DBG("traffic stopping due to CONNECTION_SPEED_CH ANGE\n");
251 } else { 251 } else {
252 qc_cleardown(dev, DOWN_CDC_CONNECTION_SPEED); 252 qc_cleardown(dev, DOWN_CDC_CONNECTION_SPEED);
253 DBG("resuming traffic due to CONNECTION_SPEED_CH ANGE\n"); 253 DBG("resuming traffic due to CONNECTION_SPEED_CH ANGE\n");
254 } 254 }
255 } else { 255 } else {
256 DBG("ignoring invalid interrupt in packet\n"); 256 DBG("ignoring invalid interrupt in packet\n");
257 » » » print_hex_dump(KERN_INFO, "QCUSBNet2k: ", 257 » » » print_hex_dump(KERN_INFO, "gobi-int: ",
258 DUMP_PREFIX_OFFSET, 16, 1, 258 DUMP_PREFIX_OFFSET, 16, 1,
259 urb->transfer_buffer, 259 urb->transfer_buffer,
260 urb->actual_length, true); 260 urb->actual_length, true);
261 } 261 }
262 } 262 }
263 263
264 interval = (dev->usbnet->udev->speed == USB_SPEED_HIGH) ? 7 : 3; 264 interval = (dev->usbnet->udev->speed == USB_SPEED_HIGH) ? 7 : 3;
265 265
266 usb_fill_int_urb(urb, urb->dev, urb->pipe, urb->transfer_buffer, 266 usb_fill_int_urb(urb, urb->dev, urb->pipe, urb->transfer_buffer,
267 urb->transfer_buffer_length, urb->complete, 267 urb->transfer_buffer_length, urb->complete,
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 setup.index = 0; 515 setup.index = 0;
516 setup.len = 0; 516 setup.len = 0;
517 setup.len = size; 517 setup.len = size;
518 518
519 usb_fill_control_urb(urb, dev->usbnet->udev, 519 usb_fill_control_urb(urb, dev->usbnet->udev,
520 usb_sndctrlpipe(dev->usbnet->udev, 0), 520 usb_sndctrlpipe(dev->usbnet->udev, 0),
521 (unsigned char *)&setup, (void *)buf, size, 521 (unsigned char *)&setup, (void *)buf, size,
522 NULL, dev); 522 NULL, dev);
523 523
524 DBG("Actual Write:\n"); 524 DBG("Actual Write:\n");
525 » print_hex_dump(KERN_INFO, "QCUSBNet2k: ", DUMP_PREFIX_OFFSET, 525 » print_hex_dump(KERN_INFO, "gobi-write: ", DUMP_PREFIX_OFFSET,
526 16, 1, buf, size, true); 526 16, 1, buf, size, true);
527 527
528 sema_init(&sem, 0); 528 sema_init(&sem, 0);
529 529
530 urb->complete = write_callback; 530 urb->complete = write_callback;
531 urb->context = &sem; 531 urb->context = &sem;
532 532
533 result = usb_autopm_get_interface(dev->iface); 533 result = usb_autopm_get_interface(dev->iface);
534 if (result < 0) { 534 if (result < 0) {
535 DBG("unable to resume interface: %d\n", result); 535 DBG("unable to resume interface: %d\n", result);
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 return -ENXIO; 1262 return -ENXIO;
1263 } 1263 }
1264 name += strlen("usb"); 1264 name += strlen("usb");
1265 qmiidx = simple_strtoul(name, NULL, 10); 1265 qmiidx = simple_strtoul(name, NULL, 10);
1266 if (qmiidx < 0) { 1266 if (qmiidx < 0) {
1267 DBG("Bad minor number\n"); 1267 DBG("Bad minor number\n");
1268 return -ENXIO; 1268 return -ENXIO;
1269 } 1269 }
1270 1270
1271 printk(KERN_INFO "creating qcqmi%d\n", qmiidx); 1271 printk(KERN_INFO "creating qcqmi%d\n", qmiidx);
1272 » device_create(dev->qmi.devclass, NULL, devno, NULL, "qcqmi%d", qmiidx); 1272 » device_create(dev->qmi.devclass, &dev->iface->dev, devno, NULL, "qcqmi%d ", qmiidx);
1273 1273
1274 dev->qmi.devnum = devno; 1274 dev->qmi.devnum = devno;
1275 return 0; 1275 return 0;
1276 } 1276 }
1277 1277
1278 void qc_deregister(struct qcusbnet *dev) 1278 void qc_deregister(struct qcusbnet *dev)
1279 { 1279 {
1280 struct list_head *node, *tmp; 1280 struct list_head *node, *tmp;
1281 struct client *client; 1281 struct client *client;
1282 struct inode *inode; 1282 struct inode *inode;
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
1583 DBG("bad get MEID resp\n"); 1583 DBG("bad get MEID resp\n");
1584 memset(&dev->meid[0], '0', 14); 1584 memset(&dev->meid[0], '0', 14);
1585 } 1585 }
1586 1586
1587 client_free(dev, cid); 1587 client_free(dev, cid);
1588 return 0; 1588 return 0;
1589 } 1589 }
1590 1590
1591 module_param(qcusbnet2k_fwdelay, int, S_IRUGO | S_IWUSR); 1591 module_param(qcusbnet2k_fwdelay, int, S_IRUGO | S_IWUSR);
1592 MODULE_PARM_DESC(qcusbnet2k_fwdelay, "Delay for old firmware"); 1592 MODULE_PARM_DESC(qcusbnet2k_fwdelay, "Delay for old firmware");
OLDNEW
« drivers/net/usb/gobi/qcusbnet.c ('K') | « drivers/net/usb/gobi/qcusbnet.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698