Lines Matching refs:cmd
68 static u8 is_command_allowed_in_ps(u16 cmd) in is_command_allowed_in_ps() argument
70 switch (cmd) { in is_command_allowed_in_ps()
91 struct cmd_ds_get_hw_spec cmd; in lbs_update_hw_spec() local
95 memset(&cmd, 0, sizeof(cmd)); in lbs_update_hw_spec()
96 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); in lbs_update_hw_spec()
97 memcpy(cmd.permanentaddr, priv->current_addr, ETH_ALEN); in lbs_update_hw_spec()
98 ret = lbs_cmd_with_response(priv, CMD_GET_HW_SPEC, &cmd); in lbs_update_hw_spec()
102 priv->fwcapinfo = le32_to_cpu(cmd.fwcapinfo); in lbs_update_hw_spec()
106 priv->fwrelease = le32_to_cpu(cmd.fwrelease); in lbs_update_hw_spec()
115 cmd.permanentaddr, in lbs_update_hw_spec()
122 cmd.hwifversion, cmd.version); in lbs_update_hw_spec()
132 priv->regioncode = (le16_to_cpu(cmd.regioncode) >> 8) & 0xFF; in lbs_update_hw_spec()
134 priv->regioncode = le16_to_cpu(cmd.regioncode) & 0xFF; in lbs_update_hw_spec()
150 memmove(priv->current_addr, cmd.permanentaddr, ETH_ALEN); in lbs_update_hw_spec()
232 struct cmd_ds_802_11_ps_mode cmd; in lbs_set_ps_mode() local
235 memset(&cmd, 0, sizeof(cmd)); in lbs_set_ps_mode()
236 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); in lbs_set_ps_mode()
237 cmd.action = cpu_to_le16(cmd_action); in lbs_set_ps_mode()
241 cmd.multipledtim = cpu_to_le16(1); /* Default DTIM multiple */ in lbs_set_ps_mode()
254 ret = lbs_cmd_with_response(priv, CMD_802_11_PS_MODE, &cmd); in lbs_set_ps_mode()
256 lbs_cmd_async(priv, CMD_802_11_PS_MODE, &cmd.hdr, sizeof (cmd)); in lbs_set_ps_mode()
265 struct cmd_ds_802_11_sleep_params cmd; in lbs_cmd_802_11_sleep_params() local
269 memset(&cmd, 0, sizeof(cmd)); in lbs_cmd_802_11_sleep_params()
271 cmd.error = cpu_to_le16(sp->sp_error); in lbs_cmd_802_11_sleep_params()
272 cmd.offset = cpu_to_le16(sp->sp_offset); in lbs_cmd_802_11_sleep_params()
273 cmd.stabletime = cpu_to_le16(sp->sp_stabletime); in lbs_cmd_802_11_sleep_params()
274 cmd.calcontrol = sp->sp_calcontrol; in lbs_cmd_802_11_sleep_params()
275 cmd.externalsleepclk = sp->sp_extsleepclk; in lbs_cmd_802_11_sleep_params()
276 cmd.reserved = cpu_to_le16(sp->sp_reserved); in lbs_cmd_802_11_sleep_params()
278 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); in lbs_cmd_802_11_sleep_params()
279 cmd.action = cpu_to_le16(cmd_action); in lbs_cmd_802_11_sleep_params()
281 ret = lbs_cmd_with_response(priv, CMD_802_11_SLEEP_PARAMS, &cmd); in lbs_cmd_802_11_sleep_params()
286 le16_to_cpu(cmd.error), le16_to_cpu(cmd.offset), in lbs_cmd_802_11_sleep_params()
287 le16_to_cpu(cmd.stabletime), cmd.calcontrol, in lbs_cmd_802_11_sleep_params()
288 cmd.externalsleepclk); in lbs_cmd_802_11_sleep_params()
290 sp->sp_error = le16_to_cpu(cmd.error); in lbs_cmd_802_11_sleep_params()
291 sp->sp_offset = le16_to_cpu(cmd.offset); in lbs_cmd_802_11_sleep_params()
292 sp->sp_stabletime = le16_to_cpu(cmd.stabletime); in lbs_cmd_802_11_sleep_params()
293 sp->sp_calcontrol = cmd.calcontrol; in lbs_cmd_802_11_sleep_params()
294 sp->sp_extsleepclk = cmd.externalsleepclk; in lbs_cmd_802_11_sleep_params()
295 sp->sp_reserved = le16_to_cpu(cmd.reserved); in lbs_cmd_802_11_sleep_params()
351 struct cmd_header *cmd) in lbs_ret_host_sleep_activate() argument
361 struct cmd_header cmd; in lbs_set_host_sleep() local
367 memset(&cmd, 0, sizeof(cmd)); in lbs_set_host_sleep()
379 &cmd, in lbs_set_host_sleep()
380 sizeof(cmd), in lbs_set_host_sleep()
419 struct cmd_ds_802_11_snmp_mib cmd; in lbs_set_snmp_mib() local
422 memset(&cmd, 0, sizeof (cmd)); in lbs_set_snmp_mib()
423 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); in lbs_set_snmp_mib()
424 cmd.action = cpu_to_le16(CMD_ACT_SET); in lbs_set_snmp_mib()
425 cmd.oid = cpu_to_le16((u16) oid); in lbs_set_snmp_mib()
429 cmd.bufsize = cpu_to_le16(sizeof(u8)); in lbs_set_snmp_mib()
430 cmd.value[0] = val; in lbs_set_snmp_mib()
437 cmd.bufsize = cpu_to_le16(sizeof(u16)); in lbs_set_snmp_mib()
438 *((__le16 *)(&cmd.value)) = cpu_to_le16(val); in lbs_set_snmp_mib()
447 le16_to_cpu(cmd.oid), le16_to_cpu(cmd.bufsize), val); in lbs_set_snmp_mib()
449 ret = lbs_cmd_with_response(priv, CMD_802_11_SNMP_MIB, &cmd); in lbs_set_snmp_mib()
466 struct cmd_ds_802_11_snmp_mib cmd; in lbs_get_snmp_mib() local
469 memset(&cmd, 0, sizeof (cmd)); in lbs_get_snmp_mib()
470 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); in lbs_get_snmp_mib()
471 cmd.action = cpu_to_le16(CMD_ACT_GET); in lbs_get_snmp_mib()
472 cmd.oid = cpu_to_le16(oid); in lbs_get_snmp_mib()
474 ret = lbs_cmd_with_response(priv, CMD_802_11_SNMP_MIB, &cmd); in lbs_get_snmp_mib()
478 switch (le16_to_cpu(cmd.bufsize)) { in lbs_get_snmp_mib()
480 *out_val = cmd.value[0]; in lbs_get_snmp_mib()
483 *out_val = le16_to_cpu(*((__le16 *)(&cmd.value))); in lbs_get_snmp_mib()
487 oid, le16_to_cpu(cmd.bufsize)); in lbs_get_snmp_mib()
508 struct cmd_ds_802_11_rf_tx_power cmd; in lbs_get_tx_power() local
511 memset(&cmd, 0, sizeof(cmd)); in lbs_get_tx_power()
512 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); in lbs_get_tx_power()
513 cmd.action = cpu_to_le16(CMD_ACT_GET); in lbs_get_tx_power()
515 ret = lbs_cmd_with_response(priv, CMD_802_11_RF_TX_POWER, &cmd); in lbs_get_tx_power()
517 *curlevel = le16_to_cpu(cmd.curlevel); in lbs_get_tx_power()
519 *minlevel = cmd.minlevel; in lbs_get_tx_power()
521 *maxlevel = cmd.maxlevel; in lbs_get_tx_power()
537 struct cmd_ds_802_11_rf_tx_power cmd; in lbs_set_tx_power() local
540 memset(&cmd, 0, sizeof(cmd)); in lbs_set_tx_power()
541 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); in lbs_set_tx_power()
542 cmd.action = cpu_to_le16(CMD_ACT_SET); in lbs_set_tx_power()
543 cmd.curlevel = cpu_to_le16(dbm); in lbs_set_tx_power()
547 ret = lbs_cmd_with_response(priv, CMD_802_11_RF_TX_POWER, &cmd); in lbs_set_tx_power()
563 struct cmd_ds_802_11_monitor_mode cmd; in lbs_set_monitor_mode() local
566 memset(&cmd, 0, sizeof(cmd)); in lbs_set_monitor_mode()
567 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); in lbs_set_monitor_mode()
568 cmd.action = cpu_to_le16(CMD_ACT_SET); in lbs_set_monitor_mode()
570 cmd.mode = cpu_to_le16(0x1); in lbs_set_monitor_mode()
574 ret = lbs_cmd_with_response(priv, CMD_802_11_MONITOR_MODE, &cmd); in lbs_set_monitor_mode()
592 struct cmd_ds_802_11_rf_channel cmd; in lbs_get_channel() local
595 memset(&cmd, 0, sizeof(cmd)); in lbs_get_channel()
596 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); in lbs_get_channel()
597 cmd.action = cpu_to_le16(CMD_OPT_802_11_RF_CHANNEL_GET); in lbs_get_channel()
599 ret = lbs_cmd_with_response(priv, CMD_802_11_RF_CHANNEL, &cmd); in lbs_get_channel()
603 ret = le16_to_cpu(cmd.channel); in lbs_get_channel()
634 struct cmd_ds_802_11_rf_channel cmd; in lbs_set_channel() local
640 memset(&cmd, 0, sizeof(cmd)); in lbs_set_channel()
641 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); in lbs_set_channel()
642 cmd.action = cpu_to_le16(CMD_OPT_802_11_RF_CHANNEL_SET); in lbs_set_channel()
643 cmd.channel = cpu_to_le16(channel); in lbs_set_channel()
645 ret = lbs_cmd_with_response(priv, CMD_802_11_RF_CHANNEL, &cmd); in lbs_set_channel()
649 priv->channel = (uint8_t) le16_to_cpu(cmd.channel); in lbs_set_channel()
668 struct cmd_ds_802_11_rssi cmd; in lbs_get_rssi() local
674 memset(&cmd, 0, sizeof(cmd)); in lbs_get_rssi()
675 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); in lbs_get_rssi()
677 cmd.n_or_snr = cpu_to_le16(8); in lbs_get_rssi()
679 ret = lbs_cmd_with_response(priv, CMD_802_11_RSSI, &cmd); in lbs_get_rssi()
681 *nf = CAL_NF(le16_to_cpu(cmd.nf)); in lbs_get_rssi()
682 *rssi = CAL_RSSI(le16_to_cpu(cmd.n_or_snr), le16_to_cpu(cmd.nf)); in lbs_get_rssi()
700 struct cmd_ds_802_11d_domain_info cmd; in lbs_set_11d_domain_info() local
701 struct mrvl_ie_domain_param_set *domain = &cmd.domain; in lbs_set_11d_domain_info()
715 memset(&cmd, 0, sizeof(cmd)); in lbs_set_11d_domain_info()
716 cmd.action = cpu_to_le16(CMD_ACT_SET); in lbs_set_11d_domain_info()
796 (u8 *) &cmd.domain.country_code, in lbs_set_11d_domain_info()
799 cmd.hdr.size = cpu_to_le16(sizeof(cmd.hdr) + in lbs_set_11d_domain_info()
800 sizeof(cmd.action) + in lbs_set_11d_domain_info()
801 sizeof(cmd.domain.header) + in lbs_set_11d_domain_info()
802 sizeof(cmd.domain.country_code) + in lbs_set_11d_domain_info()
805 ret = lbs_cmd_with_response(priv, CMD_802_11D_DOMAIN_INFO, &cmd); in lbs_set_11d_domain_info()
824 struct cmd_ds_reg_access cmd; in lbs_get_reg() local
829 memset(&cmd, 0, sizeof(cmd)); in lbs_get_reg()
830 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); in lbs_get_reg()
831 cmd.action = cpu_to_le16(CMD_ACT_GET); in lbs_get_reg()
832 cmd.offset = cpu_to_le16(offset); in lbs_get_reg()
841 ret = lbs_cmd_with_response(priv, reg, &cmd); in lbs_get_reg()
844 *value = cmd.value.bbp_rf; in lbs_get_reg()
846 *value = le32_to_cpu(cmd.value.mac); in lbs_get_reg()
866 struct cmd_ds_reg_access cmd; in lbs_set_reg() local
869 memset(&cmd, 0, sizeof(cmd)); in lbs_set_reg()
870 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); in lbs_set_reg()
871 cmd.action = cpu_to_le16(CMD_ACT_SET); in lbs_set_reg()
872 cmd.offset = cpu_to_le16(offset); in lbs_set_reg()
875 cmd.value.bbp_rf = (u8) (value & 0xFF); in lbs_set_reg()
877 cmd.value.mac = cpu_to_le32(value); in lbs_set_reg()
883 ret = lbs_cmd_with_response(priv, reg, &cmd); in lbs_set_reg()
935 struct cmd_header *cmd; in lbs_submit_command() local
941 cmd = cmdnode->cmdbuf; in lbs_submit_command()
945 cmd->seqnum = cpu_to_le16(priv->seqnum); in lbs_submit_command()
949 cmdsize = le16_to_cpu(cmd->size); in lbs_submit_command()
950 command = le16_to_cpu(cmd->command); in lbs_submit_command()
957 command, le16_to_cpu(cmd->seqnum), cmdsize); in lbs_submit_command()
960 ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) cmd, cmdsize); in lbs_submit_command()
1011 void __lbs_complete_command(struct lbs_private *priv, struct cmd_ctrl_node *cmd, in __lbs_complete_command() argument
1020 list_del_init(&cmd->list); in __lbs_complete_command()
1022 cmd->result = result; in __lbs_complete_command()
1023 cmd->cmdwaitqwoken = 1; in __lbs_complete_command()
1024 wake_up(&cmd->cmdwait_q); in __lbs_complete_command()
1026 if (!cmd->callback || cmd->callback == lbs_cmd_async_callback) in __lbs_complete_command()
1027 __lbs_cleanup_and_insert_cmd(priv, cmd); in __lbs_complete_command()
1032 void lbs_complete_command(struct lbs_private *priv, struct cmd_ctrl_node *cmd, in lbs_complete_command() argument
1037 __lbs_complete_command(priv, cmd, result); in lbs_complete_command()
1043 struct cmd_ds_802_11_radio_control cmd; in lbs_set_radio() local
1046 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); in lbs_set_radio()
1047 cmd.action = cpu_to_le16(CMD_ACT_SET); in lbs_set_radio()
1048 cmd.control = 0; in lbs_set_radio()
1056 cmd.control = cpu_to_le16(preamble); in lbs_set_radio()
1064 cmd.control |= cpu_to_le16(0x1); in lbs_set_radio()
1066 cmd.control &= cpu_to_le16(~0x1); in lbs_set_radio()
1075 ret = lbs_cmd_with_response(priv, CMD_802_11_RADIO_CONTROL, &cmd); in lbs_set_radio()
1083 struct cmd_ds_mac_control cmd; in lbs_set_mac_control() local
1085 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); in lbs_set_mac_control()
1086 cmd.action = cpu_to_le16(priv->mac_control); in lbs_set_mac_control()
1087 cmd.reserved = 0; in lbs_set_mac_control()
1089 lbs_cmd_async(priv, CMD_MAC_CONTROL, &cmd.hdr, sizeof(cmd)); in lbs_set_mac_control()
1094 struct cmd_ds_mac_control cmd; in lbs_set_mac_control_sync() local
1097 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); in lbs_set_mac_control_sync()
1098 cmd.action = cpu_to_le16(priv->mac_control); in lbs_set_mac_control_sync()
1099 cmd.reserved = 0; in lbs_set_mac_control_sync()
1100 ret = lbs_cmd_with_response(priv, CMD_MAC_CONTROL, &cmd); in lbs_set_mac_control_sync()
1231 struct cmd_header *cmd; in lbs_execute_next_command() local
1256 cmd = cmdnode->cmdbuf; in lbs_execute_next_command()
1258 if (is_command_allowed_in_ps(le16_to_cpu(cmd->command))) { in lbs_execute_next_command()
1263 le16_to_cpu(cmd->command), in lbs_execute_next_command()
1270 le16_to_cpu(cmd->command), priv->psstate); in lbs_execute_next_command()
1283 if (cmd->command != cpu_to_le16(CMD_802_11_PS_MODE)) { in lbs_execute_next_command()
1305 struct cmd_ds_802_11_ps_mode *psm = (void *)cmd; in lbs_execute_next_command()
1339 le16_to_cpu(cmd->command)); in lbs_execute_next_command()
1449 struct cmd_ds_802_11_tpc_cfg cmd; in lbs_set_tpc_cfg() local
1452 memset(&cmd, 0, sizeof(cmd)); in lbs_set_tpc_cfg()
1453 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); in lbs_set_tpc_cfg()
1454 cmd.action = cpu_to_le16(CMD_ACT_SET); in lbs_set_tpc_cfg()
1455 cmd.enable = !!enable; in lbs_set_tpc_cfg()
1456 cmd.usesnr = !!usesnr; in lbs_set_tpc_cfg()
1457 cmd.P0 = p0; in lbs_set_tpc_cfg()
1458 cmd.P1 = p1; in lbs_set_tpc_cfg()
1459 cmd.P2 = p2; in lbs_set_tpc_cfg()
1461 ret = lbs_cmd_with_response(priv, CMD_802_11_TPC_CFG, &cmd); in lbs_set_tpc_cfg()
1481 struct cmd_ds_802_11_pa_cfg cmd; in lbs_set_power_adapt_cfg() local
1484 memset(&cmd, 0, sizeof(cmd)); in lbs_set_power_adapt_cfg()
1485 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); in lbs_set_power_adapt_cfg()
1486 cmd.action = cpu_to_le16(CMD_ACT_SET); in lbs_set_power_adapt_cfg()
1487 cmd.enable = !!enable; in lbs_set_power_adapt_cfg()
1488 cmd.P0 = p0; in lbs_set_power_adapt_cfg()
1489 cmd.P1 = p1; in lbs_set_power_adapt_cfg()
1490 cmd.P2 = p2; in lbs_set_power_adapt_cfg()
1492 ret = lbs_cmd_with_response(priv, CMD_802_11_PA_CFG , &cmd); in lbs_set_power_adapt_cfg()