Lines Matching refs:pl_info
107 pl_dev->pl_info->log_state = 0; in pktlog_disable_adapter_logging()
116 struct ath_pktlog_info *pl_info; in pktlog_alloc_buf() local
126 pl_info = pl_dev->pl_info; in pktlog_alloc_buf()
128 page_cnt = (sizeof(*(pl_info->buf)) + pl_info->buf_size) / PAGE_SIZE; in pktlog_alloc_buf()
130 qdf_spin_lock_bh(&pl_info->log_lock); in pktlog_alloc_buf()
131 if (pl_info->buf) { in pktlog_alloc_buf()
132 qdf_spin_unlock_bh(&pl_info->log_lock); in pktlog_alloc_buf()
136 qdf_spin_unlock_bh(&pl_info->log_lock); in pktlog_alloc_buf()
154 qdf_spin_lock_bh(&pl_info->log_lock); in pktlog_alloc_buf()
155 if (pl_info->buf) in pktlog_alloc_buf()
158 pl_info->buf = buffer; in pktlog_alloc_buf()
159 qdf_spin_unlock_bh(&pl_info->log_lock); in pktlog_alloc_buf()
169 struct ath_pktlog_info *pl_info; in pktlog_release_buf() local
178 if (!pl_dev->pl_info) { in pktlog_release_buf()
183 pl_info = pl_dev->pl_info; in pktlog_release_buf()
185 page_cnt = ((sizeof(*(pl_info->buf)) + pl_info->buf_size) / in pktlog_release_buf()
188 for (vaddr = (unsigned long)(pl_info->buf); in pktlog_release_buf()
189 vaddr < (unsigned long)(pl_info->buf) + (page_cnt * PAGE_SIZE); in pktlog_release_buf()
195 qdf_mem_vfree(pl_info->buf); in pktlog_release_buf()
196 pl_info->buf = NULL; in pktlog_release_buf()
199 static void pktlog_cleanup(struct ath_pktlog_info *pl_info) in pktlog_cleanup() argument
201 pl_info->log_state = 0; in pktlog_cleanup()
202 PKTLOG_LOCK_DESTROY(pl_info); in pktlog_cleanup()
203 mutex_destroy(&pl_info->pktlog_mutex); in pktlog_cleanup()
266 return pl_dev->pl_info->buf_size; in get_pktlog_bufsize()
326 pl_info_lnx = PL_INFO_LNX(pl_dev->pl_info); in pktlog_sysctl_register()
443 pl_dev->pl_info = &pl_info_lnx->info; in pktlog_attach()
491 kfree(pl_dev->pl_info); in pktlog_attach()
506 pl_info_lnx = (pl_dev) ? PL_INFO_LNX(pl_dev->pl_info) : in pktlog_sysctl_unregister()
517 struct ath_pktlog_info *pl_info; in pktlog_detach() local
527 pl_info = pl_dev->pl_info; in pktlog_detach()
528 if (!pl_info) { in pktlog_detach()
533 mutex_lock(&pl_info->pktlog_mutex); in pktlog_detach()
537 qdf_spin_lock_bh(&pl_info->log_lock); in pktlog_detach()
539 if (pl_info->buf) { in pktlog_detach()
543 qdf_spin_unlock_bh(&pl_info->log_lock); in pktlog_detach()
544 mutex_unlock(&pl_info->pktlog_mutex); in pktlog_detach()
545 pktlog_cleanup(pl_info); in pktlog_detach()
548 kfree(pl_info); in pktlog_detach()
549 pl_dev->pl_info = NULL; in pktlog_detach()
557 struct ath_pktlog_info *pl_info; in __pktlog_open() local
577 pl_info = pl_dev->pl_info; in __pktlog_open()
579 if (!pl_info) { in __pktlog_open()
584 mutex_lock(&pl_info->pktlog_mutex); in __pktlog_open()
585 pl_info_lnx = (pl_dev) ? PL_INFO_LNX(pl_dev->pl_info) : in __pktlog_open()
589 mutex_unlock(&pl_info->pktlog_mutex); in __pktlog_open()
595 if (pl_info->curr_pkt_state != PKTLOG_OPR_NOT_IN_PROGRESS) { in __pktlog_open()
596 mutex_unlock(&pl_info->pktlog_mutex); in __pktlog_open()
598 pl_info->curr_pkt_state); in __pktlog_open()
602 pl_info->curr_pkt_state = PKTLOG_OPR_IN_PROGRESS_READ_START; in __pktlog_open()
604 pl_info->init_saved_state = pl_info->log_state; in __pktlog_open()
605 if (!pl_info->log_state) { in __pktlog_open()
609 pl_info->curr_pkt_state = in __pktlog_open()
611 mutex_unlock(&pl_info->pktlog_mutex); in __pktlog_open()
616 pl_info->log_state = 0; in __pktlog_open()
617 pl_info->curr_pkt_state = in __pktlog_open()
619 mutex_unlock(&pl_info->pktlog_mutex); in __pktlog_open()
643 struct ath_pktlog_info *pl_info; in __pktlog_release() local
663 pl_info = pl_dev->pl_info; in __pktlog_release()
665 if (!pl_info) { in __pktlog_release()
671 mutex_lock(&pl_info->pktlog_mutex); in __pktlog_release()
672 pl_info_lnx = (pl_dev) ? PL_INFO_LNX(pl_dev->pl_info) : in __pktlog_release()
676 pl_info->curr_pkt_state = PKTLOG_OPR_NOT_IN_PROGRESS; in __pktlog_release()
677 mutex_unlock(&pl_info->pktlog_mutex); in __pktlog_release()
682 pl_info->curr_pkt_state = PKTLOG_OPR_IN_PROGRESS_READ_COMPLETE; in __pktlog_release()
685 pl_info->log_state = pl_info->init_saved_state; in __pktlog_release()
686 pl_info->init_saved_state = 0; in __pktlog_release()
690 (struct hif_opaque_softc *)scn, pl_info->log_state, in __pktlog_release()
693 pl_info->curr_pkt_state = PKTLOG_OPR_NOT_IN_PROGRESS; in __pktlog_release()
694 mutex_unlock(&pl_info->pktlog_mutex); in __pktlog_release()
739 struct ath_pktlog_info *pl_info, bool *read_complete) in pktlog_read_proc_entry() argument
748 qdf_spin_lock_bh(&pl_info->log_lock); in pktlog_read_proc_entry()
749 log_buf = pl_info->buf; in pktlog_read_proc_entry()
755 qdf_spin_unlock_bh(&pl_info->log_lock); in pktlog_read_proc_entry()
759 if (*ppos == 0 && pl_info->log_state) { in pktlog_read_proc_entry()
760 pl_info->saved_state = pl_info->log_state; in pktlog_read_proc_entry()
761 pl_info->log_state = 0; in pktlog_read_proc_entry()
798 && ((pl_info->buf_size - log_data_offset) in pktlog_read_proc_entry()
802 PKTLOG_MOV_RD_IDX(cur_rd_offset, log_buf, pl_info->buf_size); in pktlog_read_proc_entry()
851 if ((ret_val < nbytes) && pl_info->saved_state) { in pktlog_read_proc_entry()
852 pl_info->log_state = pl_info->saved_state; in pktlog_read_proc_entry()
853 pl_info->saved_state = 0; in pktlog_read_proc_entry()
865 pl_info->buf->rd_offset = -1; in pktlog_read_proc_entry()
866 pl_info->buf->wr_offset = 0; in pktlog_read_proc_entry()
867 pl_info->buf->bytes_written = 0; in pktlog_read_proc_entry()
868 pl_info->buf->offset = PKTLOG_READ_OFFSET; in pktlog_read_proc_entry()
872 qdf_spin_unlock_bh(&pl_info->log_lock); in pktlog_read_proc_entry()
884 struct ath_pktlog_info *pl_info; in __pktlog_read() local
887 pl_info = pde_data(file->f_path.dentry->d_inode); in __pktlog_read()
888 if (!pl_info) in __pktlog_read()
891 qdf_spin_lock_bh(&pl_info->log_lock); in __pktlog_read()
892 log_buf = pl_info->buf; in __pktlog_read()
895 qdf_spin_unlock_bh(&pl_info->log_lock); in __pktlog_read()
899 if (pl_info->log_state) { in __pktlog_read()
904 qdf_spin_unlock_bh(&pl_info->log_lock); in __pktlog_read()
908 if (*ppos == 0 && pl_info->log_state) { in __pktlog_read()
909 pl_info->saved_state = pl_info->log_state; in __pktlog_read()
910 pl_info->log_state = 0; in __pktlog_read()
922 qdf_spin_unlock_bh(&pl_info->log_lock); in __pktlog_read()
929 qdf_spin_lock_bh(&pl_info->log_lock); in __pktlog_read()
951 && ((pl_info->buf_size - log_data_offset) in __pktlog_read()
955 PKTLOG_MOV_RD_IDX(cur_rd_offset, log_buf, pl_info->buf_size); in __pktlog_read()
971 qdf_spin_unlock_bh(&pl_info->log_lock); in __pktlog_read()
980 qdf_spin_lock_bh(&pl_info->log_lock); in __pktlog_read()
984 qdf_spin_unlock_bh(&pl_info->log_lock); in __pktlog_read()
992 qdf_spin_lock_bh(&pl_info->log_lock); in __pktlog_read()
1004 qdf_spin_unlock_bh(&pl_info->log_lock); in __pktlog_read()
1012 qdf_spin_lock_bh(&pl_info->log_lock); in __pktlog_read()
1017 if ((ret_val < nbytes) && pl_info->saved_state) { in __pktlog_read()
1018 pl_info->log_state = pl_info->saved_state; in __pktlog_read()
1019 pl_info->saved_state = 0; in __pktlog_read()
1023 qdf_spin_unlock_bh(&pl_info->log_lock); in __pktlog_read()