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()
114 struct pcie_service_card *card; in mwifiex_pcie_suspend() local
119 card = pci_get_drvdata(pdev); in mwifiex_pcie_suspend()
120 if (!card || !card->adapter) { in mwifiex_pcie_suspend()
129 adapter = card->adapter; in mwifiex_pcie_suspend()
151 struct pcie_service_card *card; in mwifiex_pcie_resume() local
155 card = pci_get_drvdata(pdev); in mwifiex_pcie_resume()
156 if (!card || !card->adapter) { in mwifiex_pcie_resume()
165 adapter = card->adapter; in mwifiex_pcie_resume()
191 struct pcie_service_card *card; in mwifiex_pcie_probe() local
196 card = kzalloc(sizeof(struct pcie_service_card), GFP_KERNEL); in mwifiex_pcie_probe()
197 if (!card) in mwifiex_pcie_probe()
200 card->dev = pdev; in mwifiex_pcie_probe()
204 card->pcie.firmware = data->firmware; in mwifiex_pcie_probe()
205 card->pcie.reg = data->reg; in mwifiex_pcie_probe()
206 card->pcie.blksz_fw_dl = data->blksz_fw_dl; in mwifiex_pcie_probe()
207 card->pcie.tx_buf_size = data->tx_buf_size; in mwifiex_pcie_probe()
208 card->pcie.can_dump_fw = data->can_dump_fw; in mwifiex_pcie_probe()
209 card->pcie.can_ext_scan = data->can_ext_scan; in mwifiex_pcie_probe()
212 if (mwifiex_add_card(card, &add_remove_card_sem, &pcie_ops, in mwifiex_pcie_probe()
215 kfree(card); in mwifiex_pcie_probe()
227 struct pcie_service_card *card; in mwifiex_pcie_remove() local
231 card = pci_get_drvdata(pdev); in mwifiex_pcie_remove()
232 if (!card) in mwifiex_pcie_remove()
235 adapter = card->adapter; in mwifiex_pcie_remove()
254 mwifiex_remove_card(card->adapter, &add_remove_card_sem); in mwifiex_pcie_remove()
311 struct pcie_service_card *card = adapter->card; in mwifiex_write_reg() local
313 iowrite32(data, card->pci_mmap1 + reg); in mwifiex_write_reg()
323 struct pcie_service_card *card = adapter->card; in mwifiex_read_reg() local
325 *data = ioread32(card->pci_mmap1 + reg); in mwifiex_read_reg()
334 struct pcie_service_card *card = adapter->card; in mwifiex_read_reg_byte() local
336 *data = ioread8(card->pci_mmap1 + reg); in mwifiex_read_reg_byte()
362 struct pcie_service_card *card = adapter->card; in mwifiex_delay_for_sleep_cookie() local
367 buffer = card->cmdrsp_buf->data - INTF_HEADER_LEN; in mwifiex_delay_for_sleep_cookie()
387 struct pcie_service_card *card = adapter->card; in mwifiex_pm_wakeup_card() local
388 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pm_wakeup_card()
472 struct pcie_service_card *card = adapter->card; in mwifiex_init_txq_ring() local
473 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_init_txq_ring()
479 card->tx_buf_list[i] = NULL; in mwifiex_init_txq_ring()
481 card->txbd_ring[i] = (void *)card->txbd_ring_vbase + in mwifiex_init_txq_ring()
483 desc2 = card->txbd_ring[i]; in mwifiex_init_txq_ring()
486 card->txbd_ring[i] = (void *)card->txbd_ring_vbase + in mwifiex_init_txq_ring()
488 desc = card->txbd_ring[i]; in mwifiex_init_txq_ring()
502 struct pcie_service_card *card = adapter->card; in mwifiex_init_rxq_ring() local
503 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_init_rxq_ring()
517 kfree(card->rxbd_ring_vbase); in mwifiex_init_rxq_ring()
533 card->rx_buf_list[i] = skb; in mwifiex_init_rxq_ring()
535 card->rxbd_ring[i] = (void *)card->rxbd_ring_vbase + in mwifiex_init_rxq_ring()
537 desc2 = card->rxbd_ring[i]; in mwifiex_init_rxq_ring()
544 card->rxbd_ring[i] = (void *)(card->rxbd_ring_vbase + in mwifiex_init_rxq_ring()
546 desc = card->rxbd_ring[i]; in mwifiex_init_rxq_ring()
562 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_init_evt_ring() local
574 kfree(card->evtbd_ring_vbase); in mwifiex_pcie_init_evt_ring()
590 card->evt_buf_list[i] = skb; in mwifiex_pcie_init_evt_ring()
591 card->evtbd_ring[i] = (void *)(card->evtbd_ring_vbase + in mwifiex_pcie_init_evt_ring()
593 desc = card->evtbd_ring[i]; in mwifiex_pcie_init_evt_ring()
607 struct pcie_service_card *card = adapter->card; in mwifiex_cleanup_txq_ring() local
608 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_cleanup_txq_ring()
616 desc2 = card->txbd_ring[i]; in mwifiex_cleanup_txq_ring()
617 if (card->tx_buf_list[i]) { in mwifiex_cleanup_txq_ring()
618 skb = card->tx_buf_list[i]; in mwifiex_cleanup_txq_ring()
625 desc = card->txbd_ring[i]; in mwifiex_cleanup_txq_ring()
626 if (card->tx_buf_list[i]) { in mwifiex_cleanup_txq_ring()
627 skb = card->tx_buf_list[i]; in mwifiex_cleanup_txq_ring()
634 card->tx_buf_list[i] = NULL; in mwifiex_cleanup_txq_ring()
645 struct pcie_service_card *card = adapter->card; in mwifiex_cleanup_rxq_ring() local
646 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_cleanup_rxq_ring()
654 desc2 = card->rxbd_ring[i]; in mwifiex_cleanup_rxq_ring()
655 if (card->rx_buf_list[i]) { in mwifiex_cleanup_rxq_ring()
656 skb = card->rx_buf_list[i]; in mwifiex_cleanup_rxq_ring()
663 desc = card->rxbd_ring[i]; in mwifiex_cleanup_rxq_ring()
664 if (card->rx_buf_list[i]) { in mwifiex_cleanup_rxq_ring()
665 skb = card->rx_buf_list[i]; in mwifiex_cleanup_rxq_ring()
672 card->rx_buf_list[i] = NULL; in mwifiex_cleanup_rxq_ring()
683 struct pcie_service_card *card = adapter->card; in mwifiex_cleanup_evt_ring() local
689 desc = card->evtbd_ring[i]; in mwifiex_cleanup_evt_ring()
690 if (card->evt_buf_list[i]) { in mwifiex_cleanup_evt_ring()
691 skb = card->evt_buf_list[i]; in mwifiex_cleanup_evt_ring()
696 card->evt_buf_list[i] = NULL; in mwifiex_cleanup_evt_ring()
707 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_create_txbd_ring() local
708 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_create_txbd_ring()
715 card->txbd_wrptr = 0; in mwifiex_pcie_create_txbd_ring()
718 card->txbd_rdptr = 0; in mwifiex_pcie_create_txbd_ring()
720 card->txbd_rdptr |= reg->tx_rollover_ind; in mwifiex_pcie_create_txbd_ring()
725 card->txbd_ring_size = sizeof(struct mwifiex_pfu_buf_desc) * in mwifiex_pcie_create_txbd_ring()
728 card->txbd_ring_size = sizeof(struct mwifiex_pcie_buf_desc) * in mwifiex_pcie_create_txbd_ring()
733 card->txbd_ring_size); in mwifiex_pcie_create_txbd_ring()
734 card->txbd_ring_vbase = pci_alloc_consistent(card->dev, in mwifiex_pcie_create_txbd_ring()
735 card->txbd_ring_size, in mwifiex_pcie_create_txbd_ring()
736 &card->txbd_ring_pbase); in mwifiex_pcie_create_txbd_ring()
737 if (!card->txbd_ring_vbase) { in mwifiex_pcie_create_txbd_ring()
740 card->txbd_ring_size); in mwifiex_pcie_create_txbd_ring()
745 card->txbd_ring_vbase, (unsigned int)card->txbd_ring_pbase, in mwifiex_pcie_create_txbd_ring()
746 (u32)((u64)card->txbd_ring_pbase >> 32), in mwifiex_pcie_create_txbd_ring()
747 card->txbd_ring_size); in mwifiex_pcie_create_txbd_ring()
754 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_delete_txbd_ring() local
755 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_delete_txbd_ring()
759 if (card->txbd_ring_vbase) in mwifiex_pcie_delete_txbd_ring()
760 pci_free_consistent(card->dev, card->txbd_ring_size, in mwifiex_pcie_delete_txbd_ring()
761 card->txbd_ring_vbase, in mwifiex_pcie_delete_txbd_ring()
762 card->txbd_ring_pbase); in mwifiex_pcie_delete_txbd_ring()
763 card->txbd_ring_size = 0; in mwifiex_pcie_delete_txbd_ring()
764 card->txbd_wrptr = 0; in mwifiex_pcie_delete_txbd_ring()
765 card->txbd_rdptr = 0 | reg->tx_rollover_ind; in mwifiex_pcie_delete_txbd_ring()
766 card->txbd_ring_vbase = NULL; in mwifiex_pcie_delete_txbd_ring()
767 card->txbd_ring_pbase = 0; in mwifiex_pcie_delete_txbd_ring()
777 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_create_rxbd_ring() local
778 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_create_rxbd_ring()
785 card->rxbd_wrptr = 0; in mwifiex_pcie_create_rxbd_ring()
786 card->rxbd_rdptr = reg->rx_rollover_ind; in mwifiex_pcie_create_rxbd_ring()
789 card->rxbd_ring_size = sizeof(struct mwifiex_pfu_buf_desc) * in mwifiex_pcie_create_rxbd_ring()
792 card->rxbd_ring_size = sizeof(struct mwifiex_pcie_buf_desc) * in mwifiex_pcie_create_rxbd_ring()
797 card->rxbd_ring_size); in mwifiex_pcie_create_rxbd_ring()
798 card->rxbd_ring_vbase = pci_alloc_consistent(card->dev, in mwifiex_pcie_create_rxbd_ring()
799 card->rxbd_ring_size, in mwifiex_pcie_create_rxbd_ring()
800 &card->rxbd_ring_pbase); in mwifiex_pcie_create_rxbd_ring()
801 if (!card->rxbd_ring_vbase) { in mwifiex_pcie_create_rxbd_ring()
804 card->rxbd_ring_size); in mwifiex_pcie_create_rxbd_ring()
810 card->rxbd_ring_vbase, (u32)card->rxbd_ring_pbase, in mwifiex_pcie_create_rxbd_ring()
811 (u32)((u64)card->rxbd_ring_pbase >> 32), in mwifiex_pcie_create_rxbd_ring()
812 card->rxbd_ring_size); in mwifiex_pcie_create_rxbd_ring()
822 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_delete_rxbd_ring() local
823 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_delete_rxbd_ring()
827 if (card->rxbd_ring_vbase) in mwifiex_pcie_delete_rxbd_ring()
828 pci_free_consistent(card->dev, card->rxbd_ring_size, in mwifiex_pcie_delete_rxbd_ring()
829 card->rxbd_ring_vbase, in mwifiex_pcie_delete_rxbd_ring()
830 card->rxbd_ring_pbase); in mwifiex_pcie_delete_rxbd_ring()
831 card->rxbd_ring_size = 0; in mwifiex_pcie_delete_rxbd_ring()
832 card->rxbd_wrptr = 0; in mwifiex_pcie_delete_rxbd_ring()
833 card->rxbd_rdptr = 0 | reg->rx_rollover_ind; in mwifiex_pcie_delete_rxbd_ring()
834 card->rxbd_ring_vbase = NULL; in mwifiex_pcie_delete_rxbd_ring()
835 card->rxbd_ring_pbase = 0; in mwifiex_pcie_delete_rxbd_ring()
845 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_create_evtbd_ring() local
846 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_create_evtbd_ring()
853 card->evtbd_wrptr = 0; in mwifiex_pcie_create_evtbd_ring()
854 card->evtbd_rdptr = reg->evt_rollover_ind; in mwifiex_pcie_create_evtbd_ring()
856 card->evtbd_ring_size = sizeof(struct mwifiex_evt_buf_desc) * in mwifiex_pcie_create_evtbd_ring()
861 card->evtbd_ring_size); in mwifiex_pcie_create_evtbd_ring()
862 card->evtbd_ring_vbase = pci_alloc_consistent(card->dev, in mwifiex_pcie_create_evtbd_ring()
863 card->evtbd_ring_size, in mwifiex_pcie_create_evtbd_ring()
864 &card->evtbd_ring_pbase); in mwifiex_pcie_create_evtbd_ring()
865 if (!card->evtbd_ring_vbase) { in mwifiex_pcie_create_evtbd_ring()
868 card->evtbd_ring_size); in mwifiex_pcie_create_evtbd_ring()
874 card->evtbd_ring_vbase, (u32)card->evtbd_ring_pbase, in mwifiex_pcie_create_evtbd_ring()
875 (u32)((u64)card->evtbd_ring_pbase >> 32), in mwifiex_pcie_create_evtbd_ring()
876 card->evtbd_ring_size); in mwifiex_pcie_create_evtbd_ring()
886 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_delete_evtbd_ring() local
887 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_delete_evtbd_ring()
891 if (card->evtbd_ring_vbase) in mwifiex_pcie_delete_evtbd_ring()
892 pci_free_consistent(card->dev, card->evtbd_ring_size, in mwifiex_pcie_delete_evtbd_ring()
893 card->evtbd_ring_vbase, in mwifiex_pcie_delete_evtbd_ring()
894 card->evtbd_ring_pbase); in mwifiex_pcie_delete_evtbd_ring()
895 card->evtbd_wrptr = 0; in mwifiex_pcie_delete_evtbd_ring()
896 card->evtbd_rdptr = 0 | reg->evt_rollover_ind; in mwifiex_pcie_delete_evtbd_ring()
897 card->evtbd_ring_size = 0; in mwifiex_pcie_delete_evtbd_ring()
898 card->evtbd_ring_vbase = NULL; in mwifiex_pcie_delete_evtbd_ring()
899 card->evtbd_ring_pbase = 0; in mwifiex_pcie_delete_evtbd_ring()
909 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_alloc_cmdrsp_buf() local
924 card->cmdrsp_buf = skb; in mwifiex_pcie_alloc_cmdrsp_buf()
934 struct pcie_service_card *card; in mwifiex_pcie_delete_cmdrsp_buf() local
939 card = adapter->card; in mwifiex_pcie_delete_cmdrsp_buf()
941 if (card && card->cmdrsp_buf) { in mwifiex_pcie_delete_cmdrsp_buf()
942 mwifiex_unmap_pci_memory(adapter, card->cmdrsp_buf, in mwifiex_pcie_delete_cmdrsp_buf()
944 dev_kfree_skb_any(card->cmdrsp_buf); in mwifiex_pcie_delete_cmdrsp_buf()
947 if (card && card->cmd_buf) { in mwifiex_pcie_delete_cmdrsp_buf()
948 mwifiex_unmap_pci_memory(adapter, card->cmd_buf, in mwifiex_pcie_delete_cmdrsp_buf()
959 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_alloc_sleep_cookie_buf() local
961 card->sleep_cookie_vbase = pci_alloc_consistent(card->dev, sizeof(u32), in mwifiex_pcie_alloc_sleep_cookie_buf()
962 &card->sleep_cookie_pbase); in mwifiex_pcie_alloc_sleep_cookie_buf()
963 if (!card->sleep_cookie_vbase) { in mwifiex_pcie_alloc_sleep_cookie_buf()
969 *(u32 *)card->sleep_cookie_vbase = FW_AWAKE_COOKIE; in mwifiex_pcie_alloc_sleep_cookie_buf()
973 *((u32 *)card->sleep_cookie_vbase)); in mwifiex_pcie_alloc_sleep_cookie_buf()
983 struct pcie_service_card *card; in mwifiex_pcie_delete_sleep_cookie_buf() local
988 card = adapter->card; in mwifiex_pcie_delete_sleep_cookie_buf()
990 if (card && card->sleep_cookie_vbase) { in mwifiex_pcie_delete_sleep_cookie_buf()
991 pci_free_consistent(card->dev, sizeof(u32), in mwifiex_pcie_delete_sleep_cookie_buf()
992 card->sleep_cookie_vbase, in mwifiex_pcie_delete_sleep_cookie_buf()
993 card->sleep_cookie_pbase); in mwifiex_pcie_delete_sleep_cookie_buf()
994 card->sleep_cookie_vbase = NULL; in mwifiex_pcie_delete_sleep_cookie_buf()
1006 struct pcie_service_card *card = adapter->card; in mwifiex_clean_pcie_ring_buf() local
1008 if (!mwifiex_pcie_txbd_empty(card, card->txbd_rdptr)) { in mwifiex_clean_pcie_ring_buf()
1009 card->txbd_flush = 1; in mwifiex_clean_pcie_ring_buf()
1032 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_send_data_complete() local
1033 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_send_data_complete()
1047 card->txbd_rdptr, rdptr); in mwifiex_pcie_send_data_complete()
1051 while (((card->txbd_rdptr & reg->tx_mask) != in mwifiex_pcie_send_data_complete()
1053 ((card->txbd_rdptr & reg->tx_rollover_ind) != in mwifiex_pcie_send_data_complete()
1055 wrdoneidx = (card->txbd_rdptr & reg->tx_mask) >> in mwifiex_pcie_send_data_complete()
1058 skb = card->tx_buf_list[wrdoneidx]; in mwifiex_pcie_send_data_complete()
1069 if (card->txbd_flush) in mwifiex_pcie_send_data_complete()
1076 card->tx_buf_list[wrdoneidx] = NULL; in mwifiex_pcie_send_data_complete()
1079 desc2 = card->txbd_ring[wrdoneidx]; in mwifiex_pcie_send_data_complete()
1082 desc = card->txbd_ring[wrdoneidx]; in mwifiex_pcie_send_data_complete()
1085 switch (card->dev->device) { in mwifiex_pcie_send_data_complete()
1087 card->txbd_rdptr++; in mwifiex_pcie_send_data_complete()
1091 card->txbd_rdptr += reg->ring_tx_start_ptr; in mwifiex_pcie_send_data_complete()
1096 if ((card->txbd_rdptr & reg->tx_mask) == num_tx_buffs) in mwifiex_pcie_send_data_complete()
1097 card->txbd_rdptr = ((card->txbd_rdptr & in mwifiex_pcie_send_data_complete()
1105 if (card->txbd_flush) { in mwifiex_pcie_send_data_complete()
1106 if (mwifiex_pcie_txbd_empty(card, card->txbd_rdptr)) in mwifiex_pcie_send_data_complete()
1107 card->txbd_flush = 0; in mwifiex_pcie_send_data_complete()
1126 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_send_data() local
1127 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_send_data()
1148 card->txbd_rdptr, card->txbd_wrptr); in mwifiex_pcie_send_data()
1149 if (mwifiex_pcie_txbd_not_full(card)) { in mwifiex_pcie_send_data()
1163 wrindx = (card->txbd_wrptr & reg->tx_mask) >> reg->tx_start_ptr; in mwifiex_pcie_send_data()
1165 card->tx_buf_list[wrindx] = skb; in mwifiex_pcie_send_data()
1168 desc2 = card->txbd_ring[wrindx]; in mwifiex_pcie_send_data()
1176 desc = card->txbd_ring[wrindx]; in mwifiex_pcie_send_data()
1183 switch (card->dev->device) { in mwifiex_pcie_send_data()
1185 card->txbd_wrptr++; in mwifiex_pcie_send_data()
1189 card->txbd_wrptr += reg->ring_tx_start_ptr; in mwifiex_pcie_send_data()
1193 if ((card->txbd_wrptr & reg->tx_mask) == num_tx_buffs) in mwifiex_pcie_send_data()
1194 card->txbd_wrptr = ((card->txbd_wrptr & in mwifiex_pcie_send_data()
1198 rx_val = card->rxbd_rdptr & reg->rx_wrap_mask; in mwifiex_pcie_send_data()
1201 card->txbd_wrptr | rx_val)) { in mwifiex_pcie_send_data()
1207 if ((mwifiex_pcie_txbd_not_full(card)) && in mwifiex_pcie_send_data()
1226 card->txbd_rdptr, card->txbd_wrptr); in mwifiex_pcie_send_data()
1242 card->tx_buf_list[wrindx] = NULL; in mwifiex_pcie_send_data()
1257 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_process_recv_data() local
1258 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_process_recv_data()
1276 card->rxbd_wrptr = wrptr; in mwifiex_pcie_process_recv_data()
1279 (card->rxbd_rdptr & reg->rx_mask)) || in mwifiex_pcie_process_recv_data()
1281 (card->rxbd_rdptr & reg->rx_rollover_ind))) { in mwifiex_pcie_process_recv_data()
1286 rd_index = card->rxbd_rdptr & reg->rx_mask; in mwifiex_pcie_process_recv_data()
1287 skb_data = card->rx_buf_list[rd_index]; in mwifiex_pcie_process_recv_data()
1296 card->rx_buf_list[rd_index] = NULL; in mwifiex_pcie_process_recv_data()
1307 rx_len, card->rxbd_rdptr, wrptr); in mwifiex_pcie_process_recv_data()
1313 card->rxbd_rdptr, wrptr, rx_len); in mwifiex_pcie_process_recv_data()
1342 card->rx_buf_list[rd_index] = skb_tmp; in mwifiex_pcie_process_recv_data()
1345 desc2 = card->rxbd_ring[rd_index]; in mwifiex_pcie_process_recv_data()
1352 desc = card->rxbd_ring[rd_index]; in mwifiex_pcie_process_recv_data()
1358 if ((++card->rxbd_rdptr & reg->rx_mask) == in mwifiex_pcie_process_recv_data()
1360 card->rxbd_rdptr = ((card->rxbd_rdptr & in mwifiex_pcie_process_recv_data()
1366 card->rxbd_rdptr, wrptr); in mwifiex_pcie_process_recv_data()
1368 tx_val = card->txbd_wrptr & reg->tx_wrap_mask; in mwifiex_pcie_process_recv_data()
1371 card->rxbd_rdptr | tx_val)) { in mwifiex_pcie_process_recv_data()
1387 card->rxbd_wrptr = wrptr; in mwifiex_pcie_process_recv_data()
1401 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_send_boot_cmd() local
1402 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_send_boot_cmd()
1465 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_init_fw_port() local
1466 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_init_fw_port()
1467 int tx_wrap = card->txbd_wrptr & reg->tx_wrap_mask; in mwifiex_pcie_init_fw_port()
1470 if (mwifiex_write_reg(adapter, reg->rx_rdptr, card->rxbd_rdptr | in mwifiex_pcie_init_fw_port()
1484 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_send_cmd() local
1485 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_send_cmd()
1498 if (!card->cmdrsp_buf) { in mwifiex_pcie_send_cmd()
1515 card->cmd_buf = skb; in mwifiex_pcie_send_cmd()
1527 if (card->cmdrsp_buf) { in mwifiex_pcie_send_cmd()
1528 cmdrsp_buf_pa = MWIFIEX_SKB_DMA_ADDR(card->cmdrsp_buf); in mwifiex_pcie_send_cmd()
1549 cmd_buf_pa = MWIFIEX_SKB_DMA_ADDR(card->cmd_buf); in mwifiex_pcie_send_cmd()
1569 card->cmd_buf->len)) { in mwifiex_pcie_send_cmd()
1597 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_process_cmd_complete() local
1598 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_process_cmd_complete()
1599 struct sk_buff *skb = card->cmdrsp_buf; in mwifiex_pcie_process_cmd_complete()
1610 if (card->cmd_buf) { in mwifiex_pcie_process_cmd_complete()
1611 mwifiex_unmap_pci_memory(adapter, card->cmd_buf, in mwifiex_pcie_process_cmd_complete()
1613 card->cmd_buf = NULL; in mwifiex_pcie_process_cmd_complete()
1653 card->cmdrsp_buf = NULL; in mwifiex_pcie_process_cmd_complete()
1681 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_cmdrsp_complete() local
1684 card->cmdrsp_buf = skb; in mwifiex_pcie_cmdrsp_complete()
1685 skb_push(card->cmdrsp_buf, INTF_HEADER_LEN); in mwifiex_pcie_cmdrsp_complete()
1699 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_process_event_ready() local
1700 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_process_event_ready()
1701 u32 rdptr = card->evtbd_rdptr & MWIFIEX_EVTBD_MASK; in mwifiex_pcie_process_event_ready()
1730 card->evtbd_rdptr, wrptr); in mwifiex_pcie_process_event_ready()
1731 if (((wrptr & MWIFIEX_EVTBD_MASK) != (card->evtbd_rdptr in mwifiex_pcie_process_event_ready()
1734 (card->evtbd_rdptr & reg->evt_rollover_ind))) { in mwifiex_pcie_process_event_ready()
1741 skb_cmd = card->evt_buf_list[rdptr]; in mwifiex_pcie_process_event_ready()
1746 card->evt_buf_list[rdptr] = NULL; in mwifiex_pcie_process_event_ready()
1747 desc = card->evtbd_ring[rdptr]; in mwifiex_pcie_process_event_ready()
1791 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_event_complete() local
1792 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_event_complete()
1794 u32 rdptr = card->evtbd_rdptr & MWIFIEX_EVTBD_MASK; in mwifiex_pcie_event_complete()
1815 if (!card->evt_buf_list[rdptr]) { in mwifiex_pcie_event_complete()
1822 card->evt_buf_list[rdptr] = skb; in mwifiex_pcie_event_complete()
1823 desc = card->evtbd_ring[rdptr]; in mwifiex_pcie_event_complete()
1831 rdptr, card->evt_buf_list[rdptr], skb); in mwifiex_pcie_event_complete()
1834 if ((++card->evtbd_rdptr & MWIFIEX_EVTBD_MASK) == MWIFIEX_MAX_EVT_BD) { in mwifiex_pcie_event_complete()
1835 card->evtbd_rdptr = ((card->evtbd_rdptr & in mwifiex_pcie_event_complete()
1842 card->evtbd_rdptr, wrptr); in mwifiex_pcie_event_complete()
1846 card->evtbd_rdptr)) { in mwifiex_pcie_event_complete()
1876 struct pcie_service_card *card = adapter->card; in mwifiex_prog_fw_w_helper() local
1877 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_prog_fw_w_helper()
1959 tx_blocks = (txlen + card->pcie.blksz_fw_dl - 1) / in mwifiex_prog_fw_w_helper()
1960 card->pcie.blksz_fw_dl; in mwifiex_prog_fw_w_helper()
1967 skb_trim(skb, tx_blocks * card->pcie.blksz_fw_dl); in mwifiex_prog_fw_w_helper()
2018 struct pcie_service_card *card = adapter->card; in mwifiex_check_fw_status() local
2019 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_check_fw_status()
2128 struct pcie_service_card *card; in mwifiex_pcie_interrupt() local
2136 card = pci_get_drvdata(pdev); in mwifiex_pcie_interrupt()
2137 if (!card || !card->adapter) { in mwifiex_pcie_interrupt()
2138 pr_debug("info: %s: card=%p adapter=%p\n", __func__, card, in mwifiex_pcie_interrupt()
2139 card ? card->adapter : NULL); in mwifiex_pcie_interrupt()
2142 adapter = card->adapter; in mwifiex_pcie_interrupt()
2281 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_rdwr_firmware() local
2282 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_rdwr_firmware()
2318 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_fw_dump() local
2319 const struct mwifiex_pcie_card_reg *creg = card->pcie.reg; in mwifiex_pcie_fw_dump()
2326 if (!card->pcie.can_dump_fw) in mwifiex_pcie_fw_dump()
2463 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_init() local
2465 struct pci_dev *pdev = card->dev; in mwifiex_pcie_init()
2466 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_init()
2468 pci_set_drvdata(pdev, card); in mwifiex_pcie_init()
2498 card->pci_mmap = pci_iomap(pdev, 0, 0); in mwifiex_pcie_init()
2499 if (!card->pci_mmap) { in mwifiex_pcie_init()
2509 card->pci_mmap1 = pci_iomap(pdev, 2, 0); in mwifiex_pcie_init()
2510 if (!card->pci_mmap1) { in mwifiex_pcie_init()
2519 card->pci_mmap, card->pci_mmap1); in mwifiex_pcie_init()
2521 card->cmdrsp_buf = NULL; in mwifiex_pcie_init()
2539 card->sleep_cookie_vbase = NULL; in mwifiex_pcie_init()
2552 pci_iounmap(pdev, card->pci_mmap1); in mwifiex_pcie_init()
2556 pci_iounmap(pdev, card->pci_mmap); in mwifiex_pcie_init()
2579 struct pcie_service_card *card = adapter->card; in mwifiex_pcie_cleanup() local
2580 struct pci_dev *pdev = card->dev; in mwifiex_pcie_cleanup()
2581 const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; in mwifiex_pcie_cleanup()
2592 pci_iounmap(pdev, card->pci_mmap); in mwifiex_pcie_cleanup()
2593 pci_iounmap(pdev, card->pci_mmap1); in mwifiex_pcie_cleanup()
2599 kfree(card); in mwifiex_pcie_cleanup()
2610 struct pcie_service_card *card = adapter->card; in mwifiex_register_dev() local
2611 struct pci_dev *pdev = card->dev; in mwifiex_register_dev()
2614 card->adapter = adapter; in mwifiex_register_dev()
2621 adapter->card = NULL; in mwifiex_register_dev()
2626 adapter->tx_buf_size = card->pcie.tx_buf_size; in mwifiex_register_dev()
2629 strcpy(adapter->fw_name, card->pcie.firmware); in mwifiex_register_dev()
2630 adapter->ext_scan = card->pcie.can_ext_scan; in mwifiex_register_dev()
2643 struct pcie_service_card *card = adapter->card; in mwifiex_unregister_dev() local
2646 if (card) { in mwifiex_unregister_dev()
2649 free_irq(card->dev->irq, card->dev); in mwifiex_unregister_dev()
2651 reg = card->pcie.reg; in mwifiex_unregister_dev()
2659 card->cmdrsp_buf = NULL; in mwifiex_unregister_dev()