USB: mark USB drivers as being GPL only

Over two years ago, the Linux USB developers stated that they believed
there was no way to create a USB kernel driver that was not under the
GPL. This patch moves the USB apis to enforce that decision.

There are no known closed source USB drivers in the wild, so this patch
should cause no problems.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

+61 -111
-16
Documentation/feature-removal-schedule.txt
··· 156 156 157 157 --------------------------- 158 158 159 - What: USB driver API moves to EXPORT_SYMBOL_GPL 160 - When: February 2008 161 - Files: include/linux/usb.h, drivers/usb/core/driver.c 162 - Why: The USB subsystem has changed a lot over time, and it has been 163 - possible to create userspace USB drivers using usbfs/libusb/gadgetfs 164 - that operate as fast as the USB bus allows. Because of this, the USB 165 - subsystem will not be allowing closed source kernel drivers to 166 - register with it, after this grace period is over. If anyone needs 167 - any help in converting their closed source drivers over to use the 168 - userspace filesystems, please contact the 169 - linux-usb-devel@lists.sourceforge.net mailing list, and the developers 170 - there will be glad to help you out. 171 - Who: Greg Kroah-Hartman <gregkh@suse.de> 172 - 173 - --------------------------- 174 - 175 159 What: vm_ops.nopage 176 160 When: Soon, provided in-kernel callers have been converted 177 161 Why: This interface is replaced by vm_ops.fault, but it has been around
+5 -5
drivers/usb/core/driver.c
··· 325 325 326 326 return retval; 327 327 } 328 - EXPORT_SYMBOL(usb_driver_claim_interface); 328 + EXPORT_SYMBOL_GPL(usb_driver_claim_interface); 329 329 330 330 /** 331 331 * usb_driver_release_interface - unbind a driver from an interface ··· 370 370 iface->needs_remote_wakeup = 0; 371 371 usb_pm_unlock(udev); 372 372 } 373 - EXPORT_SYMBOL(usb_driver_release_interface); 373 + EXPORT_SYMBOL_GPL(usb_driver_release_interface); 374 374 375 375 /* returns 0 if no match, 1 if match */ 376 376 int usb_match_device(struct usb_device *dev, const struct usb_device_id *id) ··· 542 542 543 543 return NULL; 544 544 } 545 - EXPORT_SYMBOL_GPL_FUTURE(usb_match_id); 545 + EXPORT_SYMBOL_GPL(usb_match_id); 546 546 547 547 static int usb_device_match(struct device *dev, struct device_driver *drv) 548 548 { ··· 745 745 746 746 return retval; 747 747 } 748 - EXPORT_SYMBOL_GPL_FUTURE(usb_register_driver); 748 + EXPORT_SYMBOL_GPL(usb_register_driver); 749 749 750 750 /** 751 751 * usb_deregister - unregister a USB interface driver ··· 769 769 770 770 usbfs_update_special(); 771 771 } 772 - EXPORT_SYMBOL_GPL_FUTURE(usb_deregister); 772 + EXPORT_SYMBOL_GPL(usb_deregister); 773 773 774 774 #ifdef CONFIG_PM 775 775
+2 -2
drivers/usb/core/file.c
··· 204 204 exit: 205 205 return retval; 206 206 } 207 - EXPORT_SYMBOL(usb_register_dev); 207 + EXPORT_SYMBOL_GPL(usb_register_dev); 208 208 209 209 /** 210 210 * usb_deregister_dev - deregister a USB device's dynamic minor. ··· 245 245 intf->minor = -1; 246 246 destroy_usb_class(); 247 247 } 248 - EXPORT_SYMBOL(usb_deregister_dev); 248 + EXPORT_SYMBOL_GPL(usb_deregister_dev);
+5 -5
drivers/usb/core/hcd-pci.c
··· 144 144 dev_err (&dev->dev, "init %s fail, %d\n", pci_name(dev), retval); 145 145 return retval; 146 146 } 147 - EXPORT_SYMBOL (usb_hcd_pci_probe); 147 + EXPORT_SYMBOL_GPL(usb_hcd_pci_probe); 148 148 149 149 150 150 /* may be called without controller electrically present */ ··· 179 179 usb_put_hcd (hcd); 180 180 pci_disable_device(dev); 181 181 } 182 - EXPORT_SYMBOL (usb_hcd_pci_remove); 182 + EXPORT_SYMBOL_GPL(usb_hcd_pci_remove); 183 183 184 184 185 185 #ifdef CONFIG_PM ··· 314 314 315 315 return retval; 316 316 } 317 - EXPORT_SYMBOL (usb_hcd_pci_suspend); 317 + EXPORT_SYMBOL_GPL(usb_hcd_pci_suspend); 318 318 319 319 /** 320 320 * usb_hcd_pci_resume - power management resume of a PCI-based HCD ··· 416 416 417 417 return retval; 418 418 } 419 - EXPORT_SYMBOL (usb_hcd_pci_resume); 419 + EXPORT_SYMBOL_GPL(usb_hcd_pci_resume); 420 420 421 421 #endif /* CONFIG_PM */ 422 422 ··· 435 435 if (hcd->driver->shutdown) 436 436 hcd->driver->shutdown(hcd); 437 437 } 438 - EXPORT_SYMBOL (usb_hcd_pci_shutdown); 438 + EXPORT_SYMBOL_GPL(usb_hcd_pci_shutdown); 439 439
+9 -9
drivers/usb/core/hcd.c
··· 971 971 return -1; 972 972 } 973 973 } 974 - EXPORT_SYMBOL (usb_calc_bus_time); 974 + EXPORT_SYMBOL_GPL(usb_calc_bus_time); 975 975 976 976 977 977 /*-------------------------------------------------------------------------*/ ··· 1427 1427 wake_up (&usb_kill_urb_queue); 1428 1428 usb_put_urb (urb); 1429 1429 } 1430 - EXPORT_SYMBOL (usb_hcd_giveback_urb); 1430 + EXPORT_SYMBOL_GPL(usb_hcd_giveback_urb); 1431 1431 1432 1432 /*-------------------------------------------------------------------------*/ 1433 1433 ··· 1667 1667 mod_timer(&hcd->rh_timer, jiffies + msecs_to_jiffies(10)); 1668 1668 return status; 1669 1669 } 1670 - EXPORT_SYMBOL (usb_bus_start_enum); 1670 + EXPORT_SYMBOL_GPL(usb_bus_start_enum); 1671 1671 1672 1672 #endif 1673 1673 ··· 1774 1774 "USB Host Controller"; 1775 1775 return hcd; 1776 1776 } 1777 - EXPORT_SYMBOL (usb_create_hcd); 1777 + EXPORT_SYMBOL_GPL(usb_create_hcd); 1778 1778 1779 1779 static void hcd_release (struct kref *kref) 1780 1780 { ··· 1789 1789 kref_get (&hcd->kref); 1790 1790 return hcd; 1791 1791 } 1792 - EXPORT_SYMBOL (usb_get_hcd); 1792 + EXPORT_SYMBOL_GPL(usb_get_hcd); 1793 1793 1794 1794 void usb_put_hcd (struct usb_hcd *hcd) 1795 1795 { 1796 1796 if (hcd) 1797 1797 kref_put (&hcd->kref, hcd_release); 1798 1798 } 1799 - EXPORT_SYMBOL (usb_put_hcd); 1799 + EXPORT_SYMBOL_GPL(usb_put_hcd); 1800 1800 1801 1801 /** 1802 1802 * usb_add_hcd - finish generic HCD structure initialization and register ··· 1922 1922 hcd_buffer_destroy(hcd); 1923 1923 return retval; 1924 1924 } 1925 - EXPORT_SYMBOL (usb_add_hcd); 1925 + EXPORT_SYMBOL_GPL(usb_add_hcd); 1926 1926 1927 1927 /** 1928 1928 * usb_remove_hcd - shutdown processing for generic HCDs ··· 1964 1964 usb_deregister_bus(&hcd->self); 1965 1965 hcd_buffer_destroy(hcd); 1966 1966 } 1967 - EXPORT_SYMBOL (usb_remove_hcd); 1967 + EXPORT_SYMBOL_GPL(usb_remove_hcd); 1968 1968 1969 1969 void 1970 1970 usb_hcd_platform_shutdown(struct platform_device* dev) ··· 1974 1974 if (hcd->driver->shutdown) 1975 1975 hcd->driver->shutdown(hcd); 1976 1976 } 1977 - EXPORT_SYMBOL (usb_hcd_platform_shutdown); 1977 + EXPORT_SYMBOL_GPL(usb_hcd_platform_shutdown); 1978 1978 1979 1979 /*-------------------------------------------------------------------------*/ 1980 1980
+3 -2
drivers/usb/core/hub.c
··· 494 494 schedule_work (&tt->kevent); 495 495 spin_unlock_irqrestore (&tt->lock, flags); 496 496 } 497 + EXPORT_SYMBOL_GPL(usb_hub_tt_clear_buffer); 497 498 498 499 static void hub_power_on(struct usb_hub *hub) 499 500 { ··· 3117 3116 hub_port_logical_disconnect(parent_hub, port1); 3118 3117 return -ENODEV; 3119 3118 } 3120 - EXPORT_SYMBOL(usb_reset_device); 3119 + EXPORT_SYMBOL_GPL(usb_reset_device); 3121 3120 3122 3121 /** 3123 3122 * usb_reset_composite_device - warn interface drivers and perform a USB port reset ··· 3188 3187 usb_autosuspend_device(udev); 3189 3188 return ret; 3190 3189 } 3191 - EXPORT_SYMBOL(usb_reset_composite_device); 3190 + EXPORT_SYMBOL_GPL(usb_reset_composite_device);
+11 -21
drivers/usb/core/message.c
··· 147 147 148 148 return ret; 149 149 } 150 - 150 + EXPORT_SYMBOL_GPL(usb_control_msg); 151 151 152 152 /** 153 153 * usb_interrupt_msg - Builds an interrupt urb, sends it off and waits for completion ··· 238 238 239 239 return usb_start_wait_urb(urb, timeout, actual_length); 240 240 } 241 + EXPORT_SYMBOL_GPL(usb_bulk_msg); 241 242 242 243 /*-------------------------------------------------------------------*/ 243 244 ··· 466 465 sg_clean (io); 467 466 return -ENOMEM; 468 467 } 469 - 468 + EXPORT_SYMBOL_GPL(usb_sg_init); 470 469 471 470 /** 472 471 * usb_sg_wait - synchronously execute scatter/gather request ··· 570 569 571 570 sg_clean (io); 572 571 } 572 + EXPORT_SYMBOL_GPL(usb_sg_wait); 573 573 574 574 /** 575 575 * usb_sg_cancel - stop scatter/gather i/o issued by usb_sg_wait() ··· 606 604 } 607 605 spin_unlock_irqrestore (&io->lock, flags); 608 606 } 607 + EXPORT_SYMBOL_GPL(usb_sg_cancel); 609 608 610 609 /*-------------------------------------------------------------------*/ 611 610 ··· 655 652 } 656 653 return result; 657 654 } 655 + EXPORT_SYMBOL_GPL(usb_get_descriptor); 658 656 659 657 /** 660 658 * usb_get_string - gets a string descriptor ··· 831 827 kfree(tbuf); 832 828 return err; 833 829 } 830 + EXPORT_SYMBOL_GPL(usb_string); 834 831 835 832 /** 836 833 * usb_cache_string - read a string descriptor and cache it for later use ··· 932 927 kfree(status); 933 928 return ret; 934 929 } 930 + EXPORT_SYMBOL_GPL(usb_get_status); 935 931 936 932 /** 937 933 * usb_clear_halt - tells device to clear endpoint halt/stall condition ··· 991 985 992 986 return 0; 993 987 } 988 + EXPORT_SYMBOL_GPL(usb_clear_halt); 994 989 995 990 /** 996 991 * usb_disable_endpoint -- Disable an endpoint by address ··· 1260 1253 1261 1254 return 0; 1262 1255 } 1256 + EXPORT_SYMBOL_GPL(usb_set_interface); 1263 1257 1264 1258 /** 1265 1259 * usb_reset_configuration - lightweight device reset ··· 1336 1328 } 1337 1329 return 0; 1338 1330 } 1331 + EXPORT_SYMBOL_GPL(usb_reset_configuration); 1339 1332 1340 1333 static void usb_release_interface(struct device *dev) 1341 1334 { ··· 1686 1677 return 0; 1687 1678 } 1688 1679 EXPORT_SYMBOL_GPL(usb_driver_set_configuration); 1689 - 1690 - // synchronous request completion model 1691 - EXPORT_SYMBOL(usb_control_msg); 1692 - EXPORT_SYMBOL(usb_bulk_msg); 1693 - 1694 - EXPORT_SYMBOL(usb_sg_init); 1695 - EXPORT_SYMBOL(usb_sg_cancel); 1696 - EXPORT_SYMBOL(usb_sg_wait); 1697 - 1698 - // synchronous control message convenience routines 1699 - EXPORT_SYMBOL(usb_get_descriptor); 1700 - EXPORT_SYMBOL(usb_get_status); 1701 - EXPORT_SYMBOL(usb_string); 1702 - 1703 - // synchronous calls that also maintain usbcore state 1704 - EXPORT_SYMBOL(usb_clear_halt); 1705 - EXPORT_SYMBOL(usb_reset_configuration); 1706 - EXPORT_SYMBOL(usb_set_interface); 1707 -
+7 -8
drivers/usb/core/urb.c
··· 42 42 INIT_LIST_HEAD(&urb->anchor_list); 43 43 } 44 44 } 45 + EXPORT_SYMBOL_GPL(usb_init_urb); 45 46 46 47 /** 47 48 * usb_alloc_urb - creates a new urb for a USB driver to use ··· 74 73 usb_init_urb(urb); 75 74 return urb; 76 75 } 76 + EXPORT_SYMBOL_GPL(usb_alloc_urb); 77 77 78 78 /** 79 79 * usb_free_urb - frees the memory used by a urb when all users of it are finished ··· 91 89 if (urb) 92 90 kref_put(&urb->kref, urb_destroy); 93 91 } 92 + EXPORT_SYMBOL_GPL(usb_free_urb); 94 93 95 94 /** 96 95 * usb_get_urb - increments the reference count of the urb ··· 109 106 kref_get(&urb->kref); 110 107 return urb; 111 108 } 109 + EXPORT_SYMBOL_GPL(usb_get_urb); 112 110 113 111 /** 114 112 * usb_anchor_urb - anchors an URB while it is processed ··· 448 444 449 445 return usb_hcd_submit_urb(urb, mem_flags); 450 446 } 447 + EXPORT_SYMBOL_GPL(usb_submit_urb); 451 448 452 449 /*-------------------------------------------------------------------*/ 453 450 ··· 519 514 return -EIDRM; 520 515 return usb_hcd_unlink_urb(urb, -ECONNRESET); 521 516 } 517 + EXPORT_SYMBOL_GPL(usb_unlink_urb); 522 518 523 519 /** 524 520 * usb_kill_urb - cancel a transfer request and wait for it to finish ··· 559 553 --urb->reject; 560 554 mutex_unlock(&reject_mutex); 561 555 } 556 + EXPORT_SYMBOL_GPL(usb_kill_urb); 562 557 563 558 /** 564 559 * usb_kill_anchored_urbs - cancel transfer requests en masse ··· 602 595 msecs_to_jiffies(timeout)); 603 596 } 604 597 EXPORT_SYMBOL_GPL(usb_wait_anchor_empty_timeout); 605 - 606 - EXPORT_SYMBOL(usb_init_urb); 607 - EXPORT_SYMBOL(usb_alloc_urb); 608 - EXPORT_SYMBOL(usb_free_urb); 609 - EXPORT_SYMBOL(usb_get_urb); 610 - EXPORT_SYMBOL(usb_submit_urb); 611 - EXPORT_SYMBOL(usb_unlink_urb); 612 - EXPORT_SYMBOL(usb_kill_urb);
+19 -43
drivers/usb/core/usb.c
··· 96 96 97 97 return NULL; 98 98 } 99 + EXPORT_SYMBOL_GPL(usb_ifnum_to_if); 99 100 100 101 /** 101 102 * usb_altnum_to_altsetting - get the altsetting structure with a given ··· 127 126 } 128 127 return NULL; 129 128 } 129 + EXPORT_SYMBOL_GPL(usb_altnum_to_altsetting); 130 130 131 131 struct find_interface_arg { 132 132 int minor; ··· 172 170 __find_interface); 173 171 return argb.interface; 174 172 } 173 + EXPORT_SYMBOL_GPL(usb_find_interface); 175 174 176 175 /** 177 176 * usb_release_dev - free a usb device structure when all users of it are finished. ··· 372 369 get_device(&dev->dev); 373 370 return dev; 374 371 } 372 + EXPORT_SYMBOL_GPL(usb_get_dev); 375 373 376 374 /** 377 375 * usb_put_dev - release a use of the usb device structure ··· 386 382 if (dev) 387 383 put_device(&dev->dev); 388 384 } 385 + EXPORT_SYMBOL_GPL(usb_put_dev); 389 386 390 387 /** 391 388 * usb_get_intf - increments the reference count of the usb interface structure ··· 407 402 get_device(&intf->dev); 408 403 return intf; 409 404 } 405 + EXPORT_SYMBOL_GPL(usb_get_intf); 410 406 411 407 /** 412 408 * usb_put_intf - release a use of the usb interface structure ··· 422 416 if (intf) 423 417 put_device(&intf->dev); 424 418 } 425 - 419 + EXPORT_SYMBOL_GPL(usb_put_intf); 426 420 427 421 /* USB device locking 428 422 * ··· 495 489 } 496 490 return 1; 497 491 } 498 - 492 + EXPORT_SYMBOL_GPL(usb_lock_device_for_reset); 499 493 500 494 static struct usb_device *match_device(struct usb_device *dev, 501 495 u16 vendor_id, u16 product_id) ··· 584 578 { 585 579 return usb_hcd_get_frame_number(dev); 586 580 } 581 + EXPORT_SYMBOL_GPL(usb_get_current_frame_number); 587 582 588 583 /*-------------------------------------------------------------------*/ 589 584 /* ··· 619 612 } 620 613 return -1; 621 614 } 615 + EXPORT_SYMBOL_GPL(__usb_get_extra_descriptor); 622 616 623 617 /** 624 618 * usb_buffer_alloc - allocate dma-consistent buffer for URB_NO_xxx_DMA_MAP ··· 654 646 return NULL; 655 647 return hcd_buffer_alloc(dev->bus, size, mem_flags, dma); 656 648 } 649 + EXPORT_SYMBOL_GPL(usb_buffer_alloc); 657 650 658 651 /** 659 652 * usb_buffer_free - free memory allocated with usb_buffer_alloc() ··· 680 671 return; 681 672 hcd_buffer_free(dev->bus, size, addr, dma); 682 673 } 674 + EXPORT_SYMBOL_GPL(usb_buffer_free); 683 675 684 676 /** 685 677 * usb_buffer_map - create DMA mapping(s) for an urb ··· 728 718 | URB_NO_SETUP_DMA_MAP); 729 719 return urb; 730 720 } 721 + EXPORT_SYMBOL_GPL(usb_buffer_map); 731 722 #endif /* 0 */ 732 723 733 724 /* XXX DISABLED, no users currently. If you wish to re-enable this ··· 766 755 DMA_TO_DEVICE); 767 756 } 768 757 } 758 + EXPORT_SYMBOL_GPL(usb_buffer_dmasync); 769 759 #endif 770 760 771 761 /** ··· 802 790 urb->transfer_flags &= ~(URB_NO_TRANSFER_DMA_MAP 803 791 | URB_NO_SETUP_DMA_MAP); 804 792 } 793 + EXPORT_SYMBOL_GPL(usb_buffer_unmap); 805 794 #endif /* 0 */ 806 795 807 796 /** ··· 847 834 return dma_map_sg(controller, sg, nents, 848 835 is_in ? DMA_FROM_DEVICE : DMA_TO_DEVICE); 849 836 } 837 + EXPORT_SYMBOL_GPL(usb_buffer_map_sg); 850 838 851 839 /* XXX DISABLED, no users currently. If you wish to re-enable this 852 840 * XXX please determine whether the sync is to transfer ownership of ··· 881 867 dma_sync_sg(controller, sg, n_hw_ents, 882 868 is_in ? DMA_FROM_DEVICE : DMA_TO_DEVICE); 883 869 } 870 + EXPORT_SYMBOL_GPL(usb_buffer_dmasync_sg); 884 871 #endif 885 872 886 873 /** ··· 908 893 dma_unmap_sg(controller, sg, n_hw_ents, 909 894 is_in ? DMA_FROM_DEVICE : DMA_TO_DEVICE); 910 895 } 896 + EXPORT_SYMBOL_GPL(usb_buffer_unmap_sg); 911 897 912 898 /* format to disable USB on kernel command line is: nousb */ 913 899 __module_param_call("", nousb, param_set_bool, param_get_bool, &nousb, 0444); ··· 920 904 { 921 905 return nousb; 922 906 } 907 + EXPORT_SYMBOL_GPL(usb_disabled); 923 908 924 909 /* 925 910 * Init ··· 1002 985 1003 986 subsys_initcall(usb_init); 1004 987 module_exit(usb_exit); 1005 - 1006 - /* 1007 - * USB may be built into the kernel or be built as modules. 1008 - * These symbols are exported for device (or host controller) 1009 - * driver modules to use. 1010 - */ 1011 - 1012 - EXPORT_SYMBOL(usb_disabled); 1013 - 1014 - EXPORT_SYMBOL_GPL(usb_get_intf); 1015 - EXPORT_SYMBOL_GPL(usb_put_intf); 1016 - 1017 - EXPORT_SYMBOL(usb_put_dev); 1018 - EXPORT_SYMBOL(usb_get_dev); 1019 - EXPORT_SYMBOL(usb_hub_tt_clear_buffer); 1020 - 1021 - EXPORT_SYMBOL(usb_lock_device_for_reset); 1022 - 1023 - EXPORT_SYMBOL(usb_find_interface); 1024 - EXPORT_SYMBOL(usb_ifnum_to_if); 1025 - EXPORT_SYMBOL(usb_altnum_to_altsetting); 1026 - 1027 - EXPORT_SYMBOL(__usb_get_extra_descriptor); 1028 - 1029 - EXPORT_SYMBOL(usb_get_current_frame_number); 1030 - 1031 - EXPORT_SYMBOL(usb_buffer_alloc); 1032 - EXPORT_SYMBOL(usb_buffer_free); 1033 - 1034 - #if 0 1035 - EXPORT_SYMBOL(usb_buffer_map); 1036 - EXPORT_SYMBOL(usb_buffer_dmasync); 1037 - EXPORT_SYMBOL(usb_buffer_unmap); 1038 - #endif 1039 - 1040 - EXPORT_SYMBOL(usb_buffer_map_sg); 1041 - #if 0 1042 - EXPORT_SYMBOL(usb_buffer_dmasync_sg); 1043 - #endif 1044 - EXPORT_SYMBOL(usb_buffer_unmap_sg); 1045 - 1046 988 MODULE_LICENSE("GPL");