Skip to content

Commit

Permalink
USB: mark USB drivers as being GPL only
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Greg Kroah-Hartman committed Feb 1, 2008
1 parent 667d691 commit 782e70c
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 111 deletions.
16 changes: 0 additions & 16 deletions Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,22 +156,6 @@ Who: Arjan van de Ven <arjan@linux.intel.com>

---------------------------

What: USB driver API moves to EXPORT_SYMBOL_GPL
When: February 2008
Files: include/linux/usb.h, drivers/usb/core/driver.c
Why: The USB subsystem has changed a lot over time, and it has been
possible to create userspace USB drivers using usbfs/libusb/gadgetfs
that operate as fast as the USB bus allows. Because of this, the USB
subsystem will not be allowing closed source kernel drivers to
register with it, after this grace period is over. If anyone needs
any help in converting their closed source drivers over to use the
userspace filesystems, please contact the
linux-usb-devel@lists.sourceforge.net mailing list, and the developers
there will be glad to help you out.
Who: Greg Kroah-Hartman <gregkh@suse.de>

---------------------------

What: vm_ops.nopage
When: Soon, provided in-kernel callers have been converted
Why: This interface is replaced by vm_ops.fault, but it has been around
Expand Down
10 changes: 5 additions & 5 deletions drivers/usb/core/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ int usb_driver_claim_interface(struct usb_driver *driver,

return retval;
}
EXPORT_SYMBOL(usb_driver_claim_interface);
EXPORT_SYMBOL_GPL(usb_driver_claim_interface);

/**
* usb_driver_release_interface - unbind a driver from an interface
Expand Down Expand Up @@ -370,7 +370,7 @@ void usb_driver_release_interface(struct usb_driver *driver,
iface->needs_remote_wakeup = 0;
usb_pm_unlock(udev);
}
EXPORT_SYMBOL(usb_driver_release_interface);
EXPORT_SYMBOL_GPL(usb_driver_release_interface);

/* returns 0 if no match, 1 if match */
int usb_match_device(struct usb_device *dev, const struct usb_device_id *id)
Expand Down Expand Up @@ -542,7 +542,7 @@ const struct usb_device_id *usb_match_id(struct usb_interface *interface,

return NULL;
}
EXPORT_SYMBOL_GPL_FUTURE(usb_match_id);
EXPORT_SYMBOL_GPL(usb_match_id);

static int usb_device_match(struct device *dev, struct device_driver *drv)
{
Expand Down Expand Up @@ -745,7 +745,7 @@ int usb_register_driver(struct usb_driver *new_driver, struct module *owner,

return retval;
}
EXPORT_SYMBOL_GPL_FUTURE(usb_register_driver);
EXPORT_SYMBOL_GPL(usb_register_driver);

/**
* usb_deregister - unregister a USB interface driver
Expand All @@ -769,7 +769,7 @@ void usb_deregister(struct usb_driver *driver)

usbfs_update_special();
}
EXPORT_SYMBOL_GPL_FUTURE(usb_deregister);
EXPORT_SYMBOL_GPL(usb_deregister);

#ifdef CONFIG_PM

Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/core/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ int usb_register_dev(struct usb_interface *intf,
exit:
return retval;
}
EXPORT_SYMBOL(usb_register_dev);
EXPORT_SYMBOL_GPL(usb_register_dev);

/**
* usb_deregister_dev - deregister a USB device's dynamic minor.
Expand Down Expand Up @@ -245,4 +245,4 @@ void usb_deregister_dev(struct usb_interface *intf,
intf->minor = -1;
destroy_usb_class();
}
EXPORT_SYMBOL(usb_deregister_dev);
EXPORT_SYMBOL_GPL(usb_deregister_dev);
10 changes: 5 additions & 5 deletions drivers/usb/core/hcd-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ int usb_hcd_pci_probe (struct pci_dev *dev, const struct pci_device_id *id)
dev_err (&dev->dev, "init %s fail, %d\n", pci_name(dev), retval);
return retval;
}
EXPORT_SYMBOL (usb_hcd_pci_probe);
EXPORT_SYMBOL_GPL(usb_hcd_pci_probe);


/* may be called without controller electrically present */
Expand Down Expand Up @@ -179,7 +179,7 @@ void usb_hcd_pci_remove (struct pci_dev *dev)
usb_put_hcd (hcd);
pci_disable_device(dev);
}
EXPORT_SYMBOL (usb_hcd_pci_remove);
EXPORT_SYMBOL_GPL(usb_hcd_pci_remove);


#ifdef CONFIG_PM
Expand Down Expand Up @@ -314,7 +314,7 @@ int usb_hcd_pci_suspend (struct pci_dev *dev, pm_message_t message)

return retval;
}
EXPORT_SYMBOL (usb_hcd_pci_suspend);
EXPORT_SYMBOL_GPL(usb_hcd_pci_suspend);

