forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/net/wireless/marvell/libertas/mesh.c
....@@ -86,6 +86,7 @@
8686 static int lbs_mesh_config(struct lbs_private *priv, uint16_t action,
8787 uint16_t chan)
8888 {
89
+ struct wireless_dev *mesh_wdev;
8990 struct cmd_ds_mesh_config cmd;
9091 struct mrvl_meshie *ie;
9192
....@@ -105,10 +106,17 @@
105106 ie->val.active_protocol_id = MARVELL_MESH_PROTO_ID_HWMP;
106107 ie->val.active_metric_id = MARVELL_MESH_METRIC_ID;
107108 ie->val.mesh_capability = MARVELL_MESH_CAPABILITY;
108
- ie->val.mesh_id_len = priv->mesh_ssid_len;
109
- memcpy(ie->val.mesh_id, priv->mesh_ssid, priv->mesh_ssid_len);
109
+
110
+ if (priv->mesh_dev) {
111
+ mesh_wdev = priv->mesh_dev->ieee80211_ptr;
112
+ ie->val.mesh_id_len = mesh_wdev->mesh_id_up_len;
113
+ memcpy(ie->val.mesh_id, mesh_wdev->ssid,
114
+ mesh_wdev->mesh_id_up_len);
115
+ }
116
+
110117 ie->len = sizeof(struct mrvl_meshie_val) -
111
- IEEE80211_MAX_SSID_LEN + priv->mesh_ssid_len;
118
+ IEEE80211_MAX_SSID_LEN + ie->val.mesh_id_len;
119
+
112120 cmd.length = cpu_to_le16(sizeof(struct mrvl_meshie_val));
113121 break;
114122 case CMD_ACT_MESH_CONFIG_STOP:
....@@ -117,8 +125,8 @@
117125 return -1;
118126 }
119127 lbs_deb_cmd("mesh config action %d type %x channel %d SSID %*pE\n",
120
- action, priv->mesh_tlv, chan, priv->mesh_ssid_len,
121
- priv->mesh_ssid);
128
+ action, priv->mesh_tlv, chan, ie->val.mesh_id_len,
129
+ ie->val.mesh_id);
122130
123131 return __lbs_mesh_config_send(priv, &cmd, action, priv->mesh_tlv);
124132 }
....@@ -802,10 +810,8 @@
802810 * Check mesh FW version and appropriately send the mesh start
803811 * command
804812 */
805
-int lbs_init_mesh(struct lbs_private *priv)
813
+void lbs_init_mesh(struct lbs_private *priv)
806814 {
807
- int ret = 0;
808
-
809815 /* Determine mesh_fw_ver from fwrelease and fwcapinfo */
810816 /* 5.0.16p0 9.0.0.p0 is known to NOT support any mesh */
811817 /* 5.110.22 have mesh command with 0xa3 command id */
....@@ -844,14 +850,6 @@
844850
845851 /* Stop meshing until interface is brought up */
846852 lbs_mesh_config(priv, CMD_ACT_MESH_CONFIG_STOP, 1);
847
-
848
- if (priv->mesh_tlv) {
849
- sprintf(priv->mesh_ssid, "mesh");
850
- priv->mesh_ssid_len = 4;
851
- ret = 1;
852
- }
853
-
854
- return ret;
855853 }
856854
857855 void lbs_start_mesh(struct lbs_private *priv)
....@@ -979,6 +977,12 @@
979977
980978 mesh_wdev->iftype = NL80211_IFTYPE_MESH_POINT;
981979 mesh_wdev->wiphy = priv->wdev->wiphy;
980
+
981
+ if (priv->mesh_tlv) {
982
+ sprintf(mesh_wdev->ssid, "mesh");
983
+ mesh_wdev->mesh_id_up_len = 4;
984
+ }
985
+
982986 mesh_wdev->netdev = mesh_dev;
983987
984988 mesh_dev->ml_priv = priv;