Lines Matching full:wilc

18 static inline void acquire_bus(struct wilc *wilc, enum bus_acquire acquire)  in acquire_bus()  argument
20 mutex_lock(&wilc->hif_cs); in acquire_bus()
22 chip_wakeup(wilc); in acquire_bus()
25 static inline void release_bus(struct wilc *wilc, enum bus_release release) in release_bus() argument
28 chip_allow_sleep(wilc); in release_bus()
29 mutex_unlock(&wilc->hif_cs); in release_bus()
32 static void wilc_wlan_txq_remove(struct wilc *wilc, u8 q_num, in wilc_wlan_txq_remove() argument
36 wilc->txq_entries -= 1; in wilc_wlan_txq_remove()
37 wilc->txq[q_num].count--; in wilc_wlan_txq_remove()
41 wilc_wlan_txq_remove_from_head(struct wilc *wilc, u8 q_num) in wilc_wlan_txq_remove_from_head() argument
46 spin_lock_irqsave(&wilc->txq_spinlock, flags); in wilc_wlan_txq_remove_from_head()
48 if (!list_empty(&wilc->txq[q_num].txq_head.list)) { in wilc_wlan_txq_remove_from_head()
49 tqe = list_first_entry(&wilc->txq[q_num].txq_head.list, in wilc_wlan_txq_remove_from_head()
52 wilc->txq_entries -= 1; in wilc_wlan_txq_remove_from_head()
53 wilc->txq[q_num].count--; in wilc_wlan_txq_remove_from_head()
55 spin_unlock_irqrestore(&wilc->txq_spinlock, flags); in wilc_wlan_txq_remove_from_head()
64 struct wilc *wilc = vif->wilc; in wilc_wlan_txq_add_to_tail() local
66 spin_lock_irqsave(&wilc->txq_spinlock, flags); in wilc_wlan_txq_add_to_tail()
68 list_add_tail(&tqe->list, &wilc->txq[q_num].txq_head.list); in wilc_wlan_txq_add_to_tail()
69 wilc->txq_entries += 1; in wilc_wlan_txq_add_to_tail()
70 wilc->txq[q_num].count++; in wilc_wlan_txq_add_to_tail()
72 spin_unlock_irqrestore(&wilc->txq_spinlock, flags); in wilc_wlan_txq_add_to_tail()
74 complete(&wilc->txq_event); in wilc_wlan_txq_add_to_tail()
81 struct wilc *wilc = vif->wilc; in wilc_wlan_txq_add_to_head() local
83 mutex_lock(&wilc->txq_add_to_head_cs); in wilc_wlan_txq_add_to_head()
85 spin_lock_irqsave(&wilc->txq_spinlock, flags); in wilc_wlan_txq_add_to_head()
87 list_add(&tqe->list, &wilc->txq[q_num].txq_head.list); in wilc_wlan_txq_add_to_head()
88 wilc->txq_entries += 1; in wilc_wlan_txq_add_to_head()
89 wilc->txq[q_num].count++; in wilc_wlan_txq_add_to_head()
91 spin_unlock_irqrestore(&wilc->txq_spinlock, flags); in wilc_wlan_txq_add_to_head()
92 mutex_unlock(&wilc->txq_add_to_head_cs); in wilc_wlan_txq_add_to_head()
93 complete(&wilc->txq_event); in wilc_wlan_txq_add_to_head()
144 struct wilc *wilc = vif->wilc; in tcp_process() local
150 spin_lock_irqsave(&wilc->txq_spinlock, flags); in tcp_process()
186 spin_unlock_irqrestore(&wilc->txq_spinlock, flags); in tcp_process()
192 struct wilc *wilc = vif->wilc; in wilc_wlan_txq_filter_dup_tcp_ack() local
198 spin_lock_irqsave(&wilc->txq_spinlock, flags); in wilc_wlan_txq_filter_dup_tcp_ack()
219 wilc_wlan_txq_remove(wilc, tqe->q_num, tqe); in wilc_wlan_txq_filter_dup_tcp_ack()
237 spin_unlock_irqrestore(&wilc->txq_spinlock, flags); in wilc_wlan_txq_filter_dup_tcp_ack()
240 wait_for_completion_timeout(&wilc->txq_event, in wilc_wlan_txq_filter_dup_tcp_ack()
255 struct wilc *wilc = vif->wilc; in wilc_wlan_txq_add_cfg_pkt() local
258 if (wilc->quit) { in wilc_wlan_txq_add_cfg_pkt()
260 complete(&wilc->cfg_event); in wilc_wlan_txq_add_cfg_pkt()
266 complete(&wilc->cfg_event); in wilc_wlan_txq_add_cfg_pkt()
284 static bool is_ac_q_limit(struct wilc *wl, u8 q_num) in is_ac_q_limit()
331 static inline u8 ac_classify(struct wilc *wilc, struct sk_buff *skb) in ac_classify() argument
370 static inline int ac_balance(struct wilc *wl, u8 *ratio) in ac_balance()
387 static inline void ac_update_fw_ac_pkt_info(struct wilc *wl, u32 reg) in ac_update_fw_ac_pkt_info()
400 static inline u8 ac_change(struct wilc *wilc, u8 *ac) in ac_change() argument
403 if (wilc->txq[*ac].fw.acm == 0) in ac_change()
418 struct wilc *wilc; in wilc_wlan_txq_add_net_pkt() local
421 wilc = vif->wilc; in wilc_wlan_txq_add_net_pkt()
423 if (wilc->quit) { in wilc_wlan_txq_add_net_pkt()
441 q_num = ac_classify(wilc, tx_data->skb); in wilc_wlan_txq_add_net_pkt()
443 if (ac_change(wilc, &q_num)) { in wilc_wlan_txq_add_net_pkt()
449 if (is_ac_q_limit(wilc, q_num)) { in wilc_wlan_txq_add_net_pkt()
459 return wilc->txq_entries; in wilc_wlan_txq_add_net_pkt()
468 struct wilc *wilc; in wilc_wlan_txq_add_mgmt_pkt() local
470 wilc = vif->wilc; in wilc_wlan_txq_add_mgmt_pkt()
472 if (wilc->quit) { in wilc_wlan_txq_add_mgmt_pkt()
495 static struct txq_entry_t *wilc_wlan_txq_get_first(struct wilc *wilc, u8 q_num) in wilc_wlan_txq_get_first() argument
500 spin_lock_irqsave(&wilc->txq_spinlock, flags); in wilc_wlan_txq_get_first()
502 if (!list_empty(&wilc->txq[q_num].txq_head.list)) in wilc_wlan_txq_get_first()
503 tqe = list_first_entry(&wilc->txq[q_num].txq_head.list, in wilc_wlan_txq_get_first()
506 spin_unlock_irqrestore(&wilc->txq_spinlock, flags); in wilc_wlan_txq_get_first()
511 static struct txq_entry_t *wilc_wlan_txq_get_next(struct wilc *wilc, in wilc_wlan_txq_get_next() argument
517 spin_lock_irqsave(&wilc->txq_spinlock, flags); in wilc_wlan_txq_get_next()
519 if (!list_is_last(&tqe->list, &wilc->txq[q_num].txq_head.list)) in wilc_wlan_txq_get_next()
523 spin_unlock_irqrestore(&wilc->txq_spinlock, flags); in wilc_wlan_txq_get_next()
528 static void wilc_wlan_rxq_add(struct wilc *wilc, struct rxq_entry_t *rqe) in wilc_wlan_rxq_add() argument
530 if (wilc->quit) in wilc_wlan_rxq_add()
533 mutex_lock(&wilc->rxq_cs); in wilc_wlan_rxq_add()
534 list_add_tail(&rqe->list, &wilc->rxq_head.list); in wilc_wlan_rxq_add()
535 mutex_unlock(&wilc->rxq_cs); in wilc_wlan_rxq_add()
538 static struct rxq_entry_t *wilc_wlan_rxq_remove(struct wilc *wilc) in wilc_wlan_rxq_remove() argument
542 mutex_lock(&wilc->rxq_cs); in wilc_wlan_rxq_remove()
543 if (!list_empty(&wilc->rxq_head.list)) { in wilc_wlan_rxq_remove()
544 rqe = list_first_entry(&wilc->rxq_head.list, struct rxq_entry_t, in wilc_wlan_rxq_remove()
548 mutex_unlock(&wilc->rxq_cs); in wilc_wlan_rxq_remove()
552 void chip_allow_sleep(struct wilc *wilc) in chip_allow_sleep() argument
555 const struct wilc_hif_func *hif_func = wilc->hif_func; in chip_allow_sleep()
562 if (wilc->io_type == WILC_HIF_SDIO) { in chip_allow_sleep()
579 ret = hif_func->hif_read_reg(wilc, to_host_from_fw_reg, &reg); in chip_allow_sleep()
589 ret = hif_func->hif_read_reg(wilc, wakeup_reg, &reg); in chip_allow_sleep()
594 ret = hif_func->hif_write_reg(wilc, wakeup_reg, reg); in chip_allow_sleep()
599 ret = hif_func->hif_read_reg(wilc, from_host_to_fw_reg, &reg); in chip_allow_sleep()
604 ret = hif_func->hif_write_reg(wilc, from_host_to_fw_reg, reg); in chip_allow_sleep()
612 void chip_wakeup(struct wilc *wilc) in chip_wakeup() argument
615 const struct wilc_hif_func *h = wilc->hif_func; in chip_wakeup()
617 if (wilc->io_type == WILC_HIF_SPI) { in chip_wakeup()
619 h->hif_read_reg(wilc, WILC_SPI_WAKEUP_REG, &reg); in chip_wakeup()
620 h->hif_write_reg(wilc, WILC_SPI_WAKEUP_REG, in chip_wakeup()
622 h->hif_write_reg(wilc, WILC_SPI_WAKEUP_REG, in chip_wakeup()
627 wilc_get_chipid(wilc, true); in chip_wakeup()
628 } while (wilc_get_chipid(wilc, true) == 0); in chip_wakeup()
629 } while (wilc_get_chipid(wilc, true) == 0); in chip_wakeup()
630 } else if (wilc->io_type == WILC_HIF_SDIO) { in chip_wakeup()
631 h->hif_write_reg(wilc, WILC_SDIO_HOST_TO_FW_REG, in chip_wakeup()
634 h->hif_read_reg(wilc, WILC_SDIO_WAKEUP_REG, &reg); in chip_wakeup()
636 h->hif_write_reg(wilc, WILC_SDIO_WAKEUP_REG, in chip_wakeup()
638 h->hif_read_reg(wilc, WILC_SDIO_CLK_STATUS_REG, in chip_wakeup()
644 h->hif_read_reg(wilc, WILC_SDIO_CLK_STATUS_REG, in chip_wakeup()
648 h->hif_write_reg(wilc, WILC_SDIO_WAKEUP_REG, in chip_wakeup()
654 if (wilc->chip_ps_state == WILC_CHIP_SLEEPING_MANUAL) { in chip_wakeup()
655 if (wilc_get_chipid(wilc, false) < WILC_1000_BASE_ID_2B) { in chip_wakeup()
658 h->hif_read_reg(wilc, WILC_REG_4_TO_1_RX, &val32); in chip_wakeup()
660 h->hif_write_reg(wilc, WILC_REG_4_TO_1_RX, val32); in chip_wakeup()
662 h->hif_read_reg(wilc, WILC_REG_4_TO_1_TX_BANK0, &val32); in chip_wakeup()
664 h->hif_write_reg(wilc, WILC_REG_4_TO_1_TX_BANK0, val32); in chip_wakeup()
667 wilc->chip_ps_state = WILC_CHIP_WAKEDUP; in chip_wakeup()
671 void host_wakeup_notify(struct wilc *wilc) in host_wakeup_notify() argument
673 acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); in host_wakeup_notify()
674 wilc->hif_func->hif_write_reg(wilc, WILC_CORTUS_INTERRUPT_2, 1); in host_wakeup_notify()
675 release_bus(wilc, WILC_BUS_RELEASE_ONLY); in host_wakeup_notify()
679 void host_sleep_notify(struct wilc *wilc) in host_sleep_notify() argument
681 acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); in host_sleep_notify()
682 wilc->hif_func->hif_write_reg(wilc, WILC_CORTUS_INTERRUPT_1, 1); in host_sleep_notify()
683 release_bus(wilc, WILC_BUS_RELEASE_ONLY); in host_sleep_notify()
687 int wilc_wlan_handle_txq(struct wilc *wilc, u32 *txq_count) in wilc_wlan_handle_txq() argument
708 u8 *txb = wilc->tx_buffer; in wilc_wlan_handle_txq()
711 if (wilc->quit) in wilc_wlan_handle_txq()
714 if (ac_balance(wilc, ac_desired_ratio)) in wilc_wlan_handle_txq()
717 mutex_lock(&wilc->txq_add_to_head_cs); in wilc_wlan_handle_txq()
719 srcu_idx = srcu_read_lock(&wilc->srcu); in wilc_wlan_handle_txq()
720 list_for_each_entry_rcu(vif, &wilc->vif_list, list) in wilc_wlan_handle_txq()
722 srcu_read_unlock(&wilc->srcu, srcu_idx); in wilc_wlan_handle_txq()
725 tqe_q[ac] = wilc_wlan_txq_get_first(wilc, ac); in wilc_wlan_handle_txq()
768 tqe_q[ac] = wilc_wlan_txq_get_next(wilc, in wilc_wlan_handle_txq()
780 acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); in wilc_wlan_handle_txq()
782 func = wilc->hif_func; in wilc_wlan_handle_txq()
784 ret = func->hif_read_reg(wilc, WILC_HOST_TX_CTRL, &reg); in wilc_wlan_handle_txq()
789 ac_update_fw_ac_pkt_info(wilc, reg); in wilc_wlan_handle_txq()
796 ret = func->hif_write_reg(wilc, WILC_HOST_TX_CTRL, 0); in wilc_wlan_handle_txq()
799 } while (!wilc->quit); in wilc_wlan_handle_txq()
806 ret = func->hif_block_tx(wilc, in wilc_wlan_handle_txq()
813 ret = func->hif_write_reg(wilc, WILC_HOST_VMM_CTL, 0x2); in wilc_wlan_handle_txq()
818 ret = func->hif_read_reg(wilc, WILC_HOST_VMM_CTL, &reg); in wilc_wlan_handle_txq()
827 ret = func->hif_write_reg(wilc, WILC_HOST_VMM_CTL, 0x0); in wilc_wlan_handle_txq()
835 ret = func->hif_read_reg(wilc, WILC_HOST_TX_CTRL, &reg); in wilc_wlan_handle_txq()
839 ret = func->hif_write_reg(wilc, WILC_HOST_TX_CTRL, reg); in wilc_wlan_handle_txq()
855 release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); in wilc_wlan_handle_txq()
865 tqe = wilc_wlan_txq_remove_from_head(wilc, vmm_entries_ac[i]); in wilc_wlan_handle_txq()
914 wilc->txq[i].fw.count += ac_pkt_num_to_chip[i]; in wilc_wlan_handle_txq()
916 acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); in wilc_wlan_handle_txq()
918 ret = func->hif_clear_int_ext(wilc, ENABLE_TX_VMM); in wilc_wlan_handle_txq()
922 ret = func->hif_block_tx_ext(wilc, 0, txb, offset); in wilc_wlan_handle_txq()
925 release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); in wilc_wlan_handle_txq()
928 mutex_unlock(&wilc->txq_add_to_head_cs); in wilc_wlan_handle_txq()
931 *txq_count = wilc->txq_entries; in wilc_wlan_handle_txq()
935 static void wilc_wlan_handle_rx_buff(struct wilc *wilc, u8 *buffer, int size) in wilc_wlan_handle_rx_buff() argument
957 wilc_wfi_mgmt_rx(wilc, buff_ptr, pkt_len); in wilc_wlan_handle_rx_buff()
960 wilc_frmw_to_host(wilc, buff_ptr, pkt_len, in wilc_wlan_handle_rx_buff()
967 wilc_wlan_cfg_indicate_rx(wilc, buff_ptr, in wilc_wlan_handle_rx_buff()
971 if (wilc->cfg_seq_no == rsp.seq_no) in wilc_wlan_handle_rx_buff()
972 complete(&wilc->cfg_event); in wilc_wlan_handle_rx_buff()
974 wilc_mac_indicate(wilc); in wilc_wlan_handle_rx_buff()
982 static void wilc_wlan_handle_rxq(struct wilc *wilc) in wilc_wlan_handle_rxq() argument
988 while (!wilc->quit) { in wilc_wlan_handle_rxq()
989 rqe = wilc_wlan_rxq_remove(wilc); in wilc_wlan_handle_rxq()
995 wilc_wlan_handle_rx_buff(wilc, buffer, size); in wilc_wlan_handle_rxq()
999 if (wilc->quit) in wilc_wlan_handle_rxq()
1000 complete(&wilc->cfg_event); in wilc_wlan_handle_rxq()
1003 static void wilc_unknown_isr_ext(struct wilc *wilc) in wilc_unknown_isr_ext() argument
1005 wilc->hif_func->hif_clear_int_ext(wilc, 0); in wilc_unknown_isr_ext()
1008 static void wilc_wlan_handle_isr_ext(struct wilc *wilc, u32 int_status) in wilc_wlan_handle_isr_ext() argument
1010 u32 offset = wilc->rx_buffer_offset; in wilc_wlan_handle_isr_ext()
1020 wilc->hif_func->hif_read_size(wilc, &size); in wilc_wlan_handle_isr_ext()
1031 buffer = &wilc->rx_buffer[offset]; in wilc_wlan_handle_isr_ext()
1033 wilc->hif_func->hif_clear_int_ext(wilc, DATA_INT_CLR | ENABLE_RX_VMM); in wilc_wlan_handle_isr_ext()
1034 ret = wilc->hif_func->hif_block_rx_ext(wilc, 0, buffer, size); in wilc_wlan_handle_isr_ext()
1039 wilc->rx_buffer_offset = offset; in wilc_wlan_handle_isr_ext()
1046 wilc_wlan_rxq_add(wilc, rqe); in wilc_wlan_handle_isr_ext()
1047 wilc_wlan_handle_rxq(wilc); in wilc_wlan_handle_isr_ext()
1050 void wilc_handle_isr(struct wilc *wilc) in wilc_handle_isr() argument
1054 acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); in wilc_handle_isr()
1055 wilc->hif_func->hif_read_int(wilc, &int_status); in wilc_handle_isr()
1058 wilc_wlan_handle_isr_ext(wilc, int_status); in wilc_handle_isr()
1061 wilc_unknown_isr_ext(wilc); in wilc_handle_isr()
1063 release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); in wilc_handle_isr()
1067 int wilc_wlan_firmware_download(struct wilc *wilc, const u8 *buffer, in wilc_wlan_firmware_download() argument
1085 acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); in wilc_wlan_firmware_download()
1094 ret = wilc->hif_func->hif_block_tx(wilc, addr, in wilc_wlan_firmware_download()
1103 release_bus(wilc, WILC_BUS_RELEASE_ONLY); in wilc_wlan_firmware_download()
1116 int wilc_wlan_start(struct wilc *wilc) in wilc_wlan_start() argument
1122 if (wilc->io_type == WILC_HIF_SDIO) { in wilc_wlan_start()
1125 } else if (wilc->io_type == WILC_HIF_SPI) { in wilc_wlan_start()
1128 acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); in wilc_wlan_start()
1129 ret = wilc->hif_func->hif_write_reg(wilc, WILC_VMM_CORE_CFG, reg); in wilc_wlan_start()
1134 if (wilc->io_type == WILC_HIF_SDIO && wilc->dev_irq_num) in wilc_wlan_start()
1137 ret = wilc->hif_func->hif_write_reg(wilc, WILC_GP_REG_1, reg); in wilc_wlan_start()
1141 wilc->hif_func->hif_sync_ext(wilc, NUM_INT_EXT); in wilc_wlan_start()
1143 ret = wilc->hif_func->hif_read_reg(wilc, WILC_CHIPID, &chipid); in wilc_wlan_start()
1147 wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, &reg); in wilc_wlan_start()
1150 wilc->hif_func->hif_write_reg(wilc, WILC_GLB_RESET_0, reg); in wilc_wlan_start()
1151 wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, &reg); in wilc_wlan_start()
1155 ret = wilc->hif_func->hif_write_reg(wilc, WILC_GLB_RESET_0, reg); in wilc_wlan_start()
1156 wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, &reg); in wilc_wlan_start()
1159 release_bus(wilc, WILC_BUS_RELEASE_ONLY); in wilc_wlan_start()
1163 int wilc_wlan_stop(struct wilc *wilc, struct wilc_vif *vif) in wilc_wlan_stop() argument
1168 acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); in wilc_wlan_stop()
1170 ret = wilc->hif_func->hif_read_reg(wilc, WILC_GP_REG_0, &reg); in wilc_wlan_stop()
1176 ret = wilc->hif_func->hif_write_reg(wilc, WILC_GP_REG_0, in wilc_wlan_stop()
1183 ret = wilc->hif_func->hif_read_reg(wilc, WILC_FW_HOST_COMM, &reg); in wilc_wlan_stop()
1190 ret = wilc->hif_func->hif_write_reg(wilc, WILC_FW_HOST_COMM, reg); in wilc_wlan_stop()
1198 release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); in wilc_wlan_stop()
1209 struct wilc *wilc = vif->wilc; in wilc_wlan_cleanup() local
1211 wilc->quit = 1; in wilc_wlan_cleanup()
1213 while ((tqe = wilc_wlan_txq_remove_from_head(wilc, ac))) { in wilc_wlan_cleanup()
1220 while ((rqe = wilc_wlan_rxq_remove(wilc))) in wilc_wlan_cleanup()
1223 kfree(wilc->rx_buffer); in wilc_wlan_cleanup()
1224 wilc->rx_buffer = NULL; in wilc_wlan_cleanup()
1225 kfree(wilc->tx_buffer); in wilc_wlan_cleanup()
1226 wilc->tx_buffer = NULL; in wilc_wlan_cleanup()
1227 wilc->hif_func->hif_deinit(NULL); in wilc_wlan_cleanup()
1233 struct wilc *wilc = vif->wilc; in wilc_wlan_cfg_commit() local
1234 struct wilc_cfg_frame *cfg = &wilc->cfg_frame; in wilc_wlan_cfg_commit()
1235 int t_len = wilc->cfg_frame_offset + sizeof(struct wilc_cfg_cmd_hdr); in wilc_wlan_cfg_commit()
1242 cfg->hdr.seq_no = wilc->cfg_seq_no % 256; in wilc_wlan_cfg_commit()
1245 wilc->cfg_seq_no = cfg->hdr.seq_no; in wilc_wlan_cfg_commit()
1258 struct wilc *wilc = vif->wilc; in wilc_wlan_cfg_set() local
1260 mutex_lock(&wilc->cfg_cmd_lock); in wilc_wlan_cfg_set()
1263 wilc->cfg_frame_offset = 0; in wilc_wlan_cfg_set()
1265 offset = wilc->cfg_frame_offset; in wilc_wlan_cfg_set()
1266 ret_size = wilc_wlan_cfg_set_wid(wilc->cfg_frame.frame, offset, in wilc_wlan_cfg_set()
1269 wilc->cfg_frame_offset = offset; in wilc_wlan_cfg_set()
1272 mutex_unlock(&wilc->cfg_cmd_lock); in wilc_wlan_cfg_set()
1276 netdev_dbg(vif->ndev, "%s: seqno[%d]\n", __func__, wilc->cfg_seq_no); in wilc_wlan_cfg_set()
1281 if (!wait_for_completion_timeout(&wilc->cfg_event, in wilc_wlan_cfg_set()
1287 wilc->cfg_frame_offset = 0; in wilc_wlan_cfg_set()
1288 wilc->cfg_seq_no += 1; in wilc_wlan_cfg_set()
1289 mutex_unlock(&wilc->cfg_cmd_lock); in wilc_wlan_cfg_set()
1299 struct wilc *wilc = vif->wilc; in wilc_wlan_cfg_get() local
1301 mutex_lock(&wilc->cfg_cmd_lock); in wilc_wlan_cfg_get()
1304 wilc->cfg_frame_offset = 0; in wilc_wlan_cfg_get()
1306 offset = wilc->cfg_frame_offset; in wilc_wlan_cfg_get()
1307 ret_size = wilc_wlan_cfg_get_wid(wilc->cfg_frame.frame, offset, wid); in wilc_wlan_cfg_get()
1309 wilc->cfg_frame_offset = offset; in wilc_wlan_cfg_get()
1312 mutex_unlock(&wilc->cfg_cmd_lock); in wilc_wlan_cfg_get()
1319 if (!wait_for_completion_timeout(&wilc->cfg_event, in wilc_wlan_cfg_get()
1324 wilc->cfg_frame_offset = 0; in wilc_wlan_cfg_get()
1325 wilc->cfg_seq_no += 1; in wilc_wlan_cfg_get()
1326 mutex_unlock(&wilc->cfg_cmd_lock); in wilc_wlan_cfg_get()
1349 wids[i].size = wilc_wlan_cfg_get_val(vif->wilc, in wilc_send_config_pkt()
1377 struct wilc *wilc = vif->wilc; in init_chip() local
1379 acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); in init_chip()
1381 chipid = wilc_get_chipid(wilc, true); in init_chip()
1384 ret = wilc->hif_func->hif_read_reg(wilc, in init_chip()
1392 ret = wilc->hif_func->hif_write_reg(wilc, in init_chip()
1399 ret = wilc->hif_func->hif_write_reg(wilc, in init_chip()
1409 release_bus(wilc, WILC_BUS_RELEASE_ONLY); in init_chip()
1414 u32 wilc_get_chipid(struct wilc *wilc, bool update) in wilc_get_chipid() argument
1421 wilc->hif_func->hif_read_reg(wilc, WILC_CHIPID, &tempchipid); in wilc_get_chipid()
1422 wilc->hif_func->hif_read_reg(wilc, WILC_RF_REVISION_ID, in wilc_get_chipid()
1447 struct wilc *wilc; in wilc_wlan_init() local
1449 wilc = vif->wilc; in wilc_wlan_init()
1451 wilc->quit = 0; in wilc_wlan_init()
1453 if (wilc->hif_func->hif_init(wilc, false)) { in wilc_wlan_init()
1458 if (!wilc->tx_buffer) in wilc_wlan_init()
1459 wilc->tx_buffer = kmalloc(WILC_TX_BUFF_SIZE, GFP_KERNEL); in wilc_wlan_init()
1461 if (!wilc->tx_buffer) { in wilc_wlan_init()
1466 if (!wilc->rx_buffer) in wilc_wlan_init()
1467 wilc->rx_buffer = kmalloc(WILC_RX_BUFF_SIZE, GFP_KERNEL); in wilc_wlan_init()
1469 if (!wilc->rx_buffer) { in wilc_wlan_init()
1483 kfree(wilc->rx_buffer); in wilc_wlan_init()
1484 wilc->rx_buffer = NULL; in wilc_wlan_init()
1485 kfree(wilc->tx_buffer); in wilc_wlan_init()
1486 wilc->tx_buffer = NULL; in wilc_wlan_init()