From 32aab82be9e4b437edb27910847d80e5a7ef00c4 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Thu, 12 Jul 2007 17:25:20 -0500 Subject: [PATCH] Fix multiple warnings, and cmdir link error. Also, disable lirc_gpio. It is broken atm for kernel 2.6.22. Waiting for upstream to fix it. Re-enable building of the modules that work. --- debian/changelog | 6 + debian/config/0list | 2 +- debian/config/amd64 | 4 +- debian/config/hppa | 4 +- debian/config/i386 | 4 +- debian/config/ia64 | 4 +- debian/config/powerpc | 4 +- debian/config/sparc | 4 +- ubuntu/media/lirc/Makefile | 2 +- ubuntu/media/lirc/lirc_bt829/lirc_bt829.c | 2 +- ubuntu/media/lirc/lirc_cmdir/commandir.c | 1513 +++++++++++++++++++++++++++ ubuntu/media/lirc/lirc_cmdir/commandir.h | 40 + ubuntu/media/lirc/lirc_cmdir/lirc_cmdir.c | 2 - ubuntu/media/lirc/lirc_gpio/lirc_gpio.c | 5 - ubuntu/media/lirc/lirc_it87/lirc_it87.c | 6 - ubuntu/media/lirc/lirc_pvr150/Makefile.am | 13 - ubuntu/media/lirc/lirc_pvr150/Makefile.in | 526 ---------- ubuntu/media/lirc/lirc_serial/lirc_serial.c | 9 - 18 files changed, 1574 insertions(+), 576 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1f93e29..2d4a2de 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,12 @@ linux-ubuntu-modules-2.6.22 (2.6.22-8.18) gutsy; urgency=low * lirc: Fix build failure, but disable anyway. Modules are missing syms + [Mario Limonciello] + + * Add additional commandir source to fix missing sym. + * Cleanup warnings for lirc it87, serial, commandir, cmdir. + * Re-enable lirc-dev, but disable lirc-gpio. + -- Ben Collins Thu, 12 Jul 2007 15:19:56 +0100 linux-ubuntu-modules-2.6.22 (2.6.22-8.17) gutsy; urgency=low diff --git a/debian/config/0list b/debian/config/0list index dea8699..601539a 100644 --- a/debian/config/0list +++ b/debian/config/0list @@ -63,7 +63,7 @@ CONFIG_LIRC_DEV=m CONFIG_LIRC_ATIUSB=m CONFIG_LIRC_BT829=m CONFIG_LIRC_CMDIR=m -CONFIG_LIRC_GPIO=m +#CONFIG_LIRC_GPIO=m CONFIG_LIRC_I2C=m CONFIG_LIRC_IGORPLUGUSB=m CONFIG_LIRC_IMON=m diff --git a/debian/config/amd64 b/debian/config/amd64 index b4162c0..c8aaa61 100644 --- a/debian/config/amd64 +++ b/debian/config/amd64 @@ -59,11 +59,11 @@ CONFIG_RT73USB=m CONFIG_IPW2100_FS_AMILO_M7400=m -#CONFIG_LIRC_DEV=m +CONFIG_LIRC_DEV=m CONFIG_LIRC_ATIUSB=m CONFIG_LIRC_BT829=m CONFIG_LIRC_CMDIR=m -CONFIG_LIRC_GPIO=m +#CONFIG_LIRC_GPIO=m CONFIG_LIRC_I2C=m CONFIG_LIRC_IGORPLUGUSB=m CONFIG_LIRC_IMON=m diff --git a/debian/config/hppa b/debian/config/hppa index ca00f0e..de3e355 100644 --- a/debian/config/hppa +++ b/debian/config/hppa @@ -57,11 +57,11 @@ CONFIG_RT73USB=m #CONFIG_IPW2100_FS_AMILO_M7400=m -#CONFIG_LIRC_DEV=m +CONFIG_LIRC_DEV=m CONFIG_LIRC_ATIUSB=m CONFIG_LIRC_BT829=m CONFIG_LIRC_CMDIR=m -CONFIG_LIRC_GPIO=m +#CONFIG_LIRC_GPIO=m CONFIG_LIRC_I2C=m CONFIG_LIRC_IGORPLUGUSB=m CONFIG_LIRC_IMON=m diff --git a/debian/config/i386 b/debian/config/i386 index 3cdaed5..44fab35 100644 --- a/debian/config/i386 +++ b/debian/config/i386 @@ -59,11 +59,11 @@ CONFIG_RT73USB=m CONFIG_IPW2100_FS_AMILO_M7400=m -#CONFIG_LIRC_DEV=m +CONFIG_LIRC_DEV=m CONFIG_LIRC_ATIUSB=m CONFIG_LIRC_BT829=m CONFIG_LIRC_CMDIR=m -CONFIG_LIRC_GPIO=m +#CONFIG_LIRC_GPIO=m CONFIG_LIRC_I2C=m CONFIG_LIRC_IGORPLUGUSB=m CONFIG_LIRC_IMON=m diff --git a/debian/config/ia64 b/debian/config/ia64 index ca00f0e..de3e355 100644 --- a/debian/config/ia64 +++ b/debian/config/ia64 @@ -57,11 +57,11 @@ CONFIG_RT73USB=m #CONFIG_IPW2100_FS_AMILO_M7400=m -#CONFIG_LIRC_DEV=m +CONFIG_LIRC_DEV=m CONFIG_LIRC_ATIUSB=m CONFIG_LIRC_BT829=m CONFIG_LIRC_CMDIR=m -CONFIG_LIRC_GPIO=m +#CONFIG_LIRC_GPIO=m CONFIG_LIRC_I2C=m CONFIG_LIRC_IGORPLUGUSB=m CONFIG_LIRC_IMON=m diff --git a/debian/config/powerpc b/debian/config/powerpc index 62caa2a..ce239db 100644 --- a/debian/config/powerpc +++ b/debian/config/powerpc @@ -58,11 +58,11 @@ CONFIG_RT73USB=m #CONFIG_IPW2100_FS_AMILO_M7400=m -#CONFIG_LIRC_DEV=m +CONFIG_LIRC_DEV=m CONFIG_LIRC_ATIUSB=m CONFIG_LIRC_BT829=m CONFIG_LIRC_CMDIR=m -CONFIG_LIRC_GPIO=m +#CONFIG_LIRC_GPIO=m CONFIG_LIRC_I2C=m CONFIG_LIRC_IGORPLUGUSB=m CONFIG_LIRC_IMON=m diff --git a/debian/config/sparc b/debian/config/sparc index ca00f0e..de3e355 100644 --- a/debian/config/sparc +++ b/debian/config/sparc @@ -57,11 +57,11 @@ CONFIG_RT73USB=m #CONFIG_IPW2100_FS_AMILO_M7400=m -#CONFIG_LIRC_DEV=m +CONFIG_LIRC_DEV=m CONFIG_LIRC_ATIUSB=m CONFIG_LIRC_BT829=m CONFIG_LIRC_CMDIR=m -CONFIG_LIRC_GPIO=m +#CONFIG_LIRC_GPIO=m CONFIG_LIRC_I2C=m CONFIG_LIRC_IGORPLUGUSB=m CONFIG_LIRC_IMON=m diff --git a/ubuntu/media/lirc/Makefile b/ubuntu/media/lirc/Makefile index d4cb2a6..1ac8ab4 100644 --- a/ubuntu/media/lirc/Makefile +++ b/ubuntu/media/lirc/Makefile @@ -5,7 +5,7 @@ EXTRA_CFLAGS =-DIRCTL_DEV_MAJOR=61 -DLIRC_SERIAL_TRANSMITTER -I$(src) obj-$(CONFIG_LIRC_DEV) += lirc_dev/lirc_dev.o obj-$(CONFIG_LIRC_ATIUSB) += lirc_atiusb/lirc_atiusb.o obj-$(CONFIG_LIRC_BT829) += lirc_bt829/lirc_bt829.o -obj-$(CONFIG_LIRC_CMDIR) += lirc_cmdir/lirc_cmdir.o +obj-$(CONFIG_LIRC_CMDIR) += lirc_cmdir/lirc_cmdir.o lirc_cmdir/commandir.o obj-$(CONFIG_LIRC_I2C) += lirc_i2c/lirc_i2c.o obj-$(CONFIG_LIRC_IGORPLUGUSB) += lirc_igorplugusb/lirc_igorplugusb.o obj-$(CONFIG_LIRC_IMON) += lirc_imon/lirc_imon.o diff --git a/ubuntu/media/lirc/lirc_bt829/lirc_bt829.c b/ubuntu/media/lirc/lirc_bt829/lirc_bt829.c index e924ce6..f9e8006 100644 --- a/ubuntu/media/lirc/lirc_bt829/lirc_bt829.c +++ b/ubuntu/media/lirc/lirc_bt829/lirc_bt829.c @@ -79,7 +79,7 @@ static struct pci_dev *do_pci_probe(void) printk(KERN_ERR "ATIR: no pci in this kernel\n"); } #endif - my_dev = (struct pci_dev *)pci_find_device(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_264VT,NULL); + my_dev = (struct pci_dev *)pci_get_device(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_264VT,NULL); if ( my_dev ) { printk(KERN_ERR "ATIR: Using device: %s\n", pci_name(my_dev)); diff --git a/ubuntu/media/lirc/lirc_cmdir/commandir.c b/ubuntu/media/lirc/lirc_cmdir/commandir.c new file mode 100644 index 0000000..3accf6e --- /dev/null +++ b/ubuntu/media/lirc/lirc_cmdir/commandir.c @@ -0,0 +1,1513 @@ + +/* + * + * Hardware Driver for COMMANDIR USB Transceiver + * 2005-2007 InnovationOne - Matt Bodkin, Evelyn Yeung + * + * Version 1.4.2 + * For 2.4.* or 2.6.* kernel versions + * Based on the USB Skeleton driver, versions 0.7 and 2.0 + * + */ + +#include +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18) +#include +#else +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include "commandir.h" + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) +#include +#include +#include +#include +#include +#include +#include +#else +#include +#include +#endif + +#define DRIVER_VERSION "v1.1.2" +#define DRIVER_AUTHOR "Evelyn Yeung, InnovationOne" +#define DRIVER_DESC "CommandIR USB Transceiver Driver" + +#define USB_CMDIR_VENDOR_ID 0x10c4 +#define USB_CMDIR_PRODUCT_ID 0x0003 +#define USB_CMDIR_MINOR_BASE 192 + +/* table of devices that work with this driver */ +static struct usb_device_id cmdir_table [] = +{ + { USB_DEVICE(USB_CMDIR_VENDOR_ID, USB_CMDIR_PRODUCT_ID) }, + { } /* Terminating entry */ +}; +MODULE_DEVICE_TABLE (usb, cmdir_table); + +static int cmdir_open (struct inode *inode, struct file *file); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) +static void * cmdir_probe (struct usb_device *dev,unsigned int ifnum,const struct usb_device_id *id); +static int cmdir_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); +static void cmdir_disconnect (struct usb_device *dev, void *ptr); +#else +static int cmdir_probe(struct usb_interface *interface, const struct usb_device_id *id); +static void cmdir_disconnect(struct usb_interface *interface); +#endif +static int cmdir_release (struct inode *inode, struct file *file); +static int cmdir_check (int device_num); +static void init_cmdir_var (int device_num); +static void reset_cmdir (int device_num); +static void update_cmdir_string (int device_num); +static void print_cmdir (int device_num); +static ssize_t cmdir_file_read (struct file *file, char *buffer, size_t count, loff_t *ppos); +ssize_t cmdir_read (unsigned char *buffer, size_t count); +static ssize_t cmdir_file_write (struct file *file, const char *buffer, size_t count, loff_t *ppos); +int cmdir_write(unsigned char *buffer, int count, void *callback_fct, int u); +int write_core(unsigned char *buffer, int count, void *callback_fct, int device_num); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) +static void cmdir_write_bulk_callback (struct urb *urb); +#else +static void cmdir_write_bulk_callback(struct urb *urb, struct pt_regs *regs); +#endif +int set_tx_channels (unsigned int next_tx); + +int add_cmdir_queue(unsigned char *buffer, int count, void *callback_vct, int usecdelay); +int cmdir_write_queue(unsigned char *buffer, int count, void *callback_vct); +int send_queue(void); +int wait_to_tx(int usecs); + +// circular packet queue +unsigned char ourbuffers[QUEUELENGTH][64]; +int waitusecs[QUEUELENGTH]; +int ourbufferlengths[QUEUELENGTH]; +int nexttosend = 0; +int nexttofill = 0; +int send_status = SEND_IDLE; +int last_tx_sec = 0; +int last_tx_usec = 0; + +static int curTXFill = 0; +struct timeval tp; + +int debug_commandir=0; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) + +/* Structure to hold all of our device specific stuff */ +struct usb_skel +{ + struct usb_device * udev; /* save off the usb device pointer */ + struct usb_interface * interface; /* the interface for this device */ + devfs_handle_t devfs; /* devfs device node */ + unsigned char minor; /* the starting minor number */ + unsigned char num_ports; /* the number of ports this device has */ + char num_interrupt_in; /* number of interrupt in endpoints */ + char num_bulk_in; /* number of bulk in endpoints */ + char num_bulk_out; /* number of bulk out endpoints */ + + unsigned char * bulk_in_buffer; /* the buffer to receive data */ + int bulk_in_size; /* the size of the receive buffer */ + __u8 bulk_in_endpointAddr; /* the address of the bulk in endpoint */ + + unsigned char * bulk_out_buffer; /* the buffer to send data */ + int bulk_out_size; /* the size of the send buffer */ + struct urb * write_urb; /* the urb used to send data */ + __u8 bulk_out_endpointAddr; /* the address of the bulk out endpoint */ + + struct tq_struct tqueue; /* task queue for line discipline waking up */ + int open_count; /* number of times this port has been opened */ + struct semaphore sem; /* locks this structure */ +}; + +extern devfs_handle_t usb_devfs_handle; /* the global usb devfs handle */ + +/* array of pointers to our devices that are currently connected */ +static struct usb_skel *minor_table[MAX_DEVICES]; +static DECLARE_MUTEX (minor_table_mutex); /* lock to protect the minor_table structure */ + +static struct file_operations cmdir_fops = +{ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16) + owner: THIS_MODULE, +#endif + read: cmdir_file_read, + write: cmdir_file_write, + ioctl: cmdir_ioctl, + open: cmdir_open, + release: cmdir_release, +}; + +/* usb specific object needed to register this driver with the usb subsystem */ +static struct usb_driver cmdir_driver = +{ + name: "commandir", + probe: cmdir_probe, + disconnect: cmdir_disconnect, + fops: &cmdir_fops, + minor: USB_CMDIR_MINOR_BASE, + id_table: cmdir_table, +}; + +#else + +/* Structure to hold all of our device specific stuff */ +struct usb_skel +{ + struct usb_device * udev; /* the usb device for this device */ + struct usb_interface * interface; /* the interface for this device */ + unsigned char * bulk_in_buffer; /* the buffer to receive data */ + size_t bulk_in_size; /* the size of the receive buffer */ + __u8 bulk_in_endpointAddr; /* the address of the bulk in endpoint */ + __u8 bulk_out_endpointAddr; /* the address of the bulk out endpoint */ + struct kref kref; +}; +#define to_skel_dev(d) container_of(d, struct usb_skel, kref) + +static struct file_operations cmdir_fops = +{ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16) + .owner = THIS_MODULE, +#endif + .read = cmdir_file_read, + .write = cmdir_file_write, + .open = cmdir_open, + .release = cmdir_release, +}; + +/* usb class driver info in order to get a minor number from the usb core, + * and to have the device registered with devfs and the driver core */ +static struct usb_class_driver cmdir_class = +{ + .name = "usb/commandir%d", + .fops = &cmdir_fops, + //.mode = S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH, + .minor_base = USB_CMDIR_MINOR_BASE, +}; + +static struct usb_driver cmdir_driver = +{ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16) + .owner = THIS_MODULE, +#endif + .name = "commandir", + .probe = cmdir_probe, + .disconnect = cmdir_disconnect, + .id_table = cmdir_table, +}; + +#endif + +static int lcd_device=0; +static int rx_device=0; +static int def_device=0; + +#define DEFAULT_TRANSMITTERS 0x0F +static unsigned int transmitters=DEFAULT_TRANSMITTERS; +static unsigned int next_transmitters=DEFAULT_TRANSMITTERS; + +#define CMDIR_VAR_LEN 68 +static char cmdir_var[] = +"COMMANDIRx:\n TX Enabled: 1, 2, 3, 4\n RX: commandirx\n LCD: commandirx"; + + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) +static inline void cmdir_delete (struct usb_skel *dev) +{ + minor_table[dev->minor] = NULL; + if (dev->bulk_in_buffer != NULL) + kfree (dev->bulk_in_buffer); + if (dev->bulk_out_buffer != NULL) + kfree (dev->bulk_out_buffer); + if (dev->write_urb != NULL) + usb_free_urb (dev->write_urb); + kfree (dev); +} +#else +static void cmdir_delete(struct kref *kref) +{ + struct usb_skel *dev = to_skel_dev(kref); + + usb_put_dev(dev->udev); + kfree (dev->bulk_in_buffer); + kfree (dev); +} +#endif + +static int __init usb_cmdir_init(void) +{ + int result; + + /* register this driver with the USB subsystem */ + result = usb_register(&cmdir_driver); + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) + if (result < 0) + { + err("usb_register failed for the "__FILE__" driver. Error number %d", + result); + return -1; + } + + info(DRIVER_DESC " " DRIVER_VERSION); + + return 0; +#else + if (result) + err("usb_register failed. Error number %d", result); + + return result; +#endif +} + +static int cmdir_open (struct inode *inode, struct file *file) +{ + struct usb_skel *dev; +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 0) + struct usb_interface *interface; +#endif + int subminor; + int retval = 0; + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) + subminor = MINOR (inode->i_rdev) - USB_CMDIR_MINOR_BASE; + if ((subminor < 0) || (subminor >= MAX_DEVICES)) + { + return -ENODEV; + } + MOD_INC_USE_COUNT; + + /* lock our minor table and get our local data for this minor */ + down (&minor_table_mutex); + dev = minor_table[subminor]; + if (dev == NULL) + { + up (&minor_table_mutex); + MOD_DEC_USE_COUNT; + return -ENODEV; + } + + down (&dev->sem); /* lock this device */ + up (&minor_table_mutex); /* unlock the minor table */ + ++dev->open_count; /* increment our usage count for the driver */ + file->private_data = dev; /* save our object in the file's private structure */ + up (&dev->sem); /* unlock this device */ + + return retval; +#else + subminor = iminor(inode); + interface = usb_find_interface(&cmdir_driver, subminor); + if (!interface) + { + err ("%s - error, can't find device for minor %d", + __FUNCTION__, subminor); + retval = -ENODEV; + goto exit; + } + + dev = usb_get_intfdata(interface); + if (!dev) + { + retval = -ENODEV; + goto exit; + } + + kref_get(&dev->kref); /* increment our usage count for the device */ + file->private_data = dev; /* save our object in the file's private structure */ + +exit: + return retval; +#endif +} + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) +static void * cmdir_probe(struct usb_device *udev,unsigned int ifnum,const struct usb_device_id *id) +{ + struct usb_skel *dev = NULL; + struct usb_interface *interface; + struct usb_interface_descriptor *iface_desc; + struct usb_endpoint_descriptor *endpoint; + int minor; + int buffer_size; + int i; + char name[10]; + + /* See if the device offered us matches what we can accept */ + if ((udev->descriptor.idVendor != USB_CMDIR_VENDOR_ID) || + (udev->descriptor.idProduct != USB_CMDIR_PRODUCT_ID)) + { + return NULL; + } + + /* select a "subminor" number (part of a minor number) */ + down (&minor_table_mutex); + for (minor = 0; minor < MAX_DEVICES; ++minor) + { + if (minor_table[minor] == NULL) + break; + } + if (minor >= MAX_DEVICES) + { + info ("Too many devices plugged in, cannot handle this device."); + goto exit; + } + + /* allocate memory for our device state and intialize it */ + dev = kmalloc (sizeof(struct usb_skel), GFP_KERNEL); + if (dev == NULL) + { + err ("Out of memory"); + goto exit; + } + memset (dev, 0x00, sizeof (*dev)); + minor_table[minor] = dev; + + interface = &udev->actconfig->interface[ifnum]; + + init_MUTEX (&dev->sem); + dev->udev = udev; + dev->interface = interface; + dev->minor = minor; + + /* set up and check the endpoint information */ + iface_desc = &interface->altsetting[0]; + for (i = 0; i < iface_desc->bNumEndpoints; ++i) + { + endpoint = &iface_desc->endpoint[i]; + + if ((endpoint->bEndpointAddress & 0x80) && + ((endpoint->bmAttributes & 3) == 0x02)) + { + /* we found a bulk in endpoint */ + buffer_size = endpoint->wMaxPacketSize; + dev->bulk_in_size = buffer_size; + dev->bulk_in_endpointAddr = endpoint->bEndpointAddress; + dev->bulk_in_buffer = kmalloc (buffer_size, GFP_KERNEL); + if (!dev->bulk_in_buffer) + { + err("Couldn't allocate bulk_in_buffer"); + goto error; + } + } + + if (((endpoint->bEndpointAddress & 0x80) == 0x00) && + ((endpoint->bmAttributes & 3) == 0x02)) + { + /* we found a bulk out endpoint */ + dev->write_urb = usb_alloc_urb(0); + if (!dev->write_urb) + { + err("No free urbs available"); + goto error; + } + buffer_size = endpoint->wMaxPacketSize; + dev->bulk_out_size = buffer_size; + dev->bulk_out_endpointAddr = endpoint->bEndpointAddress; + dev->bulk_out_buffer = kmalloc (buffer_size, GFP_KERNEL); + if (!dev->bulk_out_buffer) + { + err("Couldn't allocate bulk_out_buffer"); + goto error; + } + FILL_BULK_URB(dev->write_urb, udev, + usb_sndbulkpipe(udev, + endpoint->bEndpointAddress), + dev->bulk_out_buffer, buffer_size, + cmdir_write_bulk_callback, dev); + } + } + + /* initialize the devfs node for this device and register it */ + sprintf(name, "commandir%d", dev->minor); + + dev->devfs = devfs_register (usb_devfs_handle, name, + DEVFS_FL_DEFAULT, USB_MAJOR, + USB_CMDIR_MINOR_BASE + dev->minor, + S_IFCHR | S_IRUSR | S_IWUSR | + S_IRGRP | S_IWGRP | S_IROTH, + &cmdir_fops, NULL); + + /* let the user know what node this device is now attached to */ + info ("CommandIR USB device now attached to commandir%d", dev->minor); + + /* should reset just the one that was plugged in */ + reset_cmdir(minor); + + goto exit; + +error: + cmdir_delete (dev); + dev = NULL; + +exit: + up (&minor_table_mutex); + return dev; +} +#else +static int cmdir_probe(struct usb_interface *interface, const struct usb_device_id *id) +{ + struct usb_skel *dev = NULL; + struct usb_host_interface *iface_desc; + struct usb_endpoint_descriptor *endpoint; + size_t buffer_size; + + int i; + int retval = -ENOMEM; + int minor; + + /* allocate memory for our device state and initialize it */ + dev = kmalloc(sizeof(*dev), GFP_KERNEL); + if (dev == NULL) + { + err("Out of memory"); + goto error; + } + memset(dev, 0x00, sizeof(*dev)); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 9) + kref_init(&dev->kref, cmdir_delete); +#else + kref_init(&dev->kref); +#endif + dev->udev = usb_get_dev(interface_to_usbdev(interface)); + dev->interface = interface; + + /* set up the endpoint information */ + /* use only the first bulk-in and bulk-out endpoints */ + iface_desc = interface->cur_altsetting; + for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) + { + endpoint = &iface_desc->endpoint[i].desc; + + if (!dev->bulk_in_endpointAddr && + (endpoint->bEndpointAddress & USB_DIR_IN) && + ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) + == USB_ENDPOINT_XFER_BULK)) + { + /* we found a bulk in endpoint */ + buffer_size = endpoint->wMaxPacketSize; + dev->bulk_in_size = buffer_size; + dev->bulk_in_endpointAddr = endpoint->bEndpointAddress; + dev->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL); + if (!dev->bulk_in_buffer) + { + err("Could not allocate bulk_in_buffer"); + goto error; + } + } + + if (!dev->bulk_out_endpointAddr && + !(endpoint->bEndpointAddress & USB_DIR_IN) && + ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) + == USB_ENDPOINT_XFER_BULK)) + { + /* we found a bulk out endpoint */ + dev->bulk_out_endpointAddr = endpoint->bEndpointAddress; + } + } + if (!(dev->bulk_in_endpointAddr && dev->bulk_out_endpointAddr)) + { + err("Could not find both bulk-in and bulk-out endpoints"); + goto error; + } + + /* save our data pointer in this interface device */ + usb_set_intfdata(interface, dev); + + /* we can register the device now, as it is ready */ + retval = usb_register_dev(interface, &cmdir_class); + if (retval) + { + /* something prevented us from registering this driver */ + err("Not able to get a minor for this device."); + usb_set_intfdata(interface, NULL); + goto error; + } + + /* check whether minor already includes base */ + minor = interface->minor; + if (minor >= USB_CMDIR_MINOR_BASE) minor=minor-USB_CMDIR_MINOR_BASE; + + /* let the user know what node this device is now attached to */ + info("CommandIR USB device now attached to commandir%d", minor); + + reset_cmdir(minor); + + return 0; + +error: + if (dev) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 9) + kref_put(&dev->kref); +#else + kref_put(&dev->kref, cmdir_delete); +#endif + return retval; +} +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) +static int cmdir_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) +{ + struct usb_skel *dev; + + dev = (struct usb_skel *)file->private_data; + + /* lock this object */ + down (&dev->sem); + + /* verify that the device wasn't unplugged */ + if (dev->udev == NULL) + { + up (&dev->sem); + return -ENODEV; + } + + /* unlock the device */ + up (&dev->sem); + + /* return that we did not understand this ioctl call */ + return -ENOTTY; +} +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) +static void cmdir_disconnect(struct usb_device *udev, void *ptr) +{ + struct usb_skel *dev; + int minor; + + dev = (struct usb_skel *)ptr; + + down (&minor_table_mutex); + down (&dev->sem); + + minor = dev->minor; + + /* remove our devfs node */ + devfs_unregister(dev->devfs); + + /* if the device is not opened, then we clean up right now */ + if (!dev->open_count) + { + up (&dev->sem); + cmdir_delete (dev); + } else { + dev->udev = NULL; + up (&dev->sem); + } + + info("CommandIR #%d now disconnected", minor); + up (&minor_table_mutex); + + /* check if default RX device still exists */ + if (minor == rx_device) + { + /* decrement until find next valid device */ + while (rx_device > 0) + { + rx_device--; + if (cmdir_check(rx_device)==0) break; + } + if (minor > 0) info("Active Receiver is on CommandIR #%d", rx_device); + } + +} +#else +static void cmdir_disconnect(struct usb_interface *interface) +{ + struct usb_skel *dev; + int minor = interface->minor; + + /* prevent cmdir_open() from racing cmdir_disconnect() */ + lock_kernel(); + + dev = usb_get_intfdata(interface); + usb_set_intfdata(interface, NULL); + + /* give back our minor */ + usb_deregister_dev(interface, &cmdir_class); + + unlock_kernel(); + + /* decrement our usage count */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 9) + kref_put(&dev->kref); +#else + kref_put(&dev->kref, cmdir_delete); +#endif + + /* check whether minor already includes base */ + if (minor >= USB_CMDIR_MINOR_BASE) minor=minor-USB_CMDIR_MINOR_BASE; + + info("CommandIR #%d now disconnected", minor); + + /* check if default RX device still exists */ + if (minor == rx_device) + { + /* decrement until find next valid device */ + while (rx_device > 0) + { + rx_device--; + if (cmdir_check(rx_device)==0) break; + } + if (minor > 0) info("Active Receiver is on CommandIR #%d", rx_device); + } +} +#endif + +static int cmdir_release (struct inode *inode, struct file *file) +{ + struct usb_skel *dev; + int retval = 0; + + dev = (struct usb_skel *)file->private_data; + if (dev == NULL) + { + /*dbg(" - object is NULL");*/ + return -ENODEV; + } + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) + + /* lock our minor table */ + down (&minor_table_mutex); + + /* lock our device */ + down (&dev->sem); + + if (dev->open_count <= 0) + { + /*dbg(" - device not opened");*/ + retval = -ENODEV; + goto exit_not_opened; + } + + if (dev->udev == NULL) + { + /* the device was unplugged before the file was released */ + /*dbg (" - device unplugged before file released");*/ + up (&dev->sem); + cmdir_delete (dev); + up (&minor_table_mutex); + MOD_DEC_USE_COUNT; + return 0; + } + + /* decrement our usage count for the device */ + --dev->open_count; + if (dev->open_count <= 0) + { + /* shutdown any bulk writes that might be going on */ + usb_unlink_urb (dev->write_urb); + dev->open_count = 0; + } + + /* decrement our usage count for the module */ + MOD_DEC_USE_COUNT; + +exit_not_opened: + up (&dev->sem); + up (&minor_table_mutex); + + return retval; + +#else + /* decrement the count on our device */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 9) + kref_put(&dev->kref); +#else + kref_put(&dev->kref, cmdir_delete); +#endif + return retval; +#endif +} + +static void __exit usb_cmdir_exit(void) +{ + /* deregister this driver with the USB subsystem */ + usb_deregister(&cmdir_driver); + +} + +static int cmdir_check (int device_num) +{ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) + if (minor_table[device_num] == NULL) + { + return -ENODEV; + } + return 0; +#else + struct usb_interface *interface; + + interface = usb_find_interface(&cmdir_driver, USB_CMDIR_MINOR_BASE+device_num); + if (!interface) + { + /* also check without adding base, for devfs */ + interface = usb_find_interface(&cmdir_driver, rx_device); + if (!interface) + { + return -ENODEV; + } + } + return 0; +#endif +} + +static void init_cmdir_var (int device_num) +{ + int i; + unsigned int multiplier=1; + + for (i=0;i 0) cmdir_var[next_pos-2] = ','; + next_pos+=3; + next_comma++; + } + if (transmitters & (multiplier*0x04)) + { + cmdir_var[next_pos] = '3'; + if (next_comma > 0) cmdir_var[next_pos-2] = ','; + next_pos+=3; + next_comma++; + } + if (transmitters & (multiplier*0x08)) + { + cmdir_var[next_pos] = '4'; + if (next_comma > 0) cmdir_var[next_pos-2] = ','; + next_pos+=3; + next_comma++; + } + return; +} + +static void print_cmdir (int device_num) +{ + update_cmdir_string(device_num); + info("%s", cmdir_var); + return; +} + +static ssize_t cmdir_file_read (struct file *file, char *buffer, size_t count, loff_t *ppos) +{ + int retval=0; + int minor=0; + struct usb_skel *dev; + + dev = (struct usb_skel *)file->private_data; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) + minor = dev->minor; +#else + minor = dev->interface->minor; + if (minor>=USB_CMDIR_MINOR_BASE) minor=minor-USB_CMDIR_MINOR_BASE; +#endif + + if (((int)*ppos) == 0) + { + update_cmdir_string(minor); + if (copy_to_user (buffer, cmdir_var, CMDIR_VAR_LEN)) + retval = -EFAULT; + else + retval = CMDIR_VAR_LEN; + return retval; + } + else + { + return 0; + } +} + +/* Read data from CommandIR */ +ssize_t cmdir_read (unsigned char *buffer, size_t count) +{ + struct usb_skel *dev; + int retval = 0; + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) + if (minor_table[rx_device] == NULL) + { + return -ENODEV; + } + dev = minor_table[rx_device]; + + /* lock this object */ + down (&dev->sem); + retval = usb_bulk_msg (dev->udev, usb_rcvbulkpipe (dev->udev, dev->bulk_in_endpointAddr), + dev->bulk_in_buffer, dev->bulk_in_size, &count, HZ*100); +#else + struct usb_interface *interface; + interface = usb_find_interface(&cmdir_driver, USB_CMDIR_MINOR_BASE+rx_device); + if (!interface) + { + /* also check without adding base, for devfs */ + interface = usb_find_interface(&cmdir_driver, rx_device); + if (!interface) + { + return -ENODEV; + } + } + dev = usb_get_intfdata(interface); + if (!dev) + { + return -ENODEV; + } + retval = usb_bulk_msg(dev->udev, usb_rcvbulkpipe(dev->udev, dev->bulk_in_endpointAddr), + dev->bulk_in_buffer, min(dev->bulk_in_size, count), &count, HZ*10); +#endif + if (!retval) + { + if (!memcpy(buffer, dev->bulk_in_buffer, count)) + { + retval = -EFAULT; + } + else + { + curTXFill = buffer[2]; // current status of the TX buffer + retval = count; + } + } + /* suppress errors */ + /* + else + { + err("Read from device failed, error %d",retval); + } + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) + /* unlock the device */ + up (&dev->sem); +#endif + // printk("CommandIR Reporting TX buffer at %d bytes. \n", curTXFill); + return retval; +} + +static ssize_t cmdir_file_write (struct file *file, const char *buffer, size_t count, loff_t *ppos) +{ + int retval; + int i; + int equalsign=0; + int changeType=0; + unsigned char ctrl_buffer[MCU_CTRL_SIZE]; + char *local_buffer; + int minor; + + /* set as default - if non-specific error, won't keep calling this function */ + retval = count; + local_buffer = kmalloc(count, GFP_KERNEL); + + /* verify that we actually have some data to write */ + if (count == 0) + { + err("Write request of 0 bytes"); + goto exit; + } + if (count > 64) + { + err("Input too long"); + goto exit; + } + + /* copy the data from userspace into our local buffer */ + if (copy_from_user(local_buffer, buffer, count)) + { + retval = -EFAULT; + goto exit; + } + + /* parse code */ + changeType = cNothing; + equalsign = 0; + for (i=0; i0)&&((local_buffer[i-1]=='R')||(local_buffer[i-1]=='r'))) + { + changeType = cRX; + } + break; + case 'S': case 's': + if ((i>1)&&((local_buffer[i-1]=='E')||(local_buffer[i-1]=='e'))) + { + if ((local_buffer[i-2]=='R')||(local_buffer[i-2]=='r')) + { + changeType = cRESET; + } + } + break; + case 'L': case 'l': + if ((i>0)&&((local_buffer[i-1]=='F')||(local_buffer[i-1]=='f'))) + { + changeType=cFLASH; + } + break; + case 'C': case 'c': + if((i>0)&&((local_buffer[i-1]=='L')||(local_buffer[i-1]=='l'))) + { + changeType=cLCD; + } + break; + case '=': + if (changeType != cNothing) equalsign = i; + break; + case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': + if(equalsign>0) + { + minor = local_buffer[i] - ASCII0; + switch (changeType) + { + case cRESET: + ctrl_buffer[0]=RESET_HEADER; + retval=write_core(ctrl_buffer,MCU_CTRL_SIZE, + cmdir_write_bulk_callback,minor); + if (retval != MCU_CTRL_SIZE) + { + if (retval==-ENODEV) + err("Device %d unplugged",minor); + else + err("Error on write to %d",minor); + goto exit; + } + else + { + retval=count; + } + init_cmdir_var(minor); + break; + case cFLASH: + ctrl_buffer[0]=FLASH_HEADER; + info("Flashing indicators on device %d",minor); + retval=write_core(ctrl_buffer,MCU_CTRL_SIZE, + cmdir_write_bulk_callback,minor); + if (retval != MCU_CTRL_SIZE) + { + if (retval==-ENODEV) + err("Device %d unplugged",minor); + else + err("Error on write to %d",minor); + goto exit; + } + else + { + retval=count; + } + break; + case cRX: + rx_device=minor; + info("Default receiver set to %d",minor); + break; + case cLCD: + lcd_device=minor; + info("commandir: Default LCD set to %d",minor); + break; + default: + break; + } + } + break; + case ',': + equalsign = 0; + changeType = cNothing; + break; + default: + if ((equalsign > 0)&&(local_buffer[i]>32)) + { + err("Non-numerical argument"); + goto exit; + } + break; + } + } + + if ((changeType!=cNothing)&&(equalsign=0)) err("No device specified"); + if (changeType==cNothing) err("Unknown command"); + +exit: + kfree(local_buffer); + return retval; +} + +int cmdir_write(unsigned char *buffer, int count, void *callback_fct, int usecdelay) +{ + // Always add to queue, then send queue number + // no locks + // mbodkin, Sept 8, 2005 + int ret = 0; + if(debug_commandir == 1){ + do_gettimeofday(&tp); + printk("cmdir_write at %d\n", (int)tp.tv_usec); + } + ret = add_cmdir_queue(buffer, count, callback_fct, usecdelay); + + if(ret == -1) { + printk("cmdir_write returning 0\n"); + return 0; + } + return count; + +} + +int add_cmdir_queue(unsigned char *buffer, int count, void *callback_vct, int usecdelay) +{ + int ret = 0; + if((nexttofill + 1) % (QUEUELENGTH -1) == nexttosend){ + + // our buffer is full + printk("Too many packets backlogged in CommandIR Queue.\n"); + return -1; + } + // go ahead and use this one: + memcpy(ourbuffers[nexttofill], buffer, count); + ourbufferlengths[nexttofill] = count; + waitusecs[nexttofill] = (usecdelay==0) ? 10000 : usecdelay; + //printk("Adding %d to queue at position %d.\n", count, nexttofill); + nexttofill = (nexttofill + 1) % (QUEUELENGTH -1); + ret = nexttofill; +// if(timer_running==0) + send_queue(); // fake it if the timer's not running + return ret; // we accepted the full packet + +} + +int send_queue() +{ + int last_sent = 0; + int ret = 0; + if(debug_commandir == 1){ + do_gettimeofday(&tp); + printk("Send_queue() at %d\n", (int)tp.tv_usec); + } + // initiate the send/callback routine if not already running. + if(send_status == SEND_IDLE){ + if(!(nexttofill == nexttosend)){ + // start it up: + + last_sent = nexttosend -1; + if (last_sent< 0) last_sent = QUEUELENGTH-1; + // Final check - is it TIME to send this packet yet? + // if(wait_to_tx(waitusecs[last_sent]) == 0){ + if(curTXFill < 190){ // always send if there's room, otherwise wait until room + if(debug_commandir == 1){ + do_gettimeofday(&tp); + printk("Sending packet data at %d\n", (int)tp.tv_usec); + } + ret = cmdir_write_queue(ourbuffers[nexttosend], ourbufferlengths[nexttosend], NULL); + if(ret <= 0){ + // send failed - the device is either unplugged or full + // nexttosend = (nexttosend + 1) % (QUEUELENGTH-1); + send_status = SEND_IDLE; + return 0; //send_queue(); + } else { + nexttosend = (nexttosend + 1) % (QUEUELENGTH-1); + } + return 1; + } else { + if(debug_commandir == 1){ + do_gettimeofday(&tp); + printk("Not time to send yet - starting timer at %d.\n", (int)tp.tv_usec); + printk("Enabling timer.\n"); + } + return 0; // doesn't matter anymore + } + } else { + if(debug_commandir == 1){ + do_gettimeofday(&tp); + printk("No more data to send %d!\n", (int)tp.tv_usec); + } + last_tx_sec = 0; // reset our TX counters + last_tx_usec = 0; + return 1; // nothing more to send! + } + } else { + if(debug_commandir == 1) printk("Already sending\n"); // will try again on the callback + return 1; // then the timer shouldn't be running... + } + return 0; // should never get here... +} + + +int wait_to_tx(int usecs){ + // don't return until last_time + usecs has been reached + // for non-zero last_tx's. + int wait_until_sec = 0, wait_until_usec = 0; + int now_sec = 0, now_usec = 0; + if(debug_commandir == 1) printk("waittotx(%d)\n", usecs); + if(usecs == 0) return 0; + + if(!(last_tx_sec == 0 && last_tx_usec == 0)){ + // calculate wait time: + wait_until_sec = last_tx_sec + (usecs / 1000000); + wait_until_usec = last_tx_usec + usecs; + + do_gettimeofday(&tp); + now_sec = tp.tv_sec; + now_usec = tp.tv_usec; + + if(wait_until_usec > 1000000) { + // we've spilled over to the next second. + wait_until_sec++; + wait_until_usec -= 1000000; + // printk("usec rollover\n"); + } + if(debug_commandir == 1) printk("Testing for the right second, now = %d %d, wait = %d %d\n", now_sec, now_usec, wait_until_sec, wait_until_usec); + // now we are always on the same second. + if( now_sec > wait_until_sec ){ + if(debug_commandir == 1) printk("Setting last_tx_sec to %d.\n", wait_until_sec); + last_tx_sec = wait_until_sec; + last_tx_usec = wait_until_usec; + return 0; + } + + if((now_sec == wait_until_sec) && (now_usec > wait_until_usec)){ + if(debug_commandir == 1) printk("Setting last_tx_sec to %d.\n", wait_until_sec); + last_tx_sec = wait_until_sec; + last_tx_usec = wait_until_usec; + return 0; + } + return -1; // didn't send + } + + do_gettimeofday(&tp); + last_tx_usec = tp.tv_usec; + last_tx_sec = tp.tv_sec; + return 0; // if there's no last even, go ahead and send +} + + +int cmdir_write_queue(unsigned char *buffer, int count, void *callback_fct) +{ + int retval = count; + static char prev_signal_num = 0; + unsigned char next_mask; + unsigned int multiplier; + int i; + + send_status = SEND_ACTIVE; + + if (count < 2) + { + err("Not enough bytes (write request of %d bytes)", count); + return count; + } + + /* check data; decide which device to send to */ + switch (buffer[0]) + { + case TX_HEADER: + case TX_HEADER_NEW: + /* this is LIRC transmit data */ + if(curTXFill >= 190) { + printk("TX buffer too full to send more TX data\n"); + return 0; + } + if (next_transmitters != transmitters) + { + if (buffer[1] != prev_signal_num) + { + /* this is new signal; change transmitter mask*/ + transmitters = next_transmitters; + } + } + prev_signal_num=buffer[1]; + + multiplier=1; + for (i=0; i 0) + { + buffer[1] = next_mask; + retval = write_core(buffer,count,callback_fct,i); + if (retval != count) + { + if (retval==-ENODEV) + err("Device %d not plugged in",i); + else + err("Write error to device %d", i); + return retval; + } + } + multiplier=multiplier*0x10; + } + return retval; + break; + case LCD_HEADER: + return write_core(buffer,count,callback_fct,lcd_device); + break; + default: + return write_core(buffer,count,callback_fct,def_device); + break; + } + /* should never get here */ + return retval; + +} + +int write_core(unsigned char *buffer, int count, void *callback_fct, int device_num) +{ + struct usb_skel *dev; + int retval = count; + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) + ssize_t bytes_written = 0; + if (minor_table[device_num] == NULL) + { + /* device is unplugged */ + return -ENODEV; + } + dev = minor_table[device_num]; + + /* lock this object */ + down (&dev->sem); + + /* see if we are already in the middle of a write */ + if (dev->write_urb->status == -EINPROGRESS) + { + /*suppress errors - should just try sending again*/ + /*dbg (" - already writing");*/ + retval = -EINPROGRESS; + goto exit; + } + + /* we can only write as much as 1 urb will hold */ + bytes_written = (count > dev->bulk_out_size) ? + dev->bulk_out_size : count; + + /* copy the data into our urb */ + if (!(memcpy(dev->write_urb->transfer_buffer, buffer, bytes_written))) + { + retval = -EFAULT; + goto exit; + } + + /* set up our urb */ + if (callback_fct == NULL) + { + /*FILL_BULK_URB(dev->write_urb, dev->udev, + usb_sndbulkpipe(dev->udev, dev->bulk_out_endpointAddr), + dev->write_urb->transfer_buffer, bytes_written, + cmdir_write_bulk_callback, dev); */ + usb_fill_bulk_urb(dev->write_urb, dev->udev, + usb_sndbulkpipe(dev->udev, dev->bulk_out_endpointAddr), + dev->write_urb->transfer_buffer, bytes_written, + cmdir_write_bulk_callback, dev); + } + else + { + FILL_BULK_URB(dev->write_urb, dev->udev, + usb_sndbulkpipe(dev->udev, dev->bulk_out_endpointAddr), + dev->write_urb->transfer_buffer, bytes_written, + callback_fct, dev); + } + + /* send the data out the bulk port */ + retval = usb_submit_urb(dev->write_urb); + if (!(retval)) + { + retval = bytes_written; + } + /* suppress errors */ + /* else + { + err("Failed submitting write urb, error %d", retval); + } */ +exit: + /* unlock the device */ + up (&dev->sem); + return retval; // this should be return error I think + +#else + struct usb_interface *interface; + struct urb *urb = NULL; + char *buf = NULL; + interface = usb_find_interface(&cmdir_driver, USB_CMDIR_MINOR_BASE+device_num); + if (!interface) + { + /* also check without adding base, for devfs */ + interface = usb_find_interface(&cmdir_driver, device_num); + if (!interface) + { + return -ENODEV; + } + } + dev = usb_get_intfdata(interface); + if (!dev) + { + return -ENODEV; + } + /* create a urb, and a buffer for it, and copy the data to the urb */ + urb = usb_alloc_urb(0, GFP_ATOMIC); // Now -=Atomic=- + if (!urb) + { + retval = -ENOMEM; + goto error; + } + buf = usb_buffer_alloc(dev->udev, count, GFP_KERNEL, &urb->transfer_dma); + if (!buf) + { + retval = -ENOMEM; + goto error; + } + if (!memcpy(buf, buffer, count)) + { + retval = -EFAULT; + goto error; + } + /* initialize the urb properly */ + if (callback_fct == NULL) + { + usb_fill_bulk_urb(urb, dev->udev, + usb_sndbulkpipe(dev->udev, dev->bulk_out_endpointAddr), + buf, count, cmdir_write_bulk_callback, urb->context); + } + else + { + usb_fill_bulk_urb(urb, dev->udev, + usb_sndbulkpipe(dev->udev, dev->bulk_out_endpointAddr), + buf, count, callback_fct, dev); + } + urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; // double check this + + /* send the data out the bulk port */ + retval = usb_submit_urb(urb, GFP_KERNEL); + if (retval) + { + err("%s - failed submitting write urb, error %d", __FUNCTION__, retval); + goto error; + } + + /* release our reference to this urb, the USB core will eventually free it entirely */ + usb_free_urb(urb); + return count; + +error: + usb_buffer_free(dev->udev, count, buf, urb->transfer_dma); + usb_free_urb(urb); + return retval; +#endif +} + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) +static void cmdir_write_bulk_callback (struct urb *urb) +{ + if(debug_commandir == 1){ + do_gettimeofday(&tp); + printk("cmdir_write_bulk_callback at %d\n", (int)tp.tv_usec); + } + /*if ((urb->status != -ENOENT) && (urb->status != -ECONNRESET)) + { + return; + } + else { + dbg(" - urb status: %d", urb->status); + return; + }*/ + + send_status = SEND_IDLE; + // printk("cmdir_write_bulk_callback - set idle\n"); + send_queue(); // send the next packet + return; +} +#else +static void cmdir_write_bulk_callback(struct urb *urb, struct pt_regs *regs) +{ + struct usb_skel *dev; + dev = (struct usb_skel *)urb->context; + send_status = SEND_IDLE; + if(debug_commandir == 1) printk("callback()\n"); + /* free up our allocated buffer */ + + usb_buffer_free(urb->dev, urb->transfer_buffer_length, + urb->transfer_buffer, urb->transfer_dma); + send_queue(); // send the next packet + +} +#endif + +int set_tx_channels (unsigned int next_tx) +{ + next_transmitters=next_tx; + return 0; +} + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) +EXPORT_SYMBOL_NOVERS(cmdir_write); +EXPORT_SYMBOL_NOVERS(cmdir_read); +EXPORT_SYMBOL_NOVERS(set_tx_channels); +#else +EXPORT_SYMBOL(cmdir_write); +EXPORT_SYMBOL(cmdir_read); +EXPORT_SYMBOL(set_tx_channels); +#endif + +module_init (usb_cmdir_init); +module_exit (usb_cmdir_exit); + +MODULE_AUTHOR(DRIVER_AUTHOR); +MODULE_DESCRIPTION(DRIVER_DESC); +MODULE_LICENSE("GPL"); diff --git a/ubuntu/media/lirc/lirc_cmdir/commandir.h b/ubuntu/media/lirc/lirc_cmdir/commandir.h new file mode 100644 index 0000000..a327d1b --- /dev/null +++ b/ubuntu/media/lirc/lirc_cmdir/commandir.h @@ -0,0 +1,40 @@ +/* + * commandir.h + */ + +#define ASCII0 48 + +/* transmitter channel control */ +#define MAX_DEVICES 8 +#define MAX_CHANNELS 32 +#define TX1_ENABLE 0x80 +#define TX2_ENABLE 0x40 +#define TX3_ENABLE 0x20 +#define TX4_ENABLE 0x10 + +/* command types */ +#define cNothing 0 +#define cRESET 1 +#define cFLASH 2 +#define cLCD 3 +#define cRX 4 + +/* CommandIR control codes */ +#define MCU_CTRL_SIZE 3 +#define FREQ_HEADER 2 +#define RESET_HEADER 3 +#define FLASH_HEADER 4 +#define LCD_HEADER 5 +#define TX_HEADER 7 +#define TX_HEADER_NEW 8 + +/* Queue buffering constants */ +#define SEND_IDLE 0 +#define SEND_ACTIVE 1 + +#define QUEUELENGTH 256 + +extern int cmdir_write (unsigned char *buffer, int count, void *callback_fct, int u); +extern ssize_t cmdir_read (unsigned char *buffer, size_t count); +extern int set_tx_channels (unsigned int next_tx); + diff --git a/ubuntu/media/lirc/lirc_cmdir/lirc_cmdir.c b/ubuntu/media/lirc/lirc_cmdir/lirc_cmdir.c index c5a6eb5..ec7b93b 100644 --- a/ubuntu/media/lirc/lirc_cmdir/lirc_cmdir.c +++ b/ubuntu/media/lirc/lirc_cmdir/lirc_cmdir.c @@ -351,9 +351,7 @@ static ssize_t lirc_write(struct file *file, const char *buf, size_t n, loff_t * ppos) { int i,count; - int num_bytes_to_send; unsigned int mod_signal_length=0; - unsigned int cur_freq=0; unsigned int time_elapse=0; unsigned int total_time_elapsed=0; /* double wbuf_mod=0.0; //no floating point in 2.6 kernel */ diff --git a/ubuntu/media/lirc/lirc_gpio/lirc_gpio.c b/ubuntu/media/lirc/lirc_gpio/lirc_gpio.c index 25c7b25..19859bf 100644 --- a/ubuntu/media/lirc/lirc_gpio/lirc_gpio.c +++ b/ubuntu/media/lirc/lirc_gpio/lirc_gpio.c @@ -91,11 +91,6 @@ static unsigned long gpio_xor_mask = 0; static int soft_gap = 0; static int sample_rate = 10; -#define dprintk(fmt, args...) \ - do{ \ - if(debug) printk(KERN_DEBUG fmt, ## args); \ - }while(0) - struct rcv_info { int bttv_id; int card_id; diff --git a/ubuntu/media/lirc/lirc_it87/lirc_it87.c b/ubuntu/media/lirc/lirc_it87/lirc_it87.c index 87598e6..bee9f01 100644 --- a/ubuntu/media/lirc/lirc_it87/lirc_it87.c +++ b/ubuntu/media/lirc/lirc_it87/lirc_it87.c @@ -388,17 +388,11 @@ static struct file_operations lirc_fops = { static int set_use_inc(void* data) { -#if WE_DONT_USE_LOCAL_OPEN_CLOSE - MOD_INC_USE_COUNT; -#endif return 0; } static void set_use_dec(void* data) { -#if WE_DONT_USE_LOCAL_OPEN_CLOSE - MOD_DEC_USE_COUNT; -#endif } static struct lirc_plugin plugin = { name: LIRC_DRIVER_NAME, diff --git a/ubuntu/media/lirc/lirc_pvr150/Makefile.am b/ubuntu/media/lirc/lirc_pvr150/Makefile.am deleted file mode 100644 index 6b68f5e..0000000 --- a/ubuntu/media/lirc/lirc_pvr150/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -## $Id: Makefile.am,v 1.6 2004/04/25 16:29:26 lirc Exp $ - -## Process this file with automake to produce Makefile.in - -## this is so that Automake includes the C compiling definitions, and -## includes the source files in the distribution. -EXTRA_PROGRAMS = automake_dummy -automake_dummy_SOURCES = lirc_pvr150.c - -## there is no *just* object file support in automake. This is close enough -module_DATA = lirc_pvr150.o - -include ../Makefile.common diff --git a/ubuntu/media/lirc/lirc_pvr150/Makefile.in b/ubuntu/media/lirc/lirc_pvr150/Makefile.in deleted file mode 100644 index a8f5e2a..0000000 --- a/ubuntu/media/lirc/lirc_pvr150/Makefile.in +++ /dev/null @@ -1,526 +0,0 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# $Id: Makefile.common,v 5.4 2007/01/17 08:50:31 lirc Exp $ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -EXTRA_PROGRAMS = automake_dummy$(EXEEXT) -DIST_COMMON = $(srcdir)/../Makefile.common $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in -subdir = drivers/lirc_pvr150 -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ - $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -am_automake_dummy_OBJECTS = lirc_pvr150.$(OBJEXT) -automake_dummy_OBJECTS = $(am_automake_dummy_OBJECTS) -automake_dummy_LDADD = $(LDADD) -DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(automake_dummy_SOURCES) -DIST_SOURCES = $(automake_dummy_SOURCES) -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(moduledir)" -moduleDATA_INSTALL = $(INSTALL_DATA) -DATA = $(module_DATA) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBUSB_CONFIG = @LIBUSB_CONFIG@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -XMKMF = @XMKMF@ -X_CFLAGS = @X_CFLAGS@ -X_EXTRA_LIBS = @X_EXTRA_LIBS@ -X_LIBS = @X_LIBS@ -X_PRE_LIBS = @X_PRE_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -ac_pkss_mktemp = @ac_pkss_mktemp@ -alsa_lib = @alsa_lib@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -atilibusb_lib = @atilibusb_lib@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -caraca_lib = @caraca_lib@ -daemon = @daemon@ -datadir = @datadir@ -datarootdir = @datarootdir@ -depmod = @depmod@ -devdir = @devdir@ -docdir = @docdir@ -driver = @driver@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -forkpty = @forkpty@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -hw_module = @hw_module@ -iguanaIR_lib = @iguanaIR_lib@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -irman_lib = @irman_lib@ -irtty = @irtty@ -kernelcc = @kernelcc@ -kerneldir = @kerneldir@ -kernelext = @kernelext@ -libdir = @libdir@ -libexecdir = @libexecdir@ -lirc_driver = @lirc_driver@ -lirc_major = @lirc_major@ -lircd_conf = @lircd_conf@ -lircmd_conf = @lircmd_conf@ -localedir = @localedir@ -localstatedir = @localstatedir@ -maintmode_daemons_extra = @maintmode_daemons_extra@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -mkfifo = @mkfifo@ -mknod = @mknod@ -moduledir = @moduledir@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -portaudio_lib = @portaudio_lib@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -vga_progs = @vga_progs@ -x_progs = @x_progs@ -automake_dummy_SOURCES = lirc_pvr150.c -module_DATA = lirc_pvr150.o - -# where the kernel sources are located -KERNEL_LOCATION = @kerneldir@ -LIRC_DEVDIR = $(shell pwd) - -# some magic for using linux kernel settings -# when compiling module(s) -KBUILD_VERBOSE = 1 -LIRC_EXTRA_CFLAGS = -DIRCTL_DEV_MAJOR=$(lirc_major) -DEXPORT_SYMTAB $(DEFS) \ - $(DEFAULT_INCLUDES) -I$(LIRC_DEVDIR)/../.. \ - -I$(KERNEL_LOCATION)/include/ \ - -I$(KERNEL_LOCATION)/drivers/media/video/ - -CLEANFILES = $(module_DATA) .$(module_DATA).flags $(module_DATA:.o=.mod.c) $(module_DATA:.o=.@kernelext@) *~ -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/../Makefile.common $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu drivers/lirc_pvr150/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu drivers/lirc_pvr150/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -automake_dummy$(EXEEXT): $(automake_dummy_OBJECTS) $(automake_dummy_DEPENDENCIES) - @rm -f automake_dummy$(EXEEXT) - $(LINK) $(automake_dummy_OBJECTS) $(automake_dummy_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lirc_pvr150.Po@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) ' { files[$$0] = 1; } \ - END { for (i in files) print i; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(DATA) -installdirs: - for dir in "$(DESTDIR)$(moduledir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -@SANDBOXED_TRUE@uninstall-local: -@SANDBOXED_TRUE@install-data-local: -@SANDBOXED_TRUE@install-exec-local: -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: install-data-local install-moduleDATA - -install-dvi: install-dvi-am - -install-exec-am: install-exec-local - -install-html: install-html-am - -install-info: install-info-am - -install-man: - -install-pdf: install-pdf-am - -install-ps: install-ps-am - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-local uninstall-moduleDATA - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool ctags distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-data-local install-dvi \ - install-dvi-am install-exec install-exec-am install-exec-local \ - install-html install-html-am install-info install-info-am \ - install-man install-moduleDATA install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-local \ - uninstall-moduleDATA - -export LIRC_EXTRA_CFLAGS KERNEL_LOCATION module_DATA - -$(module_DATA): $(automake_dummy_SOURCES) $(top_srcdir)/config.h ../lirc.h - mv Makefile Makefile.automake - cp ../Makefile.kernel Makefile - $(MAKE) -C $(KERNEL_LOCATION) SUBDIRS=$(LIRC_DEVDIR) modules \ - KBUILD_VERBOSE=$(KBUILD_VERBOSE) - mv Makefile.automake Makefile - -install-moduleDATA: $(module_DATA) - $(mkinstalldirs) $(DESTDIR)$(moduledir) - @list='$(module_DATA:.o=.@kernelext@)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(moduledir)/$$f"; \ - $(INSTALL_DATA) $$d$$p $(DESTDIR)$(moduledir)/$$f; \ - done - -uninstall-moduleDATA: - @list='$(module_DATA:.o=.@kernelext@)'; for p in $$list; do \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " rm -f $(DESTDIR)$(moduledir)/$$f"; \ - rm -f $(DESTDIR)$(moduledir)/$$f; \ - done - -@SANDBOXED_FALSE@install-exec-local: mkdev -@SANDBOXED_FALSE@uninstall-local: rmdev - -mkdev: - test -e $(DESTDIR)$(devdir)/lirc || ($(mkinstalldirs) $(DESTDIR)$(devdir) && @mknod@ $(DESTDIR)$(devdir)/lirc c @lirc_major@ 0) - -rmdev: - -test -c $(DESTDIR)$(devdir)/lirc && $(RM) $(DESTDIR)$(devdir)/lirc - -@SANDBOXED_FALSE@install-data-local: install-moduleDATA -@SANDBOXED_FALSE@ -@depmod@ -a -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/ubuntu/media/lirc/lirc_serial/lirc_serial.c b/ubuntu/media/lirc/lirc_serial/lirc_serial.c index 75031bd..b02d4a0 100644 --- a/ubuntu/media/lirc/lirc_serial/lirc_serial.c +++ b/ubuntu/media/lirc/lirc_serial/lirc_serial.c @@ -63,15 +63,6 @@ #include -#if defined(CONFIG_SERIAL) || defined(CONFIG_SERIAL_8250) -#warning "******************************************" -#warning " Your serial port driver is compiled into " -#warning " the kernel. You will have to release the " -#warning " port you want to use for LIRC with: " -#warning " setserial /dev/ttySx uart none " -#warning "******************************************" -#endif - #include #include #include -- 1.4.4.2