diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-05-25 23:36:54 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-06-11 14:28:45 -0400 |
commit | 981f187b7c4b237011d4175cae0120d5d203c0fd (patch) | |
tree | b4508fc33a9aed0177c18c3a4db5c4e500fdb646 /drivers/net/wireless/libertas/main.c | |
parent | 123e0e044091ca35a4766b38ae15032f2d41bcd6 (diff) |
[PATCH] libertas: first pass at fixing up endianness issues
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/main.c')
-rw-r--r-- | drivers/net/wireless/libertas/main.c | 10 |
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, | |||
199 | static ssize_t libertas_mpp_set(struct device * dev, | 199 | static 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 | */ |
216 | static DEVICE_ATTR(libertas_mpp, 0644, libertas_mpp_get, | 219 | static 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. |