Lines Matching refs:self

244 toshoboe_dumpregs (struct toshoboe_cb *self)  in toshoboe_dumpregs()  argument
254 self->int_tx, self->int_rx, self->int_txunder, self->int_rxover, in toshoboe_dumpregs()
255 self->int_sip); in toshoboe_dumpregs()
272 if (self->ring) in toshoboe_dumpregs()
275 ringbase = virt_to_bus (self->ring); in toshoboe_dumpregs()
279 printk (" (%d,%02x)",self->ring->rx[i].len,self->ring->rx[i].control); in toshoboe_dumpregs()
283 printk (" (%d,%02x)",self->ring->tx[i].len,self->ring->tx[i].control); in toshoboe_dumpregs()
291 toshoboe_disablebm (struct toshoboe_cb *self) in toshoboe_disablebm() argument
294 pci_read_config_byte (self->pdev, PCI_COMMAND, &command); in toshoboe_disablebm()
296 pci_write_config_byte (self->pdev, PCI_COMMAND, command); in toshoboe_disablebm()
302 toshoboe_stopchip (struct toshoboe_cb *self) in toshoboe_stopchip() argument
327 toshoboe_disablebm (self); in toshoboe_stopchip()
332 toshoboe_start_DMA (struct toshoboe_cb *self, int opts) in toshoboe_start_DMA() argument
342 toshoboe_setbaud (struct toshoboe_cb *self) in toshoboe_setbaud() argument
347 pr_debug("%s(%d/%d)\n", __func__, self->speed, self->io.speed); in toshoboe_setbaud()
349 switch (self->speed) in toshoboe_setbaud()
366 self->speed); in toshoboe_setbaud()
370 switch (self->speed) in toshoboe_setbaud()
410 switch (self->speed) in toshoboe_setbaud()
420 if (self->async) in toshoboe_setbaud()
471 self->new_speed = 0; in toshoboe_setbaud()
472 self->io.speed = self->speed; in toshoboe_setbaud()
477 toshoboe_enablebm (struct toshoboe_cb *self) in toshoboe_enablebm() argument
479 pci_set_master (self->pdev); in toshoboe_enablebm()
484 toshoboe_initring (struct toshoboe_cb *self) in toshoboe_initring() argument
490 self->ring->tx[i].len = 0; in toshoboe_initring()
491 self->ring->tx[i].control = 0x00; in toshoboe_initring()
492 self->ring->tx[i].address = virt_to_bus (self->tx_bufs[i]); in toshoboe_initring()
497 self->ring->rx[i].len = RX_LEN; in toshoboe_initring()
498 self->ring->rx[i].len = 0; in toshoboe_initring()
499 self->ring->rx[i].address = virt_to_bus (self->rx_bufs[i]); in toshoboe_initring()
500 self->ring->rx[i].control = OBOE_CTL_RX_HW_OWNS; in toshoboe_initring()
505 toshoboe_resetptrs (struct toshoboe_cb *self) in toshoboe_resetptrs() argument
512 self->rxs = inb_p (OBOE_RXSLOT) & OBOE_SLOT_MASK; in toshoboe_resetptrs()
513 self->txs = inb_p (OBOE_TXSLOT) & OBOE_SLOT_MASK; in toshoboe_resetptrs()
518 toshoboe_initptrs (struct toshoboe_cb *self) in toshoboe_initptrs() argument
525 toshoboe_resetptrs (self); in toshoboe_initptrs()
531 self->txpending = 0; in toshoboe_initptrs()
540 toshoboe_startchip (struct toshoboe_cb *self) in toshoboe_startchip() argument
544 toshoboe_initring (self); in toshoboe_startchip()
545 toshoboe_enablebm (self); in toshoboe_startchip()
573 physaddr = virt_to_bus (self->ring); in toshoboe_startchip()
590 self->speed = 9600; in toshoboe_startchip()
591 toshoboe_setbaud (self); in toshoboe_startchip()
592 toshoboe_initptrs (self); in toshoboe_startchip()
596 toshoboe_isntstuck (struct toshoboe_cb *self) in toshoboe_isntstuck() argument
601 toshoboe_checkstuck (struct toshoboe_cb *self) in toshoboe_checkstuck() argument
607 spin_lock_irqsave(&self->spinlock, flags); in toshoboe_checkstuck()
612 toshoboe_stopchip (self); in toshoboe_checkstuck()
613 toshoboe_startchip (self); in toshoboe_checkstuck()
614 spin_unlock_irqrestore(&self->spinlock, flags); in toshoboe_checkstuck()
620 toshoboe_makemttpacket (struct toshoboe_cb *self, void *buf, int mtt) in toshoboe_makemttpacket() argument
624 xbofs = ((int) (mtt/100)) * (int) (self->speed); in toshoboe_makemttpacket()
629 xbofs, mtt, self->speed); in toshoboe_makemttpacket()
649 toshoboe_dumptx (struct toshoboe_cb *self) in toshoboe_dumptx() argument
654 PROBE_DEBUG(" (%d,%02x)",self->ring->tx[i].len,self->ring->tx[i].control); in toshoboe_dumptx()
655 PROBE_DEBUG(" [%d]\n",self->speed); in toshoboe_dumptx()
659 toshoboe_dumprx (struct toshoboe_cb *self, int score) in toshoboe_dumprx() argument
664 PROBE_DEBUG(" (%d,%02x)",self->ring->rx[i].len,self->ring->rx[i].control); in toshoboe_dumprx()
692 struct toshoboe_cb *self = dev_id; in toshoboe_probeinterrupt() local
708 self->int_tx++; in toshoboe_probeinterrupt()
712 if (self->ring->tx[txp].control & OBOE_CTL_TX_HW_OWNS) in toshoboe_probeinterrupt()
714 self->int_tx+=100; in toshoboe_probeinterrupt()
716 toshoboe_start_DMA(self, OBOE_CONFIG0H_ENTX | OBOE_CONFIG0H_LOOP); in toshoboe_probeinterrupt()
721 self->int_rx++; in toshoboe_probeinterrupt()
724 self->int_txunder++; in toshoboe_probeinterrupt()
727 self->int_rxover++; in toshoboe_probeinterrupt()
730 self->int_sip++; in toshoboe_probeinterrupt()
773 toshoboe_probefail (struct toshoboe_cb *self, char *msg) in toshoboe_probefail() argument
775 printk (KERN_ERR DRIVER_NAME "probe(%d) failed %s\n",self-> speed, msg); in toshoboe_probefail()
776 toshoboe_dumpregs (self); in toshoboe_probefail()
777 toshoboe_stopchip (self); in toshoboe_probefail()
778 free_irq (self->io.irq, (void *) self); in toshoboe_probefail()
783 toshoboe_numvalidrcvs (struct toshoboe_cb *self) in toshoboe_numvalidrcvs() argument
787 if ((self->ring->rx[i].control & 0xe0) == 0) in toshoboe_numvalidrcvs()
794 toshoboe_numrcvs (struct toshoboe_cb *self) in toshoboe_numrcvs() argument
798 if (!(self->ring->rx[i].control & OBOE_CTL_RX_HW_OWNS)) in toshoboe_numrcvs()
805 toshoboe_probe (struct toshoboe_cb *self) in toshoboe_probe() argument
815 if (request_irq (self->io.irq, toshoboe_probeinterrupt, in toshoboe_probe()
816 self->io.irqflags, "toshoboe", (void *) self)) in toshoboe_probe()
819 self->io.irq); in toshoboe_probe()
828 toshoboe_stopchip (self); in toshoboe_probe()
831 spin_lock_irqsave(&self->spinlock, flags); in toshoboe_probe()
833 toshoboe_startchip (self); in toshoboe_probe()
834 self->int_rx = self->int_tx = 0; in toshoboe_probe()
835 self->speed = bauds[j]; in toshoboe_probe()
836 toshoboe_setbaud (self); in toshoboe_probe()
837 toshoboe_initptrs (self); in toshoboe_probe()
838 spin_unlock_irqrestore(&self->spinlock, flags); in toshoboe_probe()
840 self->ring->tx[self->txs].control = in toshoboe_probe()
845 self->ring->tx[self->txs].len = in toshoboe_probe()
846 toshoboe_maketestpacket (self->tx_bufs[self->txs], 0, fir); in toshoboe_probe()
847 self->txs++; in toshoboe_probe()
848 self->txs %= TX_SLOTS; in toshoboe_probe()
850 self->ring->tx[self->txs].control = in toshoboe_probe()
853 self->ring->tx[self->txs].len = in toshoboe_probe()
854 toshoboe_maketestpacket (self->tx_bufs[self->txs], 0, fir); in toshoboe_probe()
855 self->txs++; in toshoboe_probe()
856 self->txs %= TX_SLOTS; in toshoboe_probe()
858 self->ring->tx[self->txs].control = in toshoboe_probe()
861 self->ring->tx[self->txs].len = in toshoboe_probe()
862 toshoboe_maketestpacket (self->tx_bufs[self->txs], 0, fir); in toshoboe_probe()
863 self->txs++; in toshoboe_probe()
864 self->txs %= TX_SLOTS; in toshoboe_probe()
866 self->ring->tx[self->txs].control = in toshoboe_probe()
870 self->ring->tx[self->txs].len = in toshoboe_probe()
871 toshoboe_maketestpacket (self->tx_bufs[self->txs], 0, fir); in toshoboe_probe()
872 self->txs++; in toshoboe_probe()
873 self->txs %= TX_SLOTS; in toshoboe_probe()
875 toshoboe_dumptx (self); in toshoboe_probe()
877 toshoboe_start_DMA(self, OBOE_CONFIG0H_ENTX | OBOE_CONFIG0H_LOOP); in toshoboe_probe()
881 while (toshoboe_numvalidrcvs (self) != n) in toshoboe_probe()
884 return toshoboe_probefail (self, "filter test"); in toshoboe_probe()
885 udelay ((9600*(TT_LEN+16))/self->speed); in toshoboe_probe()
890 while ((toshoboe_numrcvs(self) != self->int_rx) || (self->int_tx != n)) in toshoboe_probe()
893 return toshoboe_probefail (self, "interrupt test"); in toshoboe_probe()
894 udelay ((9600*(TT_LEN+16))/self->speed); in toshoboe_probe()
897 toshoboe_dumprx (self,i); in toshoboe_probe()
903 toshoboe_stopchip (self); in toshoboe_probe()
904 self->int_rx = self->int_tx = 0; in toshoboe_probe()
906 spin_lock_irqsave(&self->spinlock, flags); in toshoboe_probe()
907 toshoboe_startchip (self); in toshoboe_probe()
908 spin_unlock_irqrestore(&self->spinlock, flags); in toshoboe_probe()
910 self->async = 1; in toshoboe_probe()
911 self->speed = 115200; in toshoboe_probe()
912 toshoboe_setbaud (self); in toshoboe_probe()
913 self->ring->tx[self->txs].control = in toshoboe_probe()
915 self->ring->tx[self->txs].len = 4; in toshoboe_probe()
917 ((unsigned char *) self->tx_bufs[self->txs])[0] = 'f'; in toshoboe_probe()
918 ((unsigned char *) self->tx_bufs[self->txs])[1] = 'i'; in toshoboe_probe()
919 ((unsigned char *) self->tx_bufs[self->txs])[2] = 's'; in toshoboe_probe()
920 ((unsigned char *) self->tx_bufs[self->txs])[3] = 'h'; in toshoboe_probe()
921 toshoboe_dumptx (self); in toshoboe_probe()
922 toshoboe_start_DMA(self, OBOE_CONFIG0H_ENTX | OBOE_CONFIG0H_LOOP); in toshoboe_probe()
925 while (toshoboe_numvalidrcvs (self) != 4) in toshoboe_probe()
928 return toshoboe_probefail (self, "Async test"); in toshoboe_probe()
933 while ((toshoboe_numrcvs (self) != self->int_rx) || (self->int_tx != 1)) in toshoboe_probe()
936 return toshoboe_probefail (self, "Async interrupt test"); in toshoboe_probe()
940 toshoboe_dumprx (self,i); in toshoboe_probe()
942 self->async = 0; in toshoboe_probe()
943 self->speed = 9600; in toshoboe_probe()
944 toshoboe_setbaud (self); in toshoboe_probe()
945 toshoboe_stopchip (self); in toshoboe_probe()
947 free_irq (self->io.irq, (void *) self); in toshoboe_probe()
962 struct toshoboe_cb *self; in toshoboe_hard_xmit() local
968 self = netdev_priv(dev); in toshoboe_hard_xmit()
970 IRDA_ASSERT (self != NULL, return NETDEV_TX_OK; ); in toshoboe_hard_xmit()
973 __func__, skb->len, self->txpending, INB(OBOE_ENABLEH)); in toshoboe_hard_xmit()
982 if (self->new_speed) in toshoboe_hard_xmit()
986 if (self->stopped) in toshoboe_hard_xmit()
989 toshoboe_checkstuck (self); in toshoboe_hard_xmit()
994 if ((speed != self->io.speed) && (speed != -1)) in toshoboe_hard_xmit()
996 spin_lock_irqsave(&self->spinlock, flags); in toshoboe_hard_xmit()
998 if (self->txpending || skb->len) in toshoboe_hard_xmit()
1000 self->new_speed = speed; in toshoboe_hard_xmit()
1006 spin_unlock_irqrestore(&self->spinlock, flags); in toshoboe_hard_xmit()
1014 spin_unlock_irqrestore(&self->spinlock, flags); in toshoboe_hard_xmit()
1019 self->speed = speed; in toshoboe_hard_xmit()
1020 toshoboe_setbaud (self); in toshoboe_hard_xmit()
1021 spin_unlock_irqrestore(&self->spinlock, flags); in toshoboe_hard_xmit()
1031 spin_lock_irqsave(&self->spinlock, flags); in toshoboe_hard_xmit()
1033 if (self->txpending) in toshoboe_hard_xmit()
1035 spin_unlock_irqrestore(&self->spinlock, flags); in toshoboe_hard_xmit()
1043 mtt = toshoboe_makemttpacket (self, self->tx_bufs[self->txs], mtt); in toshoboe_hard_xmit()
1044 pr_debug("%s.mtt:%x(%x)%d\n", __func__, skb->len, mtt, self->txpending); in toshoboe_hard_xmit()
1047 self->ring->tx[self->txs].len = mtt & 0xfff; in toshoboe_hard_xmit()
1060 self->ring->tx[self->txs].control = ctl; in toshoboe_hard_xmit()
1064 toshoboe_start_DMA(self, OBOE_CONFIG0H_ENTX | OBOE_CONFIG0H_LOOP); in toshoboe_hard_xmit()
1066 self->txpending++; in toshoboe_hard_xmit()
1068 self->txs++; in toshoboe_hard_xmit()
1069 self->txs %= TX_SLOTS; in toshoboe_hard_xmit()
1076 spin_unlock_irqrestore(&self->spinlock, flags); in toshoboe_hard_xmit()
1083 spin_lock_irqsave(&self->spinlock, flags); in toshoboe_hard_xmit()
1085 if (self->ring->tx[self->txs].control & OBOE_CTL_TX_HW_OWNS) in toshoboe_hard_xmit()
1088 __func__, skb->len, self->ring->tx[self->txs].control, in toshoboe_hard_xmit()
1089 self->txpending); in toshoboe_hard_xmit()
1090 toshoboe_start_DMA(self, OBOE_CONFIG0H_ENTX); in toshoboe_hard_xmit()
1091 spin_unlock_irqrestore(&self->spinlock, flags); in toshoboe_hard_xmit()
1097 len = async_wrap_skb (skb, self->tx_bufs[self->txs], TX_BUF_SZ); in toshoboe_hard_xmit()
1102 skb_copy_from_linear_data(skb, self->tx_bufs[self->txs], len); in toshoboe_hard_xmit()
1104 self->ring->tx[self->txs].len = len & 0x0fff; in toshoboe_hard_xmit()
1115 self->ring->tx[self->txs].control = ctl; in toshoboe_hard_xmit()
1119 if (!self->txpending) in toshoboe_hard_xmit()
1120 toshoboe_start_DMA(self, OBOE_CONFIG0H_ENTX); in toshoboe_hard_xmit()
1122 self->txpending++; in toshoboe_hard_xmit()
1124 self->txs++; in toshoboe_hard_xmit()
1125 self->txs %= TX_SLOTS; in toshoboe_hard_xmit()
1127 spin_unlock_irqrestore(&self->spinlock, flags); in toshoboe_hard_xmit()
1137 struct toshoboe_cb *self = dev_id; in toshoboe_interrupt() local
1150 toshoboe_isntstuck (self); in toshoboe_interrupt()
1158 txp = self->txpending; in toshoboe_interrupt()
1159 self->txpending = 0; in toshoboe_interrupt()
1163 if (self->ring->tx[i].control & OBOE_CTL_TX_HW_OWNS) in toshoboe_interrupt()
1164 self->txpending++; in toshoboe_interrupt()
1166 pr_debug("%s.txd(%x)%x/%x\n", __func__, irqstat, txp, self->txpending); in toshoboe_interrupt()
1171 if (self->ring->tx[txp].control & OBOE_CTL_TX_HW_OWNS) in toshoboe_interrupt()
1175 while (self->ring->tx[txpc].control & OBOE_CTL_TX_HW_OWNS) in toshoboe_interrupt()
1180 self->netdev->stats.tx_packets++; in toshoboe_interrupt()
1181 if (self->ring->tx[txpc].control & OBOE_CTL_TX_HW_OWNS) in toshoboe_interrupt()
1182 self->ring->tx[txp].control &= ~OBOE_CTL_TX_RTCENTX; in toshoboe_interrupt()
1184 self->netdev->stats.tx_packets--; in toshoboe_interrupt()
1186 self->netdev->stats.tx_packets++; in toshoboe_interrupt()
1188 toshoboe_start_DMA(self, OBOE_CONFIG0H_ENTX); in toshoboe_interrupt()
1191 if ((!self->txpending) && (self->new_speed)) in toshoboe_interrupt()
1193 self->speed = self->new_speed; in toshoboe_interrupt()
1195 __func__, self->speed); in toshoboe_interrupt()
1196 toshoboe_setbaud (self); in toshoboe_interrupt()
1200 if (!self->new_speed) in toshoboe_interrupt()
1201 netif_wake_queue(self->netdev); in toshoboe_interrupt()
1206 while (!(self->ring->rx[self->rxs].control & OBOE_CTL_RX_HW_OWNS)) in toshoboe_interrupt()
1208 int len = self->ring->rx[self->rxs].len; in toshoboe_interrupt()
1211 , len, self->ring->rx[self->rxs].control); in toshoboe_interrupt()
1214 dumpbufs(self->rx_bufs[self->rxs],len,'<'); in toshoboe_interrupt()
1217 if (self->ring->rx[self->rxs].control == 0) in toshoboe_interrupt()
1225 if (!toshoboe_checkfcs (self->rx_bufs[self->rxs], len)) in toshoboe_interrupt()
1264 skb_copy_to_linear_data(skb, self->rx_bufs[self->rxs], in toshoboe_interrupt()
1266 self->netdev->stats.rx_packets++; in toshoboe_interrupt()
1267 skb->dev = self->netdev; in toshoboe_interrupt()
1288 , len, self->ring->rx[self->rxs].control); in toshoboe_interrupt()
1291 self->ring->rx[self->rxs].len = 0x0; in toshoboe_interrupt()
1292 self->ring->rx[self->rxs].control = OBOE_CTL_RX_HW_OWNS; in toshoboe_interrupt()
1294 self->rxs++; in toshoboe_interrupt()
1295 self->rxs %= RX_SLOTS; in toshoboe_interrupt()
1314 self->int_sip++; in toshoboe_interrupt()
1316 __func__, self->int_sip, irqstat, self->txpending); in toshoboe_interrupt()
1325 struct toshoboe_cb *self; in toshoboe_net_open() local
1329 self = netdev_priv(dev); in toshoboe_net_open()
1331 if (self->async) in toshoboe_net_open()
1334 if (self->stopped) in toshoboe_net_open()
1337 rc = request_irq (self->io.irq, toshoboe_interrupt, in toshoboe_net_open()
1338 IRQF_SHARED, dev->name, self); in toshoboe_net_open()
1342 spin_lock_irqsave(&self->spinlock, flags); in toshoboe_net_open()
1343 toshoboe_startchip (self); in toshoboe_net_open()
1344 spin_unlock_irqrestore(&self->spinlock, flags); in toshoboe_net_open()
1353 self->irlap = irlap_open (dev, &self->qos, driver_name); in toshoboe_net_open()
1355 self->irdad = 1; in toshoboe_net_open()
1363 struct toshoboe_cb *self; in toshoboe_net_close() local
1366 self = netdev_priv(dev); in toshoboe_net_close()
1372 if (self->irlap) in toshoboe_net_close()
1373 irlap_close (self->irlap); in toshoboe_net_close()
1374 self->irlap = NULL; in toshoboe_net_close()
1376 self->irdad = 0; in toshoboe_net_close()
1378 free_irq (self->io.irq, (void *) self); in toshoboe_net_close()
1380 if (!self->stopped) in toshoboe_net_close()
1382 toshoboe_stopchip (self); in toshoboe_net_close()
1398 struct toshoboe_cb *self; in toshoboe_net_ioctl() local
1404 self = netdev_priv(dev); in toshoboe_net_ioctl()
1406 IRDA_ASSERT (self != NULL, return -1; ); in toshoboe_net_ioctl()
1411 spin_lock_irqsave(&self->spinlock, flags); in toshoboe_net_ioctl()
1430 self->new_speed = irq->ifr_baudrate; in toshoboe_net_ioctl()
1440 irda_device_set_media_busy (self->netdev, TRUE); in toshoboe_net_ioctl()
1452 spin_unlock_irqrestore(&self->spinlock, flags); in toshoboe_net_ioctl()
1473 struct toshoboe_cb *self = pci_get_drvdata(pci_dev); in toshoboe_close() local
1475 IRDA_ASSERT (self != NULL, return; ); in toshoboe_close()
1477 if (!self->stopped) in toshoboe_close()
1479 toshoboe_stopchip (self); in toshoboe_close()
1482 release_region (self->io.fir_base, self->io.fir_ext); in toshoboe_close()
1486 kfree (self->tx_bufs[i]); in toshoboe_close()
1487 self->tx_bufs[i] = NULL; in toshoboe_close()
1492 kfree (self->rx_bufs[i]); in toshoboe_close()
1493 self->rx_bufs[i] = NULL; in toshoboe_close()
1496 unregister_netdev(self->netdev); in toshoboe_close()
1498 kfree (self->ringbuf); in toshoboe_close()
1499 self->ringbuf = NULL; in toshoboe_close()
1500 self->ring = NULL; in toshoboe_close()
1502 free_netdev(self->netdev); in toshoboe_close()
1515 struct toshoboe_cb *self; in toshoboe_open() local
1532 self = netdev_priv(dev); in toshoboe_open()
1533 self->netdev = dev; in toshoboe_open()
1534 self->pdev = pci_dev; in toshoboe_open()
1535 self->base = pci_resource_start(pci_dev,0); in toshoboe_open()
1537 self->io.fir_base = self->base; in toshoboe_open()
1538 self->io.fir_ext = OBOE_IO_EXTENT; in toshoboe_open()
1539 self->io.irq = pci_dev->irq; in toshoboe_open()
1540 self->io.irqflags = IRQF_SHARED; in toshoboe_open()
1542 self->speed = self->io.speed = 9600; in toshoboe_open()
1543 self->async = 0; in toshoboe_open()
1546 if (NULL==request_region (self->io.fir_base, self->io.fir_ext, driver_name)) in toshoboe_open()
1549 ,self->io.fir_base); in toshoboe_open()
1554 spin_lock_init(&self->spinlock); in toshoboe_open()
1556 irda_init_max_qos_capabilies (&self->qos); in toshoboe_open()
1557 self->qos.baud_rate.bits = 0; in toshoboe_open()
1560 self->qos.baud_rate.bits |= IR_2400; in toshoboe_open()
1563 self->qos.baud_rate.bits |= IR_9600; in toshoboe_open()
1565 self->qos.baud_rate.bits |= IR_19200; in toshoboe_open()
1567 self->qos.baud_rate.bits |= IR_115200; in toshoboe_open()
1571 self->qos.baud_rate.bits |= IR_1152000; in toshoboe_open()
1576 self->qos.baud_rate.bits |= (IR_4000000 << 8); in toshoboe_open()
1580 self->qos.min_turn_time.bits = 0xff; in toshoboe_open()
1582 irda_qos_bits_to_value (&self->qos); in toshoboe_open()
1585 self->ringbuf = kmalloc(OBOE_RING_LEN << 1, GFP_KERNEL); in toshoboe_open()
1586 if (!self->ringbuf) in toshoboe_open()
1600 addr = (__u32) self->ringbuf; in toshoboe_open()
1603 self->ring = (struct OboeRing *) addr; in toshoboe_open()
1606 memset (self->ring, 0, OBOE_RING_LEN); in toshoboe_open()
1607 self->io.mem_base = (__u32) self->ring; in toshoboe_open()
1612 self->tx_bufs[i] = kmalloc (TX_BUF_SZ, GFP_KERNEL); in toshoboe_open()
1613 if (!self->tx_bufs[i]) in toshoboe_open()
1619 self->rx_bufs[i] = kmalloc (RX_BUF_SZ, GFP_KERNEL); in toshoboe_open()
1620 if (!self->rx_bufs[i]) in toshoboe_open()
1633 if (!toshoboe_probe (self)) in toshoboe_open()
1652 pci_set_drvdata(pci_dev,self); in toshoboe_open()
1660 kfree (self->tx_bufs[i]); in toshoboe_open()
1662 kfree (self->rx_bufs[i]); in toshoboe_open()
1663 kfree(self->ringbuf); in toshoboe_open()
1666 release_region (self->io.fir_base, self->io.fir_ext); in toshoboe_open()
1677 struct toshoboe_cb *self = pci_get_drvdata(pci_dev); in toshoboe_gotosleep() local
1681 if (!self || self->stopped) in toshoboe_gotosleep()
1684 if ((!self->irdad) && (!self->async)) in toshoboe_gotosleep()
1688 while ((i--) && (self->txpending)) in toshoboe_gotosleep()
1691 spin_lock_irqsave(&self->spinlock, flags); in toshoboe_gotosleep()
1693 toshoboe_stopchip (self); in toshoboe_gotosleep()
1694 self->stopped = 1; in toshoboe_gotosleep()
1695 self->txpending = 0; in toshoboe_gotosleep()
1697 spin_unlock_irqrestore(&self->spinlock, flags); in toshoboe_gotosleep()
1704 struct toshoboe_cb *self = pci_get_drvdata(pci_dev); in toshoboe_wakeup() local
1707 if (!self || !self->stopped) in toshoboe_wakeup()
1710 if ((!self->irdad) && (!self->async)) in toshoboe_wakeup()
1713 spin_lock_irqsave(&self->spinlock, flags); in toshoboe_wakeup()
1715 toshoboe_startchip (self); in toshoboe_wakeup()
1716 self->stopped = 0; in toshoboe_wakeup()
1718 netif_wake_queue(self->netdev); in toshoboe_wakeup()
1719 spin_unlock_irqrestore(&self->spinlock, flags); in toshoboe_wakeup()