Commit 117599e0 authored by Jussi Kivilinna's avatar Jussi Kivilinna Committed by David S. Miller

rndis_wlan: cleanup: byteswap data from device instead of RNDIS_* defines

All other values from device provided buffer are byteswapped, so it seems more
logical to do same for these.
Signed-off-by: default avatarJussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3eef3668
...@@ -623,8 +623,8 @@ static int rndis_akm_suite_to_key_mgmt(u32 akm_suite) ...@@ -623,8 +623,8 @@ static int rndis_akm_suite_to_key_mgmt(u32 akm_suite)
#ifdef DEBUG #ifdef DEBUG
static const char *oid_to_string(__le32 oid) static const char *oid_to_string(__le32 oid)
{ {
switch (oid) { switch (le32_to_cpu(oid)) {
#define OID_STR(oid) case cpu_to_le32(oid): return(#oid) #define OID_STR(oid) case oid: return(#oid)
/* from rndis_host.h */ /* from rndis_host.h */
OID_STR(RNDIS_OID_802_3_PERMANENT_ADDRESS); OID_STR(RNDIS_OID_802_3_PERMANENT_ADDRESS);
OID_STR(RNDIS_OID_GEN_MAXIMUM_FRAME_SIZE); OID_STR(RNDIS_OID_GEN_MAXIMUM_FRAME_SIZE);
...@@ -687,19 +687,19 @@ static const char *oid_to_string(__le32 oid) ...@@ -687,19 +687,19 @@ static const char *oid_to_string(__le32 oid)
static int rndis_error_status(__le32 rndis_status) static int rndis_error_status(__le32 rndis_status)
{ {
int ret = -EINVAL; int ret = -EINVAL;
switch (rndis_status) { switch (le32_to_cpu(rndis_status)) {
case cpu_to_le32(RNDIS_STATUS_SUCCESS): case RNDIS_STATUS_SUCCESS:
ret = 0; ret = 0;
break; break;
case cpu_to_le32(RNDIS_STATUS_FAILURE): case RNDIS_STATUS_FAILURE:
case cpu_to_le32(RNDIS_STATUS_INVALID_DATA): case RNDIS_STATUS_INVALID_DATA:
ret = -EINVAL; ret = -EINVAL;
break; break;
case cpu_to_le32(RNDIS_STATUS_NOT_SUPPORTED): case RNDIS_STATUS_NOT_SUPPORTED:
ret = -EOPNOTSUPP; ret = -EOPNOTSUPP;
break; break;
case cpu_to_le32(RNDIS_STATUS_ADAPTER_NOT_READY): case RNDIS_STATUS_ADAPTER_NOT_READY:
case cpu_to_le32(RNDIS_STATUS_ADAPTER_NOT_OPEN): case RNDIS_STATUS_ADAPTER_NOT_OPEN:
ret = -EBUSY; ret = -EBUSY;
break; break;
} }
...@@ -3075,8 +3075,8 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen) ...@@ -3075,8 +3075,8 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen)
struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev);
struct rndis_indicate *msg = ind; struct rndis_indicate *msg = ind;
switch (msg->status) { switch (le32_to_cpu(msg->status)) {
case cpu_to_le32(RNDIS_STATUS_MEDIA_CONNECT): case RNDIS_STATUS_MEDIA_CONNECT:
if (priv->current_command_oid == cpu_to_le32(RNDIS_OID_802_11_ADD_KEY)) { if (priv->current_command_oid == cpu_to_le32(RNDIS_OID_802_11_ADD_KEY)) {
/* OID_802_11_ADD_KEY causes sometimes extra /* OID_802_11_ADD_KEY causes sometimes extra
* "media connect" indications which confuses driver * "media connect" indications which confuses driver
...@@ -3096,7 +3096,7 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen) ...@@ -3096,7 +3096,7 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen)
queue_work(priv->workqueue, &priv->work); queue_work(priv->workqueue, &priv->work);
break; break;
case cpu_to_le32(RNDIS_STATUS_MEDIA_DISCONNECT): case RNDIS_STATUS_MEDIA_DISCONNECT:
netdev_info(usbdev->net, "media disconnect\n"); netdev_info(usbdev->net, "media disconnect\n");
/* queue work to avoid recursive calls into rndis_command */ /* queue work to avoid recursive calls into rndis_command */
...@@ -3104,7 +3104,7 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen) ...@@ -3104,7 +3104,7 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen)
queue_work(priv->workqueue, &priv->work); queue_work(priv->workqueue, &priv->work);
break; break;
case cpu_to_le32(RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION): case RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION:
rndis_wlan_media_specific_indication(usbdev, msg, buflen); rndis_wlan_media_specific_indication(usbdev, msg, buflen);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment