I'm tired of trying to explain why a "device_type" is really a driver.
This better describes exactly what this structure is.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
.id_table = id_table,
};
-static struct usb_serial_device_type airprime_device = {
+static struct usb_serial_driver airprime_device = {
.owner = THIS_MODULE,
.name = "airprime",
.id_table = id_table,
};
/* All of the device info needed for the serial converters */
-static struct usb_serial_device_type belkin_device = {
+static struct usb_serial_driver belkin_device = {
.owner = THIS_MODULE,
.name = "Belkin / Peracom / GoHubs USB Serial Adapter",
.short_name = "belkin",
static int usb_serial_device_match (struct device *dev, struct device_driver *drv)
{
- struct usb_serial_device_type *driver;
+ struct usb_serial_driver *driver;
const struct usb_serial_port *port;
/*
static int usb_serial_device_probe (struct device *dev)
{
- struct usb_serial_device_type *driver;
+ struct usb_serial_driver *driver;
struct usb_serial_port *port;
int retval = 0;
int minor;
static int usb_serial_device_remove (struct device *dev)
{
- struct usb_serial_device_type *driver;
+ struct usb_serial_driver *driver;
struct usb_serial_port *port;
int retval = 0;
int minor;
return retval;
}
-int usb_serial_bus_register(struct usb_serial_device_type *device)
+int usb_serial_bus_register(struct usb_serial_driver *driver)
{
int retval;
- if (device->short_name)
- device->driver.name = (char *)device->short_name;
+ if (driver->short_name)
+ driver->driver.name = (char *)driver->short_name;
else
- device->driver.name = (char *)device->name;
- device->driver.bus = &usb_serial_bus_type;
- device->driver.probe = usb_serial_device_probe;
- device->driver.remove = usb_serial_device_remove;
- device->driver.owner = device->owner;
+ driver->driver.name = (char *)driver->name;
+ driver->driver.bus = &usb_serial_bus_type;
+ driver->driver.probe = usb_serial_device_probe;
+ driver->driver.remove = usb_serial_device_remove;
+ driver->driver.owner = driver->owner;
- retval = driver_register(&device->driver);
+ retval = driver_register(&driver->driver);
return retval;
}
-void usb_serial_bus_deregister(struct usb_serial_device_type *device)
+void usb_serial_bus_deregister(struct usb_serial_driver *driver)
{
- driver_unregister (&device->driver);
+ driver_unregister(&driver->driver);
}
.id_table = id_table,
};
-static struct usb_serial_device_type cp2101_device = {
+static struct usb_serial_driver cp2101_device = {
.owner = THIS_MODULE,
.name = "CP2101",
.id_table = id_table,
.id_table = id_table,
};
-static struct usb_serial_device_type cyberjack_device = {
+static struct usb_serial_driver cyberjack_device = {
.owner = THIS_MODULE,
.name = "Reiner SCT Cyberjack USB card reader",
.short_name = "cyberjack",
static unsigned int cypress_buf_get(struct cypress_buf *cb, char *buf, unsigned int count);
-static struct usb_serial_device_type cypress_earthmate_device = {
+static struct usb_serial_driver cypress_earthmate_device = {
.owner = THIS_MODULE,
.name = "DeLorme Earthmate USB",
.short_name = "earthmate",
.write_int_callback = cypress_write_int_callback,
};
-static struct usb_serial_device_type cypress_hidcom_device = {
+static struct usb_serial_driver cypress_hidcom_device = {
.owner = THIS_MODULE,
.name = "HID->COM RS232 Adapter",
.short_name = "cyphidcom",
/* device info needed for the Digi serial converter */
-static struct usb_serial_device_type digi_acceleport_2_device = {
+static struct usb_serial_driver digi_acceleport_2_device = {
.owner = THIS_MODULE,
.name = "Digi 2 port USB adapter",
.short_name = "digi_2",
.shutdown = digi_shutdown,
};
-static struct usb_serial_device_type digi_acceleport_4_device = {
+static struct usb_serial_driver digi_acceleport_4_device = {
.owner = THIS_MODULE,
.name = "Digi 4 port USB adapter",
.short_name = "digi_4",
.id_table = id_table,
};
-static struct usb_serial_device_type empeg_device = {
+static struct usb_serial_driver empeg_device = {
.owner = THIS_MODULE,
.name = "Empeg",
.id_table = id_table,
static __u32 ftdi_232bm_baud_base_to_divisor (int baud, int base);
static __u32 ftdi_232bm_baud_to_divisor (int baud);
-static struct usb_serial_device_type ftdi_sio_device = {
+static struct usb_serial_driver ftdi_sio_device = {
.owner = THIS_MODULE,
.name = "FTDI USB Serial Device",
.short_name = "ftdi_sio",
}
-
-
-
-
-
/* All of the device info needed */
-static struct usb_serial_device_type garmin_device = {
+static struct usb_serial_driver garmin_device = {
.owner = THIS_MODULE,
.name = "Garmin GPS usb/tty",
.short_name = "garmin_gps",
static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */
/* All of the device info needed for the Generic Serial Converter */
-struct usb_serial_device_type usb_serial_generic_device = {
+struct usb_serial_driver usb_serial_generic_device = {
.owner = THIS_MODULE,
.name = "Generic",
.short_name = "generic",
.id_table = id_table,
};
-static struct usb_serial_device_type hp49gp_device = {
+static struct usb_serial_driver hp49gp_device = {
.owner = THIS_MODULE,
.name = "HP4X",
.id_table = id_table,
MODULE_DEVICE_TABLE (usb, id_table_combined);
-static struct usb_serial_device_type edgeport_2port_device = {
+static struct usb_serial_driver edgeport_2port_device = {
.owner = THIS_MODULE,
.name = "Edgeport 2 port adapter",
.short_name = "edgeport_2",
.write_bulk_callback = edge_bulk_out_data_callback,
};
-static struct usb_serial_device_type edgeport_4port_device = {
+static struct usb_serial_driver edgeport_4port_device = {
.owner = THIS_MODULE,
.name = "Edgeport 4 port adapter",
.short_name = "edgeport_4",
.write_bulk_callback = edge_bulk_out_data_callback,
};
-static struct usb_serial_device_type edgeport_8port_device = {
+static struct usb_serial_driver edgeport_8port_device = {
.owner = THIS_MODULE,
.name = "Edgeport 8 port adapter",
.short_name = "edgeport_8",
}
-static struct usb_serial_device_type edgeport_1port_device = {
+static struct usb_serial_driver edgeport_1port_device = {
.owner = THIS_MODULE,
.name = "Edgeport TI 1 port adapter",
.short_name = "edgeport_ti_1",
.write_bulk_callback = edge_bulk_out_callback,
};
-static struct usb_serial_device_type edgeport_2port_device = {
+static struct usb_serial_driver edgeport_2port_device = {
.owner = THIS_MODULE,
.name = "Edgeport TI 2 port adapter",
.short_name = "edgeport_ti_2",
/* All of the device info needed for the Compaq iPAQ */
-static struct usb_serial_device_type ipaq_device = {
+static struct usb_serial_driver ipaq_device = {
.owner = THIS_MODULE,
.name = "PocketPC PDA",
.id_table = ipaq_id_table,
return 0;
}
-static struct usb_serial_device_type ipw_device = {
+static struct usb_serial_driver ipw_device = {
.owner = THIS_MODULE,
.name = "IPWireless converter",
.short_name = "ipw",
};
-static struct usb_serial_device_type ir_device = {
+static struct usb_serial_driver ir_device = {
.owner = THIS_MODULE,
.name = "IR Dongle",
.id_table = id_table,
};
/* Structs for the devices, pre and post renumeration. */
-static struct usb_serial_device_type keyspan_pre_device = {
+static struct usb_serial_driver keyspan_pre_device = {
.owner = THIS_MODULE,
.name = "Keyspan - (without firmware)",
.short_name = "keyspan_no_firm",
.attach = keyspan_fake_startup,
};
-static struct usb_serial_device_type keyspan_1port_device = {
+static struct usb_serial_driver keyspan_1port_device = {
.owner = THIS_MODULE,
.name = "Keyspan 1 port adapter",
.short_name = "keyspan_1",
.shutdown = keyspan_shutdown,
};
-static struct usb_serial_device_type keyspan_2port_device = {
+static struct usb_serial_driver keyspan_2port_device = {
.owner = THIS_MODULE,
.name = "Keyspan 2 port adapter",
.short_name = "keyspan_2",
.shutdown = keyspan_shutdown,
};
-static struct usb_serial_device_type keyspan_4port_device = {
+static struct usb_serial_driver keyspan_4port_device = {
.owner = THIS_MODULE,
.name = "Keyspan 4 port adapter",
.short_name = "keyspan_4",
}
#ifdef KEYSPAN
-static struct usb_serial_device_type keyspan_pda_fake_device = {
+static struct usb_serial_driver keyspan_pda_fake_device = {
.owner = THIS_MODULE,
.name = "Keyspan PDA - (prerenumeration)",
.short_name = "keyspan_pda_pre",
#endif
#ifdef XIRCOM
-static struct usb_serial_device_type xircom_pgs_fake_device = {
+static struct usb_serial_driver xircom_pgs_fake_device = {
.owner = THIS_MODULE,
.name = "Xircom / Entregra PGS - (prerenumeration)",
.short_name = "xircom_no_firm",
};
#endif
-static struct usb_serial_device_type keyspan_pda_device = {
+static struct usb_serial_driver keyspan_pda_device = {
.owner = THIS_MODULE,
.name = "Keyspan PDA",
.short_name = "keyspan_pda",
.id_table = id_table,
};
-static struct usb_serial_device_type kl5kusb105d_device = {
+static struct usb_serial_driver kl5kusb105d_device = {
.owner = THIS_MODULE,
.name = "KL5KUSB105D / PalmConnect",
.short_name = "kl5kusb105d",
};
-static struct usb_serial_device_type kobil_device = {
+static struct usb_serial_driver kobil_device = {
.owner = THIS_MODULE,
.name = "KOBIL USB smart card terminal",
.id_table = id_table,
.id_table = id_table_combined,
};
-static struct usb_serial_device_type mct_u232_device = {
+static struct usb_serial_driver mct_u232_device = {
.owner = THIS_MODULE,
.name = "MCT U232",
.short_name = "mct_u232",
};
-static struct usb_serial_device_type zyxel_omninet_device = {
+static struct usb_serial_driver zyxel_omninet_device = {
.owner = THIS_MODULE,
.name = "ZyXEL - omni.net lcd plus usb",
.short_name = "omninet",
/* The card has three separate interfaces, wich the serial driver
* recognizes separately, thus num_port=1.
*/
-static struct usb_serial_device_type option_3port_device = {
+static struct usb_serial_driver option_3port_device = {
.owner = THIS_MODULE,
.name = "Option 3G data card",
.short_name = "option",
/* All of the device info needed for the PL2303 SIO serial converter */
-static struct usb_serial_device_type pl2303_device = {
+static struct usb_serial_driver pl2303_device = {
.owner = THIS_MODULE,
.name = "PL-2303",
.id_table = id_table,
return 0;
}
-static struct usb_serial_device_type safe_device = {
+static struct usb_serial_driver safe_device = {
.owner = THIS_MODULE,
.name = "Safe",
.id_table = id_table,
.id_table = ti_id_table_combined,
};
-static struct usb_serial_device_type ti_1port_device = {
+static struct usb_serial_driver ti_1port_device = {
.owner = THIS_MODULE,
.name = "TI USB 3410 1 port adapter",
.id_table = ti_id_table_3410,
.write_bulk_callback = ti_bulk_out_callback,
};
-static struct usb_serial_device_type ti_2port_device = {
+static struct usb_serial_driver ti_2port_device = {
.owner = THIS_MODULE,
.name = "TI USB 5052 2 port adapter",
.id_table = ti_id_table_5052,
static struct usb_serial * create_serial (struct usb_device *dev,
struct usb_interface *interface,
- struct usb_serial_device_type *type)
+ struct usb_serial_driver *driver)
{
struct usb_serial *serial;
}
memset (serial, 0, sizeof(*serial));
serial->dev = usb_get_dev(dev);
- serial->type = type;
+ serial->type = driver;
serial->interface = interface;
kref_init(&serial->kref);
return serial;
}
-static struct usb_serial_device_type *search_serial_device(struct usb_interface *iface)
+static struct usb_serial_driver *search_serial_device(struct usb_interface *iface)
{
struct list_head *p;
const struct usb_device_id *id;
- struct usb_serial_device_type *t;
+ struct usb_serial_driver *t;
/* List trough know devices and see if the usb id matches */
list_for_each(p, &usb_serial_driver_list) {
- t = list_entry(p, struct usb_serial_device_type, driver_list);
+ t = list_entry(p, struct usb_serial_driver, driver_list);
id = usb_match_id(iface, t->id_table);
if (id != NULL) {
dbg("descriptor matches");
struct usb_endpoint_descriptor *interrupt_out_endpoint[MAX_NUM_PORTS];
struct usb_endpoint_descriptor *bulk_in_endpoint[MAX_NUM_PORTS];
struct usb_endpoint_descriptor *bulk_out_endpoint[MAX_NUM_PORTS];
- struct usb_serial_device_type *type = NULL;
+ struct usb_serial_driver *type = NULL;
int retval;
int minor;
int buffer_size;
} \
} while (0)
-static void fixup_generic(struct usb_serial_device_type *device)
+static void fixup_generic(struct usb_serial_driver *device)
{
set_to_generic_if_null(device, open);
set_to_generic_if_null(device, write);
set_to_generic_if_null(device, shutdown);
}
-int usb_serial_register(struct usb_serial_device_type *new_device)
+int usb_serial_register(struct usb_serial_driver *driver)
{
int retval;
- fixup_generic(new_device);
+ fixup_generic(driver);
/* Add this device to our list of devices */
- list_add(&new_device->driver_list, &usb_serial_driver_list);
+ list_add(&driver->driver_list, &usb_serial_driver_list);
- retval = usb_serial_bus_register(new_device);
+ retval = usb_serial_bus_register(driver);
if (retval) {
- err("problem %d when registering driver %s", retval, new_device->name);
- list_del(&new_device->driver_list);
+ err("problem %d when registering driver %s", retval, driver->name);
+ list_del(&driver->driver_list);
}
else
- info("USB Serial support registered for %s", new_device->name);
+ info("USB Serial support registered for %s", driver->name);
return retval;
}
-void usb_serial_deregister(struct usb_serial_device_type *device)
+void usb_serial_deregister(struct usb_serial_driver *device)
{
info("USB Serial deregistering driver %s", device->name);
list_del(&device->driver_list);
/**
* usb_serial - structure used by the usb-serial core for a device
* @dev: pointer to the struct usb_device for this device
- * @type: pointer to the struct usb_serial_device_type for this device
+ * @type: pointer to the struct usb_serial_driver for this device
* @interface: pointer to the struct usb_interface for this device
* @minor: the starting minor number for this device
* @num_ports: the number of ports this device has
*/
struct usb_serial {
struct usb_device * dev;
- struct usb_serial_device_type * type;
+ struct usb_serial_driver * type;
struct usb_interface * interface;
unsigned char minor;
unsigned char num_ports;
}
/**
- * usb_serial_device_type - a structure that defines a usb serial device
- * @owner: pointer to the module that owns this device.
- * @name: pointer to a string that describes this device. This string used
+ * usb_serial_driver - describes a usb serial driver
+ * @owner: pointer to the module that owns this driver.
+ * @name: pointer to a string that describes this driver. This string used
* in the syslog messages when a device is inserted or removed.
- * @short_name: a pointer to a string that describes this device in
+ * @short_name: a pointer to a string that describes this driver in
* KOBJ_NAME_LEN characters or less. This is used for the sysfs interface
* to describe the driver.
* @id_table: pointer to a list of usb_device_id structures that define all
* @shutdown: pointer to the driver's shutdown function. This will be
* called when the device is removed from the system.
*
- * This structure is defines a USB Serial device. It provides all of
+ * This structure is defines a USB Serial driver. It provides all of
* the information that the USB serial core code needs. If the function
* pointers are defined, then the USB serial core code will call them when
* the corresponding tty port functions are called. If they are not
* called, the generic serial function will be used instead.
*/
-struct usb_serial_device_type {
+struct usb_serial_driver {
struct module *owner;
char *name;
char *short_name;
void (*read_bulk_callback)(struct urb *urb, struct pt_regs *regs);
void (*write_bulk_callback)(struct urb *urb, struct pt_regs *regs);
};
-#define to_usb_serial_driver(d) container_of(d, struct usb_serial_device_type, driver)
+#define to_usb_serial_driver(d) container_of(d, struct usb_serial_driver, driver)
-extern int usb_serial_register(struct usb_serial_device_type *new_device);
-extern void usb_serial_deregister(struct usb_serial_device_type *device);
+extern int usb_serial_register(struct usb_serial_driver *driver);
+extern void usb_serial_deregister(struct usb_serial_driver *driver);
extern void usb_serial_port_softint(void *private);
extern int usb_serial_probe(struct usb_interface *iface, const struct usb_device_id *id);
extern int usb_serial_generic_register (int debug);
extern void usb_serial_generic_deregister (void);
-extern int usb_serial_bus_register (struct usb_serial_device_type *device);
-extern void usb_serial_bus_deregister (struct usb_serial_device_type *device);
+extern int usb_serial_bus_register (struct usb_serial_driver *device);
+extern void usb_serial_bus_deregister (struct usb_serial_driver *device);
-extern struct usb_serial_device_type usb_serial_generic_device;
+extern struct usb_serial_driver usb_serial_generic_device;
extern struct bus_type usb_serial_bus_type;
extern struct tty_driver *usb_serial_tty_driver;
};
/* All of the device info needed for the Handspring Visor, and Palm 4.0 devices */
-static struct usb_serial_device_type handspring_device = {
+static struct usb_serial_driver handspring_device = {
.owner = THIS_MODULE,
.name = "Handspring Visor / Palm OS",
.short_name = "visor",
};
/* All of the device info needed for the Clie UX50, TH55 Palm 5.0 devices */
-static struct usb_serial_device_type clie_5_device = {
+static struct usb_serial_driver clie_5_device = {
.owner = THIS_MODULE,
.name = "Sony Clie 5.0",
.short_name = "clie_5",
};
/* device info for the Sony Clie OS version 3.5 */
-static struct usb_serial_device_type clie_3_5_device = {
+static struct usb_serial_driver clie_3_5_device = {
.owner = THIS_MODULE,
.name = "Sony Clie 3.5",
.short_name = "clie_3.5",
static void whiteheat_read_callback (struct urb *urb, struct pt_regs *regs);
static void whiteheat_write_callback (struct urb *urb, struct pt_regs *regs);
-static struct usb_serial_device_type whiteheat_fake_device = {
+static struct usb_serial_driver whiteheat_fake_device = {
.owner = THIS_MODULE,
.name = "Connect Tech - WhiteHEAT - (prerenumeration)",
.short_name = "whiteheatnofirm",
.attach = whiteheat_firmware_attach,
};
-static struct usb_serial_device_type whiteheat_device = {
+static struct usb_serial_driver whiteheat_device = {
.owner = THIS_MODULE,
.name = "Connect Tech - WhiteHEAT",
.short_name = "whiteheat",