diff options
author | Jussi Kivilinna <jussi.kivilinna@mbnet.fi> | 2012-05-11 18:17:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-12 15:17:02 -0400 |
commit | 117599e0be7f3916b8863193569fdff64e954183 (patch) | |
tree | f3b3ee36c5113ad706bee5d0c284c0b59cbc6d8f /drivers/net/wireless/rndis_wlan.c | |
parent | 3eef36689888390cc30fbe0d27a5785e1df08de0 (diff) |
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: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/rndis_wlan.c')
-rw-r--r-- | drivers/net/wireless/rndis_wlan.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index 0dcc8e49dbb4..16b3622730b4 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c | |||
@@ -623,8 +623,8 @@ static int rndis_akm_suite_to_key_mgmt(u32 akm_suite) | |||
623 | #ifdef DEBUG | 623 | #ifdef DEBUG |
624 | static const char *oid_to_string(__le32 oid) | 624 | static const char *oid_to_string(__le32 oid) |
625 | { | 625 | { |
626 | switch (oid) { | 626 | switch (le32_to_cpu(oid)) { |
627 | #define OID_STR(oid) case cpu_to_le32(oid): return(#oid) | 627 | #define OID_STR(oid) case oid: return(#oid) |
628 | /* from rndis_host.h */ | 628 | /* from rndis_host.h */ |
629 | OID_STR(RNDIS_OID_802_3_PERMANENT_ADDRESS); | 629 | OID_STR(RNDIS_OID_802_3_PERMANENT_ADDRESS); |
630 | OID_STR(RNDIS_OID_GEN_MAXIMUM_FRAME_SIZE); | 630 | OID_STR(RNDIS_OID_GEN_MAXIMUM_FRAME_SIZE); |
@@ -687,19 +687,19 @@ static const char *oid_to_string(__le32 oid) | |||
687 | static int rndis_error_status(__le32 rndis_status) | 687 | static int rndis_error_status(__le32 rndis_status) |
688 | { | 688 | { |
689 | int ret = -EINVAL; | 689 | int ret = -EINVAL; |
690 | switch (rndis_status) { | 690 | switch (le32_to_cpu(rndis_status)) { |
691 | case cpu_to_le32(RNDIS_STATUS_SUCCESS): | 691 | case RNDIS_STATUS_SUCCESS: |
692 | ret = 0; | 692 | ret = 0; |
693 | break; | 693 | break; |
694 | case cpu_to_le32(RNDIS_STATUS_FAILURE): | 694 | case RNDIS_STATUS_FAILURE: |
695 | case cpu_to_le32(RNDIS_STATUS_INVALID_DATA): | 695 | case RNDIS_STATUS_INVALID_DATA: |
696 | ret = -EINVAL; | 696 | ret = -EINVAL; |
697 | break; | 697 | break; |
698 | case cpu_to_le32(RNDIS_STATUS_NOT_SUPPORTED): | 698 | case RNDIS_STATUS_NOT_SUPPORTED: |
699 | ret = -EOPNOTSUPP; | 699 | ret = -EOPNOTSUPP; |
700 | break; | 700 | break; |
701 | case cpu_to_le32(RNDIS_STATUS_ADAPTER_NOT_READY): | 701 | case RNDIS_STATUS_ADAPTER_NOT_READY: |
702 | case cpu_to_le32(RNDIS_STATUS_ADAPTER_NOT_OPEN): | 702 | case RNDIS_STATUS_ADAPTER_NOT_OPEN: |
703 | ret = -EBUSY; | 703 | ret = -EBUSY; |
704 | break; | 704 | break; |
705 | } | 705 | } |
@@ -3075,8 +3075,8 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen) | |||
3075 | struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); | 3075 | struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); |
3076 | struct rndis_indicate *msg = ind; | 3076 | struct rndis_indicate *msg = ind; |
3077 | 3077 | ||
3078 | switch (msg->status) { | 3078 | switch (le32_to_cpu(msg->status)) { |
3079 | case cpu_to_le32(RNDIS_STATUS_MEDIA_CONNECT): | 3079 | case RNDIS_STATUS_MEDIA_CONNECT: |
3080 | if (priv->current_command_oid == cpu_to_le32(RNDIS_OID_802_11_ADD_KEY)) { | 3080 | if (priv->current_command_oid == cpu_to_le32(RNDIS_OID_802_11_ADD_KEY)) { |
3081 | /* OID_802_11_ADD_KEY causes sometimes extra | 3081 | /* OID_802_11_ADD_KEY causes sometimes extra |
3082 | * "media connect" indications which confuses driver | 3082 | * "media connect" indications which confuses driver |
@@ -3096,7 +3096,7 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen) | |||
3096 | queue_work(priv->workqueue, &priv->work); | 3096 | queue_work(priv->workqueue, &priv->work); |
3097 | break; | 3097 | break; |
3098 | 3098 | ||
3099 | case cpu_to_le32(RNDIS_STATUS_MEDIA_DISCONNECT): | 3099 | case RNDIS_STATUS_MEDIA_DISCONNECT: |
3100 | netdev_info(usbdev->net, "media disconnect\n"); | 3100 | netdev_info(usbdev->net, "media disconnect\n"); |
3101 | 3101 | ||
3102 | /* queue work to avoid recursive calls into rndis_command */ | 3102 | /* 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 | queue_work(priv->workqueue, &priv->work); | 3104 | queue_work(priv->workqueue, &priv->work); |
3105 | break; | 3105 | break; |
3106 | 3106 | ||
3107 | case cpu_to_le32(RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION): | 3107 | case RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION: |
3108 | rndis_wlan_media_specific_indication(usbdev, msg, buflen); | 3108 | rndis_wlan_media_specific_indication(usbdev, msg, buflen); |
3109 | break; | 3109 | break; |
3110 | 3110 | ||