Lines Matching refs:card

55 	struct pcie_service_card *card = adapter->card;  in mwifiex_map_pci_memory()  local
58 mapping.addr = pci_map_single(card->dev, skb->data, size, flags); in mwifiex_map_pci_memory()
59 if (pci_dma_mapping_error(card->dev, mapping.addr)) { in mwifiex_map_pci_memory()
71 struct pcie_service_card *card = adapter->card; in mwifiex_unmap_pci_memory() local
75 pci_unmap_single(card->dev, mapping.addr, mapping.len, flags); in mwifiex_unmap_pci_memory()
84 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_ok_to_access_hw() local
85 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_ok_to_access_hw()
90 if (card->sleep_cookie_vbase) { in mwifiex_pcie_ok_to_access_hw()
91 cookie_addr = (u32 *)card->sleep_cookie_vbase; in mwifiex_pcie_ok_to_access_hw()
113 struct pcie_service_card *card; in mwifiex_pcie_suspend() local
118 card = pci_get_drvdata(pdev); in mwifiex_pcie_suspend()
119 if (!card || !card->adapter) { in mwifiex_pcie_suspend()
128 adapter = card->adapter; in mwifiex_pcie_suspend()
150 struct pcie_service_card *card; in mwifiex_pcie_resume() local
154 card = pci_get_drvdata(pdev); in mwifiex_pcie_resume()
155 if (!card || !card->adapter) { in mwifiex_pcie_resume()
164 adapter = card->adapter; in mwifiex_pcie_resume()
189 struct pcie_service_card *card; in mwifiex_pcie_probe() local
194 card = kzalloc(sizeof(struct pcie_service_card), GFP_KERNEL); in mwifiex_pcie_probe()
195 if (!card) in mwifiex_pcie_probe()
198 card->dev = pdev; in mwifiex_pcie_probe()
202 card->pcie.firmware = data->firmware; in mwifiex_pcie_probe()
203 card->pcie.reg = data->reg; in mwifiex_pcie_probe()
204 card->pcie.blksz_fw_dl = data->blksz_fw_dl; in mwifiex_pcie_probe()
205 card->pcie.tx_buf_size = data->tx_buf_size; in mwifiex_pcie_probe()
206 card->pcie.can_dump_fw = data->can_dump_fw; in mwifiex_pcie_probe()
207 card->pcie.can_ext_scan = data->can_ext_scan; in mwifiex_pcie_probe()
210 if (mwifiex_add_card(card, &add_remove_card_sem, &pcie_ops, in mwifiex_pcie_probe()
213 kfree(card); in mwifiex_pcie_probe()
225 struct pcie_service_card *card; in mwifiex_pcie_remove() local
229 card = pci_get_drvdata(pdev); in mwifiex_pcie_remove()
230 if (!card) in mwifiex_pcie_remove()
233 adapter = card->adapter; in mwifiex_pcie_remove()
252 mwifiex_remove_card(card->adapter, &add_remove_card_sem); in mwifiex_pcie_remove()
304 struct pcie_service_card *card = adapter->card; in mwifiex_write_reg() local
306 iowrite32(data, card->pci_mmap1 + reg); in mwifiex_write_reg()
316 struct pcie_service_card *card = adapter->card; in mwifiex_read_reg() local
318 *data = ioread32(card->pci_mmap1 + reg); in mwifiex_read_reg()
327 struct pcie_service_card *card = adapter->card; in mwifiex_read_reg_byte() local
329 *data = ioread8(card->pci_mmap1 + reg); in mwifiex_read_reg_byte()
355 struct pcie_service_card *card = adapter->card; in mwifiex_delay_for_sleep_cookie() local
360 buffer = card->cmdrsp_buf->data - INTF_HEADER_LEN; in mwifiex_delay_for_sleep_cookie()
380 struct pcie_service_card *card = adapter->card; in mwifiex_pm_wakeup_card() local
381 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pm_wakeup_card()
459 struct pcie_service_card *card = adapter->card; in mwifiex_init_txq_ring() local
460 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_init_txq_ring()
466 card->tx_buf_list[i] = NULL; in mwifiex_init_txq_ring()
468 card->txbd_ring[i] = (void *)card->txbd_ring_vbase + in mwifiex_init_txq_ring()
470 desc2 = card->txbd_ring[i]; in mwifiex_init_txq_ring()
473 card->txbd_ring[i] = (void *)card->txbd_ring_vbase + in mwifiex_init_txq_ring()
475 desc = card->txbd_ring[i]; in mwifiex_init_txq_ring()
489 struct pcie_service_card *card = adapter->card; in mwifiex_init_rxq_ring() local
490 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_init_rxq_ring()
504 kfree(card->rxbd_ring_vbase); in mwifiex_init_rxq_ring()
520 card->rx_buf_list[i] = skb; in mwifiex_init_rxq_ring()
522 card->rxbd_ring[i] = (void *)card->rxbd_ring_vbase + in mwifiex_init_rxq_ring()
524 desc2 = card->rxbd_ring[i]; in mwifiex_init_rxq_ring()
531 card->rxbd_ring[i] = (void *)(card->rxbd_ring_vbase + in mwifiex_init_rxq_ring()
533 desc = card->rxbd_ring[i]; in mwifiex_init_rxq_ring()
549 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_init_evt_ring() local
561 kfree(card->evtbd_ring_vbase); in mwifiex_pcie_init_evt_ring()
577 card->evt_buf_list[i] = skb; in mwifiex_pcie_init_evt_ring()
578 card->evtbd_ring[i] = (void *)(card->evtbd_ring_vbase + in mwifiex_pcie_init_evt_ring()
580 desc = card->evtbd_ring[i]; in mwifiex_pcie_init_evt_ring()
594 struct pcie_service_card *card = adapter->card; in mwifiex_cleanup_txq_ring() local
595 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_cleanup_txq_ring()
603 desc2 = card->txbd_ring[i]; in mwifiex_cleanup_txq_ring()
604 if (card->tx_buf_list[i]) { in mwifiex_cleanup_txq_ring()
605 skb = card->tx_buf_list[i]; in mwifiex_cleanup_txq_ring()
612 desc = card->txbd_ring[i]; in mwifiex_cleanup_txq_ring()
613 if (card->tx_buf_list[i]) { in mwifiex_cleanup_txq_ring()
614 skb = card->tx_buf_list[i]; in mwifiex_cleanup_txq_ring()
621 card->tx_buf_list[i] = NULL; in mwifiex_cleanup_txq_ring()
632 struct pcie_service_card *card = adapter->card; in mwifiex_cleanup_rxq_ring() local
633 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_cleanup_rxq_ring()
641 desc2 = card->rxbd_ring[i]; in mwifiex_cleanup_rxq_ring()
642 if (card->rx_buf_list[i]) { in mwifiex_cleanup_rxq_ring()
643 skb = card->rx_buf_list[i]; in mwifiex_cleanup_rxq_ring()
650 desc = card->rxbd_ring[i]; in mwifiex_cleanup_rxq_ring()
651 if (card->rx_buf_list[i]) { in mwifiex_cleanup_rxq_ring()
652 skb = card->rx_buf_list[i]; in mwifiex_cleanup_rxq_ring()
659 card->rx_buf_list[i] = NULL; in mwifiex_cleanup_rxq_ring()
670 struct pcie_service_card *card = adapter->card; in mwifiex_cleanup_evt_ring() local
676 desc = card->evtbd_ring[i]; in mwifiex_cleanup_evt_ring()
677 if (card->evt_buf_list[i]) { in mwifiex_cleanup_evt_ring()
678 skb = card->evt_buf_list[i]; in mwifiex_cleanup_evt_ring()
683 card->evt_buf_list[i] = NULL; in mwifiex_cleanup_evt_ring()
694 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_create_txbd_ring() local
695 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_create_txbd_ring()
702 card->txbd_wrptr = 0; in mwifiex_pcie_create_txbd_ring()
705 card->txbd_rdptr = 0; in mwifiex_pcie_create_txbd_ring()
707 card->txbd_rdptr |= reg->tx_rollover_ind; in mwifiex_pcie_create_txbd_ring()
712 card->txbd_ring_size = sizeof(struct mwifiex_pfu_buf_desc) * in mwifiex_pcie_create_txbd_ring()
715 card->txbd_ring_size = sizeof(struct mwifiex_pcie_buf_desc) * in mwifiex_pcie_create_txbd_ring()
719 card->txbd_ring_size); in mwifiex_pcie_create_txbd_ring()
720 card->txbd_ring_vbase = pci_alloc_consistent(card->dev, in mwifiex_pcie_create_txbd_ring()
721 card->txbd_ring_size, in mwifiex_pcie_create_txbd_ring()
722 &card->txbd_ring_pbase); in mwifiex_pcie_create_txbd_ring()
723 if (!card->txbd_ring_vbase) { in mwifiex_pcie_create_txbd_ring()
726 card->txbd_ring_size); in mwifiex_pcie_create_txbd_ring()
731 card->txbd_ring_vbase, (unsigned int)card->txbd_ring_pbase, in mwifiex_pcie_create_txbd_ring()
732 (u32)((u64)card->txbd_ring_pbase >> 32), card->txbd_ring_size); in mwifiex_pcie_create_txbd_ring()
739 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_delete_txbd_ring() local
740 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_delete_txbd_ring()
744 if (card->txbd_ring_vbase) in mwifiex_pcie_delete_txbd_ring()
745 pci_free_consistent(card->dev, card->txbd_ring_size, in mwifiex_pcie_delete_txbd_ring()
746 card->txbd_ring_vbase, in mwifiex_pcie_delete_txbd_ring()
747 card->txbd_ring_pbase); in mwifiex_pcie_delete_txbd_ring()
748 card->txbd_ring_size = 0; in mwifiex_pcie_delete_txbd_ring()
749 card->txbd_wrptr = 0; in mwifiex_pcie_delete_txbd_ring()
750 card->txbd_rdptr = 0 | reg->tx_rollover_ind; in mwifiex_pcie_delete_txbd_ring()
751 card->txbd_ring_vbase = NULL; in mwifiex_pcie_delete_txbd_ring()
752 card->txbd_ring_pbase = 0; in mwifiex_pcie_delete_txbd_ring()
762 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_create_rxbd_ring() local
763 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_create_rxbd_ring()
770 card->rxbd_wrptr = 0; in mwifiex_pcie_create_rxbd_ring()
771 card->rxbd_rdptr = reg->rx_rollover_ind; in mwifiex_pcie_create_rxbd_ring()
774 card->rxbd_ring_size = sizeof(struct mwifiex_pfu_buf_desc) * in mwifiex_pcie_create_rxbd_ring()
777 card->rxbd_ring_size = sizeof(struct mwifiex_pcie_buf_desc) * in mwifiex_pcie_create_rxbd_ring()
781 card->rxbd_ring_size); in mwifiex_pcie_create_rxbd_ring()
782 card->rxbd_ring_vbase = pci_alloc_consistent(card->dev, in mwifiex_pcie_create_rxbd_ring()
783 card->rxbd_ring_size, in mwifiex_pcie_create_rxbd_ring()
784 &card->rxbd_ring_pbase); in mwifiex_pcie_create_rxbd_ring()
785 if (!card->rxbd_ring_vbase) { in mwifiex_pcie_create_rxbd_ring()
788 card->rxbd_ring_size); in mwifiex_pcie_create_rxbd_ring()
794 card->rxbd_ring_vbase, (u32)card->rxbd_ring_pbase, in mwifiex_pcie_create_rxbd_ring()
795 (u32)((u64)card->rxbd_ring_pbase >> 32), in mwifiex_pcie_create_rxbd_ring()
796 card->rxbd_ring_size); in mwifiex_pcie_create_rxbd_ring()
806 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_delete_rxbd_ring() local
807 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_delete_rxbd_ring()
811 if (card->rxbd_ring_vbase) in mwifiex_pcie_delete_rxbd_ring()
812 pci_free_consistent(card->dev, card->rxbd_ring_size, in mwifiex_pcie_delete_rxbd_ring()
813 card->rxbd_ring_vbase, in mwifiex_pcie_delete_rxbd_ring()
814 card->rxbd_ring_pbase); in mwifiex_pcie_delete_rxbd_ring()
815 card->rxbd_ring_size = 0; in mwifiex_pcie_delete_rxbd_ring()
816 card->rxbd_wrptr = 0; in mwifiex_pcie_delete_rxbd_ring()
817 card->rxbd_rdptr = 0 | reg->rx_rollover_ind; in mwifiex_pcie_delete_rxbd_ring()
818 card->rxbd_ring_vbase = NULL; in mwifiex_pcie_delete_rxbd_ring()
819 card->rxbd_ring_pbase = 0; in mwifiex_pcie_delete_rxbd_ring()
829 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_create_evtbd_ring() local
830 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_create_evtbd_ring()
837 card->evtbd_wrptr = 0; in mwifiex_pcie_create_evtbd_ring()
838 card->evtbd_rdptr = reg->evt_rollover_ind; in mwifiex_pcie_create_evtbd_ring()
840 card->evtbd_ring_size = sizeof(struct mwifiex_evt_buf_desc) * in mwifiex_pcie_create_evtbd_ring()
844 card->evtbd_ring_size); in mwifiex_pcie_create_evtbd_ring()
845 card->evtbd_ring_vbase = pci_alloc_consistent(card->dev, in mwifiex_pcie_create_evtbd_ring()
846 card->evtbd_ring_size, in mwifiex_pcie_create_evtbd_ring()
847 &card->evtbd_ring_pbase); in mwifiex_pcie_create_evtbd_ring()
848 if (!card->evtbd_ring_vbase) { in mwifiex_pcie_create_evtbd_ring()
851 card->evtbd_ring_size); in mwifiex_pcie_create_evtbd_ring()
857 card->evtbd_ring_vbase, (u32)card->evtbd_ring_pbase, in mwifiex_pcie_create_evtbd_ring()
858 (u32)((u64)card->evtbd_ring_pbase >> 32), in mwifiex_pcie_create_evtbd_ring()
859 card->evtbd_ring_size); in mwifiex_pcie_create_evtbd_ring()
869 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_delete_evtbd_ring() local
870 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_delete_evtbd_ring()
874 if (card->evtbd_ring_vbase) in mwifiex_pcie_delete_evtbd_ring()
875 pci_free_consistent(card->dev, card->evtbd_ring_size, in mwifiex_pcie_delete_evtbd_ring()
876 card->evtbd_ring_vbase, in mwifiex_pcie_delete_evtbd_ring()
877 card->evtbd_ring_pbase); in mwifiex_pcie_delete_evtbd_ring()
878 card->evtbd_wrptr = 0; in mwifiex_pcie_delete_evtbd_ring()
879 card->evtbd_rdptr = 0 | reg->evt_rollover_ind; in mwifiex_pcie_delete_evtbd_ring()
880 card->evtbd_ring_size = 0; in mwifiex_pcie_delete_evtbd_ring()
881 card->evtbd_ring_vbase = NULL; in mwifiex_pcie_delete_evtbd_ring()
882 card->evtbd_ring_pbase = 0; in mwifiex_pcie_delete_evtbd_ring()
892 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_alloc_cmdrsp_buf() local
907 card->cmdrsp_buf = skb; in mwifiex_pcie_alloc_cmdrsp_buf()
917 struct pcie_service_card *card; in mwifiex_pcie_delete_cmdrsp_buf() local
922 card = adapter->card; in mwifiex_pcie_delete_cmdrsp_buf()
924 if (card && card->cmdrsp_buf) { in mwifiex_pcie_delete_cmdrsp_buf()
925 mwifiex_unmap_pci_memory(adapter, card->cmdrsp_buf, in mwifiex_pcie_delete_cmdrsp_buf()
927 dev_kfree_skb_any(card->cmdrsp_buf); in mwifiex_pcie_delete_cmdrsp_buf()
930 if (card && card->cmd_buf) { in mwifiex_pcie_delete_cmdrsp_buf()
931 mwifiex_unmap_pci_memory(adapter, card->cmd_buf, in mwifiex_pcie_delete_cmdrsp_buf()
942 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_alloc_sleep_cookie_buf() local
944 card->sleep_cookie_vbase = pci_alloc_consistent(card->dev, sizeof(u32), in mwifiex_pcie_alloc_sleep_cookie_buf()
945 &card->sleep_cookie_pbase); in mwifiex_pcie_alloc_sleep_cookie_buf()
946 if (!card->sleep_cookie_vbase) { in mwifiex_pcie_alloc_sleep_cookie_buf()
951 *(u32 *)card->sleep_cookie_vbase = FW_AWAKE_COOKIE; in mwifiex_pcie_alloc_sleep_cookie_buf()
954 *((u32 *)card->sleep_cookie_vbase)); in mwifiex_pcie_alloc_sleep_cookie_buf()
964 struct pcie_service_card *card; in mwifiex_pcie_delete_sleep_cookie_buf() local
969 card = adapter->card; in mwifiex_pcie_delete_sleep_cookie_buf()
971 if (card && card->sleep_cookie_vbase) { in mwifiex_pcie_delete_sleep_cookie_buf()
972 pci_free_consistent(card->dev, sizeof(u32), in mwifiex_pcie_delete_sleep_cookie_buf()
973 card->sleep_cookie_vbase, in mwifiex_pcie_delete_sleep_cookie_buf()
974 card->sleep_cookie_pbase); in mwifiex_pcie_delete_sleep_cookie_buf()
975 card->sleep_cookie_vbase = NULL; in mwifiex_pcie_delete_sleep_cookie_buf()
987 struct pcie_service_card *card = adapter->card; in mwifiex_clean_pcie_ring_buf() local
989 if (!mwifiex_pcie_txbd_empty(card, card->txbd_rdptr)) { in mwifiex_clean_pcie_ring_buf()
990 card->txbd_flush = 1; in mwifiex_clean_pcie_ring_buf()
1013 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_send_data_complete() local
1014 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_send_data_complete()
1027 card->txbd_rdptr, rdptr); in mwifiex_pcie_send_data_complete()
1031 while (((card->txbd_rdptr & reg->tx_mask) != in mwifiex_pcie_send_data_complete()
1033 ((card->txbd_rdptr & reg->tx_rollover_ind) != in mwifiex_pcie_send_data_complete()
1035 wrdoneidx = (card->txbd_rdptr & reg->tx_mask) >> in mwifiex_pcie_send_data_complete()
1038 skb = card->tx_buf_list[wrdoneidx]; in mwifiex_pcie_send_data_complete()
1049 if (card->txbd_flush) in mwifiex_pcie_send_data_complete()
1056 card->tx_buf_list[wrdoneidx] = NULL; in mwifiex_pcie_send_data_complete()
1059 desc2 = card->txbd_ring[wrdoneidx]; in mwifiex_pcie_send_data_complete()
1062 desc = card->txbd_ring[wrdoneidx]; in mwifiex_pcie_send_data_complete()
1065 switch (card->dev->device) { in mwifiex_pcie_send_data_complete()
1067 card->txbd_rdptr++; in mwifiex_pcie_send_data_complete()
1070 card->txbd_rdptr += reg->ring_tx_start_ptr; in mwifiex_pcie_send_data_complete()
1075 if ((card->txbd_rdptr & reg->tx_mask) == num_tx_buffs) in mwifiex_pcie_send_data_complete()
1076 card->txbd_rdptr = ((card->txbd_rdptr & in mwifiex_pcie_send_data_complete()
1084 if (card->txbd_flush) { in mwifiex_pcie_send_data_complete()
1085 if (mwifiex_pcie_txbd_empty(card, card->txbd_rdptr)) in mwifiex_pcie_send_data_complete()
1086 card->txbd_flush = 0; in mwifiex_pcie_send_data_complete()
1105 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_send_data() local
1106 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_send_data()
1125 card->txbd_rdptr, card->txbd_wrptr); in mwifiex_pcie_send_data()
1126 if (mwifiex_pcie_txbd_not_full(card)) { in mwifiex_pcie_send_data()
1140 wrindx = (card->txbd_wrptr & reg->tx_mask) >> reg->tx_start_ptr; in mwifiex_pcie_send_data()
1142 card->tx_buf_list[wrindx] = skb; in mwifiex_pcie_send_data()
1145 desc2 = card->txbd_ring[wrindx]; in mwifiex_pcie_send_data()
1153 desc = card->txbd_ring[wrindx]; in mwifiex_pcie_send_data()
1160 switch (card->dev->device) { in mwifiex_pcie_send_data()
1162 card->txbd_wrptr++; in mwifiex_pcie_send_data()
1165 card->txbd_wrptr += reg->ring_tx_start_ptr; in mwifiex_pcie_send_data()
1169 if ((card->txbd_wrptr & reg->tx_mask) == num_tx_buffs) in mwifiex_pcie_send_data()
1170 card->txbd_wrptr = ((card->txbd_wrptr & in mwifiex_pcie_send_data()
1174 rx_val = card->rxbd_rdptr & reg->rx_wrap_mask; in mwifiex_pcie_send_data()
1177 card->txbd_wrptr | rx_val)) { in mwifiex_pcie_send_data()
1183 if ((mwifiex_pcie_txbd_not_full(card)) && in mwifiex_pcie_send_data()
1201 card->txbd_rdptr, card->txbd_wrptr); in mwifiex_pcie_send_data()
1217 card->tx_buf_list[wrindx] = NULL; in mwifiex_pcie_send_data()
1232 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_process_recv_data() local
1233 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_process_recv_data()
1251 card->rxbd_wrptr = wrptr; in mwifiex_pcie_process_recv_data()
1254 (card->rxbd_rdptr & reg->rx_mask)) || in mwifiex_pcie_process_recv_data()
1256 (card->rxbd_rdptr & reg->rx_rollover_ind))) { in mwifiex_pcie_process_recv_data()
1261 rd_index = card->rxbd_rdptr & reg->rx_mask; in mwifiex_pcie_process_recv_data()
1262 skb_data = card->rx_buf_list[rd_index]; in mwifiex_pcie_process_recv_data()
1271 card->rx_buf_list[rd_index] = NULL; in mwifiex_pcie_process_recv_data()
1282 rx_len, card->rxbd_rdptr, wrptr); in mwifiex_pcie_process_recv_data()
1288 card->rxbd_rdptr, wrptr, rx_len); in mwifiex_pcie_process_recv_data()
1317 card->rx_buf_list[rd_index] = skb_tmp; in mwifiex_pcie_process_recv_data()
1320 desc2 = card->rxbd_ring[rd_index]; in mwifiex_pcie_process_recv_data()
1327 desc = card->rxbd_ring[rd_index]; in mwifiex_pcie_process_recv_data()
1333 if ((++card->rxbd_rdptr & reg->rx_mask) == in mwifiex_pcie_process_recv_data()
1335 card->rxbd_rdptr = ((card->rxbd_rdptr & in mwifiex_pcie_process_recv_data()
1340 card->rxbd_rdptr, wrptr); in mwifiex_pcie_process_recv_data()
1342 tx_val = card->txbd_wrptr & reg->tx_wrap_mask; in mwifiex_pcie_process_recv_data()
1345 card->rxbd_rdptr | tx_val)) { in mwifiex_pcie_process_recv_data()
1361 card->rxbd_wrptr = wrptr; in mwifiex_pcie_process_recv_data()
1375 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_send_boot_cmd() local
1376 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_send_boot_cmd()
1439 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_init_fw_port() local
1440 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_init_fw_port()
1441 int tx_wrap = card->txbd_wrptr & reg->tx_wrap_mask; in mwifiex_pcie_init_fw_port()
1444 if (mwifiex_write_reg(adapter, reg->rx_rdptr, card->rxbd_rdptr | in mwifiex_pcie_init_fw_port()
1458 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_send_cmd() local
1459 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_send_cmd()
1471 if (!card->cmdrsp_buf) { in mwifiex_pcie_send_cmd()
1488 card->cmd_buf = skb; in mwifiex_pcie_send_cmd()
1500 if (card->cmdrsp_buf) { in mwifiex_pcie_send_cmd()
1501 cmdrsp_buf_pa = MWIFIEX_SKB_DMA_ADDR(card->cmdrsp_buf); in mwifiex_pcie_send_cmd()
1522 cmd_buf_pa = MWIFIEX_SKB_DMA_ADDR(card->cmd_buf); in mwifiex_pcie_send_cmd()
1542 card->cmd_buf->len)) { in mwifiex_pcie_send_cmd()
1570 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_process_cmd_complete() local
1571 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_process_cmd_complete()
1572 struct sk_buff *skb = card->cmdrsp_buf; in mwifiex_pcie_process_cmd_complete()
1582 if (card->cmd_buf) { in mwifiex_pcie_process_cmd_complete()
1583 mwifiex_unmap_pci_memory(adapter, card->cmd_buf, in mwifiex_pcie_process_cmd_complete()
1585 card->cmd_buf = NULL; in mwifiex_pcie_process_cmd_complete()
1625 card->cmdrsp_buf = NULL; in mwifiex_pcie_process_cmd_complete()
1653 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_cmdrsp_complete() local
1656 card->cmdrsp_buf = skb; in mwifiex_pcie_cmdrsp_complete()
1657 skb_push(card->cmdrsp_buf, INTF_HEADER_LEN); in mwifiex_pcie_cmdrsp_complete()
1671 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_process_event_ready() local
1672 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_process_event_ready()
1673 u32 rdptr = card->evtbd_rdptr & MWIFIEX_EVTBD_MASK; in mwifiex_pcie_process_event_ready()
1699 card->evtbd_rdptr, wrptr); in mwifiex_pcie_process_event_ready()
1700 if (((wrptr & MWIFIEX_EVTBD_MASK) != (card->evtbd_rdptr in mwifiex_pcie_process_event_ready()
1703 (card->evtbd_rdptr & reg->evt_rollover_ind))) { in mwifiex_pcie_process_event_ready()
1709 skb_cmd = card->evt_buf_list[rdptr]; in mwifiex_pcie_process_event_ready()
1714 card->evt_buf_list[rdptr] = NULL; in mwifiex_pcie_process_event_ready()
1715 desc = card->evtbd_ring[rdptr]; in mwifiex_pcie_process_event_ready()
1758 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_event_complete() local
1759 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_event_complete()
1761 u32 rdptr = card->evtbd_rdptr & MWIFIEX_EVTBD_MASK; in mwifiex_pcie_event_complete()
1781 if (!card->evt_buf_list[rdptr]) { in mwifiex_pcie_event_complete()
1787 card->evt_buf_list[rdptr] = skb; in mwifiex_pcie_event_complete()
1788 desc = card->evtbd_ring[rdptr]; in mwifiex_pcie_event_complete()
1796 rdptr, card->evt_buf_list[rdptr], skb); in mwifiex_pcie_event_complete()
1799 if ((++card->evtbd_rdptr & MWIFIEX_EVTBD_MASK) == MWIFIEX_MAX_EVT_BD) { in mwifiex_pcie_event_complete()
1800 card->evtbd_rdptr = ((card->evtbd_rdptr & in mwifiex_pcie_event_complete()
1806 card->evtbd_rdptr, wrptr); in mwifiex_pcie_event_complete()
1810 card->evtbd_rdptr)) { in mwifiex_pcie_event_complete()
1839 struct pcie_service_card *card = adapter->card; in mwifiex_prog_fw_w_helper() local
1840 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_prog_fw_w_helper()
1918 tx_blocks = (txlen + card->pcie.blksz_fw_dl - 1) / in mwifiex_prog_fw_w_helper()
1919 card->pcie.blksz_fw_dl; in mwifiex_prog_fw_w_helper()
1926 skb_trim(skb, tx_blocks * card->pcie.blksz_fw_dl); in mwifiex_prog_fw_w_helper()
1976 struct pcie_service_card *card = adapter->card; in mwifiex_check_fw_status() local
1977 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_check_fw_status()
2082 struct pcie_service_card *card; in mwifiex_pcie_interrupt() local
2090 card = pci_get_drvdata(pdev); in mwifiex_pcie_interrupt()
2091 if (!card || !card->adapter) { in mwifiex_pcie_interrupt()
2092 pr_debug("info: %s: card=%p adapter=%p\n", __func__, card, in mwifiex_pcie_interrupt()
2093 card ? card->adapter : NULL); in mwifiex_pcie_interrupt()
2096 adapter = card->adapter; in mwifiex_pcie_interrupt()
2230 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_rdwr_firmware() local
2231 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_rdwr_firmware()
2265 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_fw_dump_work() local
2266 const struct mwifiex_pcie_card_reg *creg = card->pcie.reg; in mwifiex_pcie_fw_dump_work()
2274 if (!card->pcie.can_dump_fw) in mwifiex_pcie_fw_dump_work()
2408 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_init() local
2410 struct pci_dev *pdev = card->dev; in mwifiex_pcie_init()
2411 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_init()
2413 pci_set_drvdata(pdev, card); in mwifiex_pcie_init()
2439 card->pci_mmap = pci_iomap(pdev, 0, 0); in mwifiex_pcie_init()
2440 if (!card->pci_mmap) { in mwifiex_pcie_init()
2450 card->pci_mmap1 = pci_iomap(pdev, 2, 0); in mwifiex_pcie_init()
2451 if (!card->pci_mmap1) { in mwifiex_pcie_init()
2459 card->pci_mmap, card->pci_mmap1); in mwifiex_pcie_init()
2461 card->cmdrsp_buf = NULL; in mwifiex_pcie_init()
2479 card->sleep_cookie_vbase = NULL; in mwifiex_pcie_init()
2492 pci_iounmap(pdev, card->pci_mmap1); in mwifiex_pcie_init()
2496 pci_iounmap(pdev, card->pci_mmap); in mwifiex_pcie_init()
2519 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_cleanup() local
2520 struct pci_dev *pdev = card->dev; in mwifiex_pcie_cleanup()
2521 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_cleanup()
2531 pci_iounmap(pdev, card->pci_mmap); in mwifiex_pcie_cleanup()
2532 pci_iounmap(pdev, card->pci_mmap1); in mwifiex_pcie_cleanup()
2538 kfree(card); in mwifiex_pcie_cleanup()
2549 struct pcie_service_card *card = adapter->card; in mwifiex_register_dev() local
2550 struct pci_dev *pdev = card->dev; in mwifiex_register_dev()
2553 card->adapter = adapter; in mwifiex_register_dev()
2559 adapter->card = NULL; in mwifiex_register_dev()
2564 adapter->tx_buf_size = card->pcie.tx_buf_size; in mwifiex_register_dev()
2567 strcpy(adapter->fw_name, card->pcie.firmware); in mwifiex_register_dev()
2568 adapter->ext_scan = card->pcie.can_ext_scan; in mwifiex_register_dev()
2581 struct pcie_service_card *card = adapter->card; in mwifiex_unregister_dev() local
2584 if (card) { in mwifiex_unregister_dev()
2586 free_irq(card->dev->irq, card->dev); in mwifiex_unregister_dev()
2588 reg = card->pcie.reg; in mwifiex_unregister_dev()
2596 card->cmdrsp_buf = NULL; in mwifiex_unregister_dev()