/*Find out where the rings live */
physaddr = virt_to_bus (self->ring);
- ASSERT ((physaddr & 0x3ff) == 0,
- printk (KERN_ERR DRIVER_NAME "ring not correctly aligned\n");
- return;);
+ IRDA_ASSERT ((physaddr & 0x3ff) == 0,
+ printk (KERN_ERR DRIVER_NAME "ring not correctly aligned\n");
+ return;);
OUTB ((physaddr >> 10) & 0xff, OBOE_RING_BASE0);
OUTB ((physaddr >> 18) & 0xff, OBOE_RING_BASE1);
self = (struct toshoboe_cb *) dev->priv;
- ASSERT (self != NULL, return 0; );
+ IRDA_ASSERT (self != NULL, return 0; );
IRDA_DEBUG (1, "%s.tx:%x(%x)%x\n", __FUNCTION__
,skb->len,self->txpending,INB (OBOE_ENABLEH));
IRDA_DEBUG (4, "%s()\n", __FUNCTION__);
- ASSERT (dev != NULL, return -1; );
+ IRDA_ASSERT (dev != NULL, return -1; );
self = (struct toshoboe_cb *) dev->priv;
- ASSERT (self != NULL, return 0; );
+ IRDA_ASSERT (self != NULL, return 0; );
if (self->async)
return -EBUSY;
IRDA_DEBUG (4, "%s()\n", __FUNCTION__);
- ASSERT (dev != NULL, return -1; );
+ IRDA_ASSERT (dev != NULL, return -1; );
self = (struct toshoboe_cb *) dev->priv;
/* Stop device */
unsigned long flags;
int ret = 0;
- ASSERT (dev != NULL, return -1; );
+ IRDA_ASSERT (dev != NULL, return -1; );
self = dev->priv;
- ASSERT (self != NULL, return -1; );
+ IRDA_ASSERT (self != NULL, return -1; );
IRDA_DEBUG (5, "%s(), %s, (cmd=0x%X)\n", __FUNCTION__, dev->name, cmd);
*/
IRDA_DEBUG (1, "%s(BANDWIDTH), %s, (%X/%ld\n", __FUNCTION__
,dev->name, INB (OBOE_STATUS), irq->ifr_baudrate );
- if (!in_interrupt () && !capable (CAP_NET_ADMIN))
- return -EPERM;
+ if (!in_interrupt () && !capable (CAP_NET_ADMIN)) {
+ ret = -EPERM;
+ goto out;
+ }
/* self->speed=irq->ifr_baudrate; */
/* toshoboe_setbaud(self); */
case SIOCSMEDIABUSY: /* Set media busy */
IRDA_DEBUG (1, "%s(MEDIABUSY), %s, (%X/%x)\n", __FUNCTION__
,dev->name, INB (OBOE_STATUS), capable (CAP_NET_ADMIN) );
- if (!capable (CAP_NET_ADMIN))
- return -EPERM;
+ if (!capable (CAP_NET_ADMIN)) {
+ ret = -EPERM;
+ goto out;
+ }
irda_device_set_media_busy (self->netdev, TRUE);
break;
case SIOCGRECEIVING: /* Check if we are receiving right now */
IRDA_DEBUG (1, "%s(?), %s, (cmd=0x%X)\n", __FUNCTION__, dev->name, cmd);
ret = -EOPNOTSUPP;
}
-
+out:
spin_unlock_irqrestore(&self->spinlock, flags);
return ret;
MODULE_AUTHOR("James McKenzie <james@fishsoup.dhs.org>");
MODULE_LICENSE("GPL");
-MODULE_PARM (max_baud, "i");
+module_param (max_baud, int, 0);
MODULE_PARM_DESC(max_baud, "Maximum baud rate");
#ifdef USE_PROBE
-MODULE_PARM (do_probe, "i");
+module_param (do_probe, bool, 0);
MODULE_PARM_DESC(do_probe, "Enable/disable chip probing and self-test");
#endif
IRDA_DEBUG (4, "%s()\n", __FUNCTION__);
- ASSERT (self != NULL, return; );
+ IRDA_ASSERT (self != NULL, return; );
if (!self->stopped)
{
goto freeregion;
}
+#if (BITS_PER_LONG == 64)
+#error broken on 64-bit: casts pointer to 32-bit, and then back to pointer.
+#endif
+
/*We need to align the taskfile on a taskfile size boundary */
{
unsigned long addr;
freebufs:
for (i = 0; i < TX_SLOTS; ++i)
- if (self->tx_bufs[i])
- kfree (self->tx_bufs[i]);
+ kfree (self->tx_bufs[i]);
for (i = 0; i < RX_SLOTS; ++i)
- if (self->rx_bufs[i])
- kfree (self->rx_bufs[i]);
+ kfree (self->rx_bufs[i]);
kfree(self->ringbuf);
freeregion:
}
static int
-toshoboe_gotosleep (struct pci_dev *pci_dev, u32 crap)
+toshoboe_gotosleep (struct pci_dev *pci_dev, pm_message_t crap)
{
struct toshoboe_cb *self = (struct toshoboe_cb*)pci_get_drvdata(pci_dev);
unsigned long flags;