Пример #1
0
/* Functions used by new usb-serial code. */
static int __init sierra_init(void)
{
	int retval;
	retval = usb_serial_register(&sierra_1port_device);
	if (retval)
		goto failed_1port_device_register;
	retval = usb_serial_register(&sierra_3port_device);
	if (retval)
		goto failed_3port_device_register;


	retval = usb_register(&sierra_driver);
	if (retval)
		goto failed_driver_register;

	info(DRIVER_DESC ": " DRIVER_VERSION);

	return 0;

failed_driver_register:
	usb_serial_deregister(&sierra_3port_device);
failed_3port_device_register:
	usb_serial_deregister(&sierra_1port_device);
failed_1port_device_register:
	return retval;
}
Пример #2
0
static int __init visor_init (void)
{
	struct urb *urb;
	int i;

	usb_serial_register (&handspring_device);
	usb_serial_register (&clie_3_5_device);
	
	/* create our write urb pool and transfer buffers */ 
	spin_lock_init (&write_urb_pool_lock);
	for (i = 0; i < NUM_URBS; ++i) {
		urb = usb_alloc_urb(0);
		write_urb_pool[i] = urb;
		if (urb == NULL) {
			err("No more urbs???");
			continue;
		}

		urb->transfer_buffer = NULL;
		urb->transfer_buffer = kmalloc (URB_TRANSFER_BUFFER_SIZE, GFP_KERNEL);
		if (!urb->transfer_buffer) {
			err (__FUNCTION__ " - out of memory for urb buffers.");
			continue;
		}
	}

	info(DRIVER_DESC " " DRIVER_VERSION);

	return 0;
}
Пример #3
0
/*===========================================================================
METHOD:
   GobiInit (Free Method)

DESCRIPTION:
   Register the driver and device

PARAMETERS:

RETURN VALUE:
   int - negative error code on failure
         zero on success
===========================================================================*/
static int __init GobiInit( void )
{
   int nRetval = 0;
   gpClose = NULL;

   gGobiDevice.num_ports = NUM_BULK_EPS;

   // Registering driver to USB serial core layer 
   nRetval = usb_serial_register( &gGobiDevice );
   if (nRetval != 0)
   {
      return nRetval;
   }

   // Registering driver to USB core layer
   nRetval = usb_register( &GobiDriver );
   if (nRetval != 0) 
   {
      usb_serial_deregister( &gGobiDevice );
      return nRetval;
   }

   // This will be shown whenever driver is loaded
   printk( KERN_INFO "%s: %s\n", DRIVER_DESC, DRIVER_VERSION );
   
   return nRetval;
}
Пример #4
0
static int __init ir_init(void)
{
	int retval;

	if (buffer_size) {
		ir_device.bulk_in_size = buffer_size;
		ir_device.bulk_out_size = buffer_size;
	}

	retval = usb_serial_register(&ir_device);
	if (retval)
		goto failed_usb_serial_register;

	retval = usb_register(&ir_driver);
	if (retval)
		goto failed_usb_register;

	printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
	       DRIVER_DESC "\n");

	return 0;

failed_usb_register:
	usb_serial_deregister(&ir_device);

failed_usb_serial_register:
	return retval;
}
Пример #5
0
static int __init safe_init(void)
{
	int i, retval;

//	printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
;

	/* if we have vendor / product parameters patch them into id list */
	if (vendor || product) {
//		printk(KERN_INFO KBUILD_MODNAME ": vendor: %x product: %x\n",
;

		for (i = 0; i < ARRAY_SIZE(id_table); i++) {
			if (!id_table[i].idVendor && !id_table[i].idProduct) {
				id_table[i].idVendor = vendor;
				id_table[i].idProduct = product;
				break;
			}
		}
	}

	retval = usb_serial_register(&safe_device);
	if (retval)
		goto failed_usb_serial_register;
	retval = usb_register(&safe_driver);
	if (retval)
		goto failed_usb_register;

	return 0;
failed_usb_register:
	usb_serial_deregister(&safe_device);
failed_usb_serial_register:
	return retval;
}
Пример #6
0
static int modem_probe(struct platform_device *pdev)
{
	int retval;

	spin_lock_init(&modem.lock);
	INIT_DELAYED_WORK(&modem.delayed_pwr_shutdown, modem_power_off);
	modem.connected = false;
	modem.regulator = regulator_get(NULL, "vusb_modem_ipc");
	if (IS_ERR(modem.regulator)) {
		modem.regulator = NULL;
	}
	else {
		/* If a regulator is available for driving the other end of the modem
		   interface, set a timer to turn it off if it does not enumerate.  This
		   is done to conserve power if the modem does not enumerate due to
		   it's USB interface being turned off. */
		regulator_enable(modem.regulator);
		(void)schedule_delayed_work(&modem.delayed_pwr_shutdown,
					msecs_to_jiffies(PWR_DOWN_TIMEOUT_MS));
	}

	modem_wake_irq = platform_get_irq(pdev, 0);

	retval = usb_serial_register(&modem_device);
	if (retval)
		return retval;
	retval = usb_register(&modem_driver);
	if (retval)
		usb_serial_deregister(&modem_device);
	return retval;
}
Пример #7
0
static int __init ssu100_init(void)
{
	int retval;

	dbg("%s", __func__);

	/* register with usb-serial */
	retval = usb_serial_register(&ssu100_device);

	if (retval)
		goto failed_usb_sio_register;

	retval = usb_register(&ssu100_driver);
	if (retval)
		goto failed_usb_register;

	printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
	       DRIVER_DESC "\n");

	return 0;

