Source
static int loop_set_rx_carrier_range(struct rc_dev *dev, u32 min, u32 max)
/*
* Loopback driver for rc-core,
*
* Copyright (c) 2010 David Härdeman <david@hardeman.nu>
*
* This driver receives TX data and passes it back as RX data,
* which is useful for (scripted) debugging of rc-core without
* having to use actual hardware.
*
* 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 General Public License for more details.
*
*/
static bool debug;
struct loopback_dev {
struct rc_dev *dev;
u32 txmask;
u32 txcarrier;
u32 txduty;
bool idle;
bool learning;
bool carrierreport;
u32 rxcarriermin;
u32 rxcarriermax;
};
static struct loopback_dev loopdev;
static int loop_set_tx_mask(struct rc_dev *dev, u32 mask)
{
struct loopback_dev *lodev = dev->priv;
if ((mask & (RXMASK_REGULAR | RXMASK_LEARNING)) != mask) {
dprintk("invalid tx mask: %u\n", mask);
return -EINVAL;
}
dprintk("setting tx mask: %u\n", mask);
lodev->txmask = mask;
return 0;
}
static int loop_set_tx_carrier(struct rc_dev *dev, u32 carrier)