LIRCCODE is a lirc mode where a driver produces driver-dependent codes for receive and transmit. No driver uses this any more. The LIRC_GET_LENGTH ioctl was used for this mode only.
Unified · Split
| @@ -28,6 +28,10 @@ ignore define LIRC_CAN_SEND_MASK · 27 unmodified lines | |||
| 28 | ignore define LIRC_CAN_REC_MASK | 28 | ignore define LIRC_CAN_REC_MASK |
| 29 | ignore define LIRC_CAN_SET_REC_DUTY_CYCLE | 29 | ignore define LIRC_CAN_SET_REC_DUTY_CYCLE |
| 30 | 30 | ||
| 31 | # Obsolete ioctls | ||
| 32 | |||
| 33 | ignore ioctl LIRC_GET_LENGTH | ||
| 34 | |||
| 31 | # Undocumented macros | 35 | # Undocumented macros |
| 32 | 36 | ||
| 33 | ignore define PULSE_BIT | 37 | ignore define PULSE_BIT |
| @@ -40,3 +44,4 @@ ignore define LIRC_VALUE_MASK · 6 unmodified lines | |||
| 40 | ignore define LIRC_MODE2_MASK | 44 | ignore define LIRC_MODE2_MASK |
| 41 | 45 | ||
| 42 | ignore define LIRC_MODE_RAW | 46 | ignore define LIRC_MODE_RAW |
| 47 | ignore define LIRC_MODE_LIRCCODE | ||
| @@ -72,21 +72,6 @@ on the following table. · 71 unmodified lines | |||
| 72 | this packet will be sent, with the number of microseconds with | 72 | this packet will be sent, with the number of microseconds with |
| 73 | no IR. | 73 | no IR. |
| 74 | 74 | ||
| 75 | .. _lirc-mode-lirccode: | ||
| 76 | |||
| 77 | ``LIRC_MODE_LIRCCODE`` | ||
| 78 | |||
| 79 | This mode can be used for IR receive and send. | ||
| 80 | |||
| 81 | The IR signal is decoded internally by the receiver, or encoded by the | ||
| 82 | transmitter. The LIRC interface represents the scancode as byte string, | ||
| 83 | which might not be a u32, it can be any length. The value is entirely | ||
| 84 | driver dependent. This mode is used by some older lirc drivers. | ||
| 85 | |||
| 86 | The length of each code depends on the driver, which can be retrieved | ||
| 87 | with :ref:`lirc_get_length`. This length is used both | ||
| 88 | for transmitting and receiving IR. | ||
| 89 | |||
| 90 | .. _lirc-mode-pulse: | 75 | .. _lirc-mode-pulse: |
| 91 | 76 | ||
| 92 | ``LIRC_MODE_PULSE`` | 77 | ``LIRC_MODE_PULSE`` |
| @@ -18,7 +18,6 @@ LIRC Function Reference · 17 unmodified lines | |||
| 18 | lirc-set-send-duty-cycle | 18 | lirc-set-send-duty-cycle |
| 19 | lirc-get-timeout | 19 | lirc-get-timeout |
| 20 | lirc-set-rec-timeout | 20 | lirc-set-rec-timeout |
| 21 | lirc-get-length | ||
| 22 | lirc-set-rec-carrier | 21 | lirc-set-rec-carrier |
| 23 | lirc-set-rec-carrier-range | 22 | lirc-set-rec-carrier-range |
| 24 | lirc-set-send-carrier | 23 | lirc-set-send-carrier |
| @@ -62,8 +62,7 @@ LIRC features · 61 unmodified lines | |||
| 62 | 62 | ||
| 63 | ``LIRC_CAN_REC_LIRCCODE`` | 63 | ``LIRC_CAN_REC_LIRCCODE`` |
| 64 | 64 | ||
| 65 | The driver is capable of receiving using | 65 | Unused. Kept just to avoid breaking uAPI. |
| 66 | :ref:`LIRC_MODE_LIRCCODE <lirc-mode-LIRCCODE>`. | ||
| 67 | 66 | ||
| 68 | .. _LIRC-CAN-SET-SEND-CARRIER: | 67 | .. _LIRC-CAN-SET-SEND-CARRIER: |
| 69 | 68 | ||
| @@ -170,9 +169,7 @@ LIRC features · 100 unmodified lines | |||
| 170 | 169 | ||
| 171 | ``LIRC_CAN_SEND_LIRCCODE`` | 170 | ``LIRC_CAN_SEND_LIRCCODE`` |
| 172 | 171 | ||
| 173 | The driver supports sending (also called as IR blasting or IR TX) using | 172 | Unused. Kept just to avoid breaking uAPI. |
| 174 | :ref:`LIRC_MODE_LIRCCODE <lirc-mode-LIRCCODE>`. | ||
| 175 | |||
| 176 | 173 | ||
| 177 | Return Value | 174 | Return Value |
| 178 | ============ | 175 | ============ |
| @@ -1,44 +0,0 @@ | |||
| 1 | .. -*- coding: utf-8; mode: rst -*- | ||
| 2 | |||
| 3 | .. _lirc_get_length: | ||
| 4 | |||
| 5 | ********************* | ||
| 6 | ioctl LIRC_GET_LENGTH | ||
| 7 | ********************* | ||
| 8 | |||
| 9 | Name | ||
| 10 | ==== | ||
| 11 | |||
| 12 | LIRC_GET_LENGTH - Retrieves the code length in bits. | ||
| 13 | |||
| 14 | Synopsis | ||
| 15 | ======== | ||
| 16 | |||
| 17 | .. c:function:: int ioctl( int fd, LIRC_GET_LENGTH, __u32 *length ) | ||
| 18 | :name: LIRC_GET_LENGTH | ||
| 19 | |||
| 20 | Arguments | ||
| 21 | ========= | ||
| 22 | |||
| 23 | ``fd`` | ||
| 24 | File descriptor returned by open(). | ||
| 25 | |||
| 26 | ``length`` | ||
| 27 | length, in bits | ||
| 28 | |||
| 29 | |||
| 30 | Description | ||
| 31 | =========== | ||
| 32 | |||
| 33 | Retrieves the code length in bits (only for | ||
| 34 | :ref:`LIRC_MODE_LIRCCODE <lirc-mode-lirccode>`). | ||
| 35 | Reads on the device must be done in blocks matching the bit count. | ||
| 36 | The bit could should be rounded up so that it matches full bytes. | ||
| 37 | |||
| 38 | |||
| 39 | Return Value | ||
| 40 | ============ | ||
| 41 | |||
| 42 | On success 0 is returned, on error -1 and the ``errno`` variable is set | ||
| 43 | appropriately. The generic error codes are described at the | ||
| 44 | :ref:`Generic Error Codes <gen-errors>` chapter. | ||
| @@ -34,9 +34,7 @@ Description · 33 unmodified lines | |||
| 34 | =========== | 34 | =========== |
| 35 | 35 | ||
| 36 | Get/set supported receive modes. Only :ref:`LIRC_MODE_MODE2 <lirc-mode-mode2>` | 36 | Get/set supported receive modes. Only :ref:`LIRC_MODE_MODE2 <lirc-mode-mode2>` |
| 37 | and :ref:`LIRC_MODE_LIRCCODE <lirc-mode-lirccode>` are supported for IR | 37 | is supported for IR receive. |
| 38 | receive. Use :ref:`lirc_get_features` to find out which modes the driver | ||
| 39 | supports. | ||
| 40 | 38 | ||
| 41 | Return Value | 39 | Return Value |
| 42 | ============ | 40 | ============ |
| @@ -36,8 +36,7 @@ Description · 35 unmodified lines | |||
| 36 | 36 | ||
| 37 | Get/set current transmit mode. | 37 | Get/set current transmit mode. |
| 38 | 38 | ||
| 39 | Only :ref:`LIRC_MODE_PULSE <lirc-mode-pulse>` and | 39 | Only :ref:`LIRC_MODE_PULSE <lirc-mode-pulse>` is supported by for IR send, |
| 40 | :ref:`LIRC_MODE_LIRCCODE <lirc-mode-lirccode>` is supported by for IR send, | ||
| 41 | depending on the driver. Use :ref:`lirc_get_features` to find out which | 40 | depending on the driver. Use :ref:`lirc_get_features` to find out which |
| 42 | modes the driver supports. | 41 | modes the driver supports. |
| 43 | 42 | ||
| @@ -388,7 +388,6 @@ static int ir_lirc_register(struct rc_dev *dev) · 387 unmodified lines | |||
| 388 | ldev->features = features; | 388 | ldev->features = features; |
| 389 | ldev->data = &dev->raw->lirc; | 389 | ldev->data = &dev->raw->lirc; |
| 390 | ldev->buf = NULL; | 390 | ldev->buf = NULL; |
| 391 | ldev->code_length = sizeof(struct ir_raw_event) * 8; | ||
| 392 | ldev->chunk_size = sizeof(int); | 391 | ldev->chunk_size = sizeof(int); |
| 393 | ldev->buffer_size = LIRCBUF_SIZE; | 392 | ldev->buffer_size = LIRCBUF_SIZE; |
| 394 | ldev->fops = &lirc_fops; | 393 | ldev->fops = &lirc_fops; |
| @@ -137,12 +137,6 @@ int lirc_register_device(struct lirc_dev *d) · 136 unmodified lines | |||
| 137 | return -EINVAL; | 137 | return -EINVAL; |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | if (d->code_length < 1 || d->code_length > (BUFLEN * 8)) { | ||
| 141 | dev_err(&d->dev, "code length must be less than %d bits\n", | ||
| 142 | BUFLEN * 8); | ||
| 143 | return -EBADRQC; | ||
| 144 | } | ||
| 145 | |||
| 146 | if (!d->buf && !(d->fops && d->fops->read && | 140 | if (!d->buf && !(d->fops && d->fops->read && |
| 147 | d->fops->poll && d->fops->unlocked_ioctl)) { | 141 | d->fops->poll && d->fops->unlocked_ioctl)) { |
| 148 | dev_err(&d->dev, "undefined read, poll, ioctl\n"); | 142 | dev_err(&d->dev, "undefined read, poll, ioctl\n"); |
| @@ -152,9 +146,6 @@ int lirc_register_device(struct lirc_dev *d) · 3 unmodified lines | |||
| 152 | /* some safety check 8-) */ | 146 | /* some safety check 8-) */ |
| 153 | d->name[sizeof(d->name) - 1] = '\0'; | 147 | d->name[sizeof(d->name) - 1] = '\0'; |
| 154 | 148 | ||
| 155 | if (d->features == 0) | ||
| 156 | d->features = LIRC_CAN_REC_LIRCCODE; | ||
| 157 | |||
| 158 | if (LIRC_CAN_REC(d->features)) { | 149 | if (LIRC_CAN_REC(d->features)) { |
| 159 | err = lirc_allocate_buffer(d); | 150 | err = lirc_allocate_buffer(d); |
| 160 | if (err) | 151 | if (err) |
| @@ -343,9 +334,6 @@ long lirc_dev_fop_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · 182 unmodified lines | |||
| 343 | * for now, lirc_serial doesn't support mode changing either | 334 | * for now, lirc_serial doesn't support mode changing either |
| 344 | */ | 335 | */ |
| 345 | break; | 336 | break; |
| 346 | case LIRC_GET_LENGTH: | ||
| 347 | result = put_user(d->code_length, (__u32 __user *)arg); | ||
| 348 | break; | ||
| 349 | default: | 337 | default: |
| 350 | result = -ENOTTY; | 338 | result = -ENOTTY; |
| 351 | } | 339 | } |
| @@ -9,8 +9,6 @@ · 8 unmodified lines | |||
| 9 | #ifndef _LINUX_LIRC_DEV_H | 9 | #ifndef _LINUX_LIRC_DEV_H |
| 10 | #define _LINUX_LIRC_DEV_H | 10 | #define _LINUX_LIRC_DEV_H |
| 11 | 11 | ||
| 12 | #define BUFLEN 16 | ||
| 13 | |||
| 14 | #include <linux/slab.h> | 12 | #include <linux/slab.h> |
| 15 | #include <linux/fs.h> | 13 | #include <linux/fs.h> |
| 16 | #include <linux/ioctl.h> | 14 | #include <linux/ioctl.h> |
| @@ -117,7 +115,6 @@ static inline unsigned int lirc_buffer_write(struct lirc_buffer *buf, · 100 unmodified lines | |||
| 117 | * | 115 | * |
| 118 | * @name: used for logging | 116 | * @name: used for logging |
| 119 | * @minor: the minor device (/dev/lircX) number for the device | 117 | * @minor: the minor device (/dev/lircX) number for the device |
| 120 | * @code_length: length of a remote control key code expressed in bits | ||
| 121 | * @features: lirc compatible hardware features, like LIRC_MODE_RAW, | 118 | * @features: lirc compatible hardware features, like LIRC_MODE_RAW, |
| 122 | * LIRC_CAN\_\*, as defined at include/media/lirc.h. | 119 | * LIRC_CAN\_\*, as defined at include/media/lirc.h. |
| 123 | * @buffer_size: Number of FIFO buffers with @chunk_size size. | 120 | * @buffer_size: Number of FIFO buffers with @chunk_size size. |
| @@ -142,7 +139,6 @@ static inline unsigned int lirc_buffer_write(struct lirc_buffer *buf, · 18 unmodified lines | |||
| 142 | struct lirc_dev { | 139 | struct lirc_dev { |
| 143 | char name[40]; | 140 | char name[40]; |
| 144 | unsigned int minor; | 141 | unsigned int minor; |
| 145 | __u32 code_length; | ||
| 146 | __u32 features; | 142 | __u32 features; |
| 147 | 143 | ||
| 148 | unsigned int buffer_size; /* in chunks holding one code each */ | 144 | unsigned int buffer_size; /* in chunks holding one code each */ |