1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757
|
/****************************************************************************
** irtoy.c **********************************************************
****************************************************************************
*
* Routines for USB Infrared Toy receiver/transmitter in sampling mode
*
* Copyright (C) 2011 Peter Kooiman <pkooiman@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <poll.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <fcntl.h>
#include <unistd.h>
#include <limits.h>
#include <signal.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <errno.h>
#include "lirc_driver.h"
#include "lirc/serial.h"
#define IRTOY_MINFWVERSION 20
#define LOWEST_FW_SUPPORTING_SETPIN 22
#define IRTOY_UNIT 21.3333
#define IRTOY_LONGSPACE 1000000
/** Keys used to enumerate devices */
static const struct drv_enum_udev_what UDEV_KEYS[] = {
{.idProduct = "04d8", .idVendor = "f58b"}, // irdroid
{.idProduct = "fd08", .idVendor = "04d8"}, // irtoy
{0, 0}
};
const unsigned char IRTOY_COMMAND_TXSTART[] = { 0x03 };
const unsigned char IRTOY_COMMAND24[] = { 0x24 };
const unsigned char IRTOY_COMMAND25[] = { 0x25 };
const unsigned char IRTOY_COMMAND26[] = { 0x26 };
static const unsigned char cmdIOwrite = 0x30; // Sets the IO pins to ground (0) or +5volt (1).
static const unsigned char cmdIOdirection = 0x31; // Sets the IO pins to input (1) or output (0).
#define IRTOY_COMMAND_RESET 0
#define IRTOY_COMMAND_SMODE_ENTER 's'
#define IRTOY_COMMAND_VERSION 'v'
#define IRTOY_REPLY_XMITCOUNT 't'
#define IRTOY_REPLY_XMITSUCCESS 'C'
#define IRTOY_REPLY_VERSION 'V'
#define IRTOY_REPLY_SAMPLEMODEPROTO 'S'
#define IRTOY_LEN_XMITRES 4
#define IRTOY_LEN_VERSION 4
#define IRTOY_LEN_SAMPLEMODEPROTO 3
#define IRTOY_TIMEOUT_READYFORDATA 1000000
#define IRTOY_TIMEOUT_FLUSH 20000
#define IRTOY_TIMEOUT_SMODE_ENTER 500000
#define IRTOY_TIMEOUT_VERSION 500000
// To aid debugging, attach LEDs to the pins below. They will light up
// under certain circumstances, helping to find out what the driver does.
// If not needed, the performance penalty is believed to be very small.
/** This LED lights when device is held open. */
static const int openPin = 5; // RA5
/** This LED lights when the device is listening for inputs. */
static const int receivePin = 3; // RA3
/** This LED LED lights during IR signal transmission. */
static const int sendingPin = 4; // RA4
struct tag_irtoy_t {
int hwVersion;
int swVersion;
int protoVersion;
int fd;
int awaitingNewSig;
int receivedLongPausesInARow;
int pulse;
};
typedef struct tag_irtoy_t irtoy_t;
static const logchannel_t logchannel = LOG_DRIVER;
static irtoy_t* dev = NULL;
static unsigned char rawSB[WBUF_SIZE * 2 + 2];
/* exported functions */
static int init(void);
static int deinit(void);
static int send(struct ir_remote* remote, struct ir_ncode* code);
static char* receive(struct ir_remote* remotes);
static int decode(struct ir_remote* remote, struct decode_ctx_t* ctx);
static int drvctl_func(unsigned int cmd, void* arg);
static lirc_t readdata(lirc_t timeout);
static int irtoy_enter_samplemode(irtoy_t* dev);
const struct driver hw_usbirtoy = {
.name = "irtoy",
.device = "/dev/ttyACM0",
.features = LIRC_CAN_REC_MODE2 | LIRC_CAN_SEND_PULSE,
.send_mode = LIRC_MODE_PULSE,
.rec_mode = LIRC_MODE_MODE2,
.code_length = 0,
.init_func = init,
.deinit_func = deinit,
.open_func = default_open,
.close_func = default_close,
.send_func = send,
.rec_func = receive,
.decode_func = decode,
.drvctl_func = drvctl_func,
.readdata = readdata,
.api_version = 3,
.driver_version = "0.10.2",
.info = "See file://" PLUGINDOCS "/irtoy.html",
.device_hint = "drvctl"
};
const struct driver* hardwares[] = {
&hw_usbirtoy,
(const struct driver*)NULL
};
static int decode(struct ir_remote* remote, struct decode_ctx_t* ctx)
{
int res;
log_trace("decode: enter");
res = receive_decode(remote, ctx);
log_trace("decode: %d", res);
return res;
}
static int use_signaling_pins(void)
{
return dev->swVersion >= LOWEST_FW_SUPPORTING_SETPIN;
}
static unsigned int IOdirections = (unsigned int) -1;
static unsigned int IOdata = 0U;
int send3(unsigned char cmd, unsigned int data)
{
unsigned char array[3];
int res;
array[0] = cmd;
array[1] = (unsigned char) ((data >> 8) & 0xff);
array[2] = (unsigned char) (data & 0xff);
res = write(dev->fd, array, 3);
if (res != 3)
log_error("irtoy_setIOData: couldn't write command");
return res == 3;
}
static int setIOData(void)
{
return send3(cmdIOdirection, IOdirections) && send3(cmdIOwrite, IOdata);
}
static int setPin(unsigned int pin, int state)
{
if (!use_signaling_pins())
return 0;
unsigned int mask = 1 << pin;
IOdirections &= ~mask;
if (state)
IOdata |= mask;
else
IOdata &= ~mask;
return setIOData();
}
static ssize_t
read_with_timeout(int fd, void* buf, size_t count, long to_usec)
{
ssize_t rc;
size_t numread = 0;
struct pollfd pfd = {.fd = fd, .events = POLLIN, .revents = 0};
rc = read(fd, (char*)buf, count);
if (rc > 0)
numread += rc;
while ((rc == -1 && errno == EAGAIN) || (rc >= 0 && numread < count)) {
rc = curl_poll(&pfd, 1, to_usec / 1000);
if (rc == 0)
/* timeout */
break;
else if (rc == -1)
/* continue for EAGAIN case */
continue;
rc = read(fd, ((char*)buf) + numread, count - numread);
if (rc > 0)
numread += rc;
}
return (numread == 0) ? -1 : numread;
}
static int irtoy_readflush(irtoy_t* dev, long timeout)
{
int res;
char c;
while ((res = read_with_timeout(dev->fd, &c, 1, timeout)) == 1)
;
if (res != 0)
return -1;
else
return 0;
}
static lirc_t irtoy_read(irtoy_t* dev, lirc_t timeout)
{
lirc_t data;
int res;
unsigned char dur[2];
if (!waitfordata(timeout))
return 0;
// lircd expects a space as start of the next transmission, not
// just at the end of the last one.
// irrecord however likes to see a space at the end of the signal
// We remember if we saw the 0xFFFF timeout from the usbtoy and
// send a long space both after last signal and at start of next signal
// From usb irtoy:
// <signal...><lastpulse> [usbtoy timeout duration] 0xFFFF
// [however long it takes before next signal]
// <firstpulse><signal..>
// We return:
// <signal><lastpulse> [usbtoy timeout duration] LONGSPACE
// [however long it takes before next signal]
// LONGSPACE <firstpulse><signal>AA
if (dev->awaitingNewSig) {
log_trace("new signal after large space");
dev->pulse = 1;
dev->awaitingNewSig = 0;
return IRTOY_LONGSPACE;
}
res = read_with_timeout(dev->fd, dur, 2, 0);
if (res != 2) {
log_error("irtoy_read: could not get 2 bytes");
return 0;
}
log_trace2("read_raw %02x%02x", dur[0], dur[1]);
if (dur[0] == 0xff && dur[1] == 0xff) {
dev->awaitingNewSig = 1;
dev->receivedLongPausesInARow++;
if (dev->receivedLongPausesInARow == 3) {
// According to IRToy documentation, when device sends three long pauses in a row, it
// signals buffer overflow (We were not reading it fast enough to process IR data in real time)
// When this happens, IRToy resets to IRMan mode. We need to put it back into sampling mode.
log_warn("Irtoy got buffer overflow. Resetting to sample mode...");
irtoy_enter_samplemode(dev);
}
log_trace("Got %d Long Pauses in a row so far", dev->receivedLongPausesInARow);
return IRTOY_LONGSPACE;
}
dev->receivedLongPausesInARow = 0;
data = (lirc_t)(IRTOY_UNIT * (double)(256 * dur[0] + dur[1]));
log_trace2("read_raw %d", data);
if (dev->pulse)
data = data | PULSE_BIT;
dev->pulse = !(dev->pulse);
return data;
}
static lirc_t readdata(lirc_t timeout)
{
lirc_t data = irtoy_read(dev, timeout);
if (data)
log_trace("readdata %d %d",
!!(data & PULSE_BIT), data & PULSE_MASK);
return data;
}
static int irtoy_getversion(irtoy_t* dev)
{
int res;
char buf[16];
int vNum;
irtoy_readflush(dev, IRTOY_TIMEOUT_FLUSH);
buf[0] = IRTOY_COMMAND_VERSION;
res = write(dev->fd, buf, 1);
if (res != 1) {
log_error("irtoy_getversion: couldn't write command");
return 0;
}
res = read_with_timeout(dev->fd, buf,
IRTOY_LEN_VERSION,
IRTOY_TIMEOUT_VERSION);
if (res != IRTOY_LEN_VERSION) {
log_error("irtoy_getversion: couldn't read version");
log_error("please make sure you are using firmware v20" \
" or higher");
return 0;
}
buf[IRTOY_LEN_VERSION] = 0;
log_trace("irtoy_getversion: Got version %s", buf);
if (buf[0] != IRTOY_REPLY_VERSION) {
log_error("irtoy_getversion: invalid response %02X", buf[0]);
log_error("please make sure you are using firmware v20" \
" or higher");
return 0;
}
vNum = atoi(buf + 1);
dev->hwVersion = vNum / 100;
dev->swVersion = vNum % 100;
return 1;
}
static int irtoy_reset(irtoy_t* dev)
{
int res;
char buf[16];
buf[0] = IRTOY_COMMAND_RESET;
res = write(dev->fd, buf, 1);
if (res != 1) {
log_error("irtoy_reset: couldn't write command");
return 0;
}
irtoy_readflush(dev, IRTOY_TIMEOUT_FLUSH);
return 1;
}
static int irtoy_enter_samplemode(irtoy_t* dev)
{
int res;
char buf[16];
buf[0] = IRTOY_COMMAND_SMODE_ENTER;
res = write(dev->fd, buf, 1);
if (res != 1) {
log_error("irtoy_enter_samplemode: couldn't write command");
return 0;
}
//delay needed before reading the command result from Irtoy / Irdroid
usleep(100000);
res = read_with_timeout(dev->fd, buf,
IRTOY_LEN_SAMPLEMODEPROTO,
IRTOY_TIMEOUT_SMODE_ENTER);
if (res != IRTOY_LEN_SAMPLEMODEPROTO) {
log_error("irtoy_enter_samplemode: Can't read command result");
return 0;
}
// See gist https://gist.github.com/Irdroid/384d5144d24cba7c94e58dde75388968
res = write(dev->fd, IRTOY_COMMAND24, sizeof(IRTOY_COMMAND24));
if (res != sizeof(IRTOY_COMMAND24)) {
log_error("irtoy_send: couldn't write command 24");
return 0;
}
usleep(20000);
res = write(dev->fd, IRTOY_COMMAND25, sizeof(IRTOY_COMMAND25));
if (res != sizeof(IRTOY_COMMAND25)) {
log_error("irtoy_send: couldn't write command 25");
return 0;
}
usleep(20000);
res = write(dev->fd, IRTOY_COMMAND26, sizeof(IRTOY_COMMAND26));
if (res != sizeof(IRTOY_COMMAND26)) {
log_error("irtoy_send: couldn't write command 26");
return 0;
}
usleep(20000);
buf[IRTOY_LEN_SAMPLEMODEPROTO] = 0;
if (buf[0] != IRTOY_REPLY_SAMPLEMODEPROTO) {
log_error("irtoy_enter_samplemode: invalid response %02X",
buf[0]);
return 0;
}
log_trace("irtoy_reset: Got protocol %s", buf);
dev->protoVersion = atoi(buf + 1);
return 1;
}
static irtoy_t* irtoy_hw_init(int fd)
{
irtoy_t* dev = (irtoy_t*)malloc(sizeof(irtoy_t));
if (dev == NULL) {
log_error("init: out of memory");
return NULL;
}
memset(dev, 0, sizeof(irtoy_t));
dev->awaitingNewSig = 1;
dev->fd = fd;
dev->pulse = 1;
dev->receivedLongPausesInARow = 0;
irtoy_readflush(dev, IRTOY_TIMEOUT_FLUSH);
if (!irtoy_reset(dev) || !irtoy_getversion(dev) ||
!irtoy_enter_samplemode(dev)) {
free(dev);
dev = NULL;
return NULL;
}
return dev;
}
static int init_device(void)
{
if (access(drv.device, R_OK) != 0) {
log_debug("irtoy: cannot access %s", drv.device);
return 0;
}
if (!tty_create_lock(drv.device)) {
log_error("irtoy: could not create lock files");
return 0;
}
drv.fd = open(drv.device, O_RDWR | O_NONBLOCK | O_NOCTTY);
if (drv.fd < 0) {
log_error("irtoy: could not open %s", drv.device);
tty_delete_lock();
return 0;
}
if (!tty_reset(drv.fd)) {
log_error("irtoy: could not reset tty");
close(drv.fd);
tty_delete_lock();
return 0;
}
if (!tty_setbaud(drv.fd, 115200)) {
log_error("irtoy: could not set baud rate");
close(drv.fd);
tty_delete_lock();
return 0;
}
if (!tty_setcsize(drv.fd, 8)) {
log_error("irtoy: could not set csize");
close(drv.fd);
tty_delete_lock();
return 0;
}
if (!tty_setrtscts(drv.fd, 1)) {
log_error("irtoy: could not enable hardware flow");
close(drv.fd);
tty_delete_lock();
return 0;
}
dev = irtoy_hw_init(drv.fd);
if (dev == NULL) {
log_error("irtoy: No USB Irtoy device found at %s",
drv.device);
close(drv.fd);
tty_delete_lock();
return 0;
}
log_trace("Version hw %d, sw %d, protocol %d",
dev->hwVersion, dev->swVersion, dev->protoVersion);
if (dev->swVersion < IRTOY_MINFWVERSION) {
log_error("irtoy: Need firmware V%02d or higher, " \
"this firmware: %02d",
IRTOY_MINFWVERSION,
dev->swVersion);
free(dev);
dev = NULL;
close(drv.fd);
tty_delete_lock();
return 0;
}
rec_buffer_init();
send_buffer_init();
setPin(openPin, 1);
setPin(sendingPin, 0);
setPin(receivePin, 1);
return 1;
}
/* dev.device is const *, so I do not dare to write to it, make my own version */
static char _devname[20];
static int init(void)
{
int i;
int found;
char tmp[64];
const char* const MSG_MORE_DEVICES =
"Additional irtoy device found: %s (ignored)";
const char* const MSG_FOUND = "irtoy device found on %s";
log_trace("irtoy: init");
if (drv.device == NULL) {
log_error("irtoy: NULL device.");
return 0;
}
if (dev != NULL) {
log_debug("irtoy: init: irtoy already initialized");
return 1;
}
if (strcmp(drv.device, "auto") != 0)
return init_device();
for (found = 0, i = 0; i <= 9; i++) {
if (found) {
sprintf(tmp, "/dev/ttyACM%d", i);
drv.device = tmp;
if (init_device())
log_warn(MSG_MORE_DEVICES, tmp);
drv.device = _devname;
} else {
sprintf(_devname, "/dev/ttyACM%d", i);
drv.device = _devname;
found = init_device();
if (found)
log_info(MSG_FOUND, _devname);
}
}
return found;
}
static int deinit(void)
{
log_trace("irtoy: deinit");
// IMPORTANT do not remove this reset. it is vital to return the
// irtoy to IRMAN mode.
// If we leave the irtoy in sample mode while no-one has the
// tty open, the linux cdc_acm driver will fail on the next open.
// This is apparently due to data being sent while the tty is not
// open and fairly well known
// (google for "tty_port_close_start: tty->count = 1 port count = 0")
// IRMAN mode will wait until a signal is actually read before
// sending the next one, while sample mode will keep streaming
// (and under fluorescent light it WILL stream..)
// triggering the problem
if (dev != NULL) {
setPin(openPin, 0);
setPin(sendingPin, 0);
setPin(receivePin, 0);
irtoy_reset(dev);
free(dev);
dev = NULL;
}
close(drv.fd);
drv.fd = -1;
tty_delete_lock();
return 1;
}
static char* receive(struct ir_remote* remotes)
{
log_trace("irtoy_raw_rec");
if (!rec_buffer_clear())
return NULL;
return decode_all(remotes);
}
static int irtoy_send_double_buffered(unsigned char* signals, int length)
{
int numToXmit = length;
int numThisTime;
int res;
unsigned char irToyBufLen;
unsigned char* txPtr;
unsigned char reply[16];
int irtoyXmit;
res = write(dev->fd, IRTOY_COMMAND_TXSTART, sizeof(IRTOY_COMMAND_TXSTART));
if (res != sizeof(IRTOY_COMMAND_TXSTART)) {
log_error("irtoy_send: couldn't write command");
return 0;
}
res = read_with_timeout(dev->fd, &irToyBufLen, 1, IRTOY_TIMEOUT_READYFORDATA);
if (res != 1) {
log_error("irtoy_send: couldn't read command result");
return -1;
}
log_trace("irtoy ready for %d bytes", irToyBufLen);
txPtr = signals;
while (numToXmit) {
numThisTime = (numToXmit < irToyBufLen) ? numToXmit : irToyBufLen;
res = write(dev->fd, txPtr, numThisTime);
if (res != numThisTime) {
log_error("irtoy_send: couldn't write command");
return 0;
}
txPtr += numThisTime;
numToXmit -= numThisTime;
res = read_with_timeout(dev->fd, &irToyBufLen, 1, IRTOY_TIMEOUT_READYFORDATA);
if (res != 1) {
log_error("irtoy_send: couldn't read command result");
return -1;
}
log_trace("irtoy ready for %d bytes", irToyBufLen);
}
res = read_with_timeout(dev->fd, reply, IRTOY_LEN_XMITRES, IRTOY_TIMEOUT_READYFORDATA);
if (res != IRTOY_LEN_XMITRES) {
log_error("irtoy_send: couldn't read command result");
return -1;
}
log_trace("%c %02X %02X %c\n", reply[0], reply[1], reply[2], reply[3]);
if (reply[0] != IRTOY_REPLY_XMITCOUNT) {
log_error("irtoy_send: invalid byte count indicator received: %02X", reply[0]);
return 0;
}
irtoyXmit = (reply[1] << 8) | reply[2];
if (length != irtoyXmit) {
log_error("irtoy_send: incorrect byte count received: %d expected: %d", irtoyXmit, length);
return 0;
}
if (reply[3] != IRTOY_REPLY_XMITSUCCESS) {
log_error("irtoy_send: received error status %02X", reply[3]);
return 0;
}
return 1;
}
static int send(struct ir_remote* remote, struct ir_ncode* code)
{
int length;
const lirc_t* signals;
int numToXmit;
int i;
lirc_t val;
int res;
log_trace("irtoy: send");
if (dev == NULL) {
log_error("irtoy: send: irtoy not initialized");
return 0;
}
if (!send_buffer_put(remote, code))
return 0;
length = send_buffer_length();
signals = send_buffer_data();
for (i = 0; i < length; i++) {
val = (lirc_t)(((double)signals[i]) / IRTOY_UNIT);
rawSB[2 * i] = val >> 8;
rawSB[2 * i + 1] = val & 0xFF;
}
rawSB[2 * length] = 0xFF;
rawSB[2 * length + 1] = 0xFF;
numToXmit = 2 * length + 2;
setPin(sendingPin, 1);
res = irtoy_send_double_buffered(rawSB, numToXmit);
setPin(sendingPin, 0);
return res;
}
static int drvctl_func(unsigned int cmd, void* arg)
{
switch (cmd) {
case DRVCTL_GET_DEVICES:
return drv_enum_udev((glob_t*) arg, UDEV_KEYS);
case DRVCTL_FREE_DEVICES:
drv_enum_free((glob_t*) arg);
return 0;
default:
return DRV_ERR_NOT_IMPLEMENTED;
}
}
|