Lines Matching refs:wl
33 static bool wl1251_tx_double_buffer_busy(struct wl1251 *wl, u32 data_out_count) in wl1251_tx_double_buffer_busy() argument
37 data_in_count = wl->data_in_count; in wl1251_tx_double_buffer_busy()
54 static int wl1251_tx_path_status(struct wl1251 *wl) in wl1251_tx_path_status() argument
59 addr = wl->data_path->tx_control_addr; in wl1251_tx_path_status()
60 status = wl1251_mem_read32(wl, addr); in wl1251_tx_path_status()
62 busy = wl1251_tx_double_buffer_busy(wl, data_out_count); in wl1251_tx_path_status()
70 static int wl1251_tx_id(struct wl1251 *wl, struct sk_buff *skb) in wl1251_tx_id() argument
75 if (wl->tx_frames[i] == NULL) { in wl1251_tx_id()
76 wl->tx_frames[i] = skb; in wl1251_tx_id()
148 static int wl1251_tx_fill_hdr(struct wl1251 *wl, struct sk_buff *skb, in wl1251_tx_fill_hdr() argument
159 id = wl1251_tx_id(wl, skb); in wl1251_tx_fill_hdr()
167 rate = ieee80211_get_tx_rate(wl->hw, control); in wl1251_tx_fill_hdr()
181 static int wl1251_tx_send_packet(struct wl1251 *wl, struct sk_buff *skb, in wl1251_tx_send_packet() argument
232 wl->tx_frames[tx_hdr->id] = skb = newskb; in wl1251_tx_send_packet()
250 if (wl->data_in_count & 0x1) in wl1251_tx_send_packet()
251 addr = wl->data_path->tx_packet_ring_addr + in wl1251_tx_send_packet()
252 wl->data_path->tx_packet_ring_chunk_size; in wl1251_tx_send_packet()
254 addr = wl->data_path->tx_packet_ring_addr; in wl1251_tx_send_packet()
256 wl1251_mem_write(wl, addr, skb->data, len); in wl1251_tx_send_packet()
265 static void wl1251_tx_trigger(struct wl1251 *wl) in wl1251_tx_trigger() argument
269 if (wl->data_in_count & 0x1) { in wl1251_tx_trigger()
277 wl1251_reg_write32(wl, addr, data); in wl1251_tx_trigger()
280 wl->data_in_count = (wl->data_in_count + 1) & in wl1251_tx_trigger()
284 static void enable_tx_for_packet_injection(struct wl1251 *wl) in enable_tx_for_packet_injection() argument
288 ret = wl1251_cmd_join(wl, BSS_TYPE_STA_BSS, wl->channel, in enable_tx_for_packet_injection()
289 wl->beacon_int, wl->dtim_period); in enable_tx_for_packet_injection()
295 ret = wl1251_event_wait(wl, JOIN_EVENT_COMPLETE_ID, 100); in enable_tx_for_packet_injection()
301 wl->joined = true; in enable_tx_for_packet_injection()
305 static int wl1251_tx_frame(struct wl1251 *wl, struct sk_buff *skb) in wl1251_tx_frame() argument
314 if (unlikely(wl->monitor_present)) in wl1251_tx_frame()
318 if (unlikely(wl->default_key != idx)) { in wl1251_tx_frame()
319 ret = wl1251_acx_default_key(wl, idx); in wl1251_tx_frame()
326 if ((wl->vif == NULL) && !wl->joined) in wl1251_tx_frame()
327 enable_tx_for_packet_injection(wl); in wl1251_tx_frame()
329 ret = wl1251_tx_path_status(wl); in wl1251_tx_frame()
333 ret = wl1251_tx_fill_hdr(wl, skb, info); in wl1251_tx_frame()
337 ret = wl1251_tx_send_packet(wl, skb, info); in wl1251_tx_frame()
341 wl1251_tx_trigger(wl); in wl1251_tx_frame()
348 struct wl1251 *wl = container_of(work, struct wl1251, tx_work); in wl1251_tx_work() local
353 mutex_lock(&wl->mutex); in wl1251_tx_work()
355 if (unlikely(wl->state == WL1251_STATE_OFF)) in wl1251_tx_work()
358 while ((skb = skb_dequeue(&wl->tx_queue))) { in wl1251_tx_work()
360 ret = wl1251_ps_elp_wakeup(wl); in wl1251_tx_work()
366 ret = wl1251_tx_frame(wl, skb); in wl1251_tx_work()
368 skb_queue_head(&wl->tx_queue, skb); in wl1251_tx_work()
378 wl1251_ps_elp_sleep(wl); in wl1251_tx_work()
380 mutex_unlock(&wl->mutex); in wl1251_tx_work()
411 static void wl1251_tx_packet_cb(struct wl1251 *wl, in wl1251_tx_packet_cb() argument
419 skb = wl->tx_frames[result->id]; in wl1251_tx_packet_cb()
433 wl->stats.retry_count += result->ack_failures; in wl1251_tx_packet_cb()
453 ieee80211_tx_status(wl->hw, skb); in wl1251_tx_packet_cb()
455 wl->tx_frames[result->id] = NULL; in wl1251_tx_packet_cb()
459 void wl1251_tx_complete(struct wl1251 *wl) in wl1251_tx_complete() argument
465 if (unlikely(wl->state != WL1251_STATE_ON)) in wl1251_tx_complete()
469 wl1251_mem_read(wl, wl->data_path->tx_complete_addr, in wl1251_tx_complete()
472 result_index = wl->next_tx_complete; in wl1251_tx_complete()
479 wl1251_tx_packet_cb(wl, result_ptr); in wl1251_tx_complete()
492 queue_len = skb_queue_len(&wl->tx_queue); in wl1251_tx_complete()
497 ieee80211_queue_work(wl->hw, &wl->tx_work); in wl1251_tx_complete()
500 if (wl->tx_queue_stopped && in wl1251_tx_complete()
504 spin_lock_irqsave(&wl->wl_lock, flags); in wl1251_tx_complete()
505 ieee80211_wake_queues(wl->hw); in wl1251_tx_complete()
506 wl->tx_queue_stopped = false; in wl1251_tx_complete()
507 spin_unlock_irqrestore(&wl->wl_lock, flags); in wl1251_tx_complete()
516 if (result_index > wl->next_tx_complete) { in wl1251_tx_complete()
518 wl1251_mem_write(wl, in wl1251_tx_complete()
519 wl->data_path->tx_complete_addr + in wl1251_tx_complete()
520 (wl->next_tx_complete * in wl1251_tx_complete()
522 &result[wl->next_tx_complete], in wl1251_tx_complete()
527 } else if (result_index < wl->next_tx_complete) { in wl1251_tx_complete()
529 wl1251_mem_write(wl, in wl1251_tx_complete()
530 wl->data_path->tx_complete_addr + in wl1251_tx_complete()
531 (wl->next_tx_complete * in wl1251_tx_complete()
533 &result[wl->next_tx_complete], in wl1251_tx_complete()
535 wl->next_tx_complete) * in wl1251_tx_complete()
538 wl1251_mem_write(wl, in wl1251_tx_complete()
539 wl->data_path->tx_complete_addr, in wl1251_tx_complete()
543 wl->next_tx_complete) * in wl1251_tx_complete()
548 wl1251_mem_write(wl, in wl1251_tx_complete()
549 wl->data_path->tx_complete_addr, in wl1251_tx_complete()
557 wl->next_tx_complete = result_index; in wl1251_tx_complete()
561 void wl1251_tx_flush(struct wl1251 *wl) in wl1251_tx_flush() argument
570 while ((skb = skb_dequeue(&wl->tx_queue))) { in wl1251_tx_flush()
578 ieee80211_tx_status(wl->hw, skb); in wl1251_tx_flush()
582 if (wl->tx_frames[i] != NULL) { in wl1251_tx_flush()
583 skb = wl->tx_frames[i]; in wl1251_tx_flush()
589 ieee80211_tx_status(wl->hw, skb); in wl1251_tx_flush()
590 wl->tx_frames[i] = NULL; in wl1251_tx_flush()