• Home
  • Raw
  • Download

Lines Matching refs:self

104 static int  ali_ircc_close(struct ali_ircc_cb *self);
107 static int ali_ircc_is_receiving(struct ali_ircc_cb *self);
111 static void ali_ircc_change_speed(struct ali_ircc_cb *self, __u32 baud);
115 static irqreturn_t ali_ircc_sir_interrupt(struct ali_ircc_cb *self);
116 static void ali_ircc_sir_receive(struct ali_ircc_cb *self);
117 static void ali_ircc_sir_write_wakeup(struct ali_ircc_cb *self);
124 static irqreturn_t ali_ircc_fir_interrupt(struct ali_ircc_cb *self);
125 static int ali_ircc_dma_receive(struct ali_ircc_cb *self);
126 static int ali_ircc_dma_receive_complete(struct ali_ircc_cb *self);
127 static int ali_ircc_dma_xmit_complete(struct ali_ircc_cb *self);
128 static void ali_ircc_dma_xmit(struct ali_ircc_cb *self);
137 static void SetCOMInterrupts(struct ali_ircc_cb *self , unsigned char enable);
271 struct ali_ircc_cb *self; in ali_ircc_open() local
287 dev = alloc_irdadev(sizeof(*self)); in ali_ircc_open()
294 self = netdev_priv(dev); in ali_ircc_open()
295 self->netdev = dev; in ali_ircc_open()
296 spin_lock_init(&self->lock); in ali_ircc_open()
299 dev_self[i] = self; in ali_ircc_open()
300 self->index = i; in ali_ircc_open()
303 self->io.cfg_base = info->cfg_base; /* In ali_ircc_probe_53 assign */ in ali_ircc_open()
304 self->io.fir_base = info->fir_base; /* info->sir_base = info->fir_base */ in ali_ircc_open()
305 self->io.sir_base = info->sir_base; /* ALi SIR and FIR use the same address */ in ali_ircc_open()
306 self->io.irq = info->irq; in ali_ircc_open()
307 self->io.fir_ext = CHIP_IO_EXTENT; in ali_ircc_open()
308 self->io.dma = info->dma; in ali_ircc_open()
309 self->io.fifo_size = 16; /* SIR: 16, FIR: 32 Benjamin 2000/11/1 */ in ali_ircc_open()
312 if (!request_region(self->io.fir_base, self->io.fir_ext, in ali_ircc_open()
315 self->io.fir_base); in ali_ircc_open()
321 irda_init_max_qos_capabilies(&self->qos); in ali_ircc_open()
324 self->qos.baud_rate.bits = IR_9600|IR_19200|IR_38400|IR_57600| in ali_ircc_open()
327 self->qos.min_turn_time.bits = qos_mtt_bits; in ali_ircc_open()
329 irda_qos_bits_to_value(&self->qos); in ali_ircc_open()
332 self->rx_buff.truesize = 14384; in ali_ircc_open()
333 self->tx_buff.truesize = 14384; in ali_ircc_open()
336 self->rx_buff.head = in ali_ircc_open()
337 dma_alloc_coherent(NULL, self->rx_buff.truesize, in ali_ircc_open()
338 &self->rx_buff_dma, GFP_KERNEL); in ali_ircc_open()
339 if (self->rx_buff.head == NULL) { in ali_ircc_open()
343 memset(self->rx_buff.head, 0, self->rx_buff.truesize); in ali_ircc_open()
345 self->tx_buff.head = in ali_ircc_open()
346 dma_alloc_coherent(NULL, self->tx_buff.truesize, in ali_ircc_open()
347 &self->tx_buff_dma, GFP_KERNEL); in ali_ircc_open()
348 if (self->tx_buff.head == NULL) { in ali_ircc_open()
352 memset(self->tx_buff.head, 0, self->tx_buff.truesize); in ali_ircc_open()
354 self->rx_buff.in_frame = FALSE; in ali_ircc_open()
355 self->rx_buff.state = OUTSIDE_FRAME; in ali_ircc_open()
356 self->tx_buff.data = self->tx_buff.head; in ali_ircc_open()
357 self->rx_buff.data = self->rx_buff.head; in ali_ircc_open()
360 self->tx_fifo.len = self->tx_fifo.ptr = self->tx_fifo.free = 0; in ali_ircc_open()
361 self->tx_fifo.tail = self->tx_buff.head; in ali_ircc_open()
381 self->io.dongle_id = dongle_id; in ali_ircc_open()
388 dma_free_coherent(NULL, self->tx_buff.truesize, in ali_ircc_open()
389 self->tx_buff.head, self->tx_buff_dma); in ali_ircc_open()
391 dma_free_coherent(NULL, self->rx_buff.truesize, in ali_ircc_open()
392 self->rx_buff.head, self->rx_buff_dma); in ali_ircc_open()
394 release_region(self->io.fir_base, self->io.fir_ext); in ali_ircc_open()
408 static int __exit ali_ircc_close(struct ali_ircc_cb *self) in ali_ircc_close() argument
414 IRDA_ASSERT(self != NULL, return -1;); in ali_ircc_close()
416 iobase = self->io.fir_base; in ali_ircc_close()
419 unregister_netdev(self->netdev); in ali_ircc_close()
422 IRDA_DEBUG(4, "%s(), Releasing Region %03x\n", __func__, self->io.fir_base); in ali_ircc_close()
423 release_region(self->io.fir_base, self->io.fir_ext); in ali_ircc_close()
425 if (self->tx_buff.head) in ali_ircc_close()
426 dma_free_coherent(NULL, self->tx_buff.truesize, in ali_ircc_close()
427 self->tx_buff.head, self->tx_buff_dma); in ali_ircc_close()
429 if (self->rx_buff.head) in ali_ircc_close()
430 dma_free_coherent(NULL, self->rx_buff.truesize, in ali_ircc_close()
431 self->rx_buff.head, self->rx_buff_dma); in ali_ircc_close()
433 dev_self[self->index] = NULL; in ali_ircc_close()
434 free_netdev(self->netdev); in ali_ircc_close()
661 struct ali_ircc_cb *self; in ali_ircc_interrupt() local
666 self = netdev_priv(dev); in ali_ircc_interrupt()
668 spin_lock(&self->lock); in ali_ircc_interrupt()
671 if (self->io.speed > 115200) in ali_ircc_interrupt()
672 ret = ali_ircc_fir_interrupt(self); in ali_ircc_interrupt()
674 ret = ali_ircc_sir_interrupt(self); in ali_ircc_interrupt()
676 spin_unlock(&self->lock); in ali_ircc_interrupt()
687 static irqreturn_t ali_ircc_fir_interrupt(struct ali_ircc_cb *self) in ali_ircc_fir_interrupt() argument
694 iobase = self->io.fir_base; in ali_ircc_fir_interrupt()
697 self->InterruptID = inb(iobase+FIR_IIR); in ali_ircc_fir_interrupt()
698 self->BusStatus = inb(iobase+FIR_BSR); in ali_ircc_fir_interrupt()
700 OldMessageCount = (self->LineStatus + 1) & 0x07; in ali_ircc_fir_interrupt()
701 self->LineStatus = inb(iobase+FIR_LSR); in ali_ircc_fir_interrupt()
703 eir = self->InterruptID & self->ier; /* Mask out the interesting ones */ in ali_ircc_fir_interrupt()
705 IRDA_DEBUG(1, "%s(), self->InterruptID = %x\n", __func__,self->InterruptID); in ali_ircc_fir_interrupt()
706 IRDA_DEBUG(1, "%s(), self->LineStatus = %x\n", __func__,self->LineStatus); in ali_ircc_fir_interrupt()
707 IRDA_DEBUG(1, "%s(), self->ier = %x\n", __func__,self->ier); in ali_ircc_fir_interrupt()
711 SetCOMInterrupts(self, FALSE); in ali_ircc_fir_interrupt()
717 if (self->io.direction == IO_XMIT) /* TX */ in ali_ircc_fir_interrupt()
721 if(ali_ircc_dma_xmit_complete(self)) in ali_ircc_fir_interrupt()
723 if (irda_device_txqueue_empty(self->netdev)) in ali_ircc_fir_interrupt()
726 ali_ircc_dma_receive(self); in ali_ircc_fir_interrupt()
727 self->ier = IER_EOM; in ali_ircc_fir_interrupt()
732 self->ier = IER_EOM; in ali_ircc_fir_interrupt()
740 if(OldMessageCount > ((self->LineStatus+1) & 0x07)) in ali_ircc_fir_interrupt()
742 self->rcvFramesOverflow = TRUE; in ali_ircc_fir_interrupt()
746 if (ali_ircc_dma_receive_complete(self)) in ali_ircc_fir_interrupt()
750 self->ier = IER_EOM; in ali_ircc_fir_interrupt()
756 self->ier = IER_EOM | IER_TIMER; in ali_ircc_fir_interrupt()
764 if(OldMessageCount > ((self->LineStatus+1) & 0x07)) in ali_ircc_fir_interrupt()
766 self->rcvFramesOverflow = TRUE; in ali_ircc_fir_interrupt()
775 if (self->io.direction == IO_XMIT) in ali_ircc_fir_interrupt()
777 ali_ircc_dma_xmit(self); in ali_ircc_fir_interrupt()
780 self->ier = IER_EOM; in ali_ircc_fir_interrupt()
785 if(ali_ircc_dma_receive_complete(self)) in ali_ircc_fir_interrupt()
787 self->ier = IER_EOM; in ali_ircc_fir_interrupt()
791 self->ier = IER_EOM | IER_TIMER; in ali_ircc_fir_interrupt()
797 SetCOMInterrupts(self, TRUE); in ali_ircc_fir_interrupt()
809 static irqreturn_t ali_ircc_sir_interrupt(struct ali_ircc_cb *self) in ali_ircc_sir_interrupt() argument
816 iobase = self->io.sir_base; in ali_ircc_sir_interrupt()
833 ali_ircc_sir_receive(self); in ali_ircc_sir_interrupt()
839 ali_ircc_sir_write_wakeup(self); in ali_ircc_sir_interrupt()
862 static void ali_ircc_sir_receive(struct ali_ircc_cb *self) in ali_ircc_sir_receive() argument
868 IRDA_ASSERT(self != NULL, return;); in ali_ircc_sir_receive()
870 iobase = self->io.sir_base; in ali_ircc_sir_receive()
877 async_unwrap_char(self->netdev, &self->netdev->stats, &self->rx_buff, in ali_ircc_sir_receive()
897 static void ali_ircc_sir_write_wakeup(struct ali_ircc_cb *self) in ali_ircc_sir_write_wakeup() argument
902 IRDA_ASSERT(self != NULL, return;); in ali_ircc_sir_write_wakeup()
906 iobase = self->io.sir_base; in ali_ircc_sir_write_wakeup()
909 if (self->tx_buff.len > 0) in ali_ircc_sir_write_wakeup()
912 actual = ali_ircc_sir_write(iobase, self->io.fifo_size, in ali_ircc_sir_write_wakeup()
913 self->tx_buff.data, self->tx_buff.len); in ali_ircc_sir_write_wakeup()
914 self->tx_buff.data += actual; in ali_ircc_sir_write_wakeup()
915 self->tx_buff.len -= actual; in ali_ircc_sir_write_wakeup()
919 if (self->new_speed) in ali_ircc_sir_write_wakeup()
925 IRDA_DEBUG(1, "%s(), Changing speed! self->new_speed = %d\n", __func__ , self->new_speed); in ali_ircc_sir_write_wakeup()
926 ali_ircc_change_speed(self, self->new_speed); in ali_ircc_sir_write_wakeup()
927 self->new_speed = 0; in ali_ircc_sir_write_wakeup()
930 if (self->io.speed > 115200) in ali_ircc_sir_write_wakeup()
934 self->ier = IER_EOM; in ali_ircc_sir_write_wakeup()
941 netif_wake_queue(self->netdev); in ali_ircc_sir_write_wakeup()
944 self->netdev->stats.tx_packets++; in ali_ircc_sir_write_wakeup()
953 static void ali_ircc_change_speed(struct ali_ircc_cb *self, __u32 baud) in ali_ircc_change_speed() argument
955 struct net_device *dev = self->netdev; in ali_ircc_change_speed()
965 iobase = self->io.fir_base; in ali_ircc_change_speed()
967 SetCOMInterrupts(self, FALSE); // 2000/11/24 11:43AM in ali_ircc_change_speed()
974 ali_ircc_fir_change_speed(self, baud); in ali_ircc_change_speed()
980 self->ier = IER_EOM; // benjamin 2000/11/20 07:24PM in ali_ircc_change_speed()
983 ali_ircc_dma_receive(self); // benajmin 2000/11/8 07:46PM not complete in ali_ircc_change_speed()
988 ali_ircc_sir_change_speed(self, baud); in ali_ircc_change_speed()
995 SetCOMInterrupts(self, TRUE); // 2000/11/24 11:43AM in ali_ircc_change_speed()
997 netif_wake_queue(self->netdev); in ali_ircc_change_speed()
1006 struct ali_ircc_cb *self = (struct ali_ircc_cb *) priv; in ali_ircc_fir_change_speed() local
1011 IRDA_ASSERT(self != NULL, return;); in ali_ircc_fir_change_speed()
1013 dev = self->netdev; in ali_ircc_fir_change_speed()
1014 iobase = self->io.fir_base; in ali_ircc_fir_change_speed()
1016 IRDA_DEBUG(1, "%s(), self->io.speed = %d, change to speed = %d\n", __func__ ,self->io.speed,baud); in ali_ircc_fir_change_speed()
1019 if(self->io.speed <=115200) in ali_ircc_fir_change_speed()
1025 self->io.speed = baud; in ali_ircc_fir_change_speed()
1028 ali_ircc_change_dongle_speed(self, baud); in ali_ircc_fir_change_speed()
1041 struct ali_ircc_cb *self = (struct ali_ircc_cb *) priv; in ali_ircc_sir_change_speed() local
1052 IRDA_ASSERT(self != NULL, return;); in ali_ircc_sir_change_speed()
1054 iobase = self->io.sir_base; in ali_ircc_sir_change_speed()
1057 if(self->io.speed >115200) in ali_ircc_sir_change_speed()
1060 ali_ircc_change_dongle_speed(self, speed); in ali_ircc_sir_change_speed()
1071 self->io.speed = speed; in ali_ircc_sir_change_speed()
1073 spin_lock_irqsave(&self->lock, flags); in ali_ircc_sir_change_speed()
1084 if (self->io.speed < 38400) in ali_ircc_sir_change_speed()
1102 spin_unlock_irqrestore(&self->lock, flags); in ali_ircc_sir_change_speed()
1110 struct ali_ircc_cb *self = (struct ali_ircc_cb *) priv; in ali_ircc_change_dongle_speed() local
1116 iobase = self->io.fir_base; /* or iobase = self->io.sir_base; */ in ali_ircc_change_dongle_speed()
1117 dongle_id = self->io.dongle_id; in ali_ircc_change_dongle_speed()
1326 struct ali_ircc_cb *self; in ali_ircc_net_open() local
1334 self = netdev_priv(dev); in ali_ircc_net_open()
1336 IRDA_ASSERT(self != NULL, return 0;); in ali_ircc_net_open()
1338 iobase = self->io.fir_base; in ali_ircc_net_open()
1341 if (request_irq(self->io.irq, ali_ircc_interrupt, 0, dev->name, dev)) in ali_ircc_net_open()
1345 self->io.irq); in ali_ircc_net_open()
1353 if (request_dma(self->io.dma, dev->name)) { in ali_ircc_net_open()
1356 self->io.dma); in ali_ircc_net_open()
1357 free_irq(self->io.irq, self); in ali_ircc_net_open()
1368 sprintf(hwname, "ALI-FIR @ 0x%03x", self->io.fir_base); in ali_ircc_net_open()
1374 self->irlap = irlap_open(dev, &self->qos, hwname); in ali_ircc_net_open()
1390 struct ali_ircc_cb *self; in ali_ircc_net_close() local
1397 self = netdev_priv(dev); in ali_ircc_net_close()
1398 IRDA_ASSERT(self != NULL, return 0;); in ali_ircc_net_close()
1404 if (self->irlap) in ali_ircc_net_close()
1405 irlap_close(self->irlap); in ali_ircc_net_close()
1406 self->irlap = NULL; in ali_ircc_net_close()
1408 disable_dma(self->io.dma); in ali_ircc_net_close()
1411 SetCOMInterrupts(self, FALSE); in ali_ircc_net_close()
1413 free_irq(self->io.irq, dev); in ali_ircc_net_close()
1414 free_dma(self->io.dma); in ali_ircc_net_close()
1429 struct ali_ircc_cb *self; in ali_ircc_fir_hard_xmit() local
1437 self = netdev_priv(dev); in ali_ircc_fir_hard_xmit()
1438 iobase = self->io.fir_base; in ali_ircc_fir_hard_xmit()
1443 spin_lock_irqsave(&self->lock, flags); in ali_ircc_fir_hard_xmit()
1451 if ((speed != self->io.speed) && (speed != -1)) { in ali_ircc_fir_hard_xmit()
1454 ali_ircc_change_speed(self, speed); in ali_ircc_fir_hard_xmit()
1456 spin_unlock_irqrestore(&self->lock, flags); in ali_ircc_fir_hard_xmit()
1460 self->new_speed = speed; in ali_ircc_fir_hard_xmit()
1464 self->tx_fifo.queue[self->tx_fifo.free].start = self->tx_fifo.tail; in ali_ircc_fir_hard_xmit()
1465 self->tx_fifo.queue[self->tx_fifo.free].len = skb->len; in ali_ircc_fir_hard_xmit()
1466 self->tx_fifo.tail += skb->len; in ali_ircc_fir_hard_xmit()
1470 skb_copy_from_linear_data(skb, self->tx_fifo.queue[self->tx_fifo.free].start, in ali_ircc_fir_hard_xmit()
1472 self->tx_fifo.len++; in ali_ircc_fir_hard_xmit()
1473 self->tx_fifo.free++; in ali_ircc_fir_hard_xmit()
1476 if (self->tx_fifo.len == 1) in ali_ircc_fir_hard_xmit()
1484 do_gettimeofday(&self->now); in ali_ircc_fir_hard_xmit()
1486 diff = self->now.tv_usec - self->stamp.tv_usec; in ali_ircc_fir_hard_xmit()
1533 self->io.direction = IO_XMIT; in ali_ircc_fir_hard_xmit()
1536 self->ier = IER_TIMER; in ali_ircc_fir_hard_xmit()
1537 SetCOMInterrupts(self, TRUE); in ali_ircc_fir_hard_xmit()
1548 self->ier = IER_EOM; in ali_ircc_fir_hard_xmit()
1549 SetCOMInterrupts(self, TRUE); in ali_ircc_fir_hard_xmit()
1552 ali_ircc_dma_xmit(self); in ali_ircc_fir_hard_xmit()
1558 if (self->tx_fifo.free < MAX_TX_WINDOW) in ali_ircc_fir_hard_xmit()
1559 netif_wake_queue(self->netdev); in ali_ircc_fir_hard_xmit()
1565 spin_unlock_irqrestore(&self->lock, flags); in ali_ircc_fir_hard_xmit()
1573 static void ali_ircc_dma_xmit(struct ali_ircc_cb *self) in ali_ircc_dma_xmit() argument
1581 iobase = self->io.fir_base; in ali_ircc_dma_xmit()
1585 if(self->tx_fifo.queue[self->tx_fifo.ptr].len < TX_FIFO_Threshold) in ali_ircc_dma_xmit()
1586 FIFO_OPTI = self->tx_fifo.queue[self->tx_fifo.ptr].len-1; in ali_ircc_dma_xmit()
1594 self->io.direction = IO_XMIT; in ali_ircc_dma_xmit()
1596 irda_setup_dma(self->io.dma, in ali_ircc_dma_xmit()
1597 ((u8 *)self->tx_fifo.queue[self->tx_fifo.ptr].start - in ali_ircc_dma_xmit()
1598 self->tx_buff.head) + self->tx_buff_dma, in ali_ircc_dma_xmit()
1599 self->tx_fifo.queue[self->tx_fifo.ptr].len, in ali_ircc_dma_xmit()
1607 if (self->fifo_opti_buf!=FIFO_OPTI) in ali_ircc_dma_xmit()
1611 self->fifo_opti_buf=FIFO_OPTI; in ali_ircc_dma_xmit()
1619 Hi = (self->tx_fifo.queue[self->tx_fifo.ptr].len >> 8) & 0x0f; in ali_ircc_dma_xmit()
1620 Lo = self->tx_fifo.queue[self->tx_fifo.ptr].len & 0xff; in ali_ircc_dma_xmit()
1643 static int ali_ircc_dma_xmit_complete(struct ali_ircc_cb *self) in ali_ircc_dma_xmit_complete() argument
1650 iobase = self->io.fir_base; in ali_ircc_dma_xmit_complete()
1662 self->netdev->stats.tx_errors++; in ali_ircc_dma_xmit_complete()
1663 self->netdev->stats.tx_fifo_errors++; in ali_ircc_dma_xmit_complete()
1667 self->netdev->stats.tx_packets++; in ali_ircc_dma_xmit_complete()
1671 if (self->new_speed) in ali_ircc_dma_xmit_complete()
1673 ali_ircc_change_speed(self, self->new_speed); in ali_ircc_dma_xmit_complete()
1674 self->new_speed = 0; in ali_ircc_dma_xmit_complete()
1678 self->tx_fifo.ptr++; in ali_ircc_dma_xmit_complete()
1679 self->tx_fifo.len--; in ali_ircc_dma_xmit_complete()
1682 if (self->tx_fifo.len) in ali_ircc_dma_xmit_complete()
1684 ali_ircc_dma_xmit(self); in ali_ircc_dma_xmit_complete()
1691 self->tx_fifo.len = self->tx_fifo.ptr = self->tx_fifo.free = 0; in ali_ircc_dma_xmit_complete()
1692 self->tx_fifo.tail = self->tx_buff.head; in ali_ircc_dma_xmit_complete()
1696 if (self->tx_fifo.free < MAX_TX_WINDOW) { in ali_ircc_dma_xmit_complete()
1699 netif_wake_queue(self->netdev); in ali_ircc_dma_xmit_complete()
1715 static int ali_ircc_dma_receive(struct ali_ircc_cb *self) in ali_ircc_dma_receive() argument
1721 iobase = self->io.fir_base; in ali_ircc_dma_receive()
1724 self->tx_fifo.len = self->tx_fifo.ptr = self->tx_fifo.free = 0; in ali_ircc_dma_receive()
1725 self->tx_fifo.tail = self->tx_buff.head; in ali_ircc_dma_receive()
1735 self->rcvFramesOverflow = FALSE; in ali_ircc_dma_receive()
1737 self->LineStatus = inb(iobase+FIR_LSR) ; in ali_ircc_dma_receive()
1740 self->io.direction = IO_RECV; in ali_ircc_dma_receive()
1741 self->rx_buff.data = self->rx_buff.head; in ali_ircc_dma_receive()
1747 self->st_fifo.len = self->st_fifo.pending_bytes = 0; in ali_ircc_dma_receive()
1748 self->st_fifo.tail = self->st_fifo.head = 0; in ali_ircc_dma_receive()
1750 irda_setup_dma(self->io.dma, self->rx_buff_dma, self->rx_buff.truesize, in ali_ircc_dma_receive()
1773 static int ali_ircc_dma_receive_complete(struct ali_ircc_cb *self) in ali_ircc_dma_receive_complete() argument
1782 st_fifo = &self->st_fifo; in ali_ircc_dma_receive_complete()
1783 iobase = self->io.fir_base; in ali_ircc_dma_receive_complete()
1827 if ((status & 0xd8) || self->rcvFramesOverflow || (len==0)) in ali_ircc_dma_receive_complete()
1832 self->netdev->stats.rx_errors++; in ali_ircc_dma_receive_complete()
1834 self->rx_buff.data += len; in ali_ircc_dma_receive_complete()
1838 self->netdev->stats.rx_frame_errors++; in ali_ircc_dma_receive_complete()
1843 self->netdev->stats.rx_frame_errors++; in ali_ircc_dma_receive_complete()
1849 self->netdev->stats.rx_crc_errors++; in ali_ircc_dma_receive_complete()
1853 if(self->rcvFramesOverflow) in ali_ircc_dma_receive_complete()
1855 self->netdev->stats.rx_frame_errors++; in ali_ircc_dma_receive_complete()
1860 self->netdev->stats.rx_frame_errors++; in ali_ircc_dma_receive_complete()
1903 do_gettimeofday(&self->stamp); in ali_ircc_dma_receive_complete()
1911 self->netdev->stats.rx_dropped++; in ali_ircc_dma_receive_complete()
1921 skb_copy_to_linear_data(skb, self->rx_buff.data, len); in ali_ircc_dma_receive_complete()
1924 self->rx_buff.data += len; in ali_ircc_dma_receive_complete()
1925 self->netdev->stats.rx_bytes += len; in ali_ircc_dma_receive_complete()
1926 self->netdev->stats.rx_packets++; in ali_ircc_dma_receive_complete()
1928 skb->dev = self->netdev; in ali_ircc_dma_receive_complete()
1951 struct ali_ircc_cb *self; in ali_ircc_sir_hard_xmit() local
1960 self = netdev_priv(dev); in ali_ircc_sir_hard_xmit()
1961 IRDA_ASSERT(self != NULL, return 0;); in ali_ircc_sir_hard_xmit()
1963 iobase = self->io.sir_base; in ali_ircc_sir_hard_xmit()
1968 spin_lock_irqsave(&self->lock, flags); in ali_ircc_sir_hard_xmit()
1976 if ((speed != self->io.speed) && (speed != -1)) { in ali_ircc_sir_hard_xmit()
1979 ali_ircc_change_speed(self, speed); in ali_ircc_sir_hard_xmit()
1981 spin_unlock_irqrestore(&self->lock, flags); in ali_ircc_sir_hard_xmit()
1985 self->new_speed = speed; in ali_ircc_sir_hard_xmit()
1989 self->tx_buff.data = self->tx_buff.head; in ali_ircc_sir_hard_xmit()
1992 self->tx_buff.len = async_wrap_skb(skb, self->tx_buff.data, in ali_ircc_sir_hard_xmit()
1993 self->tx_buff.truesize); in ali_ircc_sir_hard_xmit()
1995 self->netdev->stats.tx_bytes += self->tx_buff.len; in ali_ircc_sir_hard_xmit()
2001 spin_unlock_irqrestore(&self->lock, flags); in ali_ircc_sir_hard_xmit()
2020 struct ali_ircc_cb *self; in ali_ircc_net_ioctl() local
2028 self = netdev_priv(dev); in ali_ircc_net_ioctl()
2030 IRDA_ASSERT(self != NULL, return -1;); in ali_ircc_net_ioctl()
2045 spin_lock_irqsave(&self->lock, flags); in ali_ircc_net_ioctl()
2046 ali_ircc_change_speed(self, irq->ifr_baudrate); in ali_ircc_net_ioctl()
2047 spin_unlock_irqrestore(&self->lock, flags); in ali_ircc_net_ioctl()
2053 irda_device_set_media_busy(self->netdev, TRUE); in ali_ircc_net_ioctl()
2058 irq->ifr_receiving = ali_ircc_is_receiving(self); in ali_ircc_net_ioctl()
2075 static int ali_ircc_is_receiving(struct ali_ircc_cb *self) in ali_ircc_is_receiving() argument
2083 IRDA_ASSERT(self != NULL, return FALSE;); in ali_ircc_is_receiving()
2085 spin_lock_irqsave(&self->lock, flags); in ali_ircc_is_receiving()
2087 if (self->io.speed > 115200) in ali_ircc_is_receiving()
2089 iobase = self->io.fir_base; in ali_ircc_is_receiving()
2102 status = (self->rx_buff.state != OUTSIDE_FRAME); in ali_ircc_is_receiving()
2105 spin_unlock_irqrestore(&self->lock, flags); in ali_ircc_is_receiving()
2114 struct ali_ircc_cb *self = platform_get_drvdata(dev); in ali_ircc_suspend() local
2118 if (self->io.suspended) in ali_ircc_suspend()
2121 ali_ircc_net_close(self->netdev); in ali_ircc_suspend()
2123 self->io.suspended = 1; in ali_ircc_suspend()
2130 struct ali_ircc_cb *self = platform_get_drvdata(dev); in ali_ircc_resume() local
2132 if (!self->io.suspended) in ali_ircc_resume()
2135 ali_ircc_net_open(self->netdev); in ali_ircc_resume()
2139 self->io.suspended = 0; in ali_ircc_resume()
2146 static void SetCOMInterrupts(struct ali_ircc_cb *self , unsigned char enable) in SetCOMInterrupts() argument
2151 int iobase = self->io.fir_base; /* or sir_base */ in SetCOMInterrupts()
2157 if (self->io.direction == IO_XMIT) in SetCOMInterrupts()
2159 if (self->io.speed > 115200) /* FIR, MIR */ in SetCOMInterrupts()
2161 newMask = self->ier; in SetCOMInterrupts()
2169 if (self->io.speed > 115200) /* FIR, MIR */ in SetCOMInterrupts()
2171 newMask = self->ier; in SetCOMInterrupts()
2186 if (self->io.speed > 115200) in SetCOMInterrupts()