• Home
  • Raw
  • Download

Lines Matching refs:q

37 static u16 generate_cookie(struct b43_pio_txqueue *q,  in generate_cookie()  argument
50 cookie = (((u16)q->index + 1) << 12); in generate_cookie()
62 struct b43_pio_txqueue *q = NULL; in parse_cookie() local
67 q = pio->tx_queue_AC_BK; in parse_cookie()
70 q = pio->tx_queue_AC_BE; in parse_cookie()
73 q = pio->tx_queue_AC_VI; in parse_cookie()
76 q = pio->tx_queue_AC_VO; in parse_cookie()
79 q = pio->tx_queue_mcast; in parse_cookie()
82 if (B43_WARN_ON(!q)) in parse_cookie()
85 if (B43_WARN_ON(pack_index >= ARRAY_SIZE(q->packets))) in parse_cookie()
87 *pack = &q->packets[pack_index]; in parse_cookie()
89 return q; in parse_cookie()
139 struct b43_pio_txqueue *q; in b43_setup_pioqueue_tx() local
143 q = kzalloc(sizeof(*q), GFP_KERNEL); in b43_setup_pioqueue_tx()
144 if (!q) in b43_setup_pioqueue_tx()
146 q->dev = dev; in b43_setup_pioqueue_tx()
147 q->rev = dev->dev->core_rev; in b43_setup_pioqueue_tx()
148 q->mmio_base = index_to_pioqueue_base(dev, index) + in b43_setup_pioqueue_tx()
150 q->index = index; in b43_setup_pioqueue_tx()
152 q->free_packet_slots = B43_PIO_MAX_NR_TXPACKETS; in b43_setup_pioqueue_tx()
153 if (q->rev >= 8) { in b43_setup_pioqueue_tx()
154 q->buffer_size = 1920; //FIXME this constant is wrong. in b43_setup_pioqueue_tx()
156 q->buffer_size = b43_piotx_read16(q, B43_PIO_TXQBUFSIZE); in b43_setup_pioqueue_tx()
157 q->buffer_size -= 80; in b43_setup_pioqueue_tx()
160 INIT_LIST_HEAD(&q->packets_list); in b43_setup_pioqueue_tx()
161 for (i = 0; i < ARRAY_SIZE(q->packets); i++) { in b43_setup_pioqueue_tx()
162 p = &(q->packets[i]); in b43_setup_pioqueue_tx()
165 p->queue = q; in b43_setup_pioqueue_tx()
166 list_add(&p->list, &q->packets_list); in b43_setup_pioqueue_tx()
169 return q; in b43_setup_pioqueue_tx()
175 struct b43_pio_rxqueue *q; in b43_setup_pioqueue_rx() local
177 q = kzalloc(sizeof(*q), GFP_KERNEL); in b43_setup_pioqueue_rx()
178 if (!q) in b43_setup_pioqueue_rx()
180 q->dev = dev; in b43_setup_pioqueue_rx()
181 q->rev = dev->dev->core_rev; in b43_setup_pioqueue_rx()
182 q->mmio_base = index_to_pioqueue_base(dev, index) + in b43_setup_pioqueue_rx()
188 return q; in b43_setup_pioqueue_rx()
191 static void b43_pio_cancel_tx_packets(struct b43_pio_txqueue *q) in b43_pio_cancel_tx_packets() argument
196 for (i = 0; i < ARRAY_SIZE(q->packets); i++) { in b43_pio_cancel_tx_packets()
197 pack = &(q->packets[i]); in b43_pio_cancel_tx_packets()
199 ieee80211_free_txskb(q->dev->wl->hw, pack->skb); in b43_pio_cancel_tx_packets()
205 static void b43_destroy_pioqueue_tx(struct b43_pio_txqueue *q, in b43_destroy_pioqueue_tx() argument
208 if (!q) in b43_destroy_pioqueue_tx()
210 b43_pio_cancel_tx_packets(q); in b43_destroy_pioqueue_tx()
211 kfree(q); in b43_destroy_pioqueue_tx()
214 static void b43_destroy_pioqueue_rx(struct b43_pio_rxqueue *q, in b43_destroy_pioqueue_rx() argument
217 if (!q) in b43_destroy_pioqueue_rx()
219 kfree(q); in b43_destroy_pioqueue_rx()
303 struct b43_pio_txqueue *q; in select_queue_by_priority() local
312 q = dev->pio.tx_queue_AC_VO; in select_queue_by_priority()
315 q = dev->pio.tx_queue_AC_VI; in select_queue_by_priority()
318 q = dev->pio.tx_queue_AC_BE; in select_queue_by_priority()
321 q = dev->pio.tx_queue_AC_BK; in select_queue_by_priority()
325 q = dev->pio.tx_queue_AC_BE; in select_queue_by_priority()
327 return q; in select_queue_by_priority()
330 static u16 tx_write_2byte_queue(struct b43_pio_txqueue *q, in tx_write_2byte_queue() argument
335 struct b43_wldev *dev = q->dev; in tx_write_2byte_queue()
340 b43_piotx_write16(q, B43_PIO_TXCTL, ctl); in tx_write_2byte_queue()
343 q->mmio_base + B43_PIO_TXDATA, in tx_write_2byte_queue()
351 b43_piotx_write16(q, B43_PIO_TXCTL, ctl); in tx_write_2byte_queue()
355 q->mmio_base + B43_PIO_TXDATA, in tx_write_2byte_queue()
365 struct b43_pio_txqueue *q = pack->queue; in pio_tx_frame_2byte_queue() local
370 ctl = b43_piotx_read16(q, B43_PIO_TXCTL); in pio_tx_frame_2byte_queue()
375 ctl = tx_write_2byte_queue(q, ctl, hdr, hdrlen); in pio_tx_frame_2byte_queue()
377 ctl = tx_write_2byte_queue(q, ctl, frame, frame_len); in pio_tx_frame_2byte_queue()
380 b43_piotx_write16(q, B43_PIO_TXCTL, ctl); in pio_tx_frame_2byte_queue()
383 static u32 tx_write_4byte_queue(struct b43_pio_txqueue *q, in tx_write_4byte_queue() argument
388 struct b43_wldev *dev = q->dev; in tx_write_4byte_queue()
394 b43_piotx_write32(q, B43_PIO8_TXCTL, ctl); in tx_write_4byte_queue()
397 q->mmio_base + B43_PIO8_TXDATA, in tx_write_4byte_queue()
423 b43_piotx_write32(q, B43_PIO8_TXCTL, ctl); in tx_write_4byte_queue()
425 q->mmio_base + B43_PIO8_TXDATA, in tx_write_4byte_queue()
435 struct b43_pio_txqueue *q = pack->queue; in pio_tx_frame_4byte_queue() local
440 ctl = b43_piotx_read32(q, B43_PIO8_TXCTL); in pio_tx_frame_4byte_queue()
445 ctl = tx_write_4byte_queue(q, ctl, hdr, hdrlen); in pio_tx_frame_4byte_queue()
447 ctl = tx_write_4byte_queue(q, ctl, frame, frame_len); in pio_tx_frame_4byte_queue()
450 b43_piotx_write32(q, B43_PIO_TXCTL, ctl); in pio_tx_frame_4byte_queue()
453 static int pio_tx_frame(struct b43_pio_txqueue *q, in pio_tx_frame() argument
456 struct b43_wldev *dev = q->dev; in pio_tx_frame()
465 B43_WARN_ON(list_empty(&q->packets_list)); in pio_tx_frame()
466 pack = list_entry(q->packets_list.next, in pio_tx_frame()
469 cookie = generate_cookie(q, pack); in pio_tx_frame()
486 if (q->rev >= 8) in pio_tx_frame()
496 q->buffer_used += roundup(skb->len + hdrlen, 4); in pio_tx_frame()
497 q->free_packet_slots -= 1; in pio_tx_frame()
504 struct b43_pio_txqueue *q; in b43_pio_tx() local
514 q = dev->pio.tx_queue_mcast; in b43_pio_tx()
520 q = select_queue_by_priority(dev, skb_get_queue_mapping(skb)); in b43_pio_tx()
526 if (unlikely(total_len > q->buffer_size)) { in b43_pio_tx()
531 if (unlikely(q->free_packet_slots == 0)) { in b43_pio_tx()
536 B43_WARN_ON(q->buffer_used > q->buffer_size); in b43_pio_tx()
538 if (total_len > (q->buffer_size - q->buffer_used)) { in b43_pio_tx()
542 q->stopped = true; in b43_pio_tx()
549 q->queue_prio = skb_get_queue_mapping(skb); in b43_pio_tx()
551 err = pio_tx_frame(q, skb); in b43_pio_tx()
564 B43_WARN_ON(q->buffer_used > q->buffer_size); in b43_pio_tx()
565 if (((q->buffer_size - q->buffer_used) < roundup(2 + 2 + 6, 4)) || in b43_pio_tx()
566 (q->free_packet_slots == 0)) { in b43_pio_tx()
569 q->stopped = true; in b43_pio_tx()
579 struct b43_pio_txqueue *q; in b43_pio_handle_txstatus() local
584 q = parse_cookie(dev, status->cookie, &pack); in b43_pio_handle_txstatus()
585 if (unlikely(!q)) in b43_pio_handle_txstatus()
595 q->buffer_used -= total_len; in b43_pio_handle_txstatus()
596 q->free_packet_slots += 1; in b43_pio_handle_txstatus()
600 list_add(&pack->list, &q->packets_list); in b43_pio_handle_txstatus()
602 if (q->stopped) { in b43_pio_handle_txstatus()
603 ieee80211_wake_queue(dev->wl->hw, q->queue_prio); in b43_pio_handle_txstatus()
604 q->stopped = false; in b43_pio_handle_txstatus()
609 static bool pio_rx_frame(struct b43_pio_rxqueue *q) in pio_rx_frame() argument
611 struct b43_wldev *dev = q->dev; in pio_rx_frame()
635 if (q->rev >= 8) { in pio_rx_frame()
638 ctl = b43_piorx_read32(q, B43_PIO8_RXCTL); in pio_rx_frame()
641 b43_piorx_write32(q, B43_PIO8_RXCTL, in pio_rx_frame()
644 ctl = b43_piorx_read32(q, B43_PIO8_RXCTL); in pio_rx_frame()
652 ctl = b43_piorx_read16(q, B43_PIO_RXCTL); in pio_rx_frame()
655 b43_piorx_write16(q, B43_PIO_RXCTL, in pio_rx_frame()
658 ctl = b43_piorx_read16(q, B43_PIO_RXCTL); in pio_rx_frame()
664 b43dbg(q->dev->wl, "PIO RX timed out\n"); in pio_rx_frame()
669 if (q->rev >= 8) { in pio_rx_frame()
671 q->mmio_base + B43_PIO8_RXDATA, in pio_rx_frame()
675 q->mmio_base + B43_PIO_RXDATA, in pio_rx_frame()
699 if (!(q->dev->wl->filter_flags & FIF_FCSFAIL)) { in pio_rx_frame()
717 if (q->rev >= 8) { in pio_rx_frame()
719 q->mmio_base + B43_PIO8_RXDATA, in pio_rx_frame()
727 q->mmio_base + B43_PIO8_RXDATA, in pio_rx_frame()
746 q->mmio_base + B43_PIO_RXDATA, in pio_rx_frame()
754 q->mmio_base + B43_PIO_RXDATA, in pio_rx_frame()
760 b43_rx(q->dev, skb, rxhdr); in pio_rx_frame()
766 b43dbg(q->dev->wl, "PIO RX error: %s\n", err_msg); in pio_rx_frame()
767 if (q->rev >= 8) in pio_rx_frame()
768 b43_piorx_write32(q, B43_PIO8_RXCTL, B43_PIO8_RXCTL_DATARDY); in pio_rx_frame()
770 b43_piorx_write16(q, B43_PIO_RXCTL, B43_PIO_RXCTL_DATARDY); in pio_rx_frame()
775 void b43_pio_rx(struct b43_pio_rxqueue *q) in b43_pio_rx() argument
781 stop = (pio_rx_frame(q) == 0); in b43_pio_rx()
790 static void b43_pio_tx_suspend_queue(struct b43_pio_txqueue *q) in b43_pio_tx_suspend_queue() argument
792 if (q->rev >= 8) { in b43_pio_tx_suspend_queue()
793 b43_piotx_write32(q, B43_PIO8_TXCTL, in b43_pio_tx_suspend_queue()
794 b43_piotx_read32(q, B43_PIO8_TXCTL) in b43_pio_tx_suspend_queue()
797 b43_piotx_write16(q, B43_PIO_TXCTL, in b43_pio_tx_suspend_queue()
798 b43_piotx_read16(q, B43_PIO_TXCTL) in b43_pio_tx_suspend_queue()
803 static void b43_pio_tx_resume_queue(struct b43_pio_txqueue *q) in b43_pio_tx_resume_queue() argument
805 if (q->rev >= 8) { in b43_pio_tx_resume_queue()
806 b43_piotx_write32(q, B43_PIO8_TXCTL, in b43_pio_tx_resume_queue()
807 b43_piotx_read32(q, B43_PIO8_TXCTL) in b43_pio_tx_resume_queue()
810 b43_piotx_write16(q, B43_PIO_TXCTL, in b43_pio_tx_resume_queue()
811 b43_piotx_read16(q, B43_PIO_TXCTL) in b43_pio_tx_resume_queue()