Lines Matching full:wilc
20 static inline void acquire_bus(struct wilc *wilc, enum bus_acquire acquire) in acquire_bus() argument
22 mutex_lock(&wilc->hif_cs); in acquire_bus()
23 if (acquire == WILC_BUS_ACQUIRE_AND_WAKEUP && wilc->power_save_mode) in acquire_bus()
24 chip_wakeup(wilc); in acquire_bus()
27 static inline void release_bus(struct wilc *wilc, enum bus_release release) in release_bus() argument
29 if (release == WILC_BUS_RELEASE_ALLOW_SLEEP && wilc->power_save_mode) in release_bus()
30 chip_allow_sleep(wilc); in release_bus()
31 mutex_unlock(&wilc->hif_cs); in release_bus()
34 static void wilc_wlan_txq_remove(struct wilc *wilc, u8 q_num, in wilc_wlan_txq_remove() argument
38 wilc->txq_entries -= 1; in wilc_wlan_txq_remove()
39 wilc->txq[q_num].count--; in wilc_wlan_txq_remove()
43 wilc_wlan_txq_remove_from_head(struct wilc *wilc, u8 q_num) in wilc_wlan_txq_remove_from_head() argument
48 spin_lock_irqsave(&wilc->txq_spinlock, flags); in wilc_wlan_txq_remove_from_head()
50 if (!list_empty(&wilc->txq[q_num].txq_head.list)) { in wilc_wlan_txq_remove_from_head()
51 tqe = list_first_entry(&wilc->txq[q_num].txq_head.list, in wilc_wlan_txq_remove_from_head()
54 wilc->txq_entries -= 1; in wilc_wlan_txq_remove_from_head()
55 wilc->txq[q_num].count--; in wilc_wlan_txq_remove_from_head()
57 spin_unlock_irqrestore(&wilc->txq_spinlock, flags); in wilc_wlan_txq_remove_from_head()
66 struct wilc *wilc = vif->wilc; in wilc_wlan_txq_add_to_tail() local
68 spin_lock_irqsave(&wilc->txq_spinlock, flags); in wilc_wlan_txq_add_to_tail()
70 list_add_tail(&tqe->list, &wilc->txq[q_num].txq_head.list); in wilc_wlan_txq_add_to_tail()
71 wilc->txq_entries += 1; in wilc_wlan_txq_add_to_tail()
72 wilc->txq[q_num].count++; in wilc_wlan_txq_add_to_tail()
74 spin_unlock_irqrestore(&wilc->txq_spinlock, flags); in wilc_wlan_txq_add_to_tail()
76 complete(&wilc->txq_event); in wilc_wlan_txq_add_to_tail()
83 struct wilc *wilc = vif->wilc; in wilc_wlan_txq_add_to_head() local
85 mutex_lock(&wilc->txq_add_to_head_cs); in wilc_wlan_txq_add_to_head()
87 spin_lock_irqsave(&wilc->txq_spinlock, flags); in wilc_wlan_txq_add_to_head()
89 list_add(&tqe->list, &wilc->txq[q_num].txq_head.list); in wilc_wlan_txq_add_to_head()
90 wilc->txq_entries += 1; in wilc_wlan_txq_add_to_head()
91 wilc->txq[q_num].count++; in wilc_wlan_txq_add_to_head()
93 spin_unlock_irqrestore(&wilc->txq_spinlock, flags); in wilc_wlan_txq_add_to_head()
94 mutex_unlock(&wilc->txq_add_to_head_cs); in wilc_wlan_txq_add_to_head()
95 complete(&wilc->txq_event); in wilc_wlan_txq_add_to_head()
146 struct wilc *wilc = vif->wilc; in tcp_process() local
152 spin_lock_irqsave(&wilc->txq_spinlock, flags); in tcp_process()
188 spin_unlock_irqrestore(&wilc->txq_spinlock, flags); in tcp_process()
194 struct wilc *wilc = vif->wilc; in wilc_wlan_txq_filter_dup_tcp_ack() local
200 spin_lock_irqsave(&wilc->txq_spinlock, flags); in wilc_wlan_txq_filter_dup_tcp_ack()
221 wilc_wlan_txq_remove(wilc, tqe->q_num, tqe); in wilc_wlan_txq_filter_dup_tcp_ack()
239 spin_unlock_irqrestore(&wilc->txq_spinlock, flags); in wilc_wlan_txq_filter_dup_tcp_ack()
242 wait_for_completion_timeout(&wilc->txq_event, in wilc_wlan_txq_filter_dup_tcp_ack()
257 struct wilc *wilc = vif->wilc; in wilc_wlan_txq_add_cfg_pkt() local
260 if (wilc->quit) { in wilc_wlan_txq_add_cfg_pkt()
262 complete(&wilc->cfg_event); in wilc_wlan_txq_add_cfg_pkt()
268 complete(&wilc->cfg_event); in wilc_wlan_txq_add_cfg_pkt()
286 static bool is_ac_q_limit(struct wilc *wl, u8 q_num) in is_ac_q_limit()
333 static inline u8 ac_classify(struct wilc *wilc, struct sk_buff *skb) in ac_classify() argument
372 static inline int ac_balance(struct wilc *wl, u8 *ratio) in ac_balance()
389 static inline void ac_update_fw_ac_pkt_info(struct wilc *wl, u32 reg) in ac_update_fw_ac_pkt_info()
402 static inline u8 ac_change(struct wilc *wilc, u8 *ac) in ac_change() argument
405 if (wilc->txq[*ac].fw.acm == 0) in ac_change()
420 struct wilc *wilc; in wilc_wlan_txq_add_net_pkt() local
423 wilc = vif->wilc; in wilc_wlan_txq_add_net_pkt()
425 if (wilc->quit) { in wilc_wlan_txq_add_net_pkt()
430 if (!wilc->initialized) { in wilc_wlan_txq_add_net_pkt()
448 q_num = ac_classify(wilc, tx_data->skb); in wilc_wlan_txq_add_net_pkt()
450 if (ac_change(wilc, &q_num)) { in wilc_wlan_txq_add_net_pkt()
456 if (is_ac_q_limit(wilc, q_num)) { in wilc_wlan_txq_add_net_pkt()
466 return wilc->txq_entries; in wilc_wlan_txq_add_net_pkt()
475 struct wilc *wilc; in wilc_wlan_txq_add_mgmt_pkt() local
477 wilc = vif->wilc; in wilc_wlan_txq_add_mgmt_pkt()
479 if (wilc->quit) { in wilc_wlan_txq_add_mgmt_pkt()
484 if (!wilc->initialized) { in wilc_wlan_txq_add_mgmt_pkt()
506 static struct txq_entry_t *wilc_wlan_txq_get_first(struct wilc *wilc, u8 q_num) in wilc_wlan_txq_get_first() argument
511 spin_lock_irqsave(&wilc->txq_spinlock, flags); in wilc_wlan_txq_get_first()
513 if (!list_empty(&wilc->txq[q_num].txq_head.list)) in wilc_wlan_txq_get_first()
514 tqe = list_first_entry(&wilc->txq[q_num].txq_head.list, in wilc_wlan_txq_get_first()
517 spin_unlock_irqrestore(&wilc->txq_spinlock, flags); in wilc_wlan_txq_get_first()
522 static struct txq_entry_t *wilc_wlan_txq_get_next(struct wilc *wilc, in wilc_wlan_txq_get_next() argument
528 spin_lock_irqsave(&wilc->txq_spinlock, flags); in wilc_wlan_txq_get_next()
530 if (!list_is_last(&tqe->list, &wilc->txq[q_num].txq_head.list)) in wilc_wlan_txq_get_next()
534 spin_unlock_irqrestore(&wilc->txq_spinlock, flags); in wilc_wlan_txq_get_next()
539 static void wilc_wlan_rxq_add(struct wilc *wilc, struct rxq_entry_t *rqe) in wilc_wlan_rxq_add() argument
541 if (wilc->quit) in wilc_wlan_rxq_add()
544 mutex_lock(&wilc->rxq_cs); in wilc_wlan_rxq_add()
545 list_add_tail(&rqe->list, &wilc->rxq_head.list); in wilc_wlan_rxq_add()
546 mutex_unlock(&wilc->rxq_cs); in wilc_wlan_rxq_add()
549 static struct rxq_entry_t *wilc_wlan_rxq_remove(struct wilc *wilc) in wilc_wlan_rxq_remove() argument
553 mutex_lock(&wilc->rxq_cs); in wilc_wlan_rxq_remove()
554 if (!list_empty(&wilc->rxq_head.list)) { in wilc_wlan_rxq_remove()
555 rqe = list_first_entry(&wilc->rxq_head.list, struct rxq_entry_t, in wilc_wlan_rxq_remove()
559 mutex_unlock(&wilc->rxq_cs); in wilc_wlan_rxq_remove()
563 void chip_allow_sleep(struct wilc *wilc) in chip_allow_sleep() argument
566 const struct wilc_hif_func *hif_func = wilc->hif_func; in chip_allow_sleep()
573 if (wilc->io_type == WILC_HIF_SDIO) { in chip_allow_sleep()
590 ret = hif_func->hif_read_reg(wilc, to_host_from_fw_reg, ®); in chip_allow_sleep()
600 ret = hif_func->hif_read_reg(wilc, wakeup_reg, ®); in chip_allow_sleep()
605 ret = hif_func->hif_write_reg(wilc, wakeup_reg, reg); in chip_allow_sleep()
610 ret = hif_func->hif_read_reg(wilc, from_host_to_fw_reg, ®); in chip_allow_sleep()
615 ret = hif_func->hif_write_reg(wilc, from_host_to_fw_reg, reg); in chip_allow_sleep()
623 void chip_wakeup(struct wilc *wilc) in chip_wakeup() argument
630 const struct wilc_hif_func *hif_func = wilc->hif_func; in chip_wakeup()
632 if (wilc->io_type == WILC_HIF_SDIO) { in chip_wakeup()
649 ret = hif_func->hif_write_reg(wilc, from_host_to_fw_reg, in chip_wakeup()
655 ret = hif_func->hif_write_reg(wilc, wakeup_reg, in chip_wakeup()
661 ret = hif_func->hif_read_reg(wilc, clk_status_reg, in chip_wakeup()
679 if (wilc->io_type == WILC_HIF_SPI) in chip_wakeup()
680 wilc->hif_func->hif_reset(wilc); in chip_wakeup()
684 void host_wakeup_notify(struct wilc *wilc) in host_wakeup_notify() argument
686 acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); in host_wakeup_notify()
687 wilc->hif_func->hif_write_reg(wilc, WILC_CORTUS_INTERRUPT_2, 1); in host_wakeup_notify()
688 release_bus(wilc, WILC_BUS_RELEASE_ONLY); in host_wakeup_notify()
692 void host_sleep_notify(struct wilc *wilc) in host_sleep_notify() argument
694 acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); in host_sleep_notify()
695 wilc->hif_func->hif_write_reg(wilc, WILC_CORTUS_INTERRUPT_1, 1); in host_sleep_notify()
696 release_bus(wilc, WILC_BUS_RELEASE_ONLY); in host_sleep_notify()
700 int wilc_wlan_handle_txq(struct wilc *wilc, u32 *txq_count) in wilc_wlan_handle_txq() argument
717 u32 *vmm_table = wilc->vmm_table; in wilc_wlan_handle_txq()
721 u8 *txb = wilc->tx_buffer; in wilc_wlan_handle_txq()
724 if (wilc->quit) in wilc_wlan_handle_txq()
727 if (ac_balance(wilc, ac_desired_ratio)) in wilc_wlan_handle_txq()
730 mutex_lock(&wilc->txq_add_to_head_cs); in wilc_wlan_handle_txq()
732 srcu_idx = srcu_read_lock(&wilc->srcu); in wilc_wlan_handle_txq()
733 list_for_each_entry_rcu(vif, &wilc->vif_list, list) in wilc_wlan_handle_txq()
735 srcu_read_unlock(&wilc->srcu, srcu_idx); in wilc_wlan_handle_txq()
738 tqe_q[ac] = wilc_wlan_txq_get_first(wilc, ac); in wilc_wlan_handle_txq()
781 tqe_q[ac] = wilc_wlan_txq_get_next(wilc, in wilc_wlan_handle_txq()
793 acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); in wilc_wlan_handle_txq()
795 func = wilc->hif_func; in wilc_wlan_handle_txq()
797 ret = func->hif_read_reg(wilc, WILC_HOST_TX_CTRL, ®); in wilc_wlan_handle_txq()
802 ac_update_fw_ac_pkt_info(wilc, reg); in wilc_wlan_handle_txq()
809 ret = func->hif_write_reg(wilc, WILC_HOST_TX_CTRL, 0); in wilc_wlan_handle_txq()
812 } while (!wilc->quit); in wilc_wlan_handle_txq()
819 ret = func->hif_block_tx(wilc, in wilc_wlan_handle_txq()
826 ret = func->hif_write_reg(wilc, WILC_HOST_VMM_CTL, 0x2); in wilc_wlan_handle_txq()
831 ret = func->hif_read_reg(wilc, WILC_HOST_VMM_CTL, ®); in wilc_wlan_handle_txq()
840 ret = func->hif_write_reg(wilc, WILC_HOST_VMM_CTL, 0x0); in wilc_wlan_handle_txq()
848 ret = func->hif_read_reg(wilc, WILC_HOST_TX_CTRL, ®); in wilc_wlan_handle_txq()
852 ret = func->hif_write_reg(wilc, WILC_HOST_TX_CTRL, reg); in wilc_wlan_handle_txq()
868 release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); in wilc_wlan_handle_txq()
881 tqe = wilc_wlan_txq_remove_from_head(wilc, vmm_entries_ac[i]); in wilc_wlan_handle_txq()
928 wilc->txq[i].fw.count += ac_pkt_num_to_chip[i]; in wilc_wlan_handle_txq()
930 acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); in wilc_wlan_handle_txq()
932 ret = func->hif_clear_int_ext(wilc, ENABLE_TX_VMM); in wilc_wlan_handle_txq()
936 ret = func->hif_block_tx_ext(wilc, 0, txb, offset); in wilc_wlan_handle_txq()
939 release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); in wilc_wlan_handle_txq()
942 mutex_unlock(&wilc->txq_add_to_head_cs); in wilc_wlan_handle_txq()
945 *txq_count = wilc->txq_entries; in wilc_wlan_handle_txq()
949 static void wilc_wlan_handle_rx_buff(struct wilc *wilc, u8 *buffer, int size) in wilc_wlan_handle_rx_buff() argument
971 wilc_wfi_mgmt_rx(wilc, buff_ptr, pkt_len, in wilc_wlan_handle_rx_buff()
975 wilc_frmw_to_host(wilc, buff_ptr, pkt_len, in wilc_wlan_handle_rx_buff()
982 wilc_wlan_cfg_indicate_rx(wilc, buff_ptr, in wilc_wlan_handle_rx_buff()
986 if (wilc->cfg_seq_no == rsp.seq_no) in wilc_wlan_handle_rx_buff()
987 complete(&wilc->cfg_event); in wilc_wlan_handle_rx_buff()
989 wilc_mac_indicate(wilc); in wilc_wlan_handle_rx_buff()
997 static void wilc_wlan_handle_rxq(struct wilc *wilc) in wilc_wlan_handle_rxq() argument
1003 while (!wilc->quit) { in wilc_wlan_handle_rxq()
1004 rqe = wilc_wlan_rxq_remove(wilc); in wilc_wlan_handle_rxq()
1010 wilc_wlan_handle_rx_buff(wilc, buffer, size); in wilc_wlan_handle_rxq()
1014 if (wilc->quit) in wilc_wlan_handle_rxq()
1015 complete(&wilc->cfg_event); in wilc_wlan_handle_rxq()
1018 static void wilc_unknown_isr_ext(struct wilc *wilc) in wilc_unknown_isr_ext() argument
1020 wilc->hif_func->hif_clear_int_ext(wilc, 0); in wilc_unknown_isr_ext()
1023 static void wilc_wlan_handle_isr_ext(struct wilc *wilc, u32 int_status) in wilc_wlan_handle_isr_ext() argument
1025 u32 offset = wilc->rx_buffer_offset; in wilc_wlan_handle_isr_ext()
1035 wilc->hif_func->hif_read_size(wilc, &size); in wilc_wlan_handle_isr_ext()
1046 buffer = &wilc->rx_buffer[offset]; in wilc_wlan_handle_isr_ext()
1048 wilc->hif_func->hif_clear_int_ext(wilc, DATA_INT_CLR | ENABLE_RX_VMM); in wilc_wlan_handle_isr_ext()
1049 ret = wilc->hif_func->hif_block_rx_ext(wilc, 0, buffer, size); in wilc_wlan_handle_isr_ext()
1054 wilc->rx_buffer_offset = offset; in wilc_wlan_handle_isr_ext()
1061 wilc_wlan_rxq_add(wilc, rqe); in wilc_wlan_handle_isr_ext()
1062 wilc_wlan_handle_rxq(wilc); in wilc_wlan_handle_isr_ext()
1065 void wilc_handle_isr(struct wilc *wilc) in wilc_handle_isr() argument
1069 acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); in wilc_handle_isr()
1070 wilc->hif_func->hif_read_int(wilc, &int_status); in wilc_handle_isr()
1073 wilc_wlan_handle_isr_ext(wilc, int_status); in wilc_handle_isr()
1076 wilc_unknown_isr_ext(wilc); in wilc_handle_isr()
1078 release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); in wilc_handle_isr()
1082 int wilc_wlan_firmware_download(struct wilc *wilc, const u8 *buffer, in wilc_wlan_firmware_download() argument
1100 acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); in wilc_wlan_firmware_download()
1102 wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, ®); in wilc_wlan_firmware_download()
1104 ret = wilc->hif_func->hif_write_reg(wilc, WILC_GLB_RESET_0, reg); in wilc_wlan_firmware_download()
1105 wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, ®); in wilc_wlan_firmware_download()
1109 release_bus(wilc, WILC_BUS_RELEASE_ONLY); in wilc_wlan_firmware_download()
1113 acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); in wilc_wlan_firmware_download()
1122 ret = wilc->hif_func->hif_block_tx(wilc, addr, in wilc_wlan_firmware_download()
1131 release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); in wilc_wlan_firmware_download()
1147 int wilc_wlan_start(struct wilc *wilc) in wilc_wlan_start() argument
1153 if (wilc->io_type == WILC_HIF_SDIO) { in wilc_wlan_start()
1156 } else if (wilc->io_type == WILC_HIF_SPI) { in wilc_wlan_start()
1159 acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); in wilc_wlan_start()
1160 ret = wilc->hif_func->hif_write_reg(wilc, WILC_VMM_CORE_CFG, reg); in wilc_wlan_start()
1165 if (wilc->io_type == WILC_HIF_SDIO && wilc->dev_irq_num) in wilc_wlan_start()
1168 ret = wilc->hif_func->hif_write_reg(wilc, WILC_GP_REG_1, reg); in wilc_wlan_start()
1172 wilc->hif_func->hif_sync_ext(wilc, NUM_INT_EXT); in wilc_wlan_start()
1174 ret = wilc->hif_func->hif_read_reg(wilc, WILC_CHIPID, &chipid); in wilc_wlan_start()
1178 wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, ®); in wilc_wlan_start()
1181 wilc->hif_func->hif_write_reg(wilc, WILC_GLB_RESET_0, reg); in wilc_wlan_start()
1182 wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, ®); in wilc_wlan_start()
1186 ret = wilc->hif_func->hif_write_reg(wilc, WILC_GLB_RESET_0, reg); in wilc_wlan_start()
1187 wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, ®); in wilc_wlan_start()
1190 release_bus(wilc, WILC_BUS_RELEASE_ONLY); in wilc_wlan_start()
1194 int wilc_wlan_stop(struct wilc *wilc, struct wilc_vif *vif) in wilc_wlan_stop() argument
1199 acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); in wilc_wlan_stop()
1201 ret = wilc->hif_func->hif_read_reg(wilc, WILC_GP_REG_0, ®); in wilc_wlan_stop()
1207 ret = wilc->hif_func->hif_write_reg(wilc, WILC_GP_REG_0, in wilc_wlan_stop()
1214 ret = wilc->hif_func->hif_read_reg(wilc, WILC_FW_HOST_COMM, ®); in wilc_wlan_stop()
1221 ret = wilc->hif_func->hif_write_reg(wilc, WILC_FW_HOST_COMM, reg); in wilc_wlan_stop()
1230 release_bus(wilc, WILC_BUS_RELEASE_ONLY); in wilc_wlan_stop()
1241 struct wilc *wilc = vif->wilc; in wilc_wlan_cleanup() local
1243 wilc->quit = 1; in wilc_wlan_cleanup()
1245 while ((tqe = wilc_wlan_txq_remove_from_head(wilc, ac))) { in wilc_wlan_cleanup()
1252 while ((rqe = wilc_wlan_rxq_remove(wilc))) in wilc_wlan_cleanup()
1255 kfree(wilc->vmm_table); in wilc_wlan_cleanup()
1256 wilc->vmm_table = NULL; in wilc_wlan_cleanup()
1257 kfree(wilc->rx_buffer); in wilc_wlan_cleanup()
1258 wilc->rx_buffer = NULL; in wilc_wlan_cleanup()
1259 kfree(wilc->tx_buffer); in wilc_wlan_cleanup()
1260 wilc->tx_buffer = NULL; in wilc_wlan_cleanup()
1261 wilc->hif_func->hif_deinit(wilc); in wilc_wlan_cleanup()
1267 struct wilc *wilc = vif->wilc; in wilc_wlan_cfg_commit() local
1268 struct wilc_cfg_frame *cfg = &wilc->cfg_frame; in wilc_wlan_cfg_commit()
1269 int t_len = wilc->cfg_frame_offset + sizeof(struct wilc_cfg_cmd_hdr); in wilc_wlan_cfg_commit()
1276 cfg->hdr.seq_no = wilc->cfg_seq_no % 256; in wilc_wlan_cfg_commit()
1279 wilc->cfg_seq_no = cfg->hdr.seq_no; in wilc_wlan_cfg_commit()
1292 struct wilc *wilc = vif->wilc; in wilc_wlan_cfg_set() local
1294 mutex_lock(&wilc->cfg_cmd_lock); in wilc_wlan_cfg_set()
1297 wilc->cfg_frame_offset = 0; in wilc_wlan_cfg_set()
1299 offset = wilc->cfg_frame_offset; in wilc_wlan_cfg_set()
1300 ret_size = wilc_wlan_cfg_set_wid(wilc->cfg_frame.frame, offset, in wilc_wlan_cfg_set()
1303 wilc->cfg_frame_offset = offset; in wilc_wlan_cfg_set()
1306 mutex_unlock(&wilc->cfg_cmd_lock); in wilc_wlan_cfg_set()
1310 netdev_dbg(vif->ndev, "%s: seqno[%d]\n", __func__, wilc->cfg_seq_no); in wilc_wlan_cfg_set()
1315 if (!wait_for_completion_timeout(&wilc->cfg_event, in wilc_wlan_cfg_set()
1321 wilc->cfg_frame_offset = 0; in wilc_wlan_cfg_set()
1322 wilc->cfg_seq_no += 1; in wilc_wlan_cfg_set()
1323 mutex_unlock(&wilc->cfg_cmd_lock); in wilc_wlan_cfg_set()
1333 struct wilc *wilc = vif->wilc; in wilc_wlan_cfg_get() local
1335 mutex_lock(&wilc->cfg_cmd_lock); in wilc_wlan_cfg_get()
1338 wilc->cfg_frame_offset = 0; in wilc_wlan_cfg_get()
1340 offset = wilc->cfg_frame_offset; in wilc_wlan_cfg_get()
1341 ret_size = wilc_wlan_cfg_get_wid(wilc->cfg_frame.frame, offset, wid); in wilc_wlan_cfg_get()
1343 wilc->cfg_frame_offset = offset; in wilc_wlan_cfg_get()
1346 mutex_unlock(&wilc->cfg_cmd_lock); in wilc_wlan_cfg_get()
1353 if (!wait_for_completion_timeout(&wilc->cfg_event, in wilc_wlan_cfg_get()
1358 wilc->cfg_frame_offset = 0; in wilc_wlan_cfg_get()
1359 wilc->cfg_seq_no += 1; in wilc_wlan_cfg_get()
1360 mutex_unlock(&wilc->cfg_cmd_lock); in wilc_wlan_cfg_get()
1383 wids[i].size = wilc_wlan_cfg_get_val(vif->wilc, in wilc_send_config_pkt()
1411 struct wilc *wilc = vif->wilc; in init_chip() local
1413 acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); in init_chip()
1415 chipid = wilc_get_chipid(wilc, true); in init_chip()
1418 ret = wilc->hif_func->hif_read_reg(wilc, in init_chip()
1426 ret = wilc->hif_func->hif_write_reg(wilc, in init_chip()
1433 ret = wilc->hif_func->hif_write_reg(wilc, in init_chip()
1443 release_bus(wilc, WILC_BUS_RELEASE_ONLY); in init_chip()
1448 u32 wilc_get_chipid(struct wilc *wilc, bool update) in wilc_get_chipid() argument
1453 if (wilc->chipid == 0 || update) { in wilc_get_chipid()
1454 wilc->hif_func->hif_read_reg(wilc, WILC_CHIPID, &chipid); in wilc_get_chipid()
1455 wilc->hif_func->hif_read_reg(wilc, WILC_RF_REVISION_ID, in wilc_get_chipid()
1458 wilc->chipid = 0; in wilc_get_chipid()
1459 return wilc->chipid; in wilc_get_chipid()
1471 wilc->chipid = chipid; in wilc_get_chipid()
1473 return wilc->chipid; in wilc_get_chipid()
1480 struct wilc *wilc; in wilc_wlan_init() local
1482 wilc = vif->wilc; in wilc_wlan_init()
1484 wilc->quit = 0; in wilc_wlan_init()
1486 if (!wilc->hif_func->hif_is_init(wilc)) { in wilc_wlan_init()
1487 acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); in wilc_wlan_init()
1488 ret = wilc->hif_func->hif_init(wilc, false); in wilc_wlan_init()
1489 release_bus(wilc, WILC_BUS_RELEASE_ONLY); in wilc_wlan_init()
1494 if (!wilc->vmm_table) in wilc_wlan_init()
1495 wilc->vmm_table = kcalloc(WILC_VMM_TBL_SIZE, sizeof(u32), GFP_KERNEL); in wilc_wlan_init()
1497 if (!wilc->vmm_table) { in wilc_wlan_init()
1502 if (!wilc->tx_buffer) in wilc_wlan_init()
1503 wilc->tx_buffer = kmalloc(WILC_TX_BUFF_SIZE, GFP_KERNEL); in wilc_wlan_init()
1505 if (!wilc->tx_buffer) { in wilc_wlan_init()
1510 if (!wilc->rx_buffer) in wilc_wlan_init()
1511 wilc->rx_buffer = kmalloc(WILC_RX_BUFF_SIZE, GFP_KERNEL); in wilc_wlan_init()
1513 if (!wilc->rx_buffer) { in wilc_wlan_init()
1526 kfree(wilc->vmm_table); in wilc_wlan_init()
1527 wilc->vmm_table = NULL; in wilc_wlan_init()
1528 kfree(wilc->rx_buffer); in wilc_wlan_init()
1529 wilc->rx_buffer = NULL; in wilc_wlan_init()
1530 kfree(wilc->tx_buffer); in wilc_wlan_init()
1531 wilc->tx_buffer = NULL; in wilc_wlan_init()