*
*/
+#include <linux/config.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/poll.h>
printk(KERN_WARNING "isdn_command command(%x) driver -1\n", cmd->command);
return(1);
}
- if (!dev->drv[cmd->driver]) {
- printk(KERN_WARNING "isdn_command command(%x) dev->drv[%d] NULL\n",
- cmd->command, cmd->driver);
- return(1);
- }
- if (!dev->drv[cmd->driver]->interface) {
- printk(KERN_WARNING "isdn_command command(%x) dev->drv[%d]->interface NULL\n",
- cmd->command, cmd->driver);
- return(1);
- }
if (cmd->command == ISDN_CMD_SETL2) {
int idx = isdn_dc2minor(cmd->driver, cmd->arg & 255);
unsigned long l2prot = (cmd->arg >> 8) & 255;
count_put = count_pull;
if(count_put > 1)
tty_insert_flip_string(tty, skb->data, count_put - 1);
- last = skb->data[count_put - 1];
+ last = skb->data[count_put] - 1;
len -= count_put;
#ifdef CONFIG_ISDN_AUDIO
}
static ssize_t
isdn_read(struct file *file, char __user *buf, size_t count, loff_t * off)
{
- uint minor = iminor(file->f_dentry->d_inode);
+ uint minor = MINOR(file->f_dentry->d_inode->i_rdev);
int len = 0;
int drvidx;
int chidx;
static ssize_t
isdn_write(struct file *file, const char __user *buf, size_t count, loff_t * off)
{
- uint minor = iminor(file->f_dentry->d_inode);
+ uint minor = MINOR(file->f_dentry->d_inode->i_rdev);
int drvidx;
int chidx;
int retval;
goto out;
}
chidx = isdn_minor2chan(minor);
- while ((retval = isdn_writebuf_stub(drvidx, chidx, buf, count)) == 0)
+ while (isdn_writebuf_stub(drvidx, chidx, buf, count) != count)
interruptible_sleep_on(&dev->drv[drvidx]->snd_waitq[chidx]);
+ retval = count;
goto out;
}
if (minor <= ISDN_MINOR_CTRLMAX) {
isdn_poll(struct file *file, poll_table * wait)
{
unsigned int mask = 0;
- unsigned int minor = iminor(file->f_dentry->d_inode);
+ unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev);
int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL);
lock_kernel();
static int
isdn_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
{
- uint minor = iminor(inode);
+ uint minor = MINOR(inode->i_rdev);
isdn_ctrl c;
int drvidx;
int chidx;
static int
isdn_open(struct inode *ino, struct file *filep)
{
- uint minor = iminor(ino);
+ uint minor = MINOR(ino->i_rdev);
int drvidx;
int chidx;
int retval = -ENODEV;
static int
isdn_close(struct inode *ino, struct file *filep)
{
- uint minor = iminor(ino);
+ uint minor = MINOR(ino->i_rdev);
lock_kernel();
if (minor == ISDN_MINOR_STATUS) {
{
int i;
- if ((di < 0) || (ch < 0)) {
- printk(KERN_WARNING "%s: called with invalid drv(%d) or channel(%d)\n",
- __FUNCTION__, di, ch);
- return;
- }
for (i = 0; i < ISDN_MAX_CHANNELS; i++)
if (((!usage) || ((dev->usage[i] & ISDN_USAGE_MASK) == usage)) &&
(dev->drvmap[i] == di) &&
dev->v110[i] = NULL;
// 20.10.99 JIM, try to reinitialize v110 !
isdn_info_update();
- if (dev->drv[di])
- skb_queue_purge(&dev->drv[di]->rpqueue[ch]);
+ skb_queue_purge(&dev->drv[di]->rpqueue[ch]);
}
}
struct sk_buff *skb = alloc_skb(hl + len, GFP_ATOMIC);
if (!skb)
- return -ENOMEM;
+ return 0;
skb_reserve(skb, hl);
- if (copy_from_user(skb_put(skb, len), buf, len))
- return -EFAULT;
+ copy_from_user(skb_put(skb, len), buf, len);
ret = dev->drv[drvidx]->interface->writebuf_skb(drvidx, chan, 1, skb);
if (ret <= 0)
dev_kfree_skb(skb);