Lines Matching +full:cmd +full:- +full:cnt +full:- +full:name
43 struct rsi_hw *adapter = common->priv; in rsi_send_pkt_to_bus()
46 if (common->coex_mode > 1) in rsi_send_pkt_to_bus()
47 mutex_lock(&common->tx_bus_mutex); in rsi_send_pkt_to_bus()
49 status = adapter->host_intf_ops->write_pkt(common->priv, in rsi_send_pkt_to_bus()
50 skb->data, skb->len); in rsi_send_pkt_to_bus()
52 if (common->coex_mode > 1) in rsi_send_pkt_to_bus()
53 mutex_unlock(&common->tx_bus_mutex); in rsi_send_pkt_to_bus()
60 struct rsi_hw *adapter = common->priv; in rsi_prepare_mgmt_desc()
63 struct ieee80211_conf *conf = &adapter->hw->conf; in rsi_prepare_mgmt_desc()
71 if (skb->len > MAX_MGMT_PKT_SIZE) { in rsi_prepare_mgmt_desc()
73 return -EINVAL; in rsi_prepare_mgmt_desc()
77 tx_params = (struct skb_info *)info->driver_data; in rsi_prepare_mgmt_desc()
78 vif = tx_params->vif; in rsi_prepare_mgmt_desc()
86 return -ENOSPC; in rsi_prepare_mgmt_desc()
89 dword_align_bytes = ((unsigned long)skb->data & 0x3f); in rsi_prepare_mgmt_desc()
93 return -ENOSPC; in rsi_prepare_mgmt_desc()
98 tx_params->internal_hdr_size = header_size; in rsi_prepare_mgmt_desc()
99 memset(&skb->data[0], 0, header_size); in rsi_prepare_mgmt_desc()
100 wh = (struct ieee80211_hdr *)&skb->data[header_size]; in rsi_prepare_mgmt_desc()
102 mgmt_desc = (struct rsi_mgmt_desc *)skb->data; in rsi_prepare_mgmt_desc()
103 xtend_desc = (struct rsi_xtended_desc *)&skb->data[FRAME_DESC_SZ]; in rsi_prepare_mgmt_desc()
105 rsi_set_len_qno(&mgmt_desc->len_qno, (skb->len - FRAME_DESC_SZ), in rsi_prepare_mgmt_desc()
107 mgmt_desc->frame_type = TX_DOT11_MGMT; in rsi_prepare_mgmt_desc()
108 mgmt_desc->header_len = MIN_802_11_HDR_LEN; in rsi_prepare_mgmt_desc()
109 mgmt_desc->xtend_desc_size = header_size - FRAME_DESC_SZ; in rsi_prepare_mgmt_desc()
111 if (ieee80211_is_probe_req(wh->frame_control)) in rsi_prepare_mgmt_desc()
112 mgmt_desc->frame_info = cpu_to_le16(RSI_INSERT_SEQ_IN_FW); in rsi_prepare_mgmt_desc()
113 mgmt_desc->frame_info |= cpu_to_le16(RATE_INFO_ENABLE); in rsi_prepare_mgmt_desc()
114 if (is_broadcast_ether_addr(wh->addr1)) in rsi_prepare_mgmt_desc()
115 mgmt_desc->frame_info |= cpu_to_le16(RSI_BROADCAST_PKT); in rsi_prepare_mgmt_desc()
117 mgmt_desc->seq_ctrl = in rsi_prepare_mgmt_desc()
118 cpu_to_le16(IEEE80211_SEQ_TO_SN(le16_to_cpu(wh->seq_ctrl))); in rsi_prepare_mgmt_desc()
119 if ((common->band == NL80211_BAND_2GHZ) && !common->p2p_enabled) in rsi_prepare_mgmt_desc()
120 mgmt_desc->rate_info = cpu_to_le16(RSI_RATE_1); in rsi_prepare_mgmt_desc()
122 mgmt_desc->rate_info = cpu_to_le16(RSI_RATE_6); in rsi_prepare_mgmt_desc()
125 mgmt_desc->bbp_info = cpu_to_le16(FULL40M_ENABLE); in rsi_prepare_mgmt_desc()
127 if (ieee80211_is_probe_resp(wh->frame_control)) { in rsi_prepare_mgmt_desc()
128 mgmt_desc->misc_flags |= (RSI_ADD_DELTA_TSF_VAP_ID | in rsi_prepare_mgmt_desc()
131 xtend_desc->retry_cnt = PROBE_RESP_RETRY_CNT; in rsi_prepare_mgmt_desc()
134 if (((vif->type == NL80211_IFTYPE_AP) || in rsi_prepare_mgmt_desc()
135 (vif->type == NL80211_IFTYPE_P2P_GO)) && in rsi_prepare_mgmt_desc()
136 (ieee80211_is_action(wh->frame_control))) { in rsi_prepare_mgmt_desc()
137 struct rsi_sta *rsta = rsi_find_sta(common, wh->addr1); in rsi_prepare_mgmt_desc()
140 mgmt_desc->sta_id = tx_params->sta_id; in rsi_prepare_mgmt_desc()
142 return -EINVAL; in rsi_prepare_mgmt_desc()
144 mgmt_desc->rate_info |= in rsi_prepare_mgmt_desc()
145 cpu_to_le16((tx_params->vap_id << RSI_DESC_VAP_ID_OFST) & in rsi_prepare_mgmt_desc()
154 struct rsi_hw *adapter = common->priv; in rsi_prepare_data_desc()
169 vif = info->control.vif; in rsi_prepare_data_desc()
170 tx_params = (struct skb_info *)info->driver_data; in rsi_prepare_data_desc()
172 tx_eapol = IEEE80211_SKB_CB(skb)->control.flags & in rsi_prepare_data_desc()
178 return -ENOSPC; in rsi_prepare_data_desc()
181 dword_align_bytes = ((unsigned long)skb->data & 0x3f); in rsi_prepare_data_desc()
184 return -ENOSPC; in rsi_prepare_data_desc()
189 tx_params->internal_hdr_size = header_size; in rsi_prepare_data_desc()
190 data_desc = (struct rsi_data_desc *)skb->data; in rsi_prepare_data_desc()
193 xtend_desc = (struct rsi_xtended_desc *)&skb->data[FRAME_DESC_SZ]; in rsi_prepare_data_desc()
194 wh = (struct ieee80211_hdr *)&skb->data[header_size]; in rsi_prepare_data_desc()
195 seq_num = IEEE80211_SEQ_TO_SN(le16_to_cpu(wh->seq_ctrl)); in rsi_prepare_data_desc()
197 data_desc->xtend_desc_size = header_size - FRAME_DESC_SZ; in rsi_prepare_data_desc()
199 if (ieee80211_is_data_qos(wh->frame_control)) { in rsi_prepare_data_desc()
201 data_desc->mac_flags |= cpu_to_le16(RSI_QOS_ENABLE); in rsi_prepare_data_desc()
204 if (((vif->type == NL80211_IFTYPE_STATION) || in rsi_prepare_data_desc()
205 (vif->type == NL80211_IFTYPE_P2P_CLIENT)) && in rsi_prepare_data_desc()
206 (adapter->ps_state == PS_ENABLED)) in rsi_prepare_data_desc()
207 wh->frame_control |= cpu_to_le16(RSI_SET_PS_ENABLE); in rsi_prepare_data_desc()
209 if ((!(info->flags & IEEE80211_TX_INTFL_DONT_ENCRYPT)) && in rsi_prepare_data_desc()
210 tx_params->have_key) { in rsi_prepare_data_desc()
215 data_desc->mac_flags |= cpu_to_le16(RSI_ENCRYPT_PKT); in rsi_prepare_data_desc()
217 rsi_set_len_qno(&data_desc->len_qno, (skb->len - FRAME_DESC_SZ), in rsi_prepare_data_desc()
219 data_desc->header_len = ieee80211_size; in rsi_prepare_data_desc()
221 if (common->rate_config[common->band].fixed_enabled) { in rsi_prepare_data_desc()
223 u16 fixed_rate = common->rate_config[common->band].fixed_hw_rate; in rsi_prepare_data_desc()
225 data_desc->frame_info = cpu_to_le16(RATE_INFO_ENABLE); in rsi_prepare_data_desc()
226 data_desc->rate_info = cpu_to_le16(fixed_rate); in rsi_prepare_data_desc()
228 if (conf_is_ht40(&common->priv->hw->conf)) in rsi_prepare_data_desc()
229 data_desc->bbp_info = cpu_to_le16(FULL40M_ENABLE); in rsi_prepare_data_desc()
231 if (common->vif_info[0].sgi && (fixed_rate & 0x100)) { in rsi_prepare_data_desc()
233 data_desc->rate_info |= in rsi_prepare_data_desc()
241 data_desc->frame_info = cpu_to_le16(RATE_INFO_ENABLE); in rsi_prepare_data_desc()
242 if (common->band == NL80211_BAND_5GHZ) in rsi_prepare_data_desc()
243 data_desc->rate_info = cpu_to_le16(RSI_RATE_6); in rsi_prepare_data_desc()
245 data_desc->rate_info = cpu_to_le16(RSI_RATE_1); in rsi_prepare_data_desc()
246 data_desc->mac_flags |= cpu_to_le16(RSI_REKEY_PURPOSE); in rsi_prepare_data_desc()
247 data_desc->misc_flags |= RSI_FETCH_RETRY_CNT_FRM_HST; in rsi_prepare_data_desc()
249 xtend_desc->retry_cnt = EAPOL_RETRY_CNT; in rsi_prepare_data_desc()
251 if (common->eapol4_confirm) in rsi_prepare_data_desc()
252 skb->priority = VO_Q; in rsi_prepare_data_desc()
254 rsi_set_len_qno(&data_desc->len_qno, in rsi_prepare_data_desc()
255 (skb->len - FRAME_DESC_SZ), in rsi_prepare_data_desc()
257 if (((skb->len - header_size) == EAPOL4_PACKET_LEN) || in rsi_prepare_data_desc()
258 ((skb->len - header_size) == EAPOL4_PACKET_LEN - 2)) { in rsi_prepare_data_desc()
259 data_desc->misc_flags |= in rsi_prepare_data_desc()
261 xtend_desc->confirm_frame_type = EAPOL4_CONFIRM; in rsi_prepare_data_desc()
265 data_desc->mac_flags |= cpu_to_le16(seq_num & 0xfff); in rsi_prepare_data_desc()
266 data_desc->qid_tid = ((skb->priority & 0xf) | in rsi_prepare_data_desc()
267 ((tx_params->tid & 0xf) << 4)); in rsi_prepare_data_desc()
268 data_desc->sta_id = tx_params->sta_id; in rsi_prepare_data_desc()
270 if ((is_broadcast_ether_addr(wh->addr1)) || in rsi_prepare_data_desc()
271 (is_multicast_ether_addr(wh->addr1))) { in rsi_prepare_data_desc()
272 data_desc->frame_info = cpu_to_le16(RATE_INFO_ENABLE); in rsi_prepare_data_desc()
273 data_desc->frame_info |= cpu_to_le16(RSI_BROADCAST_PKT); in rsi_prepare_data_desc()
274 data_desc->sta_id = vap_id; in rsi_prepare_data_desc()
276 if ((vif->type == NL80211_IFTYPE_AP) || in rsi_prepare_data_desc()
277 (vif->type == NL80211_IFTYPE_P2P_GO)) { in rsi_prepare_data_desc()
278 if (common->band == NL80211_BAND_5GHZ) in rsi_prepare_data_desc()
279 data_desc->rate_info = cpu_to_le16(RSI_RATE_6); in rsi_prepare_data_desc()
281 data_desc->rate_info = cpu_to_le16(RSI_RATE_1); in rsi_prepare_data_desc()
284 if (((vif->type == NL80211_IFTYPE_AP) || in rsi_prepare_data_desc()
285 (vif->type == NL80211_IFTYPE_P2P_GO)) && in rsi_prepare_data_desc()
286 (ieee80211_has_moredata(wh->frame_control))) in rsi_prepare_data_desc()
287 data_desc->frame_info |= cpu_to_le16(MORE_DATA_PRESENT); in rsi_prepare_data_desc()
289 data_desc->rate_info |= in rsi_prepare_data_desc()
290 cpu_to_le16((tx_params->vap_id << RSI_DESC_VAP_ID_OFST) & in rsi_prepare_data_desc()
299 struct rsi_hw *adapter = common->priv; in rsi_send_data_pkt()
302 int status = -EINVAL; in rsi_send_data_pkt()
306 if (common->iface_down) in rsi_send_data_pkt()
310 if (!info->control.vif) in rsi_send_data_pkt()
312 vif = info->control.vif; in rsi_send_data_pkt()
314 if (((vif->type == NL80211_IFTYPE_STATION) || in rsi_send_data_pkt()
315 (vif->type == NL80211_IFTYPE_P2P_CLIENT)) && in rsi_send_data_pkt()
316 (!vif->cfg.assoc)) in rsi_send_data_pkt()
324 ++common->tx_stats.total_tx_pkt_freed[skb->priority]; in rsi_send_data_pkt()
330 * rsi_send_mgmt_pkt() - This functions sends the received management packet
335 * Return: status: 0 on success, -1 on failure.
340 struct rsi_hw *adapter = common->priv; in rsi_send_mgmt_pkt()
346 int status = -E2BIG; in rsi_send_mgmt_pkt()
350 tx_params = (struct skb_info *)info->driver_data; in rsi_send_mgmt_pkt()
351 header_size = tx_params->internal_hdr_size; in rsi_send_mgmt_pkt()
353 if (tx_params->flags & INTERNAL_MGMT_PKT) { in rsi_send_mgmt_pkt()
354 status = adapter->host_intf_ops->write_pkt(common->priv, in rsi_send_mgmt_pkt()
355 (u8 *)skb->data, in rsi_send_mgmt_pkt()
356 skb->len); in rsi_send_mgmt_pkt()
365 wh = (struct ieee80211_hdr *)&skb->data[header_size]; in rsi_send_mgmt_pkt()
366 mgmt_desc = (struct rsi_mgmt_desc *)skb->data; in rsi_send_mgmt_pkt()
367 xtend_desc = (struct rsi_xtended_desc *)&skb->data[FRAME_DESC_SZ]; in rsi_send_mgmt_pkt()
370 if (ieee80211_is_probe_req(wh->frame_control) && in rsi_send_mgmt_pkt()
371 !info->control.vif->cfg.assoc) { in rsi_send_mgmt_pkt()
374 mgmt_desc->misc_flags = RSI_DESC_REQUIRE_CFM_TO_HOST; in rsi_send_mgmt_pkt()
375 xtend_desc->confirm_frame_type = PROBEREQ_CONFIRM; in rsi_send_mgmt_pkt()
376 common->mgmt_q_block = true; in rsi_send_mgmt_pkt()
384 rsi_indicate_tx_status(common->priv, skb, status); in rsi_send_mgmt_pkt()
390 int status = -EINVAL; in rsi_send_bt_pkt()
393 u8 queueno = ((skb->data[1] >> 4) & 0xf); in rsi_send_bt_pkt()
405 status = -ENOSPC; in rsi_send_bt_pkt()
409 memset(skb->data, 0, header_size); in rsi_send_bt_pkt()
410 bt_desc = (struct rsi_bt_desc *)skb->data; in rsi_send_bt_pkt()
412 rsi_set_len_qno(&bt_desc->len_qno, (skb->len - FRAME_DESC_SZ), in rsi_send_bt_pkt()
414 bt_desc->bt_pkt_type = cpu_to_le16(bt_cb(skb)->pkt_type); in rsi_send_bt_pkt()
427 struct rsi_hw *adapter = common->priv; in rsi_prepare_beacon()
429 struct ieee80211_hw *hw = common->priv->hw; in rsi_prepare_beacon()
430 struct ieee80211_conf *conf = &hw->conf; in rsi_prepare_beacon()
437 vif = adapter->vifs[i]; in rsi_prepare_beacon()
440 if ((vif->type == NL80211_IFTYPE_AP) || in rsi_prepare_beacon()
441 (vif->type == NL80211_IFTYPE_P2P_GO)) in rsi_prepare_beacon()
445 return -EINVAL; in rsi_prepare_beacon()
446 mac_bcn = ieee80211_beacon_get_tim(adapter->hw, in rsi_prepare_beacon()
451 return -EINVAL; in rsi_prepare_beacon()
454 common->beacon_cnt++; in rsi_prepare_beacon()
455 bcn_frm = (struct rsi_data_desc *)skb->data; in rsi_prepare_beacon()
456 rsi_set_len_qno(&bcn_frm->len_qno, mac_bcn->len, RSI_WIFI_DATA_Q); in rsi_prepare_beacon()
457 bcn_frm->header_len = MIN_802_11_HDR_LEN; in rsi_prepare_beacon()
458 bcn_frm->frame_info = cpu_to_le16(RSI_DATA_DESC_MAC_BBP_INFO | in rsi_prepare_beacon()
464 bcn_frm->rate_info = cpu_to_le16(vap_id << 14); in rsi_prepare_beacon()
465 bcn_frm->qid_tid = BEACON_HW_Q; in rsi_prepare_beacon()
468 bcn_frm->bbp_info = cpu_to_le16(LOWER_20_ENABLE); in rsi_prepare_beacon()
469 bcn_frm->bbp_info |= cpu_to_le16(LOWER_20_ENABLE >> 12); in rsi_prepare_beacon()
471 bcn_frm->bbp_info = cpu_to_le16(UPPER_20_ENABLE); in rsi_prepare_beacon()
472 bcn_frm->bbp_info |= cpu_to_le16(UPPER_20_ENABLE >> 12); in rsi_prepare_beacon()
475 if (common->band == NL80211_BAND_2GHZ) in rsi_prepare_beacon()
476 bcn_frm->rate_info |= cpu_to_le16(RSI_RATE_1); in rsi_prepare_beacon()
478 bcn_frm->rate_info |= cpu_to_le16(RSI_RATE_6); in rsi_prepare_beacon()
480 if (mac_bcn->data[tim_offset + 2] == 0) in rsi_prepare_beacon()
481 bcn_frm->frame_info |= cpu_to_le16(RSI_DATA_DESC_DTIM_BEACON); in rsi_prepare_beacon()
483 memcpy(&skb->data[FRAME_DESC_SZ], mac_bcn->data, mac_bcn->len); in rsi_prepare_beacon()
484 skb_put(skb, mac_bcn->len + FRAME_DESC_SZ); in rsi_prepare_beacon()
495 adapter->blcmd_timer_expired = true; in bl_cmd_timeout()
496 del_timer(&adapter->bl_cmd_timer); in bl_cmd_timeout()
501 timer_setup(&adapter->bl_cmd_timer, bl_cmd_timeout, 0); in bl_start_cmd_timer()
502 adapter->bl_cmd_timer.expires = (msecs_to_jiffies(timeout) + jiffies); in bl_start_cmd_timer()
504 adapter->blcmd_timer_expired = false; in bl_start_cmd_timer()
505 add_timer(&adapter->bl_cmd_timer); in bl_start_cmd_timer()
512 adapter->blcmd_timer_expired = false; in bl_stop_cmd_timer()
513 if (timer_pending(&adapter->bl_cmd_timer)) in bl_stop_cmd_timer()
514 del_timer(&adapter->bl_cmd_timer); in bl_stop_cmd_timer()
519 static int bl_write_cmd(struct rsi_hw *adapter, u8 cmd, u8 exp_resp, in bl_write_cmd() argument
522 struct rsi_host_intf_ops *hif_ops = adapter->host_intf_ops; in bl_write_cmd()
528 regin_input = (REGIN_INPUT | adapter->priv->coex_mode); in bl_write_cmd()
530 while (!adapter->blcmd_timer_expired) { in bl_write_cmd()
532 status = hif_ops->master_reg_read(adapter, SWBL_REGIN, in bl_write_cmd()
537 __func__, cmd); in bl_write_cmd()
544 if (adapter->blcmd_timer_expired) { in bl_write_cmd()
547 __func__, cmd); in bl_write_cmd()
548 return -ETIMEDOUT; in bl_write_cmd()
552 "Issuing write to Regin val:%0x sending cmd:%0x\n", in bl_write_cmd()
553 regin_val, (cmd | regin_input << 8)); in bl_write_cmd()
554 status = hif_ops->master_reg_write(adapter, SWBL_REGIN, in bl_write_cmd()
555 (cmd | regin_input << 8), 2); in bl_write_cmd()
560 if (cmd == LOAD_HOSTED_FW || cmd == JUMP_TO_ZERO_PC) { in bl_write_cmd()
567 while (!adapter->blcmd_timer_expired) { in bl_write_cmd()
569 status = hif_ops->master_reg_read(adapter, SWBL_REGOUT, in bl_write_cmd()
574 __func__, cmd); in bl_write_cmd()
581 if (adapter->blcmd_timer_expired) { in bl_write_cmd()
584 __func__, cmd); in bl_write_cmd()
592 status = hif_ops->master_reg_write(adapter, SWBL_REGOUT, in bl_write_cmd()
593 (cmd | REGOUT_INVALID << 8), 2); in bl_write_cmd()
597 __func__, cmd); in bl_write_cmd()
604 "%s: Recvd resp %x for cmd %0x\n", in bl_write_cmd()
605 __func__, output, cmd); in bl_write_cmd()
606 return -EINVAL; in bl_write_cmd()
609 "%s: Recvd Expected resp %x for cmd %0x\n", in bl_write_cmd()
610 __func__, output, cmd); in bl_write_cmd()
615 static int bl_cmd(struct rsi_hw *adapter, u8 cmd, u8 exp_resp, char *str) in bl_cmd() argument
621 if ((cmd == EOF_REACHED) || (cmd == PING_VALID) || (cmd == PONG_VALID)) in bl_cmd()
627 status = bl_write_cmd(adapter, cmd, exp_resp, ®out_val); in bl_cmd()
632 __func__, str, cmd); in bl_cmd()
645 struct rsi_host_intf_ops *hif_ops = adapter->host_intf_ops; in bl_write_header()
652 return -ENOMEM; in bl_write_header()
654 bl_hdr->flags = 0; in bl_write_header()
655 bl_hdr->image_no = cpu_to_le32(adapter->priv->coex_mode); in bl_write_header()
656 bl_hdr->check_sum = in bl_write_header()
658 bl_hdr->flash_start_address = in bl_write_header()
660 bl_hdr->flash_len = cpu_to_le32(*(u32 *)&flash_content[LEN_OFFSET]); in bl_write_header()
663 if (adapter->rsi_host_intf == RSI_HOST_INTF_USB) { in bl_write_header()
665 status = hif_ops->write_reg_multiple(adapter, write_addr, in bl_write_header()
675 status = hif_ops->master_access_msword(adapter, write_addr); in bl_write_header()
684 status = hif_ops->write_reg_multiple(adapter, write_addr, in bl_write_header()
703 if ((adapter->host_intf_ops->master_reg_read(adapter, FLASH_SIZE_ADDR, in read_flash_capacity()
715 static int ping_pong_write(struct rsi_hw *adapter, u8 cmd, u8 *addr, u32 size) in ping_pong_write() argument
717 struct rsi_host_intf_ops *hif_ops = adapter->host_intf_ops; in ping_pong_write()
718 u32 block_size = adapter->block_size; in ping_pong_write()
724 if (cmd == PING_WRITE) { in ping_pong_write()
736 status = hif_ops->load_data_master_write(adapter, cmd_addr, size, in ping_pong_write()
754 u8 cmd; in auto_fw_upgrade() local
763 return -EINVAL; in auto_fw_upgrade()
773 return -EINVAL; in auto_fw_upgrade()
780 return -EINVAL; in auto_fw_upgrade()
783 if ((flash_start_address + content_size) > adapter->flash_capacity) { in auto_fw_upgrade()
787 return -EINVAL; in auto_fw_upgrade()
815 cmd = PING_WRITE; in auto_fw_upgrade()
817 cmd = PONG_WRITE; in auto_fw_upgrade()
819 status = ping_pong_write(adapter, cmd, flash_content, in auto_fw_upgrade()
844 struct rsi_host_intf_ops *hif_ops = adapter->host_intf_ops; in rsi_hal_prepare_fwload()
850 while (!adapter->blcmd_timer_expired) { in rsi_hal_prepare_fwload()
851 status = hif_ops->master_reg_read(adapter, SWBL_REGOUT, in rsi_hal_prepare_fwload()
864 if (adapter->blcmd_timer_expired) { in rsi_hal_prepare_fwload()
868 return -ETIMEDOUT; in rsi_hal_prepare_fwload()
875 status = hif_ops->master_reg_write(adapter, SWBL_REGOUT, in rsi_hal_prepare_fwload()
890 struct rsi_common *common = adapter->priv; in rsi_load_9113_firmware()
902 adapter->flash_capacity = read_flash_capacity(adapter); in rsi_load_9113_firmware()
903 if (adapter->flash_capacity <= 0) { in rsi_load_9113_firmware()
907 return -EINVAL; in rsi_load_9113_firmware()
910 metadata_p = &metadata_flash_content[adapter->priv->coex_mode]; in rsi_load_9113_firmware()
912 rsi_dbg(INIT_ZONE, "%s: Loading file %s\n", __func__, metadata_p->name); in rsi_load_9113_firmware()
913 adapter->fw_file_name = metadata_p->name; in rsi_load_9113_firmware()
915 status = request_firmware(&fw_entry, metadata_p->name, adapter->device); in rsi_load_9113_firmware()
918 __func__, metadata_p->name); in rsi_load_9113_firmware()
921 content_size = fw_entry->size; in rsi_load_9113_firmware()
925 common->lmac_ver.ver.info.fw_ver[0] = in rsi_load_9113_firmware()
926 fw_entry->data[LMAC_VER_OFFSET_9113] & 0xFF; in rsi_load_9113_firmware()
927 common->lmac_ver.ver.info.fw_ver[1] = in rsi_load_9113_firmware()
928 fw_entry->data[LMAC_VER_OFFSET_9113 + 1] & 0xFF; in rsi_load_9113_firmware()
929 common->lmac_ver.major = in rsi_load_9113_firmware()
930 fw_entry->data[LMAC_VER_OFFSET_9113 + 2] & 0xFF; in rsi_load_9113_firmware()
931 common->lmac_ver.release_num = in rsi_load_9113_firmware()
932 fw_entry->data[LMAC_VER_OFFSET_9113 + 3] & 0xFF; in rsi_load_9113_firmware()
933 common->lmac_ver.minor = in rsi_load_9113_firmware()
934 fw_entry->data[LMAC_VER_OFFSET_9113 + 4] & 0xFF; in rsi_load_9113_firmware()
935 common->lmac_ver.patch_num = 0; in rsi_load_9113_firmware()
938 status = bl_write_header(adapter, (u8 *)fw_entry->data, content_size); in rsi_load_9113_firmware()
980 status = auto_fw_upgrade(adapter, (u8 *)fw_entry->data, content_size); in rsi_load_9113_firmware()
1005 struct rsi_common *common = adapter->priv; in rsi_load_9116_firmware()
1006 struct rsi_host_intf_ops *hif_ops = adapter->host_intf_ops; in rsi_load_9116_firmware()
1012 u16 block_size = adapter->block_size; in rsi_load_9116_firmware()
1014 int status, cnt; in rsi_load_9116_firmware() local
1018 if (adapter->rsi_host_intf == RSI_HOST_INTF_USB) { in rsi_load_9116_firmware()
1025 status = hif_ops->master_reg_write(adapter, MEM_ACCESS_CTRL_FROM_HOST, in rsi_load_9116_firmware()
1034 metadata_p = &metadata[adapter->priv->coex_mode]; in rsi_load_9116_firmware()
1035 rsi_dbg(INIT_ZONE, "%s: loading file %s\n", __func__, metadata_p->name); in rsi_load_9116_firmware()
1036 status = request_firmware(&fw_entry, metadata_p->name, adapter->device); in rsi_load_9116_firmware()
1039 __func__, metadata_p->name); in rsi_load_9116_firmware()
1043 ta_firmware = kmemdup(fw_entry->data, fw_entry->size, GFP_KERNEL); in rsi_load_9116_firmware()
1045 status = -ENOMEM; in rsi_load_9116_firmware()
1049 instructions_sz = fw_entry->size; in rsi_load_9116_firmware()
1052 common->lmac_ver.major = ta_firmware[LMAC_VER_OFFSET_9116]; in rsi_load_9116_firmware()
1053 common->lmac_ver.minor = ta_firmware[LMAC_VER_OFFSET_9116 + 1]; in rsi_load_9116_firmware()
1054 common->lmac_ver.release_num = ta_firmware[LMAC_VER_OFFSET_9116 + 2]; in rsi_load_9116_firmware()
1055 common->lmac_ver.patch_num = ta_firmware[LMAC_VER_OFFSET_9116 + 3]; in rsi_load_9116_firmware()
1056 common->lmac_ver.ver.info.fw_ver[0] = in rsi_load_9116_firmware()
1061 (FW_ALIGN_SIZE - (instructions_sz % FW_ALIGN_SIZE)); in rsi_load_9116_firmware()
1069 cnt = 0; in rsi_load_9116_firmware()
1072 __func__, cnt); in rsi_load_9116_firmware()
1074 dest = le32_to_cpu(bootload_ds.bl_entry[cnt].dst_addr); in rsi_load_9116_firmware()
1075 len = le32_to_cpu(bootload_ds.bl_entry[cnt].control) & in rsi_load_9116_firmware()
1080 status = hif_ops->load_data_master_write(adapter, dest, in rsi_load_9116_firmware()
1086 "Failed to load chunk %d\n", cnt); in rsi_load_9116_firmware()
1090 if (le32_to_cpu(bootload_ds.bl_entry[cnt].control) & in rsi_load_9116_firmware()
1093 cnt++; in rsi_load_9116_firmware()
1096 base_address = metadata_p->address; in rsi_load_9116_firmware()
1097 status = hif_ops->load_data_master_write(adapter, in rsi_load_9116_firmware()
1106 __func__, metadata_p->name); in rsi_load_9116_firmware()
1111 __func__, metadata_p->name); in rsi_load_9116_firmware()
1113 if (adapter->rsi_host_intf == RSI_HOST_INTF_SDIO) { in rsi_load_9116_firmware()
1114 if (hif_ops->ta_reset(adapter)) in rsi_load_9116_firmware()
1134 struct rsi_common *common = adapter->priv; in rsi_hal_device_init()
1137 switch (adapter->device_model) { in rsi_hal_device_init()
1146 return -EINVAL; in rsi_hal_device_init()
1157 return -EINVAL; in rsi_hal_device_init()
1161 return -EINVAL; in rsi_hal_device_init()
1163 common->fsm_state = FSM_CARD_NOT_READY; in rsi_hal_device_init()