/**
* usb_hcd_pci_resume - power management resume of a PCI-based HCD
Expand Down Expand Up @@ -416,7 +416,7 @@ int usb_hcd_pci_resume (struct pci_dev *dev)

return retval;
}
EXPORT_SYMBOL (usb_hcd_pci_resume);
EXPORT_SYMBOL_GPL(usb_hcd_pci_resume);

#endif /* CONFIG_PM */

Expand All @@ -435,5 +435,5 @@ void usb_hcd_pci_shutdown (struct pci_dev *dev)
if (hcd->driver->shutdown)
hcd->driver->shutdown(hcd);
}
EXPORT_SYMBOL (usb_hcd_pci_shutdown);
EXPORT_SYMBOL_GPL(usb_hcd_pci_shutdown);

18 changes: 9 additions & 9 deletions drivers/usb/core/hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ long usb_calc_bus_time (int speed, int is_input, int isoc, int bytecount)
return -1;
}
}
EXPORT_SYMBOL (usb_calc_bus_time);
EXPORT_SYMBOL_GPL(usb_calc_bus_time);


/*-------------------------------------------------------------------------*/
Expand Down Expand Up @@ -1427,7 +1427,7 @@ void usb_hcd_giveback_urb(struct usb_hcd *hcd, struct urb *urb, int status)
wake_up (&usb_kill_urb_queue);
usb_put_urb (urb);
}
EXPORT_SYMBOL (usb_hcd_giveback_urb);
EXPORT_SYMBOL_GPL(usb_hcd_giveback_urb);

/*-------------------------------------------------------------------------*/

Expand Down Expand Up @@ -1667,7 +1667,7 @@ int usb_bus_start_enum(struct usb_bus *bus, unsigned port_num)
mod_timer(&hcd->rh_timer, jiffies + msecs_to_jiffies(10));
return status;
}
EXPORT_SYMBOL (usb_bus_start_enum);
EXPORT_SYMBOL_GPL(usb_bus_start_enum);

#endif

Expand Down Expand Up @@ -1774,7 +1774,7 @@ struct usb_hcd *usb_create_hcd (const struct hc_driver *driver,
"USB Host Controller";
return hcd;
}
EXPORT_SYMBOL (usb_create_hcd);
EXPORT_SYMBOL_GPL(usb_create_hcd);

static void hcd_release (struct kref *kref)
{
Expand All @@ -1789,14 +1789,14 @@ struct usb_hcd *usb_get_hcd (struct usb_hcd *hcd)
kref_get (&hcd->kref);
return hcd;
}
EXPORT_SYMBOL (usb_get_hcd);
EXPORT_SYMBOL_GPL(usb_get_hcd);

void usb_put_hcd (struct usb_hcd *hcd)
{
if (hcd)
kref_put (&hcd->kref, hcd_release);
}
EXPORT_SYMBOL (usb_put_hcd);
EXPORT_SYMBOL_GPL(usb_put_hcd);

/**
* usb_add_hcd - finish generic HCD structure initialization and register
Expand Down Expand Up @@ -1922,7 +1922,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
hcd_buffer_destroy(hcd);
return retval;
}
EXPORT_SYMBOL (usb_add_hcd);
EXPORT_SYMBOL_GPL(usb_add_hcd);

/**
* usb_remove_hcd - shutdown processing for generic HCDs
Expand Down Expand Up @@ -1964,7 +1964,7 @@ void usb_remove_hcd(struct usb_hcd *hcd)
usb_deregister_bus(&hcd->self);
hcd_buffer_destroy(hcd);
}
EXPORT_SYMBOL (usb_remove_hcd);
EXPORT_SYMBOL_GPL(usb_remove_hcd);

void
usb_hcd_platform_shutdown(struct platform_device* dev)
Expand All @@ -1974,7 +1974,7 @@ usb_hcd_platform_shutdown(struct platform_device* dev)
if (hcd->driver->shutdown)
hcd->driver->shutdown(hcd);
}
EXPORT_SYMBOL (usb_hcd_platform_shutdown);
EXPORT_SYMBOL_GPL(usb_hcd_platform_shutdown);

/*-------------------------------------------------------------------------*/

Expand Down
5 changes: 3 additions & 2 deletions drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ void usb_hub_tt_clear_buffer (struct usb_device *udev, int pipe)
schedule_work (&tt->kevent);
spin_unlock_irqrestore (&tt->lock, flags);
}
EXPORT_SYMBOL_GPL(usb_hub_tt_clear_buffer);

static void hub_power_on(struct usb_hub *hub)
{
Expand Down Expand Up @@ -3116,7 +3117,7 @@ int usb_reset_device(struct usb_device *udev)
hub_port_logical_disconnect(parent_hub, port1);
return -ENODEV;
}
EXPORT_SYMBOL(usb_reset_device);
EXPORT_SYMBOL_GPL(usb_reset_device);

