Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6:
USB: gadget: Fix EEM driver comments and VID/PID
usb-storage: Workaround devices with bogus sense size
USB: ehci: Fix IST boundary checking interval math.
USB: option: Support for AIRPLUS MCD650 Datacard
USB: whci-hcd: always do an update after processing a halted qTD
USB: whci-hcd: handle early deletion of endpoints
USB: wusb: don't use the stack to read security descriptor
USB: rename Documentation/ABI/.../sysfs-class-usb_host

+82 -52
+2 -2
Documentation/ABI/testing/sysfs-class-usb_host Documentation/ABI/testing/sysfs-class-uwb_rc-wusbhc
··· 1 - What: /sys/class/usb_host/usb_hostN/wusb_chid 1 + What: /sys/class/uwb_rc/uwbN/wusbhc/wusb_chid 2 2 Date: July 2008 3 3 KernelVersion: 2.6.27 4 4 Contact: David Vrabel <david.vrabel@csr.com> ··· 9 9 10 10 Set an all zero CHID to stop the host controller. 11 11 12 - What: /sys/class/usb_host/usb_hostN/wusb_trust_timeout 12 + What: /sys/class/uwb_rc/uwbN/wusbhc/wusb_trust_timeout 13 13 Date: July 2008 14 14 KernelVersion: 2.6.27 15 15 Contact: David Vrabel <david.vrabel@csr.com>
+2 -7
drivers/usb/gadget/ether.c
··· 61 61 * simpler, Microsoft pushes their own approach: RNDIS. The published 62 62 * RNDIS specs are ambiguous and appear to be incomplete, and are also 63 63 * needlessly complex. They borrow more from CDC ACM than CDC ECM. 64 - * 65 - * While CDC ECM, CDC Subset, and RNDIS are designed to extend the ethernet 66 - * interface to the target, CDC EEM was designed to use ethernet over the USB 67 - * link between the host and target. CDC EEM is implemented as an alternative 68 - * to those other protocols when that communication model is more appropriate 69 64 */ 70 65 71 66 #define DRIVER_DESC "Ethernet Gadget" ··· 152 157 #define RNDIS_PRODUCT_NUM 0xa4a2 /* Ethernet/RNDIS Gadget */ 153 158 154 159 /* For EEM gadgets */ 155 - #define EEM_VENDOR_NUM 0x0525 /* INVALID - NEEDS TO BE ALLOCATED */ 156 - #define EEM_PRODUCT_NUM 0xa4a1 /* INVALID - NEEDS TO BE ALLOCATED */ 160 + #define EEM_VENDOR_NUM 0x1d6b /* Linux Foundation */ 161 + #define EEM_PRODUCT_NUM 0x0102 /* EEM Gadget */ 157 162 158 163 /*-------------------------------------------------------------------------*/ 159 164
+6 -6
drivers/usb/host/ehci-sched.c
··· 1400 1400 goto fail; 1401 1401 } 1402 1402 1403 + period = urb->interval; 1404 + if (!stream->highspeed) 1405 + period <<= 3; 1406 + 1403 1407 now = ehci_readl(ehci, &ehci->regs->frame_index) % mod; 1404 1408 1405 1409 /* when's the last uframe this urb could start? */ ··· 1421 1417 1422 1418 /* Fell behind (by up to twice the slop amount)? */ 1423 1419 if (start >= max - 2 * 8 * SCHEDULE_SLOP) 1424 - start += stream->interval * DIV_ROUND_UP( 1425 - max - start, stream->interval) - mod; 1420 + start += period * DIV_ROUND_UP( 1421 + max - start, period) - mod; 1426 1422 1427 1423 /* Tried to schedule too far into the future? */ 1428 1424 if (unlikely((start + sched->span) >= max)) { ··· 1444 1440 stream->next_uframe = start; 1445 1441 1446 1442 /* NOTE: assumes URB_ISO_ASAP, to limit complexity/bugs */ 1447 - 1448 - period = urb->interval; 1449 - if (!stream->highspeed) 1450 - period <<= 3; 1451 1443 1452 1444 /* find a uframe slot with enough bandwidth */ 1453 1445 for (; start < (stream->next_uframe + period); start++) {
+16 -7
drivers/usb/host/whci/asl.c
··· 115 115 if (status & QTD_STS_HALTED) { 116 116 /* Ug, an error. */ 117 117 process_halted_qtd(whc, qset, td); 118 + /* A halted qTD always triggers an update 119 + because the qset was either removed or 120 + reactivated. */ 121 + update |= WHC_UPDATE_UPDATED; 118 122 goto done; 119 123 } 120 124 ··· 309 305 struct whc_urb *wurb = urb->hcpriv; 310 306 struct whc_qset *qset = wurb->qset; 311 307 struct whc_std *std, *t; 308 + bool has_qtd = false; 312 309 int ret; 313 310 unsigned long flags; 314 311 ··· 320 315 goto out; 321 316 322 317 list_for_each_entry_safe(std, t, &qset->stds, list_node) { 323 - if (std->urb == urb) 318 + if (std->urb == urb) { 319 + if (std->qtd) 320 + has_qtd = true; 324 321 qset_free_std(whc, std); 325 - else 322 + } else 326 323 std->qtd = NULL; /* so this std is re-added when the qset is */ 327 324 } 328 325 329 - asl_qset_remove(whc, qset); 330 - wurb->status = status; 331 - wurb->is_async = true; 332 - queue_work(whc->workqueue, &wurb->dequeue_work); 333 - 326 + if (has_qtd) { 327 + asl_qset_remove(whc, qset); 328 + wurb->status = status; 329 + wurb->is_async = true; 330 + queue_work(whc->workqueue, &wurb->dequeue_work); 331 + } else 332 + qset_remove_urb(whc, qset, urb, status); 334 333 out: 335 334 spin_unlock_irqrestore(&whc->lock, flags); 336 335
+17 -7
drivers/usb/host/whci/pzl.c
··· 121 121 if (status & QTD_STS_HALTED) { 122 122 /* Ug, an error. */ 123 123 process_halted_qtd(whc, qset, td); 124 + /* A halted qTD always triggers an update 125 + because the qset was either removed or 126 + reactivated. */ 127 + update |= WHC_UPDATE_UPDATED; 124 128 goto done; 125 129 } 126 130 ··· 337 333 struct whc_urb *wurb = urb->hcpriv; 338 334 struct whc_qset *qset = wurb->qset; 339 335 struct whc_std *std, *t; 336 + bool has_qtd = false; 340 337 int ret; 341 338 unsigned long flags; 342 339 ··· 348 343 goto out; 349 344 350 345 list_for_each_entry_safe(std, t, &qset->stds, list_node) { 351 - if (std->urb == urb) 346 + if (std->urb == urb) { 347 + if (std->qtd) 348 + has_qtd = true; 352 349 qset_free_std(whc, std); 353 - else 350 + } else 354 351 std->qtd = NULL; /* so this std is re-added when the qset is */ 355 352 } 356 353 357 - pzl_qset_remove(whc, qset); 358 - wurb->status = status; 359 - wurb->is_async = false; 360 - queue_work(whc->workqueue, &wurb->dequeue_work); 361 - 354 + if (has_qtd) { 355 + pzl_qset_remove(whc, qset); 356 + update_pzl_hw_view(whc); 357 + wurb->status = status; 358 + wurb->is_async = false; 359 + queue_work(whc->workqueue, &wurb->dequeue_work); 360 + } else 361 + qset_remove_urb(whc, qset, urb, status); 362 362 out: 363 363 spin_unlock_irqrestore(&whc->lock, flags); 364 364
+4
drivers/usb/serial/option.c
··· 328 328 #define ALCATEL_VENDOR_ID 0x1bbb 329 329 #define ALCATEL_PRODUCT_X060S 0x0000 330 330 331 + /* Airplus products */ 332 + #define AIRPLUS_VENDOR_ID 0x1011 333 + #define AIRPLUS_PRODUCT_MCD650 0x3198 331 334 332 335 static struct usb_device_id option_ids[] = { 333 336 { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, ··· 592 589 { USB_DEVICE(ALINK_VENDOR_ID, 0x9000) }, 593 590 { USB_DEVICE_AND_INTERFACE_INFO(ALINK_VENDOR_ID, ALINK_PRODUCT_3GU, 0xff, 0xff, 0xff) }, 594 591 { USB_DEVICE(ALCATEL_VENDOR_ID, ALCATEL_PRODUCT_X060S) }, 592 + { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) }, 595 593 { } /* Terminating entry */ 596 594 }; 597 595 MODULE_DEVICE_TABLE(usb, option_ids);
+16 -1
drivers/usb/storage/transport.c
··· 696 696 /* device supports and needs bigger sense buffer */ 697 697 if (us->fflags & US_FL_SANE_SENSE) 698 698 sense_size = ~0; 699 - 699 + Retry_Sense: 700 700 US_DEBUGP("Issuing auto-REQUEST_SENSE\n"); 701 701 702 702 scsi_eh_prep_cmnd(srb, &ses, NULL, 0, sense_size); ··· 720 720 srb->result = DID_ABORT << 16; 721 721 goto Handle_Errors; 722 722 } 723 + 724 + /* Some devices claim to support larger sense but fail when 725 + * trying to request it. When a transport failure happens 726 + * using US_FS_SANE_SENSE, we always retry with a standard 727 + * (small) sense request. This fixes some USB GSM modems 728 + */ 729 + if (temp_result == USB_STOR_TRANSPORT_FAILED && 730 + (us->fflags & US_FL_SANE_SENSE) && 731 + sense_size != US_SENSE_SIZE) { 732 + US_DEBUGP("-- auto-sense failure, retry small sense\n"); 733 + sense_size = US_SENSE_SIZE; 734 + goto Retry_Sense; 735 + } 736 + 737 + /* Other failures */ 723 738 if (temp_result != USB_STOR_TRANSPORT_GOOD) { 724 739 US_DEBUGP("-- auto-sense failure\n"); 725 740
+19 -22
drivers/usb/wusbcore/security.c
··· 200 200 { 201 201 int result, bytes, secd_size; 202 202 struct device *dev = &usb_dev->dev; 203 - struct usb_security_descriptor secd; 203 + struct usb_security_descriptor *secd; 204 204 const struct usb_encryption_descriptor *etd, *ccm1_etd = NULL; 205 - void *secd_buf; 206 205 const void *itr, *top; 207 206 char buf[64]; 208 207 208 + secd = kmalloc(sizeof(struct usb_security_descriptor), GFP_KERNEL); 209 + if (secd == NULL) { 210 + result = -ENOMEM; 211 + goto out; 212 + } 213 + 209 214 result = usb_get_descriptor(usb_dev, USB_DT_SECURITY, 210 - 0, &secd, sizeof(secd)); 215 + 0, secd, sizeof(struct usb_security_descriptor)); 211 216 if (result < sizeof(secd)) { 212 217 dev_err(dev, "Can't read security descriptor or " 213 218 "not enough data: %d\n", result); 214 - goto error_secd; 219 + goto out; 215 220 } 216 - secd_size = le16_to_cpu(secd.wTotalLength); 217 - secd_buf = kmalloc(secd_size, GFP_KERNEL); 218 - if (secd_buf == NULL) { 221 + secd_size = le16_to_cpu(secd->wTotalLength); 222 + secd = krealloc(secd, secd_size, GFP_KERNEL); 223 + if (secd == NULL) { 219 224 dev_err(dev, "Can't allocate space for security descriptors\n"); 220 - goto error_secd_alloc; 225 + goto out; 221 226 } 222 227 result = usb_get_descriptor(usb_dev, USB_DT_SECURITY, 223 - 0, secd_buf, secd_size); 228 + 0, secd, secd_size); 224 229 if (result < secd_size) { 225 230 dev_err(dev, "Can't read security descriptor or " 226 231 "not enough data: %d\n", result); 227 - goto error_secd_all; 232 + goto out; 228 233 } 229 234 bytes = 0; 230 - itr = secd_buf + sizeof(secd); 231 - top = secd_buf + result; 235 + itr = &secd[1]; 236 + top = (void *)secd + result; 232 237 while (itr < top) { 233 238 etd = itr; 234 239 if (top - itr < sizeof(*etd)) { ··· 264 259 dev_err(dev, "WUSB device doesn't support CCM1 encryption, " 265 260 "can't use!\n"); 266 261 result = -EINVAL; 267 - goto error_no_ccm1; 262 + goto out; 268 263 } 269 264 wusb_dev->ccm1_etd = *ccm1_etd; 270 265 dev_dbg(dev, "supported encryption: %s; using %s (0x%02x/%02x)\n", 271 266 buf, wusb_et_name(ccm1_etd->bEncryptionType), 272 267 ccm1_etd->bEncryptionValue, ccm1_etd->bAuthKeyIndex); 273 268 result = 0; 274 - kfree(secd_buf); 275 269 out: 270 + kfree(secd); 276 271 return result; 277 - 278 - 279 - error_no_ccm1: 280 - error_secd_all: 281 - kfree(secd_buf); 282 - error_secd_alloc: 283 - error_secd: 284 - goto out; 285 272 } 286 273 287 274 void wusb_dev_sec_rm(struct wusb_dev *wusb_dev)