Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *  xusbatm.c -	dumb usbatm-based driver for modems initialized in userspace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *  Copyright (C) 2005 Duncan Sands, Roman Kagan (rkagan % mail ! ru)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include <linux/etherdevice.h>		/* for eth_random_addr() */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include "usbatm.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #define XUSBATM_DRIVERS_MAX	8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) #define XUSBATM_PARM(name, type, parmtype, desc) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 	static type name[XUSBATM_DRIVERS_MAX]; \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 	static unsigned int num_##name; \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 	module_param_array(name, parmtype, &num_##name, 0444); \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 	MODULE_PARM_DESC(name, desc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) XUSBATM_PARM(vendor, unsigned short, ushort, "USB device vendor");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) XUSBATM_PARM(product, unsigned short, ushort, "USB device product");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) XUSBATM_PARM(rx_endpoint, unsigned char, byte, "rx endpoint number");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) XUSBATM_PARM(tx_endpoint, unsigned char, byte, "tx endpoint number");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) XUSBATM_PARM(rx_padding, unsigned char, byte, "rx padding (default 0)");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) XUSBATM_PARM(tx_padding, unsigned char, byte, "tx padding (default 0)");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) XUSBATM_PARM(rx_altsetting, unsigned char, byte, "rx altsetting (default 0)");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) XUSBATM_PARM(tx_altsetting, unsigned char, byte, "rx altsetting (default 0)");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) static const char xusbatm_driver_name[] = "xusbatm";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) static struct usbatm_driver xusbatm_drivers[XUSBATM_DRIVERS_MAX];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) static struct usb_device_id xusbatm_usb_ids[XUSBATM_DRIVERS_MAX + 1];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) static struct usb_driver xusbatm_usb_driver;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) static struct usb_interface *xusbatm_find_intf(struct usb_device *usb_dev, int altsetting, u8 ep)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	struct usb_host_interface *alt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 	struct usb_interface *intf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	int i, j;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	for (i = 0; i < usb_dev->actconfig->desc.bNumInterfaces; i++)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 		if ((intf = usb_dev->actconfig->interface[i]) && (alt = usb_altnum_to_altsetting(intf, altsetting)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 			for (j = 0; j < alt->desc.bNumEndpoints; j++)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 				if (alt->endpoint[j].desc.bEndpointAddress == ep)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 					return intf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) static int xusbatm_capture_intf(struct usbatm_data *usbatm, struct usb_device *usb_dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 		struct usb_interface *intf, int altsetting, int claim)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	int ifnum = intf->altsetting->desc.bInterfaceNumber;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 	if (claim && (ret = usb_driver_claim_interface(&xusbatm_usb_driver, intf, usbatm))) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 		usb_err(usbatm, "%s: failed to claim interface %2d (%d)!\n", __func__, ifnum, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 		return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	ret = usb_set_interface(usb_dev, ifnum, altsetting);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	if (ret) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 		usb_err(usbatm, "%s: altsetting %2d for interface %2d failed (%d)!\n", __func__, altsetting, ifnum, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 		return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) static void xusbatm_release_intf(struct usb_device *usb_dev, struct usb_interface *intf, int claimed)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	if (claimed) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 		usb_set_intfdata(intf, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 		usb_driver_release_interface(&xusbatm_usb_driver, intf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) static int xusbatm_bind(struct usbatm_data *usbatm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 			struct usb_interface *intf, const struct usb_device_id *id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	struct usb_device *usb_dev = interface_to_usbdev(intf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	int drv_ix = id - xusbatm_usb_ids;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	int rx_alt = rx_altsetting[drv_ix];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	int tx_alt = tx_altsetting[drv_ix];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	struct usb_interface *rx_intf = xusbatm_find_intf(usb_dev, rx_alt, rx_endpoint[drv_ix]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	struct usb_interface *tx_intf = xusbatm_find_intf(usb_dev, tx_alt, tx_endpoint[drv_ix]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	usb_dbg(usbatm, "%s: binding driver %d: vendor %04x product %04x"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 		" rx: ep %02x padd %d alt %2d tx: ep %02x padd %d alt %2d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 		__func__, drv_ix, vendor[drv_ix], product[drv_ix],
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 		rx_endpoint[drv_ix], rx_padding[drv_ix], rx_alt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 		tx_endpoint[drv_ix], tx_padding[drv_ix], tx_alt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	if (!rx_intf || !tx_intf) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 		if (!rx_intf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 			usb_dbg(usbatm, "%s: no interface contains endpoint %02x in altsetting %2d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 				__func__, rx_endpoint[drv_ix], rx_alt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 		if (!tx_intf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 			usb_dbg(usbatm, "%s: no interface contains endpoint %02x in altsetting %2d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 				__func__, tx_endpoint[drv_ix], tx_alt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 		return -ENODEV;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	if ((rx_intf != intf) && (tx_intf != intf))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 		return -ENODEV;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	if ((rx_intf == tx_intf) && (rx_alt != tx_alt)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 		usb_err(usbatm, "%s: altsettings clash on interface %2d (%2d vs %2d)!\n", __func__,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 				rx_intf->altsetting->desc.bInterfaceNumber, rx_alt, tx_alt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	usb_dbg(usbatm, "%s: rx If#=%2d; tx If#=%2d\n", __func__,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 			rx_intf->altsetting->desc.bInterfaceNumber,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 			tx_intf->altsetting->desc.bInterfaceNumber);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	ret = xusbatm_capture_intf(usbatm, usb_dev, rx_intf, rx_alt, rx_intf != intf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	if (ret)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 		return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	if ((tx_intf != rx_intf) && (ret = xusbatm_capture_intf(usbatm, usb_dev, tx_intf, tx_alt, tx_intf != intf))) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 		xusbatm_release_intf(usb_dev, rx_intf, rx_intf != intf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 		return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) static void xusbatm_unbind(struct usbatm_data *usbatm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 			   struct usb_interface *intf)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	struct usb_device *usb_dev = interface_to_usbdev(intf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	usb_dbg(usbatm, "%s entered\n", __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	for (i = 0; i < usb_dev->actconfig->desc.bNumInterfaces; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 		struct usb_interface *cur_intf = usb_dev->actconfig->interface[i];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 		if (cur_intf && (usb_get_intfdata(cur_intf) == usbatm)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 			usb_set_intfdata(cur_intf, NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 			usb_driver_release_interface(&xusbatm_usb_driver, cur_intf);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) static int xusbatm_atm_start(struct usbatm_data *usbatm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 			     struct atm_dev *atm_dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	atm_dbg(usbatm, "%s entered\n", __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	/* use random MAC as we've no way to get it from the device */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	eth_random_addr(atm_dev->esi);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) static int xusbatm_usb_probe(struct usb_interface *intf,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 			     const struct usb_device_id *id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	return usbatm_usb_probe(intf, id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 				xusbatm_drivers + (id - xusbatm_usb_ids));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) static struct usb_driver xusbatm_usb_driver = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	.name		= xusbatm_driver_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	.probe		= xusbatm_usb_probe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	.disconnect	= usbatm_usb_disconnect,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	.id_table	= xusbatm_usb_ids
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) static int __init xusbatm_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	if (!num_vendor ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	    num_vendor != num_product ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	    num_vendor != num_rx_endpoint ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	    num_vendor != num_tx_endpoint) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 		printk(KERN_WARNING "xusbatm: malformed module parameters\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	for (i = 0; i < num_vendor; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 		rx_endpoint[i] |= USB_DIR_IN;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 		tx_endpoint[i] &= USB_ENDPOINT_NUMBER_MASK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 		xusbatm_usb_ids[i].match_flags	= USB_DEVICE_ID_MATCH_DEVICE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 		xusbatm_usb_ids[i].idVendor	= vendor[i];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 		xusbatm_usb_ids[i].idProduct	= product[i];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 		xusbatm_drivers[i].driver_name	= xusbatm_driver_name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 		xusbatm_drivers[i].bind		= xusbatm_bind;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 		xusbatm_drivers[i].unbind	= xusbatm_unbind;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 		xusbatm_drivers[i].atm_start	= xusbatm_atm_start;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 		xusbatm_drivers[i].bulk_in	= rx_endpoint[i];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 		xusbatm_drivers[i].bulk_out	= tx_endpoint[i];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 		xusbatm_drivers[i].rx_padding	= rx_padding[i];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 		xusbatm_drivers[i].tx_padding	= tx_padding[i];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	return usb_register(&xusbatm_usb_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) module_init(xusbatm_init);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) static void __exit xusbatm_exit(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	usb_deregister(&xusbatm_usb_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) module_exit(xusbatm_exit);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) MODULE_AUTHOR("Roman Kagan, Duncan Sands");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) MODULE_DESCRIPTION("Driver for USB ADSL modems initialized in userspace");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) MODULE_LICENSE("GPL");