/**
* usb_reset_composite_device - warn interface drivers and perform a USB port reset
Expand Down Expand Up @@ -3187,4 +3188,4 @@ int usb_reset_composite_device(struct usb_device *udev,
usb_autosuspend_device(udev);
return ret;
}
EXPORT_SYMBOL(usb_reset_composite_device);
EXPORT_SYMBOL_GPL(usb_reset_composite_device);
32 changes: 11 additions & 21 deletions drivers/usb/core/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe, __u8 request, __u

return ret;
}

EXPORT_SYMBOL_GPL(usb_control_msg);

/**
* usb_interrupt_msg - Builds an interrupt urb, sends it off and waits for completion
Expand Down Expand Up @@ -238,6 +238,7 @@ int usb_bulk_msg(struct usb_device *usb_dev, unsigned int pipe,

return usb_start_wait_urb(urb, timeout, actual_length);
}
EXPORT_SYMBOL_GPL(usb_bulk_msg);

/*-------------------------------------------------------------------*/

Expand Down Expand Up @@ -465,7 +466,7 @@ int usb_sg_init (
sg_clean (io);
return -ENOMEM;
}

EXPORT_SYMBOL_GPL(usb_sg_init);

/**
* usb_sg_wait - synchronously execute scatter/gather request
Expand Down Expand Up @@ -569,6 +570,7 @@ void usb_sg_wait (struct usb_sg_request *io)

sg_clean (io);
}
EXPORT_SYMBOL_GPL(usb_sg_wait);

/**
* usb_sg_cancel - stop scatter/gather i/o issued by usb_sg_wait()
Expand Down Expand Up @@ -604,6 +606,7 @@ void usb_sg_cancel (struct usb_sg_request *io)
}
spin_unlock_irqrestore (&io->lock, flags);
}
EXPORT_SYMBOL_GPL(usb_sg_cancel);

/*-------------------------------------------------------------------*/

Expand Down Expand Up @@ -652,6 +655,7 @@ int usb_get_descriptor(struct usb_device *dev, unsigned char type, unsigned char
}
return result;
}
EXPORT_SYMBOL_GPL(usb_get_descriptor);

/**
* usb_get_string - gets a string descriptor
Expand Down Expand Up @@ -827,6 +831,7 @@ int usb_string(struct usb_device *dev, int index, char *buf, size_t size)
kfree(tbuf);
return err;
}
EXPORT_SYMBOL_GPL(usb_string);

/**
* usb_cache_string - read a string descriptor and cache it for later use
Expand Down Expand Up @@ -927,6 +932,7 @@ int usb_get_status(struct usb_device *dev, int type, int target, void *data)
kfree(status);
return ret;
}
EXPORT_SYMBOL_GPL(usb_get_status);

/**
* usb_clear_halt - tells device to clear endpoint halt/stall condition
Expand Down Expand Up @@ -985,6 +991,7 @@ int usb_clear_halt(struct usb_device *dev, int pipe)

return 0;
}
EXPORT_SYMBOL_GPL(usb_clear_halt);

/**
* usb_disable_endpoint -- Disable an endpoint by address
Expand Down Expand Up @@ -1253,6 +1260,7 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)

return 0;
}
EXPORT_SYMBOL_GPL(usb_set_interface);

/**
* usb_reset_configuration - lightweight device reset
Expand Down Expand Up @@ -1328,6 +1336,7 @@ int usb_reset_configuration(struct usb_device *dev)
}
return 0;
}
EXPORT_SYMBOL_GPL(usb_reset_configuration);

static void usb_release_interface(struct device *dev)
{
Expand Down Expand Up @@ -1677,22 +1686,3 @@ int usb_driver_set_configuration(struct usb_device *udev, int config)
return 0;
}
EXPORT_SYMBOL_GPL(usb_driver_set_configuration);

// synchronous request completion model
EXPORT_SYMBOL(usb_control_msg);
EXPORT_SYMBOL(usb_bulk_msg);

EXPORT_SYMBOL(usb_sg_init);
EXPORT_SYMBOL(usb_sg_cancel);
EXPORT_SYMBOL(usb_sg_wait);

// synchronous control message convenience routines
EXPORT_SYMBOL(usb_get_descriptor);
EXPORT_SYMBOL(usb_get_status);
EXPORT_SYMBOL(usb_string);

// synchronous calls that also maintain usbcore state
EXPORT_SYMBOL(usb_clear_halt);
EXPORT_SYMBOL(usb_reset_configuration);
EXPORT_SYMBOL(usb_set_interface);

Loading

0 comments on commit 782e70c

Please sign in to comment.