aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/libertas/main.c')
-rw-r--r--drivers/net/wireless/libertas/main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 072eeebfdcd1..ec9be0c51c69 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -190,7 +190,7 @@ static ssize_t libertas_mpp_get(struct device * dev,
190 cmd_act_mesh_get_mpp, 190 cmd_act_mesh_get_mpp,
191 cmd_option_waitforrsp, 0, (void *)&mesh_access); 191 cmd_option_waitforrsp, 0, (void *)&mesh_access);
192 192
193 return snprintf(buf, 3, "%d\n", mesh_access.data[0]); 193 return snprintf(buf, 3, "%d\n", le32_to_cpu(mesh_access.data[0]));
194} 194}
195 195
196/** 196/**
@@ -199,9 +199,12 @@ static ssize_t libertas_mpp_get(struct device * dev,
199static ssize_t libertas_mpp_set(struct device * dev, 199static ssize_t libertas_mpp_set(struct device * dev,
200 struct device_attribute *attr, const char * buf, size_t count) { 200 struct device_attribute *attr, const char * buf, size_t count) {
201 struct cmd_ds_mesh_access mesh_access; 201 struct cmd_ds_mesh_access mesh_access;
202 uint32_t datum;
202 203
203 memset(&mesh_access, 0, sizeof(mesh_access)); 204 memset(&mesh_access, 0, sizeof(mesh_access));
204 sscanf(buf, "%d", &(mesh_access.data[0])); 205 sscanf(buf, "%d", &datum);
206 mesh_access.data[0] = cpu_to_le32(datum);
207
205 libertas_prepare_and_send_command((to_net_dev(dev))->priv, 208 libertas_prepare_and_send_command((to_net_dev(dev))->priv,
206 cmd_mesh_access, 209 cmd_mesh_access,
207 cmd_act_mesh_set_mpp, 210 cmd_act_mesh_set_mpp,
@@ -213,8 +216,7 @@ static ssize_t libertas_mpp_set(struct device * dev,
213 * libertas_mpp attribute to be exported per mshX interface 216 * libertas_mpp attribute to be exported per mshX interface
214 * through sysfs (/sys/class/net/mshX/libertas-mpp) 217 * through sysfs (/sys/class/net/mshX/libertas-mpp)
215 */ 218 */
216static DEVICE_ATTR(libertas_mpp, 0644, libertas_mpp_get, 219static DEVICE_ATTR(libertas_mpp, 0644, libertas_mpp_get, libertas_mpp_set );
217 libertas_mpp_set );
218 220
219/** 221/**
220 * @brief Check if the device can be open and wait if necessary. 222 * @brief Check if the device can be open and wait if necessary.