diff options
Diffstat (limited to 'drivers/net/wireless/libertas/cmd.c')
-rw-r--r-- | drivers/net/wireless/libertas/cmd.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index 8c3605cdc64c..c455b9abbfc0 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -119,6 +119,19 @@ int lbs_update_hw_spec(struct lbs_private *priv) | |||
119 | lbs_deb_cmd("GET_HW_SPEC: hardware interface 0x%x, hardware spec 0x%04x\n", | 119 | lbs_deb_cmd("GET_HW_SPEC: hardware interface 0x%x, hardware spec 0x%04x\n", |
120 | cmd.hwifversion, cmd.version); | 120 | cmd.hwifversion, cmd.version); |
121 | 121 | ||
122 | /* Determine mesh_fw_ver from fwrelease and fwcapinfo */ | ||
123 | /* 5.0.16p0 9.0.0.p0 is known to NOT support any mesh */ | ||
124 | /* 5.110.22 have mesh command with 0xa3 command id */ | ||
125 | /* 10.0.0.p0 FW brings in mesh config command with different id */ | ||
126 | /* Check FW version MSB and initialize mesh_fw_ver */ | ||
127 | if (MRVL_FW_MAJOR_REV(priv->fwrelease) == MRVL_FW_V5) | ||
128 | priv->mesh_fw_ver = MESH_FW_OLD; | ||
129 | else if ((MRVL_FW_MAJOR_REV(priv->fwrelease) >= MRVL_FW_V10) && | ||
130 | (priv->fwcapinfo & MESH_CAPINFO_ENABLE_MASK)) | ||
131 | priv->mesh_fw_ver = MESH_FW_NEW; | ||
132 | else | ||
133 | priv->mesh_fw_ver = MESH_NONE; | ||
134 | |||
122 | /* Clamp region code to 8-bit since FW spec indicates that it should | 135 | /* Clamp region code to 8-bit since FW spec indicates that it should |
123 | * only ever be 8-bit, even though the field size is 16-bit. Some firmware | 136 | * only ever be 8-bit, even though the field size is 16-bit. Some firmware |
124 | * returns non-zero high 8 bits here. | 137 | * returns non-zero high 8 bits here. |
@@ -1036,17 +1049,26 @@ static int __lbs_mesh_config_send(struct lbs_private *priv, | |||
1036 | uint16_t action, uint16_t type) | 1049 | uint16_t action, uint16_t type) |
1037 | { | 1050 | { |
1038 | int ret; | 1051 | int ret; |
1052 | u16 command = CMD_MESH_CONFIG_OLD; | ||
1039 | 1053 | ||
1040 | lbs_deb_enter(LBS_DEB_CMD); | 1054 | lbs_deb_enter(LBS_DEB_CMD); |
1041 | 1055 | ||
1042 | cmd->hdr.command = cpu_to_le16(CMD_MESH_CONFIG); | 1056 | /* |
1057 | * Command id is 0xac for v10 FW along with mesh interface | ||
1058 | * id in bits 14-13-12. | ||
1059 | */ | ||
1060 | if (priv->mesh_fw_ver == MESH_FW_NEW) | ||
1061 | command = CMD_MESH_CONFIG | | ||
1062 | (MESH_IFACE_ID << MESH_IFACE_BIT_OFFSET); | ||
1063 | |||
1064 | cmd->hdr.command = cpu_to_le16(command); | ||
1043 | cmd->hdr.size = cpu_to_le16(sizeof(struct cmd_ds_mesh_config)); | 1065 | cmd->hdr.size = cpu_to_le16(sizeof(struct cmd_ds_mesh_config)); |
1044 | cmd->hdr.result = 0; | 1066 | cmd->hdr.result = 0; |
1045 | 1067 | ||
1046 | cmd->type = cpu_to_le16(type); | 1068 | cmd->type = cpu_to_le16(type); |
1047 | cmd->action = cpu_to_le16(action); | 1069 | cmd->action = cpu_to_le16(action); |
1048 | 1070 | ||
1049 | ret = lbs_cmd_with_response(priv, CMD_MESH_CONFIG, cmd); | 1071 | ret = lbs_cmd_with_response(priv, command, cmd); |
1050 | 1072 | ||
1051 | lbs_deb_leave(LBS_DEB_CMD); | 1073 | lbs_deb_leave(LBS_DEB_CMD); |
1052 | return ret; | 1074 | return ret; |