diff options
Diffstat (limited to 'drivers/usb/core/usb.c')
-rw-r--r-- | drivers/usb/core/usb.c | 62 |
1 files changed, 19 insertions, 43 deletions
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index fdb444d8127..8c6319afa75 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
@@ -96,6 +96,7 @@ struct usb_interface *usb_ifnum_to_if(const struct usb_device *dev, | |||
96 | 96 | ||
97 | return NULL; | 97 | return NULL; |
98 | } | 98 | } |
99 | EXPORT_SYMBOL_GPL(usb_ifnum_to_if); | ||
99 | 100 | ||
100 | /** | 101 | /** |
101 | * usb_altnum_to_altsetting - get the altsetting structure with a given | 102 | * usb_altnum_to_altsetting - get the altsetting structure with a given |
@@ -126,6 +127,7 @@ struct usb_host_interface *usb_altnum_to_altsetting(const struct usb_interface * | |||
126 | } | 127 | } |
127 | return NULL; | 128 | return NULL; |
128 | } | 129 | } |
130 | EXPORT_SYMBOL_GPL(usb_altnum_to_altsetting); | ||
129 | 131 | ||
130 | struct find_interface_arg { | 132 | struct find_interface_arg { |
131 | int minor; | 133 | int minor; |
@@ -170,6 +172,7 @@ struct usb_interface *usb_find_interface(struct usb_driver *drv, int minor) | |||
170 | __find_interface); | 172 | __find_interface); |
171 | return argb.interface; | 173 | return argb.interface; |
172 | } | 174 | } |
175 | EXPORT_SYMBOL_GPL(usb_find_interface); | ||
173 | 176 | ||
174 | /** | 177 | /** |
175 | * usb_release_dev - free a usb device structure when all users of it are finished. | 178 | * usb_release_dev - free a usb device structure when all users of it are finished. |
@@ -369,6 +372,7 @@ struct usb_device *usb_get_dev(struct usb_device *dev) | |||
369 | get_device(&dev->dev); | 372 | get_device(&dev->dev); |
370 | return dev; | 373 | return dev; |
371 | } | 374 | } |
375 | EXPORT_SYMBOL_GPL(usb_get_dev); | ||
372 | 376 | ||
373 | /** | 377 | /** |
374 | * usb_put_dev - release a use of the usb device structure | 378 | * usb_put_dev - release a use of the usb device structure |
@@ -382,6 +386,7 @@ void usb_put_dev(struct usb_device *dev) | |||
382 | if (dev) | 386 | if (dev) |
383 | put_device(&dev->dev); | 387 | put_device(&dev->dev); |
384 | } | 388 | } |
389 | EXPORT_SYMBOL_GPL(usb_put_dev); | ||
385 | 390 | ||
386 | /** | 391 | /** |
387 | * usb_get_intf - increments the reference count of the usb interface structure | 392 | * usb_get_intf - increments the reference count of the usb interface structure |
@@ -402,6 +407,7 @@ struct usb_interface *usb_get_intf(struct usb_interface *intf) | |||
402 | get_device(&intf->dev); | 407 | get_device(&intf->dev); |
403 | return intf; | 408 | return intf; |
404 | } | 409 | } |
410 | EXPORT_SYMBOL_GPL(usb_get_intf); | ||
405 | 411 | ||
406 | /** | 412 | /** |
407 | * usb_put_intf - release a use of the usb interface structure | 413 | * usb_put_intf - release a use of the usb interface structure |
@@ -416,7 +422,7 @@ void usb_put_intf(struct usb_interface *intf) | |||
416 | if (intf) | 422 | if (intf) |
417 | put_device(&intf->dev); | 423 | put_device(&intf->dev); |
418 | } | 424 | } |
419 | 425 | EXPORT_SYMBOL_GPL(usb_put_intf); | |
420 | 426 | ||
421 | /* USB device locking | 427 | /* USB device locking |
422 | * | 428 | * |
@@ -489,7 +495,7 @@ int usb_lock_device_for_reset(struct usb_device *udev, | |||
489 | } | 495 | } |
490 | return 1; | 496 | return 1; |
491 | } | 497 | } |
492 | 498 | EXPORT_SYMBOL_GPL(usb_lock_device_for_reset); | |
493 | 499 | ||
494 | static struct usb_device *match_device(struct usb_device *dev, | 500 | static struct usb_device *match_device(struct usb_device *dev, |
495 | u16 vendor_id, u16 product_id) | 501 | u16 vendor_id, u16 product_id) |
@@ -578,6 +584,7 @@ int usb_get_current_frame_number(struct usb_device *dev) | |||
578 | { | 584 | { |
579 | return usb_hcd_get_frame_number(dev); | 585 | return usb_hcd_get_frame_number(dev); |
580 | } | 586 | } |
587 | EXPORT_SYMBOL_GPL(usb_get_current_frame_number); | ||
581 | 588 | ||
582 | /*-------------------------------------------------------------------*/ | 589 | /*-------------------------------------------------------------------*/ |
583 | /* | 590 | /* |
@@ -612,6 +619,7 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size, | |||
612 | } | 619 | } |
613 | return -1; | 620 | return -1; |
614 | } | 621 | } |
622 | EXPORT_SYMBOL_GPL(__usb_get_extra_descriptor); | ||
615 | 623 | ||
616 | /** | 624 | /** |
617 | * usb_buffer_alloc - allocate dma-consistent buffer for URB_NO_xxx_DMA_MAP | 625 | * usb_buffer_alloc - allocate dma-consistent buffer for URB_NO_xxx_DMA_MAP |
@@ -646,6 +654,7 @@ void *usb_buffer_alloc( | |||
646 | return NULL; | 654 | return NULL; |
647 | return hcd_buffer_alloc(dev->bus, size, mem_flags, dma); | 655 | return hcd_buffer_alloc(dev->bus, size, mem_flags, dma); |
648 | } | 656 | } |
657 | EXPORT_SYMBOL_GPL(usb_buffer_alloc); | ||
649 | 658 | ||
650 | /** | 659 | /** |
651 | * usb_buffer_free - free memory allocated with usb_buffer_alloc() | 660 | * usb_buffer_free - free memory allocated with usb_buffer_alloc() |
@@ -671,6 +680,7 @@ void usb_buffer_free( | |||
671 | return; | 680 | return; |
672 | hcd_buffer_free(dev->bus, size, addr, dma); | 681 | hcd_buffer_free(dev->bus, size, addr, dma); |
673 | } | 682 | } |
683 | EXPORT_SYMBOL_GPL(usb_buffer_free); | ||
674 | 684 | ||
675 | /** | 685 | /** |
676 | * usb_buffer_map - create DMA mapping(s) for an urb | 686 | * usb_buffer_map - create DMA mapping(s) for an urb |
@@ -718,6 +728,7 @@ struct urb *usb_buffer_map(struct urb *urb) | |||
718 | | URB_NO_SETUP_DMA_MAP); | 728 | | URB_NO_SETUP_DMA_MAP); |
719 | return urb; | 729 | return urb; |
720 | } | 730 | } |
731 | EXPORT_SYMBOL_GPL(usb_buffer_map); | ||
721 | #endif /* 0 */ | 732 | #endif /* 0 */ |
722 | 733 | ||
723 | /* XXX DISABLED, no users currently. If you wish to re-enable this | 734 | /* XXX DISABLED, no users currently. If you wish to re-enable this |
@@ -755,6 +766,7 @@ void usb_buffer_dmasync(struct urb *urb) | |||
755 | DMA_TO_DEVICE); | 766 | DMA_TO_DEVICE); |
756 | } | 767 | } |
757 | } | 768 | } |
769 | EXPORT_SYMBOL_GPL(usb_buffer_dmasync); | ||
758 | #endif | 770 | #endif |
759 | 771 | ||
760 | /** | 772 | /** |
@@ -790,6 +802,7 @@ void usb_buffer_unmap(struct urb *urb) | |||
790 | urb->transfer_flags &= ~(URB_NO_TRANSFER_DMA_MAP | 802 | urb->transfer_flags &= ~(URB_NO_TRANSFER_DMA_MAP |
791 | | URB_NO_SETUP_DMA_MAP); | 803 | | URB_NO_SETUP_DMA_MAP); |
792 | } | 804 | } |
805 | EXPORT_SYMBOL_GPL(usb_buffer_unmap); | ||
793 | #endif /* 0 */ | 806 | #endif /* 0 */ |
794 | 807 | ||
795 | /** | 808 | /** |
@@ -834,6 +847,7 @@ int usb_buffer_map_sg(const struct usb_device *dev, int is_in, | |||
834 | return dma_map_sg(controller, sg, nents, | 847 | return dma_map_sg(controller, sg, nents, |
835 | is_in ? DMA_FROM_DEVICE : DMA_TO_DEVICE); | 848 | is_in ? DMA_FROM_DEVICE : DMA_TO_DEVICE); |
836 | } | 849 | } |
850 | EXPORT_SYMBOL_GPL(usb_buffer_map_sg); | ||
837 | 851 | ||
838 | /* XXX DISABLED, no users currently. If you wish to re-enable this | 852 | /* XXX DISABLED, no users currently. If you wish to re-enable this |
839 | * XXX please determine whether the sync is to transfer ownership of | 853 | * XXX please determine whether the sync is to transfer ownership of |
@@ -867,6 +881,7 @@ void usb_buffer_dmasync_sg(const struct usb_device *dev, int is_in, | |||
867 | dma_sync_sg(controller, sg, n_hw_ents, | 881 | dma_sync_sg(controller, sg, n_hw_ents, |
868 | is_in ? DMA_FROM_DEVICE : DMA_TO_DEVICE); | 882 | is_in ? DMA_FROM_DEVICE : DMA_TO_DEVICE); |
869 | } | 883 | } |
884 | EXPORT_SYMBOL_GPL(usb_buffer_dmasync_sg); | ||
870 | #endif | 885 | #endif |
871 | 886 | ||
872 | /** | 887 | /** |
@@ -893,6 +908,7 @@ void usb_buffer_unmap_sg(const struct usb_device *dev, int is_in, | |||
893 | dma_unmap_sg(controller, sg, n_hw_ents, | 908 | dma_unmap_sg(controller, sg, n_hw_ents, |
894 | is_in ? DMA_FROM_DEVICE : DMA_TO_DEVICE); | 909 | is_in ? DMA_FROM_DEVICE : DMA_TO_DEVICE); |
895 | } | 910 | } |
911 | EXPORT_SYMBOL_GPL(usb_buffer_unmap_sg); | ||
896 | 912 | ||
897 | /* format to disable USB on kernel command line is: nousb */ | 913 | /* format to disable USB on kernel command line is: nousb */ |
898 | __module_param_call("", nousb, param_set_bool, param_get_bool, &nousb, 0444); | 914 | __module_param_call("", nousb, param_set_bool, param_get_bool, &nousb, 0444); |
@@ -904,6 +920,7 @@ int usb_disabled(void) | |||
904 | { | 920 | { |
905 | return nousb; | 921 | return nousb; |
906 | } | 922 | } |
923 | EXPORT_SYMBOL_GPL(usb_disabled); | ||
907 | 924 | ||
908 | /* | 925 | /* |
909 | * Init | 926 | * Init |
@@ -985,45 +1002,4 @@ static void __exit usb_exit(void) | |||
985 | 1002 | ||
986 | subsys_initcall(usb_init); | 1003 | subsys_initcall(usb_init); |
987 | module_exit(usb_exit); | 1004 | module_exit(usb_exit); |
988 | |||
989 | /* | ||
990 | * USB may be built into the kernel or be built as modules. | ||
991 | * These symbols are exported for device (or host controller) | ||
992 | * driver modules to use. | ||
993 | */ | ||
994 | |||
995 | EXPORT_SYMBOL(usb_disabled); | ||
996 | |||
997 | EXPORT_SYMBOL_GPL(usb_get_intf); | ||
998 | EXPORT_SYMBOL_GPL(usb_put_intf); | ||
999 | |||
1000 | EXPORT_SYMBOL(usb_put_dev); | ||
1001 | EXPORT_SYMBOL(usb_get_dev); | ||
1002 | EXPORT_SYMBOL(usb_hub_tt_clear_buffer); | ||
1003 | |||
1004 | EXPORT_SYMBOL(usb_lock_device_for_reset); | ||
1005 | |||
1006 | EXPORT_SYMBOL(usb_find_interface); | ||
1007 | EXPORT_SYMBOL(usb_ifnum_to_if); | ||
1008 | EXPORT_SYMBOL(usb_altnum_to_altsetting); | ||
1009 | |||
1010 | EXPORT_SYMBOL(__usb_get_extra_descriptor); | ||
1011 | |||
1012 | EXPORT_SYMBOL(usb_get_current_frame_number); | ||
1013 | |||
1014 | EXPORT_SYMBOL(usb_buffer_alloc); | ||
1015 | EXPORT_SYMBOL(usb_buffer_free); | ||
1016 | |||
1017 | #if 0 | ||
1018 | EXPORT_SYMBOL(usb_buffer_map); | ||
1019 | EXPORT_SYMBOL(usb_buffer_dmasync); | ||
1020 | EXPORT_SYMBOL(usb_buffer_unmap); | ||
1021 | #endif | ||
1022 | |||
1023 | EXPORT_SYMBOL(usb_buffer_map_sg); | ||
1024 | #if 0 | ||
1025 | EXPORT_SYMBOL(usb_buffer_dmasync_sg); | ||
1026 | #endif | ||
1027 | EXPORT_SYMBOL(usb_buffer_unmap_sg); | ||
1028 | |||
1029 | MODULE_LICENSE("GPL"); | 1005 | MODULE_LICENSE("GPL"); |