| OLD | NEW |
| 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 Loading... |
| 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, "QCUSBNet2k: ", DUMP_PREFIX_OFFSET, | 169 » print_hex_dump(KERN_INFO, "gobi-read: ", DUMP_PREFIX_OFFSET, |
| 170 16, 1, data, size, true); | 170 16, 1, data, size, true); |
| 171 | 171 |
| 172 result = qmux_parse(&cid, data, size); | 172 result = qmux_parse(&cid, data, size); |
| 173 if (result < 0) { | 173 if (result < 0) { |
| 174 DBG("Read error parsing QMUX %d\n", result); | 174 DBG("Read error parsing QMUX %d\n", result); |
| 175 return; | 175 return; |
| 176 } | 176 } |
| 177 | 177 |
| 178 if (size < result + 3) { | 178 if (size < result + 3) { |
| 179 DBG("Data buffer too small to parse\n"); | 179 DBG("Data buffer too small to parse\n"); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 if ((*(u32 *)(urb->transfer_buffer + 8) == 0) || | 248 if ((*(u32 *)(urb->transfer_buffer + 8) == 0) || |
| 249 (*(u32 *)(urb->transfer_buffer + 12) == 0)) { | 249 (*(u32 *)(urb->transfer_buffer + 12) == 0)) { |
| 250 qc_setdown(dev, DOWN_CDC_CONNECTION_SPEED); | 250 qc_setdown(dev, DOWN_CDC_CONNECTION_SPEED); |
| 251 DBG("traffic stopping due to CONNECTION_SPEED_CH
ANGE\n"); | 251 DBG("traffic stopping due to CONNECTION_SPEED_CH
ANGE\n"); |
| 252 } else { | 252 } else { |
| 253 qc_cleardown(dev, DOWN_CDC_CONNECTION_SPEED); | 253 qc_cleardown(dev, DOWN_CDC_CONNECTION_SPEED); |
| 254 DBG("resuming traffic due to CONNECTION_SPEED_CH
ANGE\n"); | 254 DBG("resuming traffic due to CONNECTION_SPEED_CH
ANGE\n"); |
| 255 } | 255 } |
| 256 } else { | 256 } else { |
| 257 DBG("ignoring invalid interrupt in packet\n"); | 257 DBG("ignoring invalid interrupt in packet\n"); |
| 258 » » » print_hex_dump(KERN_INFO, "QCUSBNet2k: ", | 258 » » » print_hex_dump(KERN_INFO, "gobi-int: ", |
| 259 DUMP_PREFIX_OFFSET, 16, 1, | 259 DUMP_PREFIX_OFFSET, 16, 1, |
| 260 urb->transfer_buffer, | 260 urb->transfer_buffer, |
| 261 urb->actual_length, true); | 261 urb->actual_length, true); |
| 262 } | 262 } |
| 263 } | 263 } |
| 264 | 264 |
| 265 interval = (dev->usbnet->udev->speed == USB_SPEED_HIGH) ? 7 : 3; | 265 interval = (dev->usbnet->udev->speed == USB_SPEED_HIGH) ? 7 : 3; |
| 266 | 266 |
| 267 usb_fill_int_urb(urb, urb->dev, urb->pipe, urb->transfer_buffer, | 267 usb_fill_int_urb(urb, urb->dev, urb->pipe, urb->transfer_buffer, |
| 268 urb->transfer_buffer_length, urb->complete, | 268 urb->transfer_buffer_length, urb->complete, |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 setup.index = 0; | 516 setup.index = 0; |
| 517 setup.len = 0; | 517 setup.len = 0; |
| 518 setup.len = size; | 518 setup.len = size; |
| 519 | 519 |
| 520 usb_fill_control_urb(urb, dev->usbnet->udev, | 520 usb_fill_control_urb(urb, dev->usbnet->udev, |
| 521 usb_sndctrlpipe(dev->usbnet->udev, 0), | 521 usb_sndctrlpipe(dev->usbnet->udev, 0), |
| 522 (unsigned char *)&setup, (void *)buf, size, | 522 (unsigned char *)&setup, (void *)buf, size, |
| 523 NULL, dev); | 523 NULL, dev); |
| 524 | 524 |
| 525 DBG("Actual Write:\n"); | 525 DBG("Actual Write:\n"); |
| 526 » print_hex_dump(KERN_INFO, "QCUSBNet2k: ", DUMP_PREFIX_OFFSET, | 526 » print_hex_dump(KERN_INFO, "gobi-write: ", DUMP_PREFIX_OFFSET, |
| 527 16, 1, buf, size, true); | 527 16, 1, buf, size, true); |
| 528 | 528 |
| 529 sema_init(&sem, 0); | 529 sema_init(&sem, 0); |
| 530 | 530 |
| 531 urb->complete = write_callback; | 531 urb->complete = write_callback; |
| 532 urb->context = &sem; | 532 urb->context = &sem; |
| 533 | 533 |
| 534 result = usb_autopm_get_interface(dev->iface); | 534 result = usb_autopm_get_interface(dev->iface); |
| 535 if (result < 0) { | 535 if (result < 0) { |
| 536 DBG("unable to resume interface: %d\n", result); | 536 DBG("unable to resume interface: %d\n", result); |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1235 return -ENXIO; | 1235 return -ENXIO; |
| 1236 } | 1236 } |
| 1237 name += strlen("usb"); | 1237 name += strlen("usb"); |
| 1238 qmiidx = simple_strtoul(name, NULL, 10); | 1238 qmiidx = simple_strtoul(name, NULL, 10); |
| 1239 if (qmiidx < 0) { | 1239 if (qmiidx < 0) { |
| 1240 DBG("Bad minor number\n"); | 1240 DBG("Bad minor number\n"); |
| 1241 return -ENXIO; | 1241 return -ENXIO; |
| 1242 } | 1242 } |
| 1243 | 1243 |
| 1244 printk(KERN_INFO "creating qcqmi%d\n", qmiidx); | 1244 printk(KERN_INFO "creating qcqmi%d\n", qmiidx); |
| 1245 » device_create(dev->qmi.devclass, NULL, devno, NULL, "qcqmi%d", qmiidx); | 1245 » device_create(dev->qmi.devclass, &dev->iface->dev, devno, NULL, "qcqmi%d
", qmiidx); |
| 1246 | 1246 |
| 1247 dev->qmi.devnum = devno; | 1247 dev->qmi.devnum = devno; |
| 1248 return 0; | 1248 return 0; |
| 1249 } | 1249 } |
| 1250 | 1250 |
| 1251 void qc_deregister(struct qcusbnet *dev) | 1251 void qc_deregister(struct qcusbnet *dev) |
| 1252 { | 1252 { |
| 1253 struct list_head *node, *tmp; | 1253 struct list_head *node, *tmp; |
| 1254 struct client *client; | 1254 struct client *client; |
| 1255 struct inode *inode; | 1255 struct inode *inode; |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1553 DBG("bad get MEID resp\n"); | 1553 DBG("bad get MEID resp\n"); |
| 1554 memset(&dev->meid[0], '0', 14); | 1554 memset(&dev->meid[0], '0', 14); |
| 1555 } | 1555 } |
| 1556 | 1556 |
| 1557 client_free(dev, cid); | 1557 client_free(dev, cid); |
| 1558 return 0; | 1558 return 0; |
| 1559 } | 1559 } |
| 1560 | 1560 |
| 1561 module_param(qcusbnet2k_fwdelay, int, S_IRUGO | S_IWUSR); | 1561 module_param(qcusbnet2k_fwdelay, int, S_IRUGO | S_IWUSR); |
| 1562 MODULE_PARM_DESC(qcusbnet2k_fwdelay, "Delay for old firmware"); | 1562 MODULE_PARM_DESC(qcusbnet2k_fwdelay, "Delay for old firmware"); |
| OLD | NEW |