Lines Matching full:wilc

15 static inline void acquire_bus(struct wilc *wilc, enum bus_acquire acquire)  in acquire_bus()  argument
17 mutex_lock(&wilc->hif_cs); in acquire_bus()
18 if (acquire == WILC_BUS_ACQUIRE_AND_WAKEUP && wilc->power_save_mode) in acquire_bus()
19 chip_wakeup(wilc); in acquire_bus()
22 static inline void release_bus(struct wilc *wilc, enum bus_release release) in release_bus() argument
24 if (release == WILC_BUS_RELEASE_ALLOW_SLEEP && wilc->power_save_mode) in release_bus()
25 chip_allow_sleep(wilc); in release_bus()
26 mutex_unlock(&wilc->hif_cs); in release_bus()
29 static void wilc_wlan_txq_remove(struct wilc *wilc, u8 q_num, in wilc_wlan_txq_remove() argument
33 wilc->txq_entries -= 1; in wilc_wlan_txq_remove()
34 wilc->txq[q_num].count--; in wilc_wlan_txq_remove()
38 wilc_wlan_txq_remove_from_head(struct wilc *wilc, u8 q_num) in wilc_wlan_txq_remove_from_head() argument
43 spin_lock_irqsave(&wilc->txq_spinlock, flags); in wilc_wlan_txq_remove_from_head()
45 if (!list_empty(&wilc->txq[q_num].txq_head.list)) { in wilc_wlan_txq_remove_from_head()
46 tqe = list_first_entry(&wilc->txq[q_num].txq_head.list, in wilc_wlan_txq_remove_from_head()
49 wilc->txq_entries -= 1; in wilc_wlan_txq_remove_from_head()
50 wilc->txq[q_num].count--; in wilc_wlan_txq_remove_from_head()
52 spin_unlock_irqrestore(&wilc->txq_spinlock, flags); in wilc_wlan_txq_remove_from_head()
61 struct wilc *wilc = vif->wilc; in wilc_wlan_txq_add_to_tail() local
63 spin_lock_irqsave(&wilc->txq_spinlock, flags); in wilc_wlan_txq_add_to_tail()
65 list_add_tail(&tqe->list, &wilc->txq[q_num].txq_head.list); in wilc_wlan_txq_add_to_tail()
66 wilc->txq_entries += 1; in wilc_wlan_txq_add_to_tail()
67 wilc->txq[q_num].count++; in wilc_wlan_txq_add_to_tail()
69 spin_unlock_irqrestore(&wilc->txq_spinlock, flags); in wilc_wlan_txq_add_to_tail()
71 complete(&wilc->txq_event); in wilc_wlan_txq_add_to_tail()
78 struct wilc *wilc = vif->wilc; in wilc_wlan_txq_add_to_head() local
80 mutex_lock(&wilc->txq_add_to_head_cs); in wilc_wlan_txq_add_to_head()
82 spin_lock_irqsave(&wilc->txq_spinlock, flags); in wilc_wlan_txq_add_to_head()
84 list_add(&tqe->list, &wilc->txq[q_num].txq_head.list); in wilc_wlan_txq_add_to_head()
85 wilc->txq_entries += 1; in wilc_wlan_txq_add_to_head()
86 wilc->txq[q_num].count++; in wilc_wlan_txq_add_to_head()
88 spin_unlock_irqrestore(&wilc->txq_spinlock, flags); in wilc_wlan_txq_add_to_head()
89 mutex_unlock(&wilc->txq_add_to_head_cs); in wilc_wlan_txq_add_to_head()
90 complete(&wilc->txq_event); in wilc_wlan_txq_add_to_head()
141 struct wilc *wilc = vif->wilc; in tcp_process() local
147 spin_lock_irqsave(&wilc->txq_spinlock, flags); in tcp_process()
183 spin_unlock_irqrestore(&wilc->txq_spinlock, flags); in tcp_process()
189 struct wilc *wilc = vif->wilc; in wilc_wlan_txq_filter_dup_tcp_ack() local
195 spin_lock_irqsave(&wilc->txq_spinlock, flags); in wilc_wlan_txq_filter_dup_tcp_ack()
216 wilc_wlan_txq_remove(wilc, tqe->q_num, tqe); in wilc_wlan_txq_filter_dup_tcp_ack()
234 spin_unlock_irqrestore(&wilc->txq_spinlock, flags); in wilc_wlan_txq_filter_dup_tcp_ack()
237 wait_for_completion_timeout(&wilc->txq_event, in wilc_wlan_txq_filter_dup_tcp_ack()
252 struct wilc *wilc = vif->wilc; in wilc_wlan_txq_add_cfg_pkt() local
255 if (wilc->quit) { in wilc_wlan_txq_add_cfg_pkt()
257 complete(&wilc->cfg_event); in wilc_wlan_txq_add_cfg_pkt()
263 complete(&wilc->cfg_event); in wilc_wlan_txq_add_cfg_pkt()
281 static bool is_ac_q_limit(struct wilc *wl, u8 q_num) in is_ac_q_limit()
328 static inline u8 ac_classify(struct wilc *wilc, struct sk_buff *skb) in ac_classify() argument
367 static inline int ac_balance(struct wilc *wl, u8 *ratio) in ac_balance()
384 static inline void ac_update_fw_ac_pkt_info(struct wilc *wl, u32 reg) in ac_update_fw_ac_pkt_info()
397 static inline u8 ac_change(struct wilc *wilc, u8 *ac) in ac_change() argument
400 if (wilc->txq[*ac].fw.acm == 0) in ac_change()
415 struct wilc *wilc; in wilc_wlan_txq_add_net_pkt() local
418 wilc = vif->wilc; in wilc_wlan_txq_add_net_pkt()
420 if (wilc->quit) { in wilc_wlan_txq_add_net_pkt()
425 if (!wilc->initialized) { in wilc_wlan_txq_add_net_pkt()
443 q_num = ac_classify(wilc, tx_data->skb); in wilc_wlan_txq_add_net_pkt()
445 if (ac_change(wilc, &q_num)) { in wilc_wlan_txq_add_net_pkt()
451 if (is_ac_q_limit(wilc, q_num)) { in wilc_wlan_txq_add_net_pkt()
461 return wilc->txq_entries; in wilc_wlan_txq_add_net_pkt()
470 struct wilc *wilc; in wilc_wlan_txq_add_mgmt_pkt() local
472 wilc = vif->wilc; in wilc_wlan_txq_add_mgmt_pkt()
474 if (wilc->quit) { in wilc_wlan_txq_add_mgmt_pkt()
479 if (!wilc->initialized) { in wilc_wlan_txq_add_mgmt_pkt()
501 static struct txq_entry_t *wilc_wlan_txq_get_first(struct wilc *wilc, u8 q_num) in wilc_wlan_txq_get_first() argument
506 spin_lock_irqsave(&wilc->txq_spinlock, flags); in wilc_wlan_txq_get_first()
508 if (!list_empty(&wilc->txq[q_num].txq_head.list)) in wilc_wlan_txq_get_first()
509 tqe = list_first_entry(&wilc->txq[q_num].txq_head.list, in wilc_wlan_txq_get_first()
512 spin_unlock_irqrestore(&wilc->txq_spinlock, flags); in wilc_wlan_txq_get_first()
517 static struct txq_entry_t *wilc_wlan_txq_get_next(struct wilc *wilc, in wilc_wlan_txq_get_next() argument
523 spin_lock_irqsave(&wilc->txq_spinlock, flags); in wilc_wlan_txq_get_next()
525 if (!list_is_last(&tqe->list, &wilc->txq[q_num].txq_head.list)) in wilc_wlan_txq_get_next()
529 spin_unlock_irqrestore(&wilc->txq_spinlock, flags); in wilc_wlan_txq_get_next()
534 static void wilc_wlan_rxq_add(struct wilc *wilc, struct rxq_entry_t *rqe) in wilc_wlan_rxq_add() argument
536 if (wilc->quit) in wilc_wlan_rxq_add()
539 mutex_lock(&wilc->rxq_cs); in wilc_wlan_rxq_add()
540 list_add_tail(&rqe->list, &wilc->rxq_head.list); in wilc_wlan_rxq_add()
541 mutex_unlock(&wilc->rxq_cs); in wilc_wlan_rxq_add()
544 static struct rxq_entry_t *wilc_wlan_rxq_remove(struct wilc *wilc) in wilc_wlan_rxq_remove() argument
548 mutex_lock(&wilc->rxq_cs); in wilc_wlan_rxq_remove()
549 if (!list_empty(&wilc->rxq_head.list)) { in wilc_wlan_rxq_remove()
550 rqe = list_first_entry(&wilc->rxq_head.list, struct rxq_entry_t, in wilc_wlan_rxq_remove()
554 mutex_unlock(&wilc->rxq_cs); in wilc_wlan_rxq_remove()
558 void chip_allow_sleep(struct wilc *wilc) in chip_allow_sleep() argument
561 const struct wilc_hif_func *hif_func = wilc->hif_func; in chip_allow_sleep()
568 if (wilc->io_type == WILC_HIF_SDIO) { in chip_allow_sleep()
585 ret = hif_func->hif_read_reg(wilc, to_host_from_fw_reg, &reg); in chip_allow_sleep()
595 ret = hif_func->hif_read_reg(wilc, wakeup_reg, &reg); in chip_allow_sleep()
600 ret = hif_func->hif_write_reg(wilc, wakeup_reg, reg); in chip_allow_sleep()
605 ret = hif_func->hif_read_reg(wilc, from_host_to_fw_reg, &reg); in chip_allow_sleep()
610 ret = hif_func->hif_write_reg(wilc, from_host_to_fw_reg, reg); in chip_allow_sleep()
618 void chip_wakeup(struct wilc *wilc) in chip_wakeup() argument
625 const struct wilc_hif_func *hif_func = wilc->hif_func; in chip_wakeup()
627 if (wilc->io_type == WILC_HIF_SDIO) { in chip_wakeup()
644 ret = hif_func->hif_write_reg(wilc, from_host_to_fw_reg, in chip_wakeup()
650 ret = hif_func->hif_write_reg(wilc, wakeup_reg, in chip_wakeup()
656 ret = hif_func->hif_read_reg(wilc, clk_status_reg, in chip_wakeup()
674 if (wilc->io_type == WILC_HIF_SPI) in chip_wakeup()
675 wilc->hif_func->hif_reset(wilc); in chip_wakeup()
679 void host_wakeup_notify(struct wilc *wilc) in host_wakeup_notify() argument
681 acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); in host_wakeup_notify()
682 wilc->hif_func->hif_write_reg(wilc, WILC_CORTUS_INTERRUPT_2, 1); in host_wakeup_notify()
683 release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); in host_wakeup_notify()
687 void host_sleep_notify(struct wilc *wilc) in host_sleep_notify() argument
689 acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); in host_sleep_notify()
690 wilc->hif_func->hif_write_reg(wilc, WILC_CORTUS_INTERRUPT_1, 1); in host_sleep_notify()
691 release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); in host_sleep_notify()
695 int wilc_wlan_handle_txq(struct wilc *wilc, u32 *txq_count) in wilc_wlan_handle_txq() argument
712 u32 *vmm_table = wilc->vmm_table; in wilc_wlan_handle_txq()
716 u8 *txb = wilc->tx_buffer; in wilc_wlan_handle_txq()
719 if (wilc->quit) in wilc_wlan_handle_txq()
722 if (ac_balance(wilc, ac_desired_ratio)) in wilc_wlan_handle_txq()
725 mutex_lock(&wilc->txq_add_to_head_cs); in wilc_wlan_handle_txq()
727 srcu_idx = srcu_read_lock(&wilc->srcu); in wilc_wlan_handle_txq()
728 wilc_for_each_vif(wilc, vif) in wilc_wlan_handle_txq()
730 srcu_read_unlock(&wilc->srcu, srcu_idx); in wilc_wlan_handle_txq()
733 tqe_q[ac] = wilc_wlan_txq_get_first(wilc, ac); in wilc_wlan_handle_txq()
776 tqe_q[ac] = wilc_wlan_txq_get_next(wilc, in wilc_wlan_handle_txq()
788 acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); in wilc_wlan_handle_txq()
790 func = wilc->hif_func; in wilc_wlan_handle_txq()
792 ret = func->hif_read_reg(wilc, WILC_HOST_TX_CTRL, &reg); in wilc_wlan_handle_txq()
797 ac_update_fw_ac_pkt_info(wilc, reg); in wilc_wlan_handle_txq()
804 ret = func->hif_write_reg(wilc, WILC_HOST_TX_CTRL, 0); in wilc_wlan_handle_txq()
807 } while (!wilc->quit); in wilc_wlan_handle_txq()
814 ret = func->hif_block_tx(wilc, in wilc_wlan_handle_txq()
821 ret = func->hif_write_reg(wilc, WILC_HOST_VMM_CTL, 0x2); in wilc_wlan_handle_txq()
826 ret = func->hif_read_reg(wilc, WILC_HOST_VMM_CTL, &reg); in wilc_wlan_handle_txq()
835 ret = func->hif_write_reg(wilc, WILC_HOST_VMM_CTL, 0x0); in wilc_wlan_handle_txq()
843 ret = func->hif_read_reg(wilc, WILC_HOST_TX_CTRL, &reg); in wilc_wlan_handle_txq()
847 ret = func->hif_write_reg(wilc, WILC_HOST_TX_CTRL, reg); in wilc_wlan_handle_txq()
863 release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); in wilc_wlan_handle_txq()
876 tqe = wilc_wlan_txq_remove_from_head(wilc, vmm_entries_ac[i]); in wilc_wlan_handle_txq()
923 wilc->txq[i].fw.count += ac_pkt_num_to_chip[i]; in wilc_wlan_handle_txq()
925 acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); in wilc_wlan_handle_txq()
927 ret = func->hif_clear_int_ext(wilc, ENABLE_TX_VMM); in wilc_wlan_handle_txq()
931 ret = func->hif_block_tx_ext(wilc, 0, txb, offset); in wilc_wlan_handle_txq()
934 release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); in wilc_wlan_handle_txq()
937 mutex_unlock(&wilc->txq_add_to_head_cs); in wilc_wlan_handle_txq()
940 *txq_count = wilc->txq_entries; in wilc_wlan_handle_txq()
944 static void wilc_wlan_handle_rx_buff(struct wilc *wilc, u8 *buffer, int size) in wilc_wlan_handle_rx_buff() argument
966 wilc_wfi_mgmt_rx(wilc, buff_ptr, pkt_len, in wilc_wlan_handle_rx_buff()
970 wilc_frmw_to_host(wilc, buff_ptr, pkt_len, in wilc_wlan_handle_rx_buff()
977 wilc_wlan_cfg_indicate_rx(wilc, buff_ptr, in wilc_wlan_handle_rx_buff()
981 if (wilc->cfg_seq_no == rsp.seq_no) in wilc_wlan_handle_rx_buff()
982 complete(&wilc->cfg_event); in wilc_wlan_handle_rx_buff()
984 wilc_mac_indicate(wilc); in wilc_wlan_handle_rx_buff()
992 static void wilc_wlan_handle_rxq(struct wilc *wilc) in wilc_wlan_handle_rxq() argument
998 while (!wilc->quit) { in wilc_wlan_handle_rxq()
999 rqe = wilc_wlan_rxq_remove(wilc); in wilc_wlan_handle_rxq()
1005 wilc_wlan_handle_rx_buff(wilc, buffer, size); in wilc_wlan_handle_rxq()
1009 if (wilc->quit) in wilc_wlan_handle_rxq()
1010 complete(&wilc->cfg_event); in wilc_wlan_handle_rxq()
1013 static void wilc_unknown_isr_ext(struct wilc *wilc) in wilc_unknown_isr_ext() argument
1015 wilc->hif_func->hif_clear_int_ext(wilc, 0); in wilc_unknown_isr_ext()
1018 static void wilc_wlan_handle_isr_ext(struct wilc *wilc, u32 int_status) in wilc_wlan_handle_isr_ext() argument
1020 u32 offset = wilc->rx_buffer_offset; in wilc_wlan_handle_isr_ext()
1030 wilc->hif_func->hif_read_size(wilc, &size); in wilc_wlan_handle_isr_ext()
1041 buffer = &wilc->rx_buffer[offset]; in wilc_wlan_handle_isr_ext()
1043 wilc->hif_func->hif_clear_int_ext(wilc, DATA_INT_CLR | ENABLE_RX_VMM); in wilc_wlan_handle_isr_ext()
1044 ret = wilc->hif_func->hif_block_rx_ext(wilc, 0, buffer, size); in wilc_wlan_handle_isr_ext()
1049 wilc->rx_buffer_offset = offset; in wilc_wlan_handle_isr_ext()
1056 wilc_wlan_rxq_add(wilc, rqe); in wilc_wlan_handle_isr_ext()
1057 wilc_wlan_handle_rxq(wilc); in wilc_wlan_handle_isr_ext()
1060 void wilc_handle_isr(struct wilc *wilc) in wilc_handle_isr() argument
1064 acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); in wilc_handle_isr()
1065 wilc->hif_func->hif_read_int(wilc, &int_status); in wilc_handle_isr()
1068 wilc_wlan_handle_isr_ext(wilc, int_status); in wilc_handle_isr()
1071 wilc_unknown_isr_ext(wilc); in wilc_handle_isr()
1073 release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); in wilc_handle_isr()
1077 int wilc_wlan_firmware_download(struct wilc *wilc, const u8 *buffer, in wilc_wlan_firmware_download() argument
1095 acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); in wilc_wlan_firmware_download()
1097 wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, &reg); in wilc_wlan_firmware_download()
1099 ret = wilc->hif_func->hif_write_reg(wilc, WILC_GLB_RESET_0, reg); in wilc_wlan_firmware_download()
1100 wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, &reg); in wilc_wlan_firmware_download()
1104 release_bus(wilc, WILC_BUS_RELEASE_ONLY); in wilc_wlan_firmware_download()
1108 acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); in wilc_wlan_firmware_download()
1117 ret = wilc->hif_func->hif_block_tx(wilc, addr, in wilc_wlan_firmware_download()
1126 release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP); in wilc_wlan_firmware_download()
1142 int wilc_wlan_start(struct wilc *wilc) in wilc_wlan_start() argument
1148 if (wilc->io_type == WILC_HIF_SDIO) { in wilc_wlan_start()
1151 } else if (wilc->io_type == WILC_HIF_SPI) { in wilc_wlan_start()
1154 acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); in wilc_wlan_start()
1155 ret = wilc->hif_func->hif_write_reg(wilc, WILC_VMM_CORE_CFG, reg); in wilc_wlan_start()
1160 if (wilc->io_type == WILC_HIF_SDIO && wilc->dev_irq_num) in wilc_wlan_start()
1163 ret = wilc->hif_func->hif_write_reg(wilc, WILC_GP_REG_1, reg); in wilc_wlan_start()
1167 wilc->hif_func->hif_sync_ext(wilc, NUM_INT_EXT); in wilc_wlan_start()
1169 ret = wilc->hif_func->hif_read_reg(wilc, WILC_CHIPID, &chipid); in wilc_wlan_start()
1173 wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, &reg); in wilc_wlan_start()
1176 wilc->hif_func->hif_write_reg(wilc, WILC_GLB_RESET_0, reg); in wilc_wlan_start()
1177 wilc->hif_func->hif_read_reg(wilc, WILC_GLB_RESET_0, &reg); in wilc_wlan_start()
1181 ret = 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, &reg); in wilc_wlan_start()
1185 release_bus(wilc, WILC_BUS_RELEASE_ONLY); in wilc_wlan_start()
1189 int wilc_wlan_stop(struct wilc *wilc, struct wilc_vif *vif) in wilc_wlan_stop() argument
1194 acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); in wilc_wlan_stop()
1196 ret = wilc->hif_func->hif_read_reg(wilc, GLOBAL_MODE_CONTROL, &reg); in wilc_wlan_stop()
1201 ret = wilc->hif_func->hif_write_reg(wilc, GLOBAL_MODE_CONTROL, reg); in wilc_wlan_stop()
1205 ret = wilc->hif_func->hif_read_reg(wilc, PWR_SEQ_MISC_CTRL, &reg); in wilc_wlan_stop()
1210 ret = wilc->hif_func->hif_write_reg(wilc, PWR_SEQ_MISC_CTRL, reg); in wilc_wlan_stop()
1214 ret = wilc->hif_func->hif_read_reg(wilc, WILC_GP_REG_0, &reg); in wilc_wlan_stop()
1220 ret = wilc->hif_func->hif_write_reg(wilc, WILC_GP_REG_0, 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_AND_WAKEUP); 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_ALLOW_SLEEP); 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()
1476 int wilc_load_mac_from_nv(struct wilc *wl) in wilc_load_mac_from_nv()
1529 struct wilc *wilc; in wilc_wlan_init() local
1531 wilc = vif->wilc; in wilc_wlan_init()
1533 wilc->quit = 0; in wilc_wlan_init()
1535 if (!wilc->hif_func->hif_is_init(wilc)) { in wilc_wlan_init()
1536 acquire_bus(wilc, WILC_BUS_ACQUIRE_ONLY); in wilc_wlan_init()
1537 ret = wilc->hif_func->hif_init(wilc, false); in wilc_wlan_init()
1538 release_bus(wilc, WILC_BUS_RELEASE_ONLY); in wilc_wlan_init()
1543 if (!wilc->vmm_table) in wilc_wlan_init()
1544 wilc->vmm_table = kcalloc(WILC_VMM_TBL_SIZE, sizeof(u32), GFP_KERNEL); in wilc_wlan_init()
1546 if (!wilc->vmm_table) { in wilc_wlan_init()
1551 if (!wilc->tx_buffer) in wilc_wlan_init()
1552 wilc->tx_buffer = kmalloc(WILC_TX_BUFF_SIZE, GFP_KERNEL); in wilc_wlan_init()
1554 if (!wilc->tx_buffer) { in wilc_wlan_init()
1559 if (!wilc->rx_buffer) in wilc_wlan_init()
1560 wilc->rx_buffer = kmalloc(WILC_RX_BUFF_SIZE, GFP_KERNEL); in wilc_wlan_init()
1562 if (!wilc->rx_buffer) { in wilc_wlan_init()
1575 kfree(wilc->vmm_table); in wilc_wlan_init()
1576 wilc->vmm_table = NULL; in wilc_wlan_init()
1577 kfree(wilc->rx_buffer); in wilc_wlan_init()
1578 wilc->rx_buffer = NULL; in wilc_wlan_init()
1579 kfree(wilc->tx_buffer); in wilc_wlan_init()
1580 wilc->tx_buffer = NULL; in wilc_wlan_init()