summaryrefslogtreecommitdiffstats
path: root/drivers/net/irda
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-11-28 03:58:46 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-11-28 03:58:46 +0000
commitb63ad0882a16a5d28003e57f2b0b81dee3fb322b (patch)
tree0a343ce219e2b8b38a5d702d66032c57b83d9720 /drivers/net/irda
parenta9d7bff9a84dba79609a0002e5321b74c4d64c64 (diff)
Merge with 2.4.0-test11.
Diffstat (limited to 'drivers/net/irda')
-rw-r--r--drivers/net/irda/irport.c17
-rw-r--r--drivers/net/irda/irtty.c17
-rw-r--r--drivers/net/irda/nsc-ircc.c27
-rw-r--r--drivers/net/irda/smc-ircc.c36
-rw-r--r--drivers/net/irda/toshoboe.c13
-rw-r--r--drivers/net/irda/w83977af_ir.c19
6 files changed, 94 insertions, 35 deletions
diff --git a/drivers/net/irda/irport.c b/drivers/net/irda/irport.c
index 03944f066..d9c2edbc0 100644
--- a/drivers/net/irda/irport.c
+++ b/drivers/net/irda/irport.c
@@ -230,7 +230,7 @@ irport_open(int i, unsigned int iobase, unsigned int irq)
dev->init = irport_net_init;
dev->hard_start_xmit = irport_hard_xmit;
dev->tx_timeout = irport_timeout;
- dev->watchdog_timeo = HZ/20;
+ dev->watchdog_timeo = HZ; /* Allow time enough for speed change */
dev->open = irport_net_open;
dev->stop = irport_net_close;
dev->get_stats = irport_net_get_stats;
@@ -496,7 +496,6 @@ static void irport_write_wakeup(struct irport_cb *self)
self->tx_buff.data += actual;
self->tx_buff.len -= actual;
} else {
-
/*
* Now serial buffer is almost free & we can start
* transmission of another packet. But first we must check
@@ -629,8 +628,16 @@ int irport_hard_xmit(struct sk_buff *skb, struct net_device *dev)
netif_stop_queue(dev);
/* Check if we need to change the speed */
- if ((speed = irda_get_speed(skb)) != self->io.speed)
- self->new_speed = speed;
+ if ((speed = irda_get_speed(skb)) != self->io.speed) {
+ /* Check for empty frame */
+ if (!skb->len) {
+ irda_task_execute(self, __irport_change_speed,
+ irport_change_speed_complete,
+ NULL, (void *) speed);
+ return 0;
+ } else
+ self->new_speed = speed;
+ }
spin_lock_irqsave(&self->lock, flags);
@@ -999,7 +1006,9 @@ static struct net_device_stats *irport_net_get_stats(struct net_device *dev)
#ifdef MODULE
MODULE_PARM(io, "1-4i");
+MODULE_PARM_DESC(io, "Base I/O adresses");
MODULE_PARM(irq, "1-4i");
+MODULE_PARM_DESC(irq, "IRQ lines");
MODULE_AUTHOR("Dag Brattli <dagb@cs.uit.no>");
MODULE_DESCRIPTION("Half duplex serial driver for IrDA SIR mode");
diff --git a/drivers/net/irda/irtty.c b/drivers/net/irda/irtty.c
index 1fd3acda9..614c5e200 100644
--- a/drivers/net/irda/irtty.c
+++ b/drivers/net/irda/irtty.c
@@ -176,7 +176,7 @@ static int irtty_open(struct tty_struct *tty)
MINOR(tty->device) - tty->driver.minor_start +
tty->driver.name_base);
- hashbin_insert(irtty, (queue_t *) self, (int) self, NULL);
+ hashbin_insert(irtty, (irda_queue_t *) self, (int) self, NULL);
if (tty->driver.flush_buffer)
tty->driver.flush_buffer(tty);
@@ -233,8 +233,6 @@ static int irtty_open(struct tty_struct *tty)
ERROR(__FUNCTION__ "(), dev_alloc() failed!\n");
return -ENOMEM;
}
- /* dev_alloc doesn't clear the struct */
- memset(((__u8*)dev)+sizeof(char*),0,sizeof(struct net_device)-sizeof(char*));
dev->priv = (void *) self;
self->netdev = dev;
@@ -640,8 +638,16 @@ static int irtty_hard_xmit(struct sk_buff *skb, struct net_device *dev)
netif_stop_queue(dev);
/* Check if we need to change the speed */
- if ((speed = irda_get_speed(skb)) != self->io.speed)
- self->new_speed = speed;
+ if ((speed = irda_get_speed(skb)) != self->io.speed) {
+ /* Check for empty frame */
+ if (!skb->len) {
+ irda_task_execute(self, irtty_change_speed,
+ irtty_change_speed_complete,
+ NULL, (void *) speed);
+ return 0;
+ } else
+ self->new_speed = speed;
+ }
/* Init tx buffer*/
self->tx_buff.data = self->tx_buff.head;
@@ -1029,6 +1035,7 @@ MODULE_AUTHOR("Dag Brattli <dagb@cs.uit.no>");
MODULE_DESCRIPTION("IrDA TTY device driver");
MODULE_PARM(qos_mtt_bits, "i");
+MODULE_PARM_DESC(qos_mtt_bits, "Minimum Turn Time");
/*
* Function init_module (void)
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c
index 834300c28..245442ff2 100644
--- a/drivers/net/irda/nsc-ircc.c
+++ b/drivers/net/irda/nsc-ircc.c
@@ -1076,9 +1076,15 @@ static int nsc_ircc_hard_xmit_sir(struct sk_buff *skb, struct net_device *dev)
netif_stop_queue(dev);
/* Check if we need to change the speed */
- if ((speed = irda_get_speed(skb)) != self->io.speed)
- self->new_speed = speed;
-
+ if ((speed = irda_get_speed(skb)) != self->io.speed) {
+ /* Check for empty frame */
+ if (!skb->len) {
+ nsc_ircc_change_speed(self, speed);
+ return 0;
+ } else
+ self->new_speed = speed;
+ }
+
spin_lock_irqsave(&self->lock, flags);
/* Save current bank */
@@ -1120,8 +1126,14 @@ static int nsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev)
netif_stop_queue(dev);
/* Check if we need to change the speed */
- if ((speed = irda_get_speed(skb)) != self->io.speed)
- self->new_speed = speed;
+ if ((speed = irda_get_speed(skb)) != self->io.speed) {
+ /* Check for empty frame */
+ if (!skb->len) {
+ nsc_ircc_change_speed(self, speed);
+ return 0;
+ } else
+ self->new_speed = speed;
+ }
spin_lock_irqsave(&self->lock, flags);
@@ -2029,10 +2041,15 @@ MODULE_AUTHOR("Dag Brattli <dagb@cs.uit.no>");
MODULE_DESCRIPTION("NSC IrDA Device Driver");
MODULE_PARM(qos_mtt_bits, "i");
+MODULE_PARM_DESC(qos_mtt_bits, "Minimum Turn Time");
MODULE_PARM(io, "1-4i");
+MODULE_PARM_DESC(io, "Base I/O addresses");
MODULE_PARM(irq, "1-4i");
+MODULE_PARM_DESC(irq, "IRQ lines");
MODULE_PARM(dma, "1-4i");
+MODULE_PARM_DESC(dma, "DMA channels");
MODULE_PARM(dongle_id, "i");
+MODULE_PARM_DESC(dongle_id, "Type-id of used dongle");
int init_module(void)
{
diff --git a/drivers/net/irda/smc-ircc.c b/drivers/net/irda/smc-ircc.c
index 470d6dd4d..480796f75 100644
--- a/drivers/net/irda/smc-ircc.c
+++ b/drivers/net/irda/smc-ircc.c
@@ -7,7 +7,7 @@
* Author: Thomas Davis (tadavis@jps.net)
* Created at:
* Modified at: Tue Feb 22 10:05:06 2000
- * Modified by: Dag Brattli <dagb@cs.uit.no>
+ * Modified by: Dag Brattli <dag@brattli.net>
*
* Copyright (c) 1999-2000 Dag Brattli
* Copyright (c) 1998-1999 Thomas Davis,
@@ -252,6 +252,7 @@ static int ircc_open(int i, unsigned int fir_base, unsigned int sir_base)
IR_115200|IR_576000|IR_1152000|(IR_4000000 << 8);
irport->qos.min_turn_time.bits = 0x07;
+ irport->qos.window_size.bits = 0x01;
irda_qos_bits_to_value(&irport->qos);
irport->flags = IFF_FIR|IFF_MIR|IFF_SIR|IFF_DMA|IFF_PIO;
@@ -508,6 +509,10 @@ static void ircc_change_speed(void *priv, __u32 speed)
outb(0x00, iobase+IRCC_MASTER);
switch (speed) {
+ default:
+ IRDA_DEBUG(0, __FUNCTION__ "(), unknown baud rate of %d\n",
+ speed);
+ /* FALLTHROUGH */
case 9600:
case 19200:
case 38400:
@@ -535,10 +540,6 @@ static void ircc_change_speed(void *priv, __u32 speed)
fast = IRCC_LCR_A_FAST;
IRDA_DEBUG(0, __FUNCTION__ "(), handling baud of 4000000\n");
break;
- default:
- IRDA_DEBUG(0, __FUNCTION__ "(), unknown baud rate of %d\n",
- speed);
- return;
}
register_bank(iobase, 0);
@@ -589,6 +590,8 @@ static void ircc_change_speed(void *priv, __u32 speed)
register_bank(iobase, 0);
outb(fast, iobase+IRCC_LCR_A);
+
+ netif_start_queue(dev);
}
/*
@@ -612,13 +615,19 @@ static int ircc_hard_xmit(struct sk_buff *skb, struct net_device *dev)
iobase = self->io.fir_base;
- spin_lock_irqsave(&self->lock, flags);
+ netif_stop_queue(dev);
/* Check if we need to change the speed after this frame */
- if ((speed = irda_get_speed(skb)) != self->io.speed)
- self->new_speed = speed;
+ if ((speed = irda_get_speed(skb)) != self->io.speed) {
+ /* Check for empty frame */
+ if (!skb->len) {
+ ircc_change_speed(self, speed);
+ return 0;
+ } else
+ self->new_speed = speed;
+ }
- netif_stop_queue(dev);
+ spin_lock_irqsave(&self->lock, flags);
memcpy(self->tx_buff.head, skb->data, skb->len);
@@ -630,7 +639,7 @@ static int ircc_hard_xmit(struct sk_buff *skb, struct net_device *dev)
int bofs;
/*
- * Compute who many BOFS (STA or PA's) we need to waste the
+ * Compute how many BOFs (STA or PA's) we need to waste the
* min turn time given the speed of the link.
*/
bofs = mtt * (self->io.speed / 1000) / 8000;
@@ -642,7 +651,6 @@ static int ircc_hard_xmit(struct sk_buff *skb, struct net_device *dev)
/* Transmit frame */
ircc_dma_xmit(self, iobase, 0);
}
-
spin_unlock_irqrestore(&self->lock, flags);
dev_kfree_skb(skb);
@@ -759,6 +767,7 @@ static int ircc_dma_receive(struct ircc_cb *self, int iobase)
setup_dma(self->io.dma, self->rx_buff.data, self->rx_buff.truesize,
DMA_RX_MODE);
+
/* Set max Rx frame size */
register_bank(iobase, 4);
outb((2050 >> 8) & 0x0f, iobase+IRCC_RX_SIZE_HI);
@@ -787,7 +796,6 @@ static int ircc_dma_receive(struct ircc_cb *self, int iobase)
*
* Finished with receiving frames
*
- *
*/
static void ircc_dma_receive_complete(struct ircc_cb *self, int iobase)
{
@@ -814,7 +822,7 @@ static void ircc_dma_receive_complete(struct ircc_cb *self, int iobase)
else
len -= 4;
- if ((len < 2) && (len > 2050)) {
+ if ((len < 2) || (len > 2050)) {
WARNING(__FUNCTION__ "(), bogus len=%d\n", len);
return;
}
@@ -1039,7 +1047,9 @@ static int ircc_pmproc(struct pm_dev *dev, pm_request_t rqst, void *data)
MODULE_AUTHOR("Thomas Davis <tadavis@jps.net>");
MODULE_DESCRIPTION("SMC IrCC controller driver");
MODULE_PARM(ircc_dma, "1i");
+MODULE_PARM_DESC(ircc_dma, "DMA channel");
MODULE_PARM(ircc_irq, "1i");
+MODULE_PARM_DESC(ircc_irq, "IRQ line");
int init_module(void)
{
diff --git a/drivers/net/irda/toshoboe.c b/drivers/net/irda/toshoboe.c
index 65ccfee2b..04d91c232 100644
--- a/drivers/net/irda/toshoboe.c
+++ b/drivers/net/irda/toshoboe.c
@@ -272,8 +272,14 @@ toshoboe_hard_xmit (struct sk_buff *skb, struct net_device *dev)
);
/* Check if we need to change the speed */
- if ((speed = irda_get_speed(skb)) != self->io.speed)
- self->new_speed = speed;
+ if ((speed = irda_get_speed(skb)) != self->io.speed) {
+ /* Check for empty frame */
+ if (!skb->len) {
+ toshoboe_setbaud(self, speed);
+ return 0;
+ } else
+ self->new_speed = speed;
+ }
netif_stop_queue(dev);
@@ -628,7 +634,10 @@ static int toshoboe_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
#ifdef MODULE
+MODULE_DESCRIPTION("Toshiba OBOE IrDA Device Driver");
+MODULE_AUTHOR("James McKenzie <james@fishsoup.dhs.org>");
MODULE_PARM (max_baud, "i");
+MODULE_PARM_DESC(max_baus, "Maximum baud rate");
static int
toshoboe_close (struct toshoboe_cb *self)
diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c
index 2456e012d..91e81df66 100644
--- a/drivers/net/irda/w83977af_ir.c
+++ b/drivers/net/irda/w83977af_ir.c
@@ -255,13 +255,12 @@ int w83977af_open(int i, unsigned int iobase, unsigned int irq,
dev->get_stats = w83977af_net_get_stats;
rtnl_lock();
- err = register_netdev(dev);
+ err = register_netdevice(dev);
rtnl_unlock();
if (err) {
- ERROR(__FUNCTION__ "(), register_netdev() failed!\n");
+ ERROR(__FUNCTION__ "(), register_netdevice() failed!\n");
return -1;
}
-
MESSAGE("IrDA: Registered device %s\n", dev->name);
return 0;
@@ -514,8 +513,14 @@ int w83977af_hard_xmit(struct sk_buff *skb, struct net_device *dev)
netif_stop_queue(dev);
/* Check if we need to change the speed */
- if ((speed = irda_get_speed(skb)) != self->io.speed)
- self->new_speed = speed;
+ if ((speed = irda_get_speed(skb)) != self->io.speed) {
+ /* Check for empty frame */
+ if (!skb->len) {
+ w83977af_change_speed(self, speed);
+ return 0;
+ } else
+ self->new_speed = speed;
+ }
/* Save current set */
set = inb(iobase+SSR);
@@ -1366,9 +1371,11 @@ MODULE_AUTHOR("Dag Brattli <dagb@cs.uit.no>");
MODULE_DESCRIPTION("Winbond W83977AF IrDA Device Driver");
MODULE_PARM(qos_mtt_bits, "i");
+MODULE_PARM_DESC(qos_mtt_bits, "Mimimum Turn Time");
MODULE_PARM(io, "1-4i");
-MODULE_PARM(io2, "1-4i");
+MODULE_PARM_DESC(io, "Base I/O addresses");
MODULE_PARM(irq, "1-4i");
+MODULE_PARM_DESC(irq, "IRQ lines");
/*
* Function init_module (void)