printk("Timer: Cool,chrdev is regsitered!\n");
for(tmrs=0;tmrs<8;tmrs++)
{
timer_handles[tmrs]=devfs_register(NULL,"timer",DEVFS_FL_DEFAULT,
42, tmrs, S_IFCHR |
S_IRUGO | S_IWUSR,&timer_fops,tmrs);
}
}
And in my open, I try to decode the minor number:
static
int timer_open(struct inode *inode, struct file *file)
{
printk("sysclk: open() f_mode=%d, minor = %1d, minor2 %0x\n",
file->f_mode, MINOR(inode->i_rdev),(inode->i_rdev));
// we're going to be sneaky here - the minor number
// stored in the file private data will be used to
// index the 'interrupt occurred' flag for the poll
// routine.
file->private_data = (void *)MINOR(inode->i_rdev);
usequeue[MINOR(inode->i_rdev)]++;
MOD_INC_USE_COUNT;
return 0;
}
But MINOR(inode->i_rdev) always returns 0, no matter which
minor devices I open.
If this doesn't belong here, please direct mail me, as this
has my stymied.
Thank you.
-- Michael Baumann Optivus Technology Inc.|Loma Linda University Medical Center San Bernardino, California. (909)799-8308 |Internet: baumann@llumc.edu
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/