Hey, you know me, this is for free...
The main reason why I didn't release source yet, is that I think it isn't stable enough. I could only test over reliable network connections and that's why this link was here.
The remote operation of the empeg also incorperates a kernel-change in the IR-driver. I will post the kernel-change here for someone to get a good look at it, as I still think it is wrong( but hey, it works...)
static ssize_t ir_write(struct file *filp, const char *buf, size_t count,
loff_t *ppos)
{
struct empeg_ir_write {
int type;
ir_code ircode;
} *data;
struct ir_dev *dev = filp->private_data;
if ( count < sizeof(data) ) return count;
data = (struct empeg_ir_write *) buf;
#if IR_DEBUG
printk("count: %d.\n",count);
printk("type: %d.\n",data->type);
printk("ircode: %d.\n",data->ircode);
#endif
if ( data->type ) {
ir_append_data_repeat(dev,data->ircode);
} else {
ir_append_data_repeatable(dev,data->ircode);
}
return count;
}
static int ir_open(struct inode *inode, struct file *filp)
{
struct ir_dev *dev = ir_devices;
if ( (!(filp->f_flags & O_WRONLY)) && users )
return -EBUSY;
users++;
MOD_INC_USE_COUNT;
/* This shouldn't be necessary, but there's something (IDE, audio?)
* that's setting rather than or'ing these and breaking it after
* initialisation.
*/
GRER|=EMPEG_IRINPUT;
GFER|=EMPEG_IRINPUT;
GEDR=EMPEG_IRINPUT;
dev->ir_type = IR_TYPE_DEFAULT;
dev->repeat_delay_jiffies = IR_RPTDELAY_DEFAULT;
dev->repeat_interval_jiffies = IR_RPTINT_DEFAULT;
dev->repeat_timeout_jiffies = IR_RPTTMOUT_DEFAULT;
filp->private_data = dev;
return 0;
}
I think the problem is in ir_open. If I just return 0 after opening, I get a kernel-error after first write to /dev/ir, but it just doesn't feel right to reinitialize the private_data.
Any suggestions?...
Frank van Gestel