failed_usb_register:
	usb_serial_deregister(&ssu100_device);
failed_usb_sio_register:
	return retval;
}
Пример #8
0
static int __init visor_init (void)
{
	struct urb *urb;
	int i;

	/* Only if parameters were passed to us */
	if ((vendor > 0) && (product > 0)) {
       		struct usb_device_id usb_dev_temp[]=
	       		{{USB_DEVICE(vendor, product)}};
		id_param_table[0] = usb_dev_temp[0];
		info("Untested USB device specified at time of module insertion");
		info("Warning: This is not guaranteed to work");
		info("Using a newer kernel is preferred to this method");
		info("Adding Palm OS protocol 4.x support for unknown device: 0x%x/0x%x",
			param_device.id_table[0].idVendor, param_device.id_table[0].idProduct);
		param_register = 1;
		usb_serial_register (&param_device);
	}
	usb_serial_register (&handspring_device);
	usb_serial_register (&clie_3_5_device);
	
	/* create our write urb pool and transfer buffers */ 
	spin_lock_init (&write_urb_pool_lock);
	for (i = 0; i < NUM_URBS; ++i) {
		urb = usb_alloc_urb(0);
		write_urb_pool[i] = urb;
		if (urb == NULL) {
			err("No more urbs???");
			continue;
		}

		urb->transfer_buffer = NULL;
		urb->transfer_buffer = kmalloc (URB_TRANSFER_BUFFER_SIZE, GFP_KERNEL);
		if (!urb->transfer_buffer) {
			err("%s - out of memory for urb buffers.", __FUNCTION__);
			continue;
		}
	}

	info(DRIVER_DESC " " DRIVER_VERSION);

	return 0;
}
Пример #9
0
static int usb_ipw_init(void)
{
	int retval;

	retval = usb_serial_register(&ipw_device);
	if (retval)
		return retval;
	info(DRIVER_DESC " " DRIVER_VERSION);
	return 0;
}
Пример #10
0
static int __init moto_flashqsc_init(void)
{
	int retval;

	retval = usb_serial_register(&moto_flashqsc_device);
	if (retval)
		return retval;
	retval = usb_register(&moto_flashqsc_driver);
	if (retval)
		usb_serial_deregister(&moto_flashqsc_device);
	return retval;
}
Пример #11
0
static int __init zio_init(void)
{
	int retval;

	retval = usb_serial_register(&zio_device);
	if (retval)
		return retval;
	retval = usb_register(&zio_driver);
	if (retval)
		usb_serial_deregister(&zio_device);
	return retval;
}
Пример #12
0
static int do_usbserial(struct command *cmdtp, int argc, char *argv[])
{
	int opt;
	struct usb_serial_pdata pdata;
	char *argstr;
	char *manufacturer = "barebox";
	char *productname = CONFIG_BOARDINFO;
	u16 idVendor = 0, idProduct = 0;
	int mode = 0;

	while ((opt = getopt(argc, argv, "m:p:V:P:asd")) > 0) {
		switch (opt) {
		case 'm':
			manufacturer = optarg;
			break;
		case 'p':
			productname = optarg;
			break;
		case 'V':
			idVendor = simple_strtoul(optarg, NULL, 0);
			break;
		case 'P':
			idProduct = simple_strtoul(optarg, NULL, 0);
			break;
		case 'a':
			mode = 0;
			break;
#ifdef HAVE_OBEX
		case 'o':
			mode = 1;
			break;
#endif
		case 's':
			mode = 2;
			break;
		case 'd':
			usb_serial_unregister();
			return 0;
		}
	}

	argstr = argv[optind];

	pdata.manufacturer = manufacturer;
	pdata.productname = productname;
	pdata.idVendor = idVendor;
	pdata.idProduct = idProduct;
	pdata.mode = mode;

	return usb_serial_register(&pdata);
}
Пример #13
0
static int __init usi_init(void)
{
	int retval;
        printk("====usi_init====\n");
	
	retval = usb_serial_register(&usi_device);
	if (retval)
		return retval;
	retval = usb_register(&usi_driver);
	if (retval)
		usb_serial_deregister(&usi_device);	

	return retval;
}
Пример #14
0
static int __init airprime_init(void)
{
	int retval;

	airprime_device.num_ports =
		(endpoints > 0 && endpoints <= MAX_BULK_EPS) ? endpoints : NUM_BULK_EPS;
	retval = usb_serial_register(&airprime_device);
	if (retval)
		return retval;
	retval = usb_register(&airprime_driver);
	if (retval)
		usb_serial_deregister(&airprime_device);
	return retval;
}
Пример #15
0
static int __init qcinit(void)
{
	int retval;

	retval = usb_serial_register(&qcdevice);
	if (retval)
		return retval;

	retval = usb_register(&qcdriver);
	if (retval) {
		usb_serial_deregister(&qcdevice);
		return retval;
	}

	return 0;
}
Пример #16
0
static int __init aircable_init (void)
{
	int retval;
	retval = usb_serial_register(&aircable_device);
	if (retval)
		goto failed_serial_register;
	retval = usb_register(&aircable_driver);
	if (retval)
		goto failed_usb_register;
	return 0;

failed_serial_register:
	usb_serial_deregister(&aircable_device);
failed_usb_register:
	return retval;
}
Пример #17
0
static int __init escvp_init(void)
{
  int ret;
  ret = usb_serial_register(&escvp_device);
  if (ret) {
    printk(KERN_ERR "escvp: registeration failed\n");
    return ret;
  }
  ret = usb_register(&escvp_driver);
  if (ret) {
    usb_serial_deregister(&escvp_device);
    printk(KERN_ERR "escvp: registeration failed\n");
    return ret;
  };
  return 0;
}
Пример #18
0
static int __init mct_u232_init (void)
{
	int retval;
	retval = usb_serial_register(&mct_u232_device);
	if (retval)
		goto failed_usb_serial_register;
	retval = usb_register(&mct_u232_driver);
	if (retval)
		goto failed_usb_register;
	info(DRIVER_DESC " " DRIVER_VERSION);
	return 0;
failed_usb_register:
	usb_serial_deregister(&mct_u232_device);
failed_usb_serial_register:
	return retval;
}
Пример #19
0
static int __init omninet_init (void)
{
	int retval;
	retval = usb_serial_register(&zyxel_omninet_device);
	if (retval)
		goto failed_usb_serial_register;
	retval = usb_register(&omninet_driver);
	if (retval)
		goto failed_usb_register;
	info(DRIVER_VERSION ":" DRIVER_DESC);
	return 0;
failed_usb_register:
	usb_serial_deregister(&zyxel_omninet_device);
failed_usb_serial_register:
	return retval;
}
Пример #20
0
static int __init usb_ipw_init(void)
{
	int retval;

	retval = usb_serial_register(&ipw_device);
	if (retval)
		return retval;
	retval = usb_register(&usb_ipw_driver);
	if (retval) {
		usb_serial_deregister(&ipw_device);
		return retval;
	}
	printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
	       DRIVER_DESC "\n");
	return 0;
}
Пример #21
0
static int __init belkin_sa_init(void)
{
	int retval;
	retval = usb_serial_register(&belkin_device);
	if (retval)
		goto failed_usb_serial_register;
	retval = usb_register(&belkin_driver);
	if (retval)
		goto failed_usb_register;
//	printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
;
	return 0;
failed_usb_register:
	usb_serial_deregister(&belkin_device);
failed_usb_serial_register:
	return retval;
}
Пример #22
0
static int __init mct_u232_init(void)
{
	int retval;
	retval = usb_serial_register(&mct_u232_device);
	if (retval)
		goto failed_usb_serial_register;
	retval = usb_register(&mct_u232_driver);
	if (retval)
		goto failed_usb_register;
	printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
	       DRIVER_DESC "\n");
	return 0;
