Lines Matching refs:ar_usb
54 struct ath6kl_usb *ar_usb; member
135 spin_lock_irqsave(&pipe->ar_usb->cs_lock, flags); in ath6kl_usb_alloc_urb_from_pipe()
143 spin_unlock_irqrestore(&pipe->ar_usb->cs_lock, flags); in ath6kl_usb_alloc_urb_from_pipe()
153 spin_lock_irqsave(&pipe->ar_usb->cs_lock, flags); in ath6kl_usb_free_urb_to_pipe()
157 spin_unlock_irqrestore(&pipe->ar_usb->cs_lock, flags); in ath6kl_usb_free_urb_to_pipe()
214 if (pipe->ar_usb == NULL) { in ath6kl_usb_free_pipe_resources()
241 static void ath6kl_usb_cleanup_pipe_resources(struct ath6kl_usb *ar_usb) in ath6kl_usb_cleanup_pipe_resources() argument
246 ath6kl_usb_free_pipe_resources(&ar_usb->pipes[i]); in ath6kl_usb_cleanup_pipe_resources()
249 static u8 ath6kl_usb_get_logical_pipe_num(struct ath6kl_usb *ar_usb, in ath6kl_usb_get_logical_pipe_num() argument
295 static int ath6kl_usb_setup_pipe_resources(struct ath6kl_usb *ar_usb) in ath6kl_usb_setup_pipe_resources() argument
297 struct usb_interface *interface = ar_usb->interface; in ath6kl_usb_setup_pipe_resources()
338 ath6kl_usb_get_logical_pipe_num(ar_usb, in ath6kl_usb_setup_pipe_resources()
344 pipe = &ar_usb->pipes[pipe_num]; in ath6kl_usb_setup_pipe_resources()
345 if (pipe->ar_usb != NULL) { in ath6kl_usb_setup_pipe_resources()
350 pipe->ar_usb = ar_usb; in ath6kl_usb_setup_pipe_resources()
358 usb_rcvbulkpipe(ar_usb->udev, in ath6kl_usb_setup_pipe_resources()
362 usb_sndbulkpipe(ar_usb->udev, in ath6kl_usb_setup_pipe_resources()
368 usb_rcvintpipe(ar_usb->udev, in ath6kl_usb_setup_pipe_resources()
372 usb_sndintpipe(ar_usb->udev, in ath6kl_usb_setup_pipe_resources()
379 usb_rcvisocpipe(ar_usb->udev, in ath6kl_usb_setup_pipe_resources()
383 usb_sndisocpipe(ar_usb->udev, in ath6kl_usb_setup_pipe_resources()
423 recv_pipe->ar_usb->udev, in ath6kl_usb_post_recv_transfers()
455 static void ath6kl_usb_flush_all(struct ath6kl_usb *ar_usb) in ath6kl_usb_flush_all() argument
460 if (ar_usb->pipes[i].ar_usb != NULL) in ath6kl_usb_flush_all()
461 usb_kill_anchored_urbs(&ar_usb->pipes[i].urb_submitted); in ath6kl_usb_flush_all()
471 static void ath6kl_usb_start_recv_pipes(struct ath6kl_usb *ar_usb) in ath6kl_usb_start_recv_pipes() argument
482 ar_usb->pipes[ATH6KL_USB_PIPE_RX_DATA].urb_cnt_thresh = 1; in ath6kl_usb_start_recv_pipes()
484 ath6kl_usb_post_recv_transfers(&ar_usb->pipes[ATH6KL_USB_PIPE_RX_DATA], in ath6kl_usb_start_recv_pipes()
577 struct ath6kl_usb *ar_usb; in ath6kl_usb_io_comp_work() local
580 ar_usb = pipe->ar_usb; in ath6kl_usb_io_comp_work()
586 ath6kl_core_tx_complete(ar_usb->ar, skb); in ath6kl_usb_io_comp_work()
590 ath6kl_core_rx_complete(ar_usb->ar, skb, in ath6kl_usb_io_comp_work()
599 static void ath6kl_usb_destroy(struct ath6kl_usb *ar_usb) in ath6kl_usb_destroy() argument
601 ath6kl_usb_flush_all(ar_usb); in ath6kl_usb_destroy()
603 ath6kl_usb_cleanup_pipe_resources(ar_usb); in ath6kl_usb_destroy()
605 usb_set_intfdata(ar_usb->interface, NULL); in ath6kl_usb_destroy()
607 kfree(ar_usb->diag_cmd_buffer); in ath6kl_usb_destroy()
608 kfree(ar_usb->diag_resp_buffer); in ath6kl_usb_destroy()
610 kfree(ar_usb); in ath6kl_usb_destroy()
616 struct ath6kl_usb *ar_usb; in ath6kl_usb_create() local
621 ar_usb = kzalloc(sizeof(struct ath6kl_usb), GFP_KERNEL); in ath6kl_usb_create()
622 if (ar_usb == NULL) in ath6kl_usb_create()
625 usb_set_intfdata(interface, ar_usb); in ath6kl_usb_create()
626 spin_lock_init(&(ar_usb->cs_lock)); in ath6kl_usb_create()
627 ar_usb->udev = dev; in ath6kl_usb_create()
628 ar_usb->interface = interface; in ath6kl_usb_create()
631 pipe = &ar_usb->pipes[i]; in ath6kl_usb_create()
637 ar_usb->diag_cmd_buffer = kzalloc(ATH6KL_USB_MAX_DIAG_CMD, GFP_KERNEL); in ath6kl_usb_create()
638 if (ar_usb->diag_cmd_buffer == NULL) { in ath6kl_usb_create()
643 ar_usb->diag_resp_buffer = kzalloc(ATH6KL_USB_MAX_DIAG_RESP, in ath6kl_usb_create()
645 if (ar_usb->diag_resp_buffer == NULL) { in ath6kl_usb_create()
650 status = ath6kl_usb_setup_pipe_resources(ar_usb); in ath6kl_usb_create()
654 ath6kl_usb_destroy(ar_usb); in ath6kl_usb_create()
655 ar_usb = NULL; in ath6kl_usb_create()
657 return ar_usb; in ath6kl_usb_create()
662 struct ath6kl_usb *ar_usb; in ath6kl_usb_device_detached() local
664 ar_usb = usb_get_intfdata(interface); in ath6kl_usb_device_detached()
665 if (ar_usb == NULL) in ath6kl_usb_device_detached()
668 ath6kl_stop_txrx(ar_usb->ar); in ath6kl_usb_device_detached()
672 ath6kl_core_cleanup(ar_usb->ar); in ath6kl_usb_device_detached()
673 ath6kl_usb_destroy(ar_usb); in ath6kl_usb_device_detached()
851 static int ath6kl_usb_submit_ctrl_out(struct ath6kl_usb *ar_usb, in ath6kl_usb_submit_ctrl_out() argument
865 ret = usb_control_msg(ar_usb->udev, in ath6kl_usb_submit_ctrl_out()
866 usb_sndctrlpipe(ar_usb->udev, 0), in ath6kl_usb_submit_ctrl_out()
883 static int ath6kl_usb_submit_ctrl_in(struct ath6kl_usb *ar_usb, in ath6kl_usb_submit_ctrl_in() argument
897 ret = usb_control_msg(ar_usb->udev, in ath6kl_usb_submit_ctrl_in()
898 usb_rcvctrlpipe(ar_usb->udev, 0), in ath6kl_usb_submit_ctrl_in()
917 static int ath6kl_usb_ctrl_msg_exchange(struct ath6kl_usb *ar_usb, in ath6kl_usb_ctrl_msg_exchange() argument
924 ret = ath6kl_usb_submit_ctrl_out(ar_usb, req_val, 0, 0, in ath6kl_usb_ctrl_msg_exchange()
936 ret = ath6kl_usb_submit_ctrl_in(ar_usb, resp_val, 0, 0, in ath6kl_usb_ctrl_msg_exchange()
944 struct ath6kl_usb *ar_usb = ar->hif_priv; in ath6kl_usb_diag_read32() local
950 cmd = (struct ath6kl_usb_ctrl_diag_cmd_read *) ar_usb->diag_cmd_buffer; in ath6kl_usb_diag_read32()
957 ret = ath6kl_usb_ctrl_msg_exchange(ar_usb, in ath6kl_usb_diag_read32()
962 ar_usb->diag_resp_buffer, &resp_len); in ath6kl_usb_diag_read32()
970 ar_usb->diag_resp_buffer; in ath6kl_usb_diag_read32()
979 struct ath6kl_usb *ar_usb = ar->hif_priv; in ath6kl_usb_diag_write32() local
983 cmd = (struct ath6kl_usb_ctrl_diag_cmd_write *) ar_usb->diag_cmd_buffer; in ath6kl_usb_diag_write32()
990 ret = ath6kl_usb_ctrl_msg_exchange(ar_usb, in ath6kl_usb_diag_write32()
1005 struct ath6kl_usb *ar_usb = ar->hif_priv; in ath6kl_usb_bmi_read() local
1009 ret = ath6kl_usb_submit_ctrl_in(ar_usb, in ath6kl_usb_bmi_read()
1023 struct ath6kl_usb *ar_usb = ar->hif_priv; in ath6kl_usb_bmi_write() local
1027 ret = ath6kl_usb_submit_ctrl_out(ar_usb, in ath6kl_usb_bmi_write()
1103 struct ath6kl_usb *ar_usb = NULL; in ath6kl_usb_probe() local
1125 ar_usb = ath6kl_usb_create(interface); in ath6kl_usb_probe()
1127 if (ar_usb == NULL) { in ath6kl_usb_probe()
1132 ar = ath6kl_core_create(&ar_usb->udev->dev); in ath6kl_usb_probe()
1139 ar->hif_priv = ar_usb; in ath6kl_usb_probe()
1145 ar_usb->ar = ar; in ath6kl_usb_probe()
1158 ath6kl_usb_destroy(ar_usb); in ath6kl_usb_probe()