Lines Matching refs:self
190 static void smsc_ircc_setup_io(struct smsc_ircc_cb *self, unsigned int fir_base, unsigned int sir_b…
191 static void smsc_ircc_setup_qos(struct smsc_ircc_cb *self);
192 static void smsc_ircc_init_chip(struct smsc_ircc_cb *self);
193 static int __exit smsc_ircc_close(struct smsc_ircc_cb *self);
194 static int smsc_ircc_dma_receive(struct smsc_ircc_cb *self);
195 static void smsc_ircc_dma_receive_complete(struct smsc_ircc_cb *self);
196 static void smsc_ircc_sir_receive(struct smsc_ircc_cb *self);
199 static void smsc_ircc_dma_xmit(struct smsc_ircc_cb *self, int bofs);
200 static void smsc_ircc_dma_xmit_complete(struct smsc_ircc_cb *self);
201 static void smsc_ircc_change_speed(struct smsc_ircc_cb *self, u32 speed);
202 static void smsc_ircc_set_sir_speed(struct smsc_ircc_cb *self, u32 speed);
205 static void smsc_ircc_sir_start(struct smsc_ircc_cb *self);
207 static void smsc_ircc_sir_stop(struct smsc_ircc_cb *self);
209 static void smsc_ircc_sir_write_wakeup(struct smsc_ircc_cb *self);
217 static int smsc_ircc_is_receiving(struct smsc_ircc_cb *self);
218 static void smsc_ircc_probe_transceiver(struct smsc_ircc_cb *self);
219 static void smsc_ircc_set_transceiver_for_speed(struct smsc_ircc_cb *self, u32 speed);
220 static void smsc_ircc_sir_wait_hw_transmitter_finish(struct smsc_ircc_cb *self);
497 struct smsc_ircc_cb *self; in smsc_ircc_open() local
531 self = netdev_priv(dev); in smsc_ircc_open()
532 self->netdev = dev; in smsc_ircc_open()
535 dev->base_addr = self->io.fir_base = fir_base; in smsc_ircc_open()
536 dev->irq = self->io.irq = irq; in smsc_ircc_open()
539 dev_self[dev_count] = self; in smsc_ircc_open()
540 spin_lock_init(&self->lock); in smsc_ircc_open()
542 self->rx_buff.truesize = SMSC_IRCC2_RX_BUFF_TRUESIZE; in smsc_ircc_open()
543 self->tx_buff.truesize = SMSC_IRCC2_TX_BUFF_TRUESIZE; in smsc_ircc_open()
545 self->rx_buff.head = in smsc_ircc_open()
546 dma_alloc_coherent(NULL, self->rx_buff.truesize, in smsc_ircc_open()
547 &self->rx_buff_dma, GFP_KERNEL); in smsc_ircc_open()
548 if (self->rx_buff.head == NULL) { in smsc_ircc_open()
554 self->tx_buff.head = in smsc_ircc_open()
555 dma_alloc_coherent(NULL, self->tx_buff.truesize, in smsc_ircc_open()
556 &self->tx_buff_dma, GFP_KERNEL); in smsc_ircc_open()
557 if (self->tx_buff.head == NULL) { in smsc_ircc_open()
563 memset(self->rx_buff.head, 0, self->rx_buff.truesize); in smsc_ircc_open()
564 memset(self->tx_buff.head, 0, self->tx_buff.truesize); in smsc_ircc_open()
566 self->rx_buff.in_frame = FALSE; in smsc_ircc_open()
567 self->rx_buff.state = OUTSIDE_FRAME; in smsc_ircc_open()
568 self->tx_buff.data = self->tx_buff.head; in smsc_ircc_open()
569 self->rx_buff.data = self->rx_buff.head; in smsc_ircc_open()
571 smsc_ircc_setup_io(self, fir_base, sir_base, dma, irq); in smsc_ircc_open()
572 smsc_ircc_setup_qos(self); in smsc_ircc_open()
573 smsc_ircc_init_chip(self); in smsc_ircc_open()
577 self->transceiver = ircc_transceiver; in smsc_ircc_open()
579 smsc_ircc_probe_transceiver(self); in smsc_ircc_open()
581 err = register_netdev(self->netdev); in smsc_ircc_open()
588 self->pldev = platform_device_register_simple(SMSC_IRCC2_DRIVER_NAME, in smsc_ircc_open()
590 if (IS_ERR(self->pldev)) { in smsc_ircc_open()
591 err = PTR_ERR(self->pldev); in smsc_ircc_open()
594 platform_set_drvdata(self->pldev, self); in smsc_ircc_open()
602 unregister_netdev(self->netdev); in smsc_ircc_open()
605 dma_free_coherent(NULL, self->tx_buff.truesize, in smsc_ircc_open()
606 self->tx_buff.head, self->tx_buff_dma); in smsc_ircc_open()
608 dma_free_coherent(NULL, self->rx_buff.truesize, in smsc_ircc_open()
609 self->rx_buff.head, self->rx_buff_dma); in smsc_ircc_open()
611 free_netdev(self->netdev); in smsc_ircc_open()
679 static void smsc_ircc_setup_io(struct smsc_ircc_cb *self, in smsc_ircc_setup_io() argument
690 self->io.fir_base = fir_base; in smsc_ircc_setup_io()
691 self->io.sir_base = sir_base; in smsc_ircc_setup_io()
692 self->io.fir_ext = SMSC_IRCC2_FIR_CHIP_IO_EXTENT; in smsc_ircc_setup_io()
693 self->io.sir_ext = SMSC_IRCC2_SIR_CHIP_IO_EXTENT; in smsc_ircc_setup_io()
694 self->io.fifo_size = SMSC_IRCC2_FIFO_SIZE; in smsc_ircc_setup_io()
695 self->io.speed = SMSC_IRCC2_C_IRDA_FALLBACK_SPEED; in smsc_ircc_setup_io()
701 self->io.irq = irq; in smsc_ircc_setup_io()
703 self->io.irq = chip_irq; in smsc_ircc_setup_io()
709 self->io.dma = dma; in smsc_ircc_setup_io()
711 self->io.dma = chip_dma; in smsc_ircc_setup_io()
721 static void smsc_ircc_setup_qos(struct smsc_ircc_cb *self) in smsc_ircc_setup_qos() argument
724 irda_init_max_qos_capabilies(&self->qos); in smsc_ircc_setup_qos()
726 self->qos.baud_rate.bits = IR_9600|IR_19200|IR_38400|IR_57600| in smsc_ircc_setup_qos()
729 self->qos.min_turn_time.bits = SMSC_IRCC2_MIN_TURN_TIME; in smsc_ircc_setup_qos()
730 self->qos.window_size.bits = SMSC_IRCC2_WINDOW_SIZE; in smsc_ircc_setup_qos()
731 irda_qos_bits_to_value(&self->qos); in smsc_ircc_setup_qos()
740 static void smsc_ircc_init_chip(struct smsc_ircc_cb *self) in smsc_ircc_init_chip() argument
742 int iobase = self->io.fir_base; in smsc_ircc_init_chip()
768 smsc_ircc_set_sir_speed(self, SMSC_IRCC2_C_IRDA_FALLBACK_SPEED); in smsc_ircc_init_chip()
783 struct smsc_ircc_cb *self; in smsc_ircc_net_ioctl() local
789 self = netdev_priv(dev); in smsc_ircc_net_ioctl()
791 IRDA_ASSERT(self != NULL, return -1;); in smsc_ircc_net_ioctl()
802 spin_lock_irqsave(&self->lock, flags); in smsc_ircc_net_ioctl()
803 smsc_ircc_change_speed(self, irq->ifr_baudrate); in smsc_ircc_net_ioctl()
804 spin_unlock_irqrestore(&self->lock, flags); in smsc_ircc_net_ioctl()
813 irda_device_set_media_busy(self->netdev, TRUE); in smsc_ircc_net_ioctl()
816 irq->ifr_receiving = smsc_ircc_is_receiving(self); in smsc_ircc_net_ioctl()
844 struct smsc_ircc_cb *self = netdev_priv(dev); in smsc_ircc_timeout() local
848 dev->name, self->io.speed); in smsc_ircc_timeout()
849 spin_lock_irqsave(&self->lock, flags); in smsc_ircc_timeout()
850 smsc_ircc_sir_start(self); in smsc_ircc_timeout()
851 smsc_ircc_change_speed(self, self->io.speed); in smsc_ircc_timeout()
854 spin_unlock_irqrestore(&self->lock, flags); in smsc_ircc_timeout()
867 struct smsc_ircc_cb *self; in smsc_ircc_hard_xmit_sir() local
875 self = netdev_priv(dev); in smsc_ircc_hard_xmit_sir()
876 IRDA_ASSERT(self != NULL, return 0;); in smsc_ircc_hard_xmit_sir()
881 spin_lock_irqsave(&self->lock, flags); in smsc_ircc_hard_xmit_sir()
885 if (speed != self->io.speed && speed != -1) { in smsc_ircc_hard_xmit_sir()
897 smsc_ircc_sir_wait_hw_transmitter_finish(self); in smsc_ircc_hard_xmit_sir()
898 smsc_ircc_change_speed(self, speed); in smsc_ircc_hard_xmit_sir()
899 spin_unlock_irqrestore(&self->lock, flags); in smsc_ircc_hard_xmit_sir()
903 self->new_speed = speed; in smsc_ircc_hard_xmit_sir()
907 self->tx_buff.data = self->tx_buff.head; in smsc_ircc_hard_xmit_sir()
910 self->tx_buff.len = async_wrap_skb(skb, self->tx_buff.data, in smsc_ircc_hard_xmit_sir()
911 self->tx_buff.truesize); in smsc_ircc_hard_xmit_sir()
913 dev->stats.tx_bytes += self->tx_buff.len; in smsc_ircc_hard_xmit_sir()
916 outb(UART_IER_THRI, self->io.sir_base + UART_IER); in smsc_ircc_hard_xmit_sir()
918 spin_unlock_irqrestore(&self->lock, flags); in smsc_ircc_hard_xmit_sir()
931 static void smsc_ircc_set_fir_speed(struct smsc_ircc_cb *self, u32 speed) in smsc_ircc_set_fir_speed() argument
935 IRDA_ASSERT(self != NULL, return;); in smsc_ircc_set_fir_speed()
936 fir_base = self->io.fir_base; in smsc_ircc_set_fir_speed()
938 self->io.speed = speed; in smsc_ircc_set_fir_speed()
983 static void smsc_ircc_fir_start(struct smsc_ircc_cb *self) in smsc_ircc_fir_start() argument
990 IRDA_ASSERT(self != NULL, return;); in smsc_ircc_fir_start()
991 dev = self->netdev; in smsc_ircc_fir_start()
994 fir_base = self->io.fir_base; in smsc_ircc_fir_start()
1032 static void smsc_ircc_fir_stop(struct smsc_ircc_cb *self) in smsc_ircc_fir_stop() argument
1038 IRDA_ASSERT(self != NULL, return;); in smsc_ircc_fir_stop()
1040 fir_base = self->io.fir_base; in smsc_ircc_fir_stop()
1055 static void smsc_ircc_change_speed(struct smsc_ircc_cb *self, u32 speed) in smsc_ircc_change_speed() argument
1062 IRDA_ASSERT(self != NULL, return;); in smsc_ircc_change_speed()
1063 dev = self->netdev; in smsc_ircc_change_speed()
1065 last_speed_was_sir = self->io.speed <= SMSC_IRCC2_MAX_SIR_SPEED; in smsc_ircc_change_speed()
1070 self->io.speed = speed; in smsc_ircc_change_speed()
1072 smsc_ircc_fir_start(self); in smsc_ircc_change_speed()
1075 if (self->io.speed == 0) in smsc_ircc_change_speed()
1076 smsc_ircc_sir_start(self); in smsc_ircc_change_speed()
1079 if (!last_speed_was_sir) speed = self->io.speed; in smsc_ircc_change_speed()
1082 if (self->io.speed != speed) in smsc_ircc_change_speed()
1083 smsc_ircc_set_transceiver_for_speed(self, speed); in smsc_ircc_change_speed()
1085 self->io.speed = speed; in smsc_ircc_change_speed()
1089 smsc_ircc_fir_stop(self); in smsc_ircc_change_speed()
1090 smsc_ircc_sir_start(self); in smsc_ircc_change_speed()
1092 smsc_ircc_set_sir_speed(self, speed); in smsc_ircc_change_speed()
1096 smsc_ircc_sir_stop(self); in smsc_ircc_change_speed()
1098 smsc_ircc_fir_start(self); in smsc_ircc_change_speed()
1100 smsc_ircc_set_fir_speed(self, speed); in smsc_ircc_change_speed()
1103 self->tx_buff.len = 10; in smsc_ircc_change_speed()
1104 self->tx_buff.data = self->tx_buff.head; in smsc_ircc_change_speed()
1106 smsc_ircc_dma_xmit(self, 4000); in smsc_ircc_change_speed()
1109 smsc_ircc_dma_receive(self); in smsc_ircc_change_speed()
1121 static void smsc_ircc_set_sir_speed(struct smsc_ircc_cb *self, __u32 speed) in smsc_ircc_set_sir_speed() argument
1130 IRDA_ASSERT(self != NULL, return;); in smsc_ircc_set_sir_speed()
1131 iobase = self->io.sir_base; in smsc_ircc_set_sir_speed()
1134 self->io.speed = speed; in smsc_ircc_set_sir_speed()
1148 fcr |= self->io.speed < 38400 ? in smsc_ircc_set_sir_speed()
1175 struct smsc_ircc_cb *self; in smsc_ircc_hard_xmit_fir() local
1181 self = netdev_priv(dev); in smsc_ircc_hard_xmit_fir()
1182 IRDA_ASSERT(self != NULL, return 0;); in smsc_ircc_hard_xmit_fir()
1187 spin_lock_irqsave(&self->lock, flags); in smsc_ircc_hard_xmit_fir()
1191 if (speed != self->io.speed && speed != -1) { in smsc_ircc_hard_xmit_fir()
1197 smsc_ircc_change_speed(self, speed); in smsc_ircc_hard_xmit_fir()
1198 spin_unlock_irqrestore(&self->lock, flags); in smsc_ircc_hard_xmit_fir()
1203 self->new_speed = speed; in smsc_ircc_hard_xmit_fir()
1206 skb_copy_from_linear_data(skb, self->tx_buff.head, skb->len); in smsc_ircc_hard_xmit_fir()
1208 self->tx_buff.len = skb->len; in smsc_ircc_hard_xmit_fir()
1209 self->tx_buff.data = self->tx_buff.head; in smsc_ircc_hard_xmit_fir()
1219 bofs = mtt * (self->io.speed / 1000) / 8000; in smsc_ircc_hard_xmit_fir()
1223 smsc_ircc_dma_xmit(self, bofs); in smsc_ircc_hard_xmit_fir()
1226 smsc_ircc_dma_xmit(self, 0); in smsc_ircc_hard_xmit_fir()
1229 spin_unlock_irqrestore(&self->lock, flags); in smsc_ircc_hard_xmit_fir()
1241 static void smsc_ircc_dma_xmit(struct smsc_ircc_cb *self, int bofs) in smsc_ircc_dma_xmit() argument
1243 int iobase = self->io.fir_base; in smsc_ircc_dma_xmit()
1256 self->io.direction = IO_XMIT; in smsc_ircc_dma_xmit()
1265 outb(self->tx_buff.len >> 8, iobase + IRCC_TX_SIZE_HI); in smsc_ircc_dma_xmit()
1266 outb(self->tx_buff.len & 0xff, iobase + IRCC_TX_SIZE_LO); in smsc_ircc_dma_xmit()
1276 irda_setup_dma(self->io.dma, self->tx_buff_dma, self->tx_buff.len, in smsc_ircc_dma_xmit()
1296 static void smsc_ircc_dma_xmit_complete(struct smsc_ircc_cb *self) in smsc_ircc_dma_xmit_complete() argument
1298 int iobase = self->io.fir_base; in smsc_ircc_dma_xmit_complete()
1313 self->netdev->stats.tx_errors++; in smsc_ircc_dma_xmit_complete()
1314 self->netdev->stats.tx_fifo_errors++; in smsc_ircc_dma_xmit_complete()
1321 self->netdev->stats.tx_packets++; in smsc_ircc_dma_xmit_complete()
1322 self->netdev->stats.tx_bytes += self->tx_buff.len; in smsc_ircc_dma_xmit_complete()
1326 if (self->new_speed) { in smsc_ircc_dma_xmit_complete()
1327 smsc_ircc_change_speed(self, self->new_speed); in smsc_ircc_dma_xmit_complete()
1328 self->new_speed = 0; in smsc_ircc_dma_xmit_complete()
1331 netif_wake_queue(self->netdev); in smsc_ircc_dma_xmit_complete()
1341 static int smsc_ircc_dma_receive(struct smsc_ircc_cb *self) in smsc_ircc_dma_receive() argument
1343 int iobase = self->io.fir_base; in smsc_ircc_dma_receive()
1360 self->io.direction = IO_RECV; in smsc_ircc_dma_receive()
1361 self->rx_buff.data = self->rx_buff.head; in smsc_ircc_dma_receive()
1369 irda_setup_dma(self->io.dma, self->rx_buff_dma, self->rx_buff.truesize, in smsc_ircc_dma_receive()
1396 static void smsc_ircc_dma_receive_complete(struct smsc_ircc_cb *self) in smsc_ircc_dma_receive_complete() argument
1400 int iobase = self->io.fir_base; in smsc_ircc_dma_receive_complete()
1416 get_dma_residue(self->io.dma)); in smsc_ircc_dma_receive_complete()
1418 len = self->rx_buff.truesize - get_dma_residue(self->io.dma); in smsc_ircc_dma_receive_complete()
1422 self->netdev->stats.rx_errors++; in smsc_ircc_dma_receive_complete()
1424 self->netdev->stats.rx_frame_errors++; in smsc_ircc_dma_receive_complete()
1426 self->netdev->stats.rx_crc_errors++; in smsc_ircc_dma_receive_complete()
1428 self->netdev->stats.rx_length_errors++; in smsc_ircc_dma_receive_complete()
1430 self->netdev->stats.rx_length_errors++; in smsc_ircc_dma_receive_complete()
1435 len -= self->io.speed < 4000000 ? 2 : 4; in smsc_ircc_dma_receive_complete()
1452 memcpy(skb_put(skb, len), self->rx_buff.data, len); in smsc_ircc_dma_receive_complete()
1453 self->netdev->stats.rx_packets++; in smsc_ircc_dma_receive_complete()
1454 self->netdev->stats.rx_bytes += len; in smsc_ircc_dma_receive_complete()
1456 skb->dev = self->netdev; in smsc_ircc_dma_receive_complete()
1468 static void smsc_ircc_sir_receive(struct smsc_ircc_cb *self) in smsc_ircc_sir_receive() argument
1473 IRDA_ASSERT(self != NULL, return;); in smsc_ircc_sir_receive()
1475 iobase = self->io.sir_base; in smsc_ircc_sir_receive()
1482 async_unwrap_char(self->netdev, &self->netdev->stats, &self->rx_buff, in smsc_ircc_sir_receive()
1503 struct smsc_ircc_cb *self = netdev_priv(dev); in smsc_ircc_interrupt() local
1508 spin_lock(&self->lock); in smsc_ircc_interrupt()
1511 if (self->io.speed <= SMSC_IRCC2_MAX_SIR_SPEED) { in smsc_ircc_interrupt()
1516 iobase = self->io.fir_base; in smsc_ircc_interrupt()
1532 if (self->io.direction == IO_RECV) in smsc_ircc_interrupt()
1533 smsc_ircc_dma_receive_complete(self); in smsc_ircc_interrupt()
1535 smsc_ircc_dma_xmit_complete(self); in smsc_ircc_interrupt()
1537 smsc_ircc_dma_receive(self); in smsc_ircc_interrupt()
1550 spin_unlock(&self->lock); in smsc_ircc_interrupt()
1562 struct smsc_ircc_cb *self = netdev_priv(dev); in smsc_ircc_interrupt_sir() local
1570 iobase = self->io.sir_base; in smsc_ircc_interrupt_sir()
1588 smsc_ircc_sir_receive(self); in smsc_ircc_interrupt_sir()
1593 smsc_ircc_sir_write_wakeup(self); in smsc_ircc_interrupt_sir()
1619 static int ircc_is_receiving(struct smsc_ircc_cb *self)
1626 IRDA_ASSERT(self != NULL, return FALSE;);
1629 get_dma_residue(self->io.dma));
1631 status = (self->rx_buff.state != OUTSIDE_FRAME);
1637 static int smsc_ircc_request_irq(struct smsc_ircc_cb *self) in smsc_ircc_request_irq() argument
1641 error = request_irq(self->io.irq, smsc_ircc_interrupt, 0, in smsc_ircc_request_irq()
1642 self->netdev->name, self->netdev); in smsc_ircc_request_irq()
1645 __func__, self->io.irq, error); in smsc_ircc_request_irq()
1650 static void smsc_ircc_start_interrupts(struct smsc_ircc_cb *self) in smsc_ircc_start_interrupts() argument
1654 spin_lock_irqsave(&self->lock, flags); in smsc_ircc_start_interrupts()
1656 self->io.speed = 0; in smsc_ircc_start_interrupts()
1657 smsc_ircc_change_speed(self, SMSC_IRCC2_C_IRDA_FALLBACK_SPEED); in smsc_ircc_start_interrupts()
1659 spin_unlock_irqrestore(&self->lock, flags); in smsc_ircc_start_interrupts()
1662 static void smsc_ircc_stop_interrupts(struct smsc_ircc_cb *self) in smsc_ircc_stop_interrupts() argument
1664 int iobase = self->io.fir_base; in smsc_ircc_stop_interrupts()
1667 spin_lock_irqsave(&self->lock, flags); in smsc_ircc_stop_interrupts()
1674 spin_unlock_irqrestore(&self->lock, flags); in smsc_ircc_stop_interrupts()
1686 struct smsc_ircc_cb *self; in smsc_ircc_net_open() local
1692 self = netdev_priv(dev); in smsc_ircc_net_open()
1693 IRDA_ASSERT(self != NULL, return 0;); in smsc_ircc_net_open()
1695 if (self->io.suspended) { in smsc_ircc_net_open()
1700 if (request_irq(self->io.irq, smsc_ircc_interrupt, 0, dev->name, in smsc_ircc_net_open()
1703 __func__, self->io.irq); in smsc_ircc_net_open()
1707 smsc_ircc_start_interrupts(self); in smsc_ircc_net_open()
1711 sprintf(hwname, "SMSC @ 0x%03x", self->io.fir_base); in smsc_ircc_net_open()
1717 self->irlap = irlap_open(dev, &self->qos, hwname); in smsc_ircc_net_open()
1723 if (request_dma(self->io.dma, dev->name)) { in smsc_ircc_net_open()
1727 __func__, self->io.dma); in smsc_ircc_net_open()
1744 struct smsc_ircc_cb *self; in smsc_ircc_net_close() local
1749 self = netdev_priv(dev); in smsc_ircc_net_close()
1750 IRDA_ASSERT(self != NULL, return 0;); in smsc_ircc_net_close()
1756 if (self->irlap) in smsc_ircc_net_close()
1757 irlap_close(self->irlap); in smsc_ircc_net_close()
1758 self->irlap = NULL; in smsc_ircc_net_close()
1760 smsc_ircc_stop_interrupts(self); in smsc_ircc_net_close()
1763 if (!self->io.suspended) in smsc_ircc_net_close()
1764 free_irq(self->io.irq, dev); in smsc_ircc_net_close()
1766 disable_dma(self->io.dma); in smsc_ircc_net_close()
1767 free_dma(self->io.dma); in smsc_ircc_net_close()
1774 struct smsc_ircc_cb *self = platform_get_drvdata(dev); in smsc_ircc_suspend() local
1776 if (!self->io.suspended) { in smsc_ircc_suspend()
1780 if (netif_running(self->netdev)) { in smsc_ircc_suspend()
1781 netif_device_detach(self->netdev); in smsc_ircc_suspend()
1782 smsc_ircc_stop_interrupts(self); in smsc_ircc_suspend()
1783 free_irq(self->io.irq, self->netdev); in smsc_ircc_suspend()
1784 disable_dma(self->io.dma); in smsc_ircc_suspend()
1786 self->io.suspended = 1; in smsc_ircc_suspend()
1795 struct smsc_ircc_cb *self = platform_get_drvdata(dev); in smsc_ircc_resume() local
1797 if (self->io.suspended) { in smsc_ircc_resume()
1801 smsc_ircc_init_chip(self); in smsc_ircc_resume()
1802 if (netif_running(self->netdev)) { in smsc_ircc_resume()
1803 if (smsc_ircc_request_irq(self)) { in smsc_ircc_resume()
1808 unregister_netdevice(self->netdev); in smsc_ircc_resume()
1810 enable_dma(self->io.dma); in smsc_ircc_resume()
1811 smsc_ircc_start_interrupts(self); in smsc_ircc_resume()
1812 netif_device_attach(self->netdev); in smsc_ircc_resume()
1815 self->io.suspended = 0; in smsc_ircc_resume()
1827 static int __exit smsc_ircc_close(struct smsc_ircc_cb *self) in smsc_ircc_close() argument
1831 IRDA_ASSERT(self != NULL, return -1;); in smsc_ircc_close()
1833 platform_device_unregister(self->pldev); in smsc_ircc_close()
1836 unregister_netdev(self->netdev); in smsc_ircc_close()
1838 smsc_ircc_stop_interrupts(self); in smsc_ircc_close()
1842 self->io.fir_base); in smsc_ircc_close()
1844 release_region(self->io.fir_base, self->io.fir_ext); in smsc_ircc_close()
1847 self->io.sir_base); in smsc_ircc_close()
1849 release_region(self->io.sir_base, self->io.sir_ext); in smsc_ircc_close()
1851 if (self->tx_buff.head) in smsc_ircc_close()
1852 dma_free_coherent(NULL, self->tx_buff.truesize, in smsc_ircc_close()
1853 self->tx_buff.head, self->tx_buff_dma); in smsc_ircc_close()
1855 if (self->rx_buff.head) in smsc_ircc_close()
1856 dma_free_coherent(NULL, self->rx_buff.truesize, in smsc_ircc_close()
1857 self->rx_buff.head, self->rx_buff_dma); in smsc_ircc_close()
1859 free_netdev(self->netdev); in smsc_ircc_close()
1887 static void smsc_ircc_sir_start(struct smsc_ircc_cb *self) in smsc_ircc_sir_start() argument
1894 IRDA_ASSERT(self != NULL, return;); in smsc_ircc_sir_start()
1895 dev = self->netdev; in smsc_ircc_sir_start()
1899 fir_base = self->io.fir_base; in smsc_ircc_sir_start()
1900 sir_base = self->io.sir_base; in smsc_ircc_sir_start()
1925 void smsc_ircc_sir_stop(struct smsc_ircc_cb *self) in smsc_ircc_sir_stop() argument
1930 iobase = self->io.sir_base; in smsc_ircc_sir_stop()
1947 static void smsc_ircc_sir_write_wakeup(struct smsc_ircc_cb *self) in smsc_ircc_sir_write_wakeup() argument
1953 IRDA_ASSERT(self != NULL, return;); in smsc_ircc_sir_write_wakeup()
1957 iobase = self->io.sir_base; in smsc_ircc_sir_write_wakeup()
1960 if (self->tx_buff.len > 0) { in smsc_ircc_sir_write_wakeup()
1962 actual = smsc_ircc_sir_write(iobase, self->io.fifo_size, in smsc_ircc_sir_write_wakeup()
1963 self->tx_buff.data, self->tx_buff.len); in smsc_ircc_sir_write_wakeup()
1964 self->tx_buff.data += actual; in smsc_ircc_sir_write_wakeup()
1965 self->tx_buff.len -= actual; in smsc_ircc_sir_write_wakeup()
1975 if (self->new_speed) { in smsc_ircc_sir_write_wakeup()
1977 __func__, self->new_speed); in smsc_ircc_sir_write_wakeup()
1978 smsc_ircc_sir_wait_hw_transmitter_finish(self); in smsc_ircc_sir_write_wakeup()
1979 smsc_ircc_change_speed(self, self->new_speed); in smsc_ircc_sir_write_wakeup()
1980 self->new_speed = 0; in smsc_ircc_sir_write_wakeup()
1983 netif_wake_queue(self->netdev); in smsc_ircc_sir_write_wakeup()
1985 self->netdev->stats.tx_packets++; in smsc_ircc_sir_write_wakeup()
1987 if (self->io.speed <= 115200) { in smsc_ircc_sir_write_wakeup()
1993 fcr |= self->io.speed < 38400 ? in smsc_ircc_sir_write_wakeup()
2035 static int smsc_ircc_is_receiving(struct smsc_ircc_cb *self) in smsc_ircc_is_receiving() argument
2037 return (self->rx_buff.state != OUTSIDE_FRAME); in smsc_ircc_is_receiving()
2047 static void smsc_ircc_probe_transceiver(struct smsc_ircc_cb *self) in smsc_ircc_probe_transceiver() argument
2051 IRDA_ASSERT(self != NULL, return;); in smsc_ircc_probe_transceiver()
2054 if (smsc_transceivers[i].probe(self->io.fir_base)) { in smsc_ircc_probe_transceiver()
2057 self->transceiver= i + 1; in smsc_ircc_probe_transceiver()
2064 self->transceiver = SMSC_IRCC2_C_DEFAULT_TRANSCEIVER; in smsc_ircc_probe_transceiver()
2074 static void smsc_ircc_set_transceiver_for_speed(struct smsc_ircc_cb *self, u32 speed) in smsc_ircc_set_transceiver_for_speed() argument
2078 trx = self->transceiver; in smsc_ircc_set_transceiver_for_speed()
2080 smsc_transceivers[trx - 1].set_for_speed(self->io.fir_base, speed); in smsc_ircc_set_transceiver_for_speed()
2106 static void smsc_ircc_sir_wait_hw_transmitter_finish(struct smsc_ircc_cb *self) in smsc_ircc_sir_wait_hw_transmitter_finish() argument
2108 int iobase = self->io.sir_base; in smsc_ircc_sir_wait_hw_transmitter_finish()