failed_usb_register:
	usb_serial_deregister(&mct_u232_device);
failed_usb_serial_register:
	return retval;
}
Пример #23
0
static int __init empeg_init(void)
{
    struct urb *urb;
    int i, retval;

    /* create our write urb pool and transfer buffers */
    spin_lock_init(&write_urb_pool_lock);
    for (i = 0; i < NUM_URBS; ++i) {
        urb = usb_alloc_urb(0, GFP_KERNEL);
        write_urb_pool[i] = urb;
        if (urb == NULL) {
            printk(KERN_ERR "empeg: No more urbs???\n");
            continue;
        }

        urb->transfer_buffer = kmalloc(URB_TRANSFER_BUFFER_SIZE,
                                       GFP_KERNEL);
        if (!urb->transfer_buffer) {
            printk(KERN_ERR "empeg: %s - out of memory for urb "
                   "buffers.", __func__);
            continue;
        }
    }

    retval = usb_serial_register(&empeg_device);
    if (retval)
        goto failed_usb_serial_register;
    retval = usb_register(&empeg_driver);
    if (retval)
        goto failed_usb_register;

    printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
           DRIVER_DESC "\n");

    return 0;
failed_usb_register:
    usb_serial_deregister(&empeg_device);
failed_usb_serial_register:
    for (i = 0; i < NUM_URBS; ++i) {
        if (write_urb_pool[i]) {
            kfree(write_urb_pool[i]->transfer_buffer);
            usb_free_urb(write_urb_pool[i]);
        }
    }
    return retval;
}
Пример #24
0
static int __init siemens_usb_mpi_init(void)
{
	int retval;

	retval = usb_serial_register(&siemens_usb_mpi_device);
	if (retval)
		goto failed_usb_serial_register;
	retval = usb_register(&siemens_usb_mpi_driver);
	if (retval)
		goto failed_usb_register;
	printk(KERN_INFO DRIVER_DESC "\n");
	printk(KERN_INFO DRIVER_VERSION " " DRIVER_AUTHOR "\n");
	return retval;
failed_usb_register:
	usb_serial_deregister(&siemens_usb_mpi_device);
failed_usb_serial_register:
	return retval;
}
Пример #25
0
static int __init qcinit(void)
{
	int retval;

	printk(KERN_INFO "qcserial: loaded");

	retval = usb_serial_register(&qcdevice);
	if (retval)
		return retval;

	retval = usb_register(&qcdriver);
	if (retval) {
		usb_serial_deregister(&qcdevice);
		return retval;
	}

	return 0;
}
Пример #26
0
static int __init cyberjack_init (void)
{
	int retval;
	retval  = usb_serial_register(&cyberjack_device);
	if (retval)
		goto failed_usb_serial_register;
	retval = usb_register(&cyberjack_driver);
	if (retval) 
		goto failed_usb_register;

	info(DRIVER_VERSION " " DRIVER_AUTHOR);
	info(DRIVER_DESC);

	return 0;
failed_usb_register:
	usb_serial_deregister(&cyberjack_device);
failed_usb_serial_register:
	return retval;
}
Пример #27
0
static int __init cp2101_init (void)
{
	int retval;

	retval = usb_serial_register(&cp2101_device);
	if (retval)
		return retval; /* Failed to register */

	retval = usb_register(&cp2101_driver);
	if (retval) {
		/* Failed to register */
		usb_serial_deregister(&cp2101_device);
		return retval;
	}

	/* Success */
	info(DRIVER_DESC " " DRIVER_VERSION);
	return 0;
}
Пример #28
0
static int __init cp210x_init(void)
{
	int retval;

	retval = usb_serial_register(&cp210x_device);
	if (retval)
		return retval; /* Failed to register */

	retval = usb_register(&cp210x_driver);
	if (retval) {
		/* Failed to register */
		usb_serial_deregister(&cp210x_device);
		return retval;
	}

	/* Success */
	printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
	       DRIVER_DESC "\n");
	return 0;
}
Пример #29
0
int usb_serial_generic_register (int _debug)
{
	int retval = 0;

	debug = _debug;
#ifdef CONFIG_USB_SERIAL_GENERIC
	generic_device_ids[0].idVendor = vendor;
	generic_device_ids[0].idProduct = product;
	generic_device_ids[0].match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT;

	/* register our generic driver with ourselves */
	retval = usb_serial_register (&usb_serial_generic_device);
	if (retval)
		goto exit;
	retval = usb_register(&generic_driver);
	if (retval)
		usb_serial_deregister(&usb_serial_generic_device);
exit:
#endif
	return retval;
}
Пример #30
0
static int __init ipaq_init(void)
{
    int retval;
    retval = usb_serial_register(&ipaq_device);
    if (retval)
        goto failed_usb_serial_register;
    if (vendor) {
        ipaq_id_table[0].idVendor = vendor;
        ipaq_id_table[0].idProduct = product;
    }
    retval = usb_register(&ipaq_driver);
    if (retval)
        goto failed_usb_register;

//	printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
    ;
    return 0;
failed_usb_register:
    usb_serial_deregister(&ipaq_device);
failed_usb_serial_register:
    return retval;
}