Lines Matching defs:aup
88 static db_dest_t *GetFreeDB(struct au1k_private *aup)
91 pDB = aup->pDBfree;
94 aup->pDBfree = pDB->pnext;
99 static void ReleaseDB(struct au1k_private *aup, db_dest_t *pDB)
101 db_dest_t *pDBfree = aup->pDBfree;
104 aup->pDBfree = pDB;
137 setup_hw_rings(struct au1k_private *aup, u32 rx_base, u32 tx_base)
141 aup->rx_ring[i] = (volatile ring_dest_t *)
145 aup->tx_ring[i] = (volatile ring_dest_t *)
153 struct au1k_private *aup;
175 aup = netdev_priv(dev);
176 dma_free((void *)aup->db[0].vaddr,
178 dma_free((void *)aup->rx_ring[0],
180 kfree(aup->rx_buff.head);
208 struct au1k_private *aup = netdev_priv(dev);
213 err = au1k_irda_init_iobuf(&aup->rx_buff, 14384);
219 irda_init_max_qos_capabilies(&aup->qos);
222 aup->qos.baud_rate.bits = IR_9600|IR_19200|IR_38400|IR_57600|
225 aup->qos.min_turn_time.bits = qos_mtt_bits;
226 irda_qos_bits_to_value(&aup->qos);
232 aup->rx_ring[0] = (ring_dest_t *)
234 if (!aup->rx_ring[0])
238 aup->db[0].vaddr =
240 if (!aup->db[0].vaddr)
243 setup_hw_rings(aup, (u32)aup->rx_ring[0], (u32)aup->rx_ring[0] + 512);
246 pDB = aup->db;
251 (u32 *)((unsigned)aup->db[0].vaddr + MAX_BUF_SIZE*i);
255 aup->pDBfree = pDBfree;
259 pDB = GetFreeDB(aup);
261 aup->rx_ring[i]->addr_0 = (u8)(pDB->dma_addr & 0xff);
262 aup->rx_ring[i]->addr_1 = (u8)((pDB->dma_addr>>8) & 0xff);
263 aup->rx_ring[i]->addr_2 = (u8)((pDB->dma_addr>>16) & 0xff);
264 aup->rx_ring[i]->addr_3 = (u8)((pDB->dma_addr>>24) & 0xff);
265 aup->rx_db_inuse[i] = pDB;
268 pDB = GetFreeDB(aup);
270 aup->tx_ring[i]->addr_0 = (u8)(pDB->dma_addr & 0xff);
271 aup->tx_ring[i]->addr_1 = (u8)((pDB->dma_addr>>8) & 0xff);
272 aup->tx_ring[i]->addr_2 = (u8)((pDB->dma_addr>>16) & 0xff);
273 aup->tx_ring[i]->addr_3 = (u8)((pDB->dma_addr>>24) & 0xff);
274 aup->tx_ring[i]->count_0 = 0;
275 aup->tx_ring[i]->count_1 = 0;
276 aup->tx_ring[i]->flags = 0;
277 aup->tx_db_inuse[i] = pDB;
289 dma_free((void *)aup->rx_ring[0],
292 kfree(aup->rx_buff.head);
301 struct au1k_private *aup = netdev_priv(dev);
312 aup->tx_head = 0;
313 aup->tx_tail = 0;
314 aup->rx_head = 0;
317 aup->rx_ring[i]->flags = AU_OWN;
328 ring_address = (u32)virt_to_phys((void *)aup->rx_ring[0]);
345 struct au1k_private *aup = netdev_priv(dev);
368 aup->irlap = irlap_open(dev, &aup->qos, hwname);
373 aup->timer.expires = RUN_AT((3*HZ));
374 aup->timer.data = (unsigned long)dev;
380 struct au1k_private *aup = netdev_priv(dev);
388 if (aup->irlap) {
389 irlap_close(aup->irlap);
390 aup->irlap = NULL;
394 del_timer(&aup->timer);
405 struct au1k_private *aup = netdev_priv(dev);
409 dma_free((void *)aup->db[0].vaddr,
411 dma_free((void *)aup->rx_ring[0],
413 kfree(aup->rx_buff.head);
421 struct au1k_private *aup = netdev_priv(dev);
422 struct net_device_stats *ps = &aup->stats;
436 struct au1k_private *aup = netdev_priv(dev);
439 ptxd = aup->tx_ring[aup->tx_tail];
440 while (!(ptxd->flags & AU_OWN) && (aup->tx_tail != aup->tx_head)) {
447 aup->tx_tail = (aup->tx_tail + 1) & (NUM_IR_DESC - 1);
448 ptxd = aup->tx_ring[aup->tx_tail];
450 if (aup->tx_full) {
451 aup->tx_full = 0;
456 if (aup->tx_tail == aup->tx_head) {
457 if (aup->newspeed) {
458 au1k_irda_set_speed(dev, aup->newspeed);
459 aup->newspeed = 0;
479 struct au1k_private *aup = netdev_priv(dev);
487 if (speed != aup->speed && speed != -1) {
488 aup->newspeed = speed;
491 if ((skb->len == 0) && (aup->newspeed)) {
492 if (aup->tx_tail == aup->tx_head) {
494 aup->newspeed = 0;
500 ptxd = aup->tx_ring[aup->tx_head];
506 aup->tx_full = 1;
509 else if (((aup->tx_head + 1) & (NUM_IR_DESC - 1)) == aup->tx_tail) {
512 aup->tx_full = 1;
516 pDB = aup->tx_db_inuse[aup->tx_head];
519 if (aup->speed == 4000000) {
542 aup->tx_head = (aup->tx_head + 1) & (NUM_IR_DESC - 1);
550 struct au1k_private *aup = netdev_priv(dev);
551 struct net_device_stats *ps = &aup->stats;
573 struct au1k_private *aup = netdev_priv(dev);
579 prxd = aup->rx_ring[aup->rx_head];
583 pDB = aup->rx_db_inuse[aup->rx_head];
590 aup->netdev->stats.rx_dropped++;
594 if (aup->speed == 4000000)
607 aup->rx_head = (aup->rx_head + 1) & (NUM_IR_DESC - 1);
612 prxd = aup->rx_ring[aup->rx_head];
640 struct au1k_private *aup = netdev_priv(dev);
643 speed = aup->speed;
644 aup->speed = 0;
646 aup->tx_full = 0;
658 struct au1k_private *aup = netdev_priv(dev);
666 if (speed == aup->speed)
695 aup->tx_head = aup->tx_tail = aup->rx_head = 0;
697 ptxd = aup->tx_ring[i];
704 ptxd = aup->rx_ring[i];
756 aup->speed = speed;
788 struct au1k_private *aup = netdev_priv(dev);
798 if (aup->open)