diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2012-05-11 18:15:39 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-12 15:00:45 -0400 |
commit | 7390e8b0dee778b0a964337558990a91094e679a (patch) | |
tree | af1fc449dcfa152e55e6b8544ff3102ab4f44891 | |
parent | 647c0c70e8a44e359d1d90d9d067d0b6b611076a (diff) |
usb/net: rndis: inline the cpu_to_le32() macro
The header file <linux/usb/rndis_host.h> used a number of #defines
that included the cpu_to_le32() macro to assure the result will be
in LE endianness. Inlining this into the code instead of using it
in the code definitions yields consolidation opportunities later
on as you will see in the following patches. The individual
drivers also used local defines - all are switched over to the
pattern of doing the conversion at the call sites instead.
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>
-rw-r--r-- | drivers/net/usb/rndis_host.c | 54 | ||||
-rw-r--r-- | drivers/net/wireless/rndis_wlan.c | 212 | ||||
-rw-r--r-- | include/linux/usb/rndis_host.h | 84 |
3 files changed, 177 insertions, 173 deletions
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index c8f1b5b3aff3..3b7ddfd25fd2 100644 --- a/drivers/net/usb/rndis_host.c +++ b/drivers/net/usb/rndis_host.c | |||
@@ -78,10 +78,10 @@ static void rndis_msg_indicate(struct usbnet *dev, struct rndis_indicate *msg, | |||
78 | dev->driver_info->indication(dev, msg, buflen); | 78 | dev->driver_info->indication(dev, msg, buflen); |
79 | } else { | 79 | } else { |
80 | switch (msg->status) { | 80 | switch (msg->status) { |
81 | case RNDIS_STATUS_MEDIA_CONNECT: | 81 | case cpu_to_le32(RNDIS_STATUS_MEDIA_CONNECT): |
82 | dev_info(udev, "rndis media connect\n"); | 82 | dev_info(udev, "rndis media connect\n"); |
83 | break; | 83 | break; |
84 | case RNDIS_STATUS_MEDIA_DISCONNECT: | 84 | case cpu_to_le32(RNDIS_STATUS_MEDIA_DISCONNECT): |
85 | dev_info(udev, "rndis media disconnect\n"); | 85 | dev_info(udev, "rndis media disconnect\n"); |
86 | break; | 86 | break; |
87 | default: | 87 | default: |
@@ -117,8 +117,8 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen) | |||
117 | */ | 117 | */ |
118 | 118 | ||
119 | /* Issue the request; xid is unique, don't bother byteswapping it */ | 119 | /* Issue the request; xid is unique, don't bother byteswapping it */ |
120 | if (likely(buf->msg_type != RNDIS_MSG_HALT && | 120 | if (likely(buf->msg_type != cpu_to_le32(RNDIS_MSG_HALT) && |
121 | buf->msg_type != RNDIS_MSG_RESET)) { | 121 | buf->msg_type != cpu_to_le32(RNDIS_MSG_RESET))) { |
122 | xid = dev->xid++; | 122 | xid = dev->xid++; |
123 | if (!xid) | 123 | if (!xid) |
124 | xid = dev->xid++; | 124 | xid = dev->xid++; |
@@ -149,7 +149,7 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen) | |||
149 | } | 149 | } |
150 | 150 | ||
151 | /* Poll the control channel; the request probably completed immediately */ | 151 | /* Poll the control channel; the request probably completed immediately */ |
152 | rsp = buf->msg_type | RNDIS_MSG_COMPLETION; | 152 | rsp = buf->msg_type | cpu_to_le32(RNDIS_MSG_COMPLETION); |
153 | for (count = 0; count < 10; count++) { | 153 | for (count = 0; count < 10; count++) { |
154 | memset(buf, 0, CONTROL_BUFFER_SIZE); | 154 | memset(buf, 0, CONTROL_BUFFER_SIZE); |
155 | retval = usb_control_msg(dev->udev, | 155 | retval = usb_control_msg(dev->udev, |
@@ -164,9 +164,10 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen) | |||
164 | request_id = (__force u32) buf->request_id; | 164 | request_id = (__force u32) buf->request_id; |
165 | if (likely(buf->msg_type == rsp)) { | 165 | if (likely(buf->msg_type == rsp)) { |
166 | if (likely(request_id == xid)) { | 166 | if (likely(request_id == xid)) { |
167 | if (unlikely(rsp == RNDIS_MSG_RESET_C)) | 167 | if (unlikely(rsp == |
168 | cpu_to_le32(RNDIS_MSG_RESET_C))) | ||
168 | return 0; | 169 | return 0; |
169 | if (likely(RNDIS_STATUS_SUCCESS | 170 | if (likely(cpu_to_le32(RNDIS_STATUS_SUCCESS) |
170 | == buf->status)) | 171 | == buf->status)) |
171 | return 0; | 172 | return 0; |
172 | dev_dbg(&info->control->dev, | 173 | dev_dbg(&info->control->dev, |
@@ -179,16 +180,15 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen) | |||
179 | request_id, xid); | 180 | request_id, xid); |
180 | /* then likely retry */ | 181 | /* then likely retry */ |
181 | } else switch (buf->msg_type) { | 182 | } else switch (buf->msg_type) { |
182 | case RNDIS_MSG_INDICATE: /* fault/event */ | 183 | case cpu_to_le32(RNDIS_MSG_INDICATE): /* fault/event */ |
183 | rndis_msg_indicate(dev, (void *)buf, buflen); | 184 | rndis_msg_indicate(dev, (void *)buf, buflen); |
184 | |||
185 | break; | 185 | break; |
186 | case RNDIS_MSG_KEEPALIVE: { /* ping */ | 186 | case cpu_to_le32(RNDIS_MSG_KEEPALIVE): { /* ping */ |
187 | struct rndis_keepalive_c *msg = (void *)buf; | 187 | struct rndis_keepalive_c *msg = (void *)buf; |
188 | 188 | ||
189 | msg->msg_type = RNDIS_MSG_KEEPALIVE_C; | 189 | msg->msg_type = cpu_to_le32(RNDIS_MSG_KEEPALIVE_C); |
190 | msg->msg_len = cpu_to_le32(sizeof *msg); | 190 | msg->msg_len = cpu_to_le32(sizeof *msg); |
191 | msg->status = RNDIS_STATUS_SUCCESS; | 191 | msg->status = cpu_to_le32(RNDIS_STATUS_SUCCESS); |
192 | retval = usb_control_msg(dev->udev, | 192 | retval = usb_control_msg(dev->udev, |
193 | usb_sndctrlpipe(dev->udev, 0), | 193 | usb_sndctrlpipe(dev->udev, 0), |
194 | USB_CDC_SEND_ENCAPSULATED_COMMAND, | 194 | USB_CDC_SEND_ENCAPSULATED_COMMAND, |
@@ -251,7 +251,7 @@ static int rndis_query(struct usbnet *dev, struct usb_interface *intf, | |||
251 | u.buf = buf; | 251 | u.buf = buf; |
252 | 252 | ||
253 | memset(u.get, 0, sizeof *u.get + in_len); | 253 | memset(u.get, 0, sizeof *u.get + in_len); |
254 | u.get->msg_type = RNDIS_MSG_QUERY; | 254 | u.get->msg_type = cpu_to_le32(RNDIS_MSG_QUERY); |
255 | u.get->msg_len = cpu_to_le32(sizeof *u.get + in_len); | 255 | u.get->msg_len = cpu_to_le32(sizeof *u.get + in_len); |
256 | u.get->oid = oid; | 256 | u.get->oid = oid; |
257 | u.get->len = cpu_to_le32(in_len); | 257 | u.get->len = cpu_to_le32(in_len); |
@@ -324,7 +324,7 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) | |||
324 | if (retval < 0) | 324 | if (retval < 0) |
325 | goto fail; | 325 | goto fail; |
326 | 326 | ||
327 | u.init->msg_type = RNDIS_MSG_INIT; | 327 | u.init->msg_type = cpu_to_le32(RNDIS_MSG_INIT); |
328 | u.init->msg_len = cpu_to_le32(sizeof *u.init); | 328 | u.init->msg_len = cpu_to_le32(sizeof *u.init); |
329 | u.init->major_version = cpu_to_le32(1); | 329 | u.init->major_version = cpu_to_le32(1); |
330 | u.init->minor_version = cpu_to_le32(0); | 330 | u.init->minor_version = cpu_to_le32(0); |
@@ -395,22 +395,23 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) | |||
395 | /* Check physical medium */ | 395 | /* Check physical medium */ |
396 | phym = NULL; | 396 | phym = NULL; |
397 | reply_len = sizeof *phym; | 397 | reply_len = sizeof *phym; |
398 | retval = rndis_query(dev, intf, u.buf, OID_GEN_PHYSICAL_MEDIUM, | 398 | retval = rndis_query(dev, intf, u.buf, |
399 | cpu_to_le32(OID_GEN_PHYSICAL_MEDIUM), | ||
399 | 0, (void **) &phym, &reply_len); | 400 | 0, (void **) &phym, &reply_len); |
400 | if (retval != 0 || !phym) { | 401 | if (retval != 0 || !phym) { |
401 | /* OID is optional so don't fail here. */ | 402 | /* OID is optional so don't fail here. */ |
402 | phym_unspec = RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED; | 403 | phym_unspec = cpu_to_le32(RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED); |
403 | phym = &phym_unspec; | 404 | phym = &phym_unspec; |
404 | } | 405 | } |
405 | if ((flags & FLAG_RNDIS_PHYM_WIRELESS) && | 406 | if ((flags & FLAG_RNDIS_PHYM_WIRELESS) && |
406 | *phym != RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN) { | 407 | *phym != cpu_to_le32(RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN)) { |
407 | netif_dbg(dev, probe, dev->net, | 408 | netif_dbg(dev, probe, dev->net, |
408 | "driver requires wireless physical medium, but device is not\n"); | 409 | "driver requires wireless physical medium, but device is not\n"); |
409 | retval = -ENODEV; | 410 | retval = -ENODEV; |
410 | goto halt_fail_and_release; | 411 | goto halt_fail_and_release; |
411 | } | 412 | } |
412 | if ((flags & FLAG_RNDIS_PHYM_NOT_WIRELESS) && | 413 | if ((flags & FLAG_RNDIS_PHYM_NOT_WIRELESS) && |
413 | *phym == RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN) { | 414 | *phym == cpu_to_le32(RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN)) { |
414 | netif_dbg(dev, probe, dev->net, | 415 | netif_dbg(dev, probe, dev->net, |
415 | "driver requires non-wireless physical medium, but device is wireless.\n"); | 416 | "driver requires non-wireless physical medium, but device is wireless.\n"); |
416 | retval = -ENODEV; | 417 | retval = -ENODEV; |
@@ -419,7 +420,8 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) | |||
419 | 420 | ||
420 | /* Get designated host ethernet address */ | 421 | /* Get designated host ethernet address */ |
421 | reply_len = ETH_ALEN; | 422 | reply_len = ETH_ALEN; |
422 | retval = rndis_query(dev, intf, u.buf, OID_802_3_PERMANENT_ADDRESS, | 423 | retval = rndis_query(dev, intf, u.buf, |
424 | cpu_to_le32(OID_802_3_PERMANENT_ADDRESS), | ||
423 | 48, (void **) &bp, &reply_len); | 425 | 48, (void **) &bp, &reply_len); |
424 | if (unlikely(retval< 0)) { | 426 | if (unlikely(retval< 0)) { |
425 | dev_err(&intf->dev, "rndis get ethaddr, %d\n", retval); | 427 | dev_err(&intf->dev, "rndis get ethaddr, %d\n", retval); |
@@ -430,12 +432,12 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) | |||
430 | 432 | ||
431 | /* set a nonzero filter to enable data transfers */ | 433 | /* set a nonzero filter to enable data transfers */ |
432 | memset(u.set, 0, sizeof *u.set); | 434 | memset(u.set, 0, sizeof *u.set); |
433 | u.set->msg_type = RNDIS_MSG_SET; | 435 | u.set->msg_type = cpu_to_le32(RNDIS_MSG_SET); |
434 | u.set->msg_len = cpu_to_le32(4 + sizeof *u.set); | 436 | u.set->msg_len = cpu_to_le32(4 + sizeof *u.set); |
435 | u.set->oid = OID_GEN_CURRENT_PACKET_FILTER; | 437 | u.set->oid = cpu_to_le32(OID_GEN_CURRENT_PACKET_FILTER); |
436 | u.set->len = cpu_to_le32(4); | 438 | u.set->len = cpu_to_le32(4); |
437 | u.set->offset = cpu_to_le32((sizeof *u.set) - 8); | 439 | u.set->offset = cpu_to_le32((sizeof *u.set) - 8); |
438 | *(__le32 *)(u.buf + sizeof *u.set) = RNDIS_DEFAULT_FILTER; | 440 | *(__le32 *)(u.buf + sizeof *u.set) = cpu_to_le32(RNDIS_DEFAULT_FILTER); |
439 | 441 | ||
440 | retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE); | 442 | retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE); |
441 | if (unlikely(retval < 0)) { | 443 | if (unlikely(retval < 0)) { |
@@ -450,7 +452,7 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) | |||
450 | 452 | ||
451 | halt_fail_and_release: | 453 | halt_fail_and_release: |
452 | memset(u.halt, 0, sizeof *u.halt); | 454 | memset(u.halt, 0, sizeof *u.halt); |
453 | u.halt->msg_type = RNDIS_MSG_HALT; | 455 | u.halt->msg_type = cpu_to_le32(RNDIS_MSG_HALT); |
454 | u.halt->msg_len = cpu_to_le32(sizeof *u.halt); | 456 | u.halt->msg_len = cpu_to_le32(sizeof *u.halt); |
455 | (void) rndis_command(dev, (void *)u.halt, CONTROL_BUFFER_SIZE); | 457 | (void) rndis_command(dev, (void *)u.halt, CONTROL_BUFFER_SIZE); |
456 | fail_and_release: | 458 | fail_and_release: |
@@ -475,7 +477,7 @@ void rndis_unbind(struct usbnet *dev, struct usb_interface *intf) | |||
475 | /* try to clear any rndis state/activity (no i/o from stack!) */ | 477 | /* try to clear any rndis state/activity (no i/o from stack!) */ |
476 | halt = kzalloc(CONTROL_BUFFER_SIZE, GFP_KERNEL); | 478 | halt = kzalloc(CONTROL_BUFFER_SIZE, GFP_KERNEL); |
477 | if (halt) { | 479 | if (halt) { |
478 | halt->msg_type = RNDIS_MSG_HALT; | 480 | halt->msg_type = cpu_to_le32(RNDIS_MSG_HALT); |
479 | halt->msg_len = cpu_to_le32(sizeof *halt); | 481 | halt->msg_len = cpu_to_le32(sizeof *halt); |
480 | (void) rndis_command(dev, (void *)halt, CONTROL_BUFFER_SIZE); | 482 | (void) rndis_command(dev, (void *)halt, CONTROL_BUFFER_SIZE); |
481 | kfree(halt); | 483 | kfree(halt); |
@@ -501,7 +503,7 @@ int rndis_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
501 | data_len = le32_to_cpu(hdr->data_len); | 503 | data_len = le32_to_cpu(hdr->data_len); |
502 | 504 | ||
503 | /* don't choke if we see oob, per-packet data, etc */ | 505 | /* don't choke if we see oob, per-packet data, etc */ |
504 | if (unlikely(hdr->msg_type != RNDIS_MSG_PACKET || | 506 | if (unlikely(hdr->msg_type != cpu_to_le32(RNDIS_MSG_PACKET) || |
505 | skb->len < msg_len || | 507 | skb->len < msg_len || |
506 | (data_offset + data_len + 8) > msg_len)) { | 508 | (data_offset + data_len + 8) > msg_len)) { |
507 | dev->net->stats.rx_frame_errors++; | 509 | dev->net->stats.rx_frame_errors++; |
@@ -569,7 +571,7 @@ rndis_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) | |||
569 | fill: | 571 | fill: |
570 | hdr = (void *) __skb_push(skb, sizeof *hdr); | 572 | hdr = (void *) __skb_push(skb, sizeof *hdr); |
571 | memset(hdr, 0, sizeof *hdr); | 573 | memset(hdr, 0, sizeof *hdr); |
572 | hdr->msg_type = RNDIS_MSG_PACKET; | 574 | hdr->msg_type = cpu_to_le32(RNDIS_MSG_PACKET); |
573 | hdr->msg_len = cpu_to_le32(skb->len); | 575 | hdr->msg_len = cpu_to_le32(skb->len); |
574 | hdr->data_offset = cpu_to_le32(sizeof(*hdr) - 8); | 576 | hdr->data_offset = cpu_to_le32(sizeof(*hdr) - 8); |
575 | hdr->data_len = cpu_to_le32(len); | 577 | hdr->data_len = cpu_to_le32(len); |
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index dcf0e7e25ab0..cd828e3b8e40 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c | |||
@@ -90,45 +90,45 @@ MODULE_PARM_DESC(workaround_interval, | |||
90 | 90 | ||
91 | 91 | ||
92 | /* various RNDIS OID defs */ | 92 | /* various RNDIS OID defs */ |
93 | #define OID_GEN_LINK_SPEED cpu_to_le32(0x00010107) | 93 | #define OID_GEN_LINK_SPEED 0x00010107 |
94 | #define OID_GEN_RNDIS_CONFIG_PARAMETER cpu_to_le32(0x0001021b) | 94 | #define OID_GEN_RNDIS_CONFIG_PARAMETER 0x0001021b |
95 | 95 | ||
96 | #define OID_GEN_XMIT_OK cpu_to_le32(0x00020101) | 96 | #define OID_GEN_XMIT_OK 0x00020101 |
97 | #define OID_GEN_RCV_OK cpu_to_le32(0x00020102) | 97 | #define OID_GEN_RCV_OK 0x00020102 |
98 | #define OID_GEN_XMIT_ERROR cpu_to_le32(0x00020103) | 98 | #define OID_GEN_XMIT_ERROR 0x00020103 |
99 | #define OID_GEN_RCV_ERROR cpu_to_le32(0x00020104) | 99 | #define OID_GEN_RCV_ERROR 0x00020104 |
100 | #define OID_GEN_RCV_NO_BUFFER cpu_to_le32(0x00020105) | 100 | #define OID_GEN_RCV_NO_BUFFER 0x00020105 |
101 | 101 | ||
102 | #define OID_802_3_CURRENT_ADDRESS cpu_to_le32(0x01010102) | 102 | #define OID_802_3_CURRENT_ADDRESS 0x01010102 |
103 | #define OID_802_3_MULTICAST_LIST cpu_to_le32(0x01010103) | 103 | #define OID_802_3_MULTICAST_LIST 0x01010103 |
104 | #define OID_802_3_MAXIMUM_LIST_SIZE cpu_to_le32(0x01010104) | 104 | #define OID_802_3_MAXIMUM_LIST_SIZE 0x01010104 |
105 | 105 | ||
106 | #define OID_802_11_BSSID cpu_to_le32(0x0d010101) | 106 | #define OID_802_11_BSSID 0x0d010101 |
107 | #define OID_802_11_SSID cpu_to_le32(0x0d010102) | 107 | #define OID_802_11_SSID 0x0d010102 |
108 | #define OID_802_11_INFRASTRUCTURE_MODE cpu_to_le32(0x0d010108) | 108 | #define OID_802_11_INFRASTRUCTURE_MODE 0x0d010108 |
109 | #define OID_802_11_ADD_WEP cpu_to_le32(0x0d010113) | 109 | #define OID_802_11_ADD_WEP 0x0d010113 |
110 | #define OID_802_11_REMOVE_WEP cpu_to_le32(0x0d010114) | 110 | #define OID_802_11_REMOVE_WEP 0x0d010114 |
111 | #define OID_802_11_DISASSOCIATE cpu_to_le32(0x0d010115) | 111 | #define OID_802_11_DISASSOCIATE 0x0d010115 |
112 | #define OID_802_11_AUTHENTICATION_MODE cpu_to_le32(0x0d010118) | 112 | #define OID_802_11_AUTHENTICATION_MODE 0x0d010118 |
113 | #define OID_802_11_PRIVACY_FILTER cpu_to_le32(0x0d010119) | 113 | #define OID_802_11_PRIVACY_FILTER 0x0d010119 |
114 | #define OID_802_11_BSSID_LIST_SCAN cpu_to_le32(0x0d01011a) | 114 | #define OID_802_11_BSSID_LIST_SCAN 0x0d01011a |
115 | #define OID_802_11_ENCRYPTION_STATUS cpu_to_le32(0x0d01011b) | 115 | #define OID_802_11_ENCRYPTION_STATUS 0x0d01011b |
116 | #define OID_802_11_ADD_KEY cpu_to_le32(0x0d01011d) | 116 | #define OID_802_11_ADD_KEY 0x0d01011d |
117 | #define OID_802_11_REMOVE_KEY cpu_to_le32(0x0d01011e) | 117 | #define OID_802_11_REMOVE_KEY 0x0d01011e |
118 | #define OID_802_11_ASSOCIATION_INFORMATION cpu_to_le32(0x0d01011f) | 118 | #define OID_802_11_ASSOCIATION_INFORMATION 0x0d01011f |
119 | #define OID_802_11_CAPABILITY cpu_to_le32(0x0d010122) | 119 | #define OID_802_11_CAPABILITY 0x0d010122 |
120 | #define OID_802_11_PMKID cpu_to_le32(0x0d010123) | 120 | #define OID_802_11_PMKID 0x0d010123 |
121 | #define OID_802_11_NETWORK_TYPES_SUPPORTED cpu_to_le32(0x0d010203) | 121 | #define OID_802_11_NETWORK_TYPES_SUPPORTED 0x0d010203 |
122 | #define OID_802_11_NETWORK_TYPE_IN_USE cpu_to_le32(0x0d010204) | 122 | #define OID_802_11_NETWORK_TYPE_IN_USE 0x0d010204 |
123 | #define OID_802_11_TX_POWER_LEVEL cpu_to_le32(0x0d010205) | 123 | #define OID_802_11_TX_POWER_LEVEL 0x0d010205 |
124 | #define OID_802_11_RSSI cpu_to_le32(0x0d010206) | 124 | #define OID_802_11_RSSI 0x0d010206 |
125 | #define OID_802_11_RSSI_TRIGGER cpu_to_le32(0x0d010207) | 125 | #define OID_802_11_RSSI_TRIGGER 0x0d010207 |
126 | #define OID_802_11_FRAGMENTATION_THRESHOLD cpu_to_le32(0x0d010209) | 126 | #define OID_802_11_FRAGMENTATION_THRESHOLD 0x0d010209 |
127 | #define OID_802_11_RTS_THRESHOLD cpu_to_le32(0x0d01020a) | 127 | #define OID_802_11_RTS_THRESHOLD 0x0d01020a |
128 | #define OID_802_11_SUPPORTED_RATES cpu_to_le32(0x0d01020e) | 128 | #define OID_802_11_SUPPORTED_RATES 0x0d01020e |
129 | #define OID_802_11_CONFIGURATION cpu_to_le32(0x0d010211) | 129 | #define OID_802_11_CONFIGURATION 0x0d010211 |
130 | #define OID_802_11_POWER_MODE cpu_to_le32(0x0d010216) | 130 | #define OID_802_11_POWER_MODE 0x0d010216 |
131 | #define OID_802_11_BSSID_LIST cpu_to_le32(0x0d010217) | 131 | #define OID_802_11_BSSID_LIST 0x0d010217 |
132 | 132 | ||
133 | 133 | ||
134 | /* Typical noise/maximum signal level values taken from ndiswrapper iw_ndis.h */ | 134 | /* Typical noise/maximum signal level values taken from ndiswrapper iw_ndis.h */ |
@@ -151,8 +151,8 @@ MODULE_PARM_DESC(workaround_interval, | |||
151 | 151 | ||
152 | 152 | ||
153 | /* codes for "status" field of completion messages */ | 153 | /* codes for "status" field of completion messages */ |
154 | #define RNDIS_STATUS_ADAPTER_NOT_READY cpu_to_le32(0xc0010011) | 154 | #define RNDIS_STATUS_ADAPTER_NOT_READY 0xc0010011 |
155 | #define RNDIS_STATUS_ADAPTER_NOT_OPEN cpu_to_le32(0xc0010012) | 155 | #define RNDIS_STATUS_ADAPTER_NOT_OPEN 0xc0010012 |
156 | 156 | ||
157 | 157 | ||
158 | /* Known device types */ | 158 | /* Known device types */ |
@@ -673,7 +673,7 @@ static int rndis_akm_suite_to_key_mgmt(u32 akm_suite) | |||
673 | static const char *oid_to_string(__le32 oid) | 673 | static const char *oid_to_string(__le32 oid) |
674 | { | 674 | { |
675 | switch (oid) { | 675 | switch (oid) { |
676 | #define OID_STR(oid) case oid: return(#oid) | 676 | #define OID_STR(oid) case cpu_to_le32(oid): return(#oid) |
677 | /* from rndis_host.h */ | 677 | /* from rndis_host.h */ |
678 | OID_STR(OID_802_3_PERMANENT_ADDRESS); | 678 | OID_STR(OID_802_3_PERMANENT_ADDRESS); |
679 | OID_STR(OID_GEN_MAXIMUM_FRAME_SIZE); | 679 | OID_STR(OID_GEN_MAXIMUM_FRAME_SIZE); |
@@ -737,18 +737,18 @@ static int rndis_error_status(__le32 rndis_status) | |||
737 | { | 737 | { |
738 | int ret = -EINVAL; | 738 | int ret = -EINVAL; |
739 | switch (rndis_status) { | 739 | switch (rndis_status) { |
740 | case RNDIS_STATUS_SUCCESS: | 740 | case cpu_to_le32(RNDIS_STATUS_SUCCESS): |
741 | ret = 0; | 741 | ret = 0; |
742 | break; | 742 | break; |
743 | case RNDIS_STATUS_FAILURE: | 743 | case cpu_to_le32(RNDIS_STATUS_FAILURE): |
744 | case RNDIS_STATUS_INVALID_DATA: | 744 | case cpu_to_le32(RNDIS_STATUS_INVALID_DATA): |
745 | ret = -EINVAL; | 745 | ret = -EINVAL; |
746 | break; | 746 | break; |
747 | case RNDIS_STATUS_NOT_SUPPORTED: | 747 | case cpu_to_le32(RNDIS_STATUS_NOT_SUPPORTED): |
748 | ret = -EOPNOTSUPP; | 748 | ret = -EOPNOTSUPP; |
749 | break; | 749 | break; |
750 | case RNDIS_STATUS_ADAPTER_NOT_READY: | 750 | case cpu_to_le32(RNDIS_STATUS_ADAPTER_NOT_READY): |
751 | case RNDIS_STATUS_ADAPTER_NOT_OPEN: | 751 | case cpu_to_le32(RNDIS_STATUS_ADAPTER_NOT_OPEN): |
752 | ret = -EBUSY; | 752 | ret = -EBUSY; |
753 | break; | 753 | break; |
754 | } | 754 | } |
@@ -782,7 +782,7 @@ static int rndis_query_oid(struct usbnet *dev, __le32 oid, void *data, int *len) | |||
782 | mutex_lock(&priv->command_lock); | 782 | mutex_lock(&priv->command_lock); |
783 | 783 | ||
784 | memset(u.get, 0, sizeof *u.get); | 784 | memset(u.get, 0, sizeof *u.get); |
785 | u.get->msg_type = RNDIS_MSG_QUERY; | 785 | u.get->msg_type = cpu_to_le32(RNDIS_MSG_QUERY); |
786 | u.get->msg_len = cpu_to_le32(sizeof *u.get); | 786 | u.get->msg_len = cpu_to_le32(sizeof *u.get); |
787 | u.get->oid = oid; | 787 | u.get->oid = oid; |
788 | 788 | ||
@@ -866,7 +866,7 @@ static int rndis_set_oid(struct usbnet *dev, __le32 oid, const void *data, | |||
866 | mutex_lock(&priv->command_lock); | 866 | mutex_lock(&priv->command_lock); |
867 | 867 | ||
868 | memset(u.set, 0, sizeof *u.set); | 868 | memset(u.set, 0, sizeof *u.set); |
869 | u.set->msg_type = RNDIS_MSG_SET; | 869 | u.set->msg_type = cpu_to_le32(RNDIS_MSG_SET); |
870 | u.set->msg_len = cpu_to_le32(sizeof(*u.set) + len); | 870 | u.set->msg_len = cpu_to_le32(sizeof(*u.set) + len); |
871 | u.set->oid = oid; | 871 | u.set->oid = oid; |
872 | u.set->len = cpu_to_le32(len); | 872 | u.set->len = cpu_to_le32(len); |
@@ -908,7 +908,7 @@ static int rndis_reset(struct usbnet *usbdev) | |||
908 | 908 | ||
909 | reset = (void *)priv->command_buffer; | 909 | reset = (void *)priv->command_buffer; |
910 | memset(reset, 0, sizeof(*reset)); | 910 | memset(reset, 0, sizeof(*reset)); |
911 | reset->msg_type = RNDIS_MSG_RESET; | 911 | reset->msg_type = cpu_to_le32(RNDIS_MSG_RESET); |
912 | reset->msg_len = cpu_to_le32(sizeof(*reset)); | 912 | reset->msg_len = cpu_to_le32(sizeof(*reset)); |
913 | priv->current_command_oid = 0; | 913 | priv->current_command_oid = 0; |
914 | ret = rndis_command(usbdev, (void *)reset, CONTROL_BUFFER_SIZE); | 914 | ret = rndis_command(usbdev, (void *)reset, CONTROL_BUFFER_SIZE); |
@@ -994,7 +994,7 @@ static int rndis_set_config_parameter(struct usbnet *dev, char *param, | |||
994 | } | 994 | } |
995 | #endif | 995 | #endif |
996 | 996 | ||
997 | ret = rndis_set_oid(dev, OID_GEN_RNDIS_CONFIG_PARAMETER, | 997 | ret = rndis_set_oid(dev, cpu_to_le32(OID_GEN_RNDIS_CONFIG_PARAMETER), |
998 | infobuf, info_len); | 998 | infobuf, info_len); |
999 | if (ret != 0) | 999 | if (ret != 0) |
1000 | netdev_dbg(dev->net, "setting rndis config parameter failed, %d\n", | 1000 | netdev_dbg(dev->net, "setting rndis config parameter failed, %d\n", |
@@ -1033,7 +1033,7 @@ static int rndis_start_bssid_list_scan(struct usbnet *usbdev) | |||
1033 | 1033 | ||
1034 | /* Note: OID_802_11_BSSID_LIST_SCAN clears internal BSS list. */ | 1034 | /* Note: OID_802_11_BSSID_LIST_SCAN clears internal BSS list. */ |
1035 | tmp = cpu_to_le32(1); | 1035 | tmp = cpu_to_le32(1); |
1036 | return rndis_set_oid(usbdev, OID_802_11_BSSID_LIST_SCAN, &tmp, | 1036 | return rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_BSSID_LIST_SCAN), &tmp, |
1037 | sizeof(tmp)); | 1037 | sizeof(tmp)); |
1038 | } | 1038 | } |
1039 | 1039 | ||
@@ -1042,7 +1042,7 @@ static int set_essid(struct usbnet *usbdev, struct ndis_80211_ssid *ssid) | |||
1042 | struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); | 1042 | struct rndis_wlan_private *priv = get_rndis_wlan_priv(usbdev); |
1043 | int ret; | 1043 | int ret; |
1044 | 1044 | ||
1045 | ret = rndis_set_oid(usbdev, OID_802_11_SSID, ssid, sizeof(*ssid)); | 1045 | ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_SSID), ssid, sizeof(*ssid)); |
1046 | if (ret < 0) { | 1046 | if (ret < 0) { |
1047 | netdev_warn(usbdev->net, "setting SSID failed (%08X)\n", ret); | 1047 | netdev_warn(usbdev->net, "setting SSID failed (%08X)\n", ret); |
1048 | return ret; | 1048 | return ret; |
@@ -1059,7 +1059,7 @@ static int set_bssid(struct usbnet *usbdev, const u8 *bssid) | |||
1059 | { | 1059 | { |
1060 | int ret; | 1060 | int ret; |
1061 | 1061 | ||
1062 | ret = rndis_set_oid(usbdev, OID_802_11_BSSID, bssid, ETH_ALEN); | 1062 | ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_BSSID), bssid, ETH_ALEN); |
1063 | if (ret < 0) { | 1063 | if (ret < 0) { |
1064 | netdev_warn(usbdev->net, "setting BSSID[%pM] failed (%08X)\n", | 1064 | netdev_warn(usbdev->net, "setting BSSID[%pM] failed (%08X)\n", |
1065 | bssid, ret); | 1065 | bssid, ret); |
@@ -1083,7 +1083,7 @@ static int get_bssid(struct usbnet *usbdev, u8 bssid[ETH_ALEN]) | |||
1083 | int ret, len; | 1083 | int ret, len; |
1084 | 1084 | ||
1085 | len = ETH_ALEN; | 1085 | len = ETH_ALEN; |
1086 | ret = rndis_query_oid(usbdev, OID_802_11_BSSID, bssid, &len); | 1086 | ret = rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_BSSID), bssid, &len); |
1087 | 1087 | ||
1088 | if (ret != 0) | 1088 | if (ret != 0) |
1089 | memset(bssid, 0, ETH_ALEN); | 1089 | memset(bssid, 0, ETH_ALEN); |
@@ -1094,7 +1094,7 @@ static int get_bssid(struct usbnet *usbdev, u8 bssid[ETH_ALEN]) | |||
1094 | static int get_association_info(struct usbnet *usbdev, | 1094 | static int get_association_info(struct usbnet *usbdev, |
1095 | struct ndis_80211_assoc_info *info, int len) | 1095 | struct ndis_80211_assoc_info *info, int len) |
1096 | { | 1096 | { |
1097 | return rndis_query_oid(usbdev, OID_802_11_ASSOCIATION_INFORMATION, | 1097 | return rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_ASSOCIATION_INFORMATION), |
1098 | info, &len); | 1098 | info, &len); |
1099 | } | 1099 | } |
1100 | 1100 | ||
@@ -1119,7 +1119,7 @@ static int disassociate(struct usbnet *usbdev, bool reset_ssid) | |||
1119 | int i, ret = 0; | 1119 | int i, ret = 0; |
1120 | 1120 | ||
1121 | if (priv->radio_on) { | 1121 | if (priv->radio_on) { |
1122 | ret = rndis_set_oid(usbdev, OID_802_11_DISASSOCIATE, NULL, 0); | 1122 | ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_DISASSOCIATE), NULL, 0); |
1123 | if (ret == 0) { | 1123 | if (ret == 0) { |
1124 | priv->radio_on = false; | 1124 | priv->radio_on = false; |
1125 | netdev_dbg(usbdev->net, "%s(): radio_on = false\n", | 1125 | netdev_dbg(usbdev->net, "%s(): radio_on = false\n", |
@@ -1181,7 +1181,7 @@ static int set_auth_mode(struct usbnet *usbdev, u32 wpa_version, | |||
1181 | return -ENOTSUPP; | 1181 | return -ENOTSUPP; |
1182 | 1182 | ||
1183 | tmp = cpu_to_le32(auth_mode); | 1183 | tmp = cpu_to_le32(auth_mode); |
1184 | ret = rndis_set_oid(usbdev, OID_802_11_AUTHENTICATION_MODE, &tmp, | 1184 | ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_AUTHENTICATION_MODE), &tmp, |
1185 | sizeof(tmp)); | 1185 | sizeof(tmp)); |
1186 | if (ret != 0) { | 1186 | if (ret != 0) { |
1187 | netdev_warn(usbdev->net, "setting auth mode failed (%08X)\n", | 1187 | netdev_warn(usbdev->net, "setting auth mode failed (%08X)\n", |
@@ -1208,7 +1208,7 @@ static int set_priv_filter(struct usbnet *usbdev) | |||
1208 | else | 1208 | else |
1209 | tmp = cpu_to_le32(NDIS_80211_PRIV_ACCEPT_ALL); | 1209 | tmp = cpu_to_le32(NDIS_80211_PRIV_ACCEPT_ALL); |
1210 | 1210 | ||
1211 | return rndis_set_oid(usbdev, OID_802_11_PRIVACY_FILTER, &tmp, | 1211 | return rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_PRIVACY_FILTER), &tmp, |
1212 | sizeof(tmp)); | 1212 | sizeof(tmp)); |
1213 | } | 1213 | } |
1214 | 1214 | ||
@@ -1234,7 +1234,7 @@ static int set_encr_mode(struct usbnet *usbdev, int pairwise, int groupwise) | |||
1234 | encr_mode = NDIS_80211_ENCR_DISABLED; | 1234 | encr_mode = NDIS_80211_ENCR_DISABLED; |
1235 | 1235 | ||
1236 | tmp = cpu_to_le32(encr_mode); | 1236 | tmp = cpu_to_le32(encr_mode); |
1237 | ret = rndis_set_oid(usbdev, OID_802_11_ENCRYPTION_STATUS, &tmp, | 1237 | ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_ENCRYPTION_STATUS), &tmp, |
1238 | sizeof(tmp)); | 1238 | sizeof(tmp)); |
1239 | if (ret != 0) { | 1239 | if (ret != 0) { |
1240 | netdev_warn(usbdev->net, "setting encr mode failed (%08X)\n", | 1240 | netdev_warn(usbdev->net, "setting encr mode failed (%08X)\n", |
@@ -1255,7 +1255,7 @@ static int set_infra_mode(struct usbnet *usbdev, int mode) | |||
1255 | __func__, priv->infra_mode); | 1255 | __func__, priv->infra_mode); |
1256 | 1256 | ||
1257 | tmp = cpu_to_le32(mode); | 1257 | tmp = cpu_to_le32(mode); |
1258 | ret = rndis_set_oid(usbdev, OID_802_11_INFRASTRUCTURE_MODE, &tmp, | 1258 | ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_INFRASTRUCTURE_MODE), &tmp, |
1259 | sizeof(tmp)); | 1259 | sizeof(tmp)); |
1260 | if (ret != 0) { | 1260 | if (ret != 0) { |
1261 | netdev_warn(usbdev->net, "setting infra mode failed (%08X)\n", | 1261 | netdev_warn(usbdev->net, "setting infra mode failed (%08X)\n", |
@@ -1282,7 +1282,7 @@ static int set_rts_threshold(struct usbnet *usbdev, u32 rts_threshold) | |||
1282 | rts_threshold = 2347; | 1282 | rts_threshold = 2347; |
1283 | 1283 | ||
1284 | tmp = cpu_to_le32(rts_threshold); | 1284 | tmp = cpu_to_le32(rts_threshold); |
1285 | return rndis_set_oid(usbdev, OID_802_11_RTS_THRESHOLD, &tmp, | 1285 | return rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_RTS_THRESHOLD), &tmp, |
1286 | sizeof(tmp)); | 1286 | sizeof(tmp)); |
1287 | } | 1287 | } |
1288 | 1288 | ||
@@ -1296,7 +1296,7 @@ static int set_frag_threshold(struct usbnet *usbdev, u32 frag_threshold) | |||
1296 | frag_threshold = 2346; | 1296 | frag_threshold = 2346; |
1297 | 1297 | ||
1298 | tmp = cpu_to_le32(frag_threshold); | 1298 | tmp = cpu_to_le32(frag_threshold); |
1299 | return rndis_set_oid(usbdev, OID_802_11_FRAGMENTATION_THRESHOLD, &tmp, | 1299 | return rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_FRAGMENTATION_THRESHOLD), &tmp, |
1300 | sizeof(tmp)); | 1300 | sizeof(tmp)); |
1301 | } | 1301 | } |
1302 | 1302 | ||
@@ -1333,7 +1333,7 @@ static int set_channel(struct usbnet *usbdev, int channel) | |||
1333 | dsconfig = ieee80211_dsss_chan_to_freq(channel) * 1000; | 1333 | dsconfig = ieee80211_dsss_chan_to_freq(channel) * 1000; |
1334 | 1334 | ||
1335 | len = sizeof(config); | 1335 | len = sizeof(config); |
1336 | ret = rndis_query_oid(usbdev, OID_802_11_CONFIGURATION, &config, &len); | 1336 | ret = rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_CONFIGURATION), &config, &len); |
1337 | if (ret < 0) { | 1337 | if (ret < 0) { |
1338 | netdev_dbg(usbdev->net, "%s(): querying configuration failed\n", | 1338 | netdev_dbg(usbdev->net, "%s(): querying configuration failed\n", |
1339 | __func__); | 1339 | __func__); |
@@ -1341,7 +1341,7 @@ static int set_channel(struct usbnet *usbdev, int channel) | |||
1341 | } | 1341 | } |
1342 | 1342 | ||
1343 | config.ds_config = cpu_to_le32(dsconfig); | 1343 | config.ds_config = cpu_to_le32(dsconfig); |
1344 | ret = rndis_set_oid(usbdev, OID_802_11_CONFIGURATION, &config, | 1344 | ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_CONFIGURATION), &config, |
1345 | sizeof(config)); | 1345 | sizeof(config)); |
1346 | 1346 | ||
1347 | netdev_dbg(usbdev->net, "%s(): %d -> %d\n", __func__, channel, ret); | 1347 | netdev_dbg(usbdev->net, "%s(): %d -> %d\n", __func__, channel, ret); |
@@ -1359,7 +1359,7 @@ static struct ieee80211_channel *get_current_channel(struct usbnet *usbdev, | |||
1359 | 1359 | ||
1360 | /* Get channel and beacon interval */ | 1360 | /* Get channel and beacon interval */ |
1361 | len = sizeof(config); | 1361 | len = sizeof(config); |
1362 | ret = rndis_query_oid(usbdev, OID_802_11_CONFIGURATION, &config, &len); | 1362 | ret = rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_CONFIGURATION), &config, &len); |
1363 | netdev_dbg(usbdev->net, "%s(): OID_802_11_CONFIGURATION -> %d\n", | 1363 | netdev_dbg(usbdev->net, "%s(): OID_802_11_CONFIGURATION -> %d\n", |
1364 | __func__, ret); | 1364 | __func__, ret); |
1365 | if (ret < 0) | 1365 | if (ret < 0) |
@@ -1413,7 +1413,7 @@ static int add_wep_key(struct usbnet *usbdev, const u8 *key, int key_len, | |||
1413 | ret); | 1413 | ret); |
1414 | } | 1414 | } |
1415 | 1415 | ||
1416 | ret = rndis_set_oid(usbdev, OID_802_11_ADD_WEP, &ndis_key, | 1416 | ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_ADD_WEP), &ndis_key, |
1417 | sizeof(ndis_key)); | 1417 | sizeof(ndis_key)); |
1418 | if (ret != 0) { | 1418 | if (ret != 0) { |
1419 | netdev_warn(usbdev->net, "adding encryption key %d failed (%08X)\n", | 1419 | netdev_warn(usbdev->net, "adding encryption key %d failed (%08X)\n", |
@@ -1504,7 +1504,7 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len, | |||
1504 | get_bssid(usbdev, ndis_key.bssid); | 1504 | get_bssid(usbdev, ndis_key.bssid); |
1505 | } | 1505 | } |
1506 | 1506 | ||
1507 | ret = rndis_set_oid(usbdev, OID_802_11_ADD_KEY, &ndis_key, | 1507 | ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_ADD_KEY), &ndis_key, |
1508 | le32_to_cpu(ndis_key.size)); | 1508 | le32_to_cpu(ndis_key.size)); |
1509 | netdev_dbg(usbdev->net, "%s(): OID_802_11_ADD_KEY -> %08X\n", | 1509 | netdev_dbg(usbdev->net, "%s(): OID_802_11_ADD_KEY -> %08X\n", |
1510 | __func__, ret); | 1510 | __func__, ret); |
@@ -1594,13 +1594,13 @@ static int remove_key(struct usbnet *usbdev, u8 index, const u8 *bssid) | |||
1594 | memset(remove_key.bssid, 0xff, | 1594 | memset(remove_key.bssid, 0xff, |
1595 | sizeof(remove_key.bssid)); | 1595 | sizeof(remove_key.bssid)); |
1596 | 1596 | ||
1597 | ret = rndis_set_oid(usbdev, OID_802_11_REMOVE_KEY, &remove_key, | 1597 | ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_REMOVE_KEY), &remove_key, |
1598 | sizeof(remove_key)); | 1598 | sizeof(remove_key)); |
1599 | if (ret != 0) | 1599 | if (ret != 0) |
1600 | return ret; | 1600 | return ret; |
1601 | } else { | 1601 | } else { |
1602 | keyindex = cpu_to_le32(index); | 1602 | keyindex = cpu_to_le32(index); |
1603 | ret = rndis_set_oid(usbdev, OID_802_11_REMOVE_WEP, &keyindex, | 1603 | ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_REMOVE_WEP), &keyindex, |
1604 | sizeof(keyindex)); | 1604 | sizeof(keyindex)); |
1605 | if (ret != 0) { | 1605 | if (ret != 0) { |
1606 | netdev_warn(usbdev->net, | 1606 | netdev_warn(usbdev->net, |
@@ -1626,14 +1626,14 @@ static void set_multicast_list(struct usbnet *usbdev) | |||
1626 | char *mc_addrs = NULL; | 1626 | char *mc_addrs = NULL; |
1627 | int mc_count; | 1627 | int mc_count; |
1628 | 1628 | ||
1629 | basefilter = filter = RNDIS_PACKET_TYPE_DIRECTED | | 1629 | basefilter = filter = cpu_to_le32(RNDIS_PACKET_TYPE_DIRECTED | |
1630 | RNDIS_PACKET_TYPE_BROADCAST; | 1630 | RNDIS_PACKET_TYPE_BROADCAST); |
1631 | 1631 | ||
1632 | if (usbdev->net->flags & IFF_PROMISC) { | 1632 | if (usbdev->net->flags & IFF_PROMISC) { |
1633 | filter |= RNDIS_PACKET_TYPE_PROMISCUOUS | | 1633 | filter |= cpu_to_le32(RNDIS_PACKET_TYPE_PROMISCUOUS | |
1634 | RNDIS_PACKET_TYPE_ALL_LOCAL; | 1634 | RNDIS_PACKET_TYPE_ALL_LOCAL); |
1635 | } else if (usbdev->net->flags & IFF_ALLMULTI) { | 1635 | } else if (usbdev->net->flags & IFF_ALLMULTI) { |
1636 | filter |= RNDIS_PACKET_TYPE_ALL_MULTICAST; | 1636 | filter |= cpu_to_le32(RNDIS_PACKET_TYPE_ALL_MULTICAST); |
1637 | } | 1637 | } |
1638 | 1638 | ||
1639 | if (filter != basefilter) | 1639 | if (filter != basefilter) |
@@ -1646,7 +1646,7 @@ static void set_multicast_list(struct usbnet *usbdev) | |||
1646 | netif_addr_lock_bh(usbdev->net); | 1646 | netif_addr_lock_bh(usbdev->net); |
1647 | mc_count = netdev_mc_count(usbdev->net); | 1647 | mc_count = netdev_mc_count(usbdev->net); |
1648 | if (mc_count > priv->multicast_size) { | 1648 | if (mc_count > priv->multicast_size) { |
1649 | filter |= RNDIS_PACKET_TYPE_ALL_MULTICAST; | 1649 | filter |= cpu_to_le32(RNDIS_PACKET_TYPE_ALL_MULTICAST); |
1650 | } else if (mc_count) { | 1650 | } else if (mc_count) { |
1651 | int i = 0; | 1651 | int i = 0; |
1652 | 1652 | ||
@@ -1669,20 +1669,20 @@ static void set_multicast_list(struct usbnet *usbdev) | |||
1669 | goto set_filter; | 1669 | goto set_filter; |
1670 | 1670 | ||
1671 | if (mc_count) { | 1671 | if (mc_count) { |
1672 | ret = rndis_set_oid(usbdev, OID_802_3_MULTICAST_LIST, mc_addrs, | 1672 | ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_3_MULTICAST_LIST), mc_addrs, |
1673 | mc_count * ETH_ALEN); | 1673 | mc_count * ETH_ALEN); |
1674 | kfree(mc_addrs); | 1674 | kfree(mc_addrs); |
1675 | if (ret == 0) | 1675 | if (ret == 0) |
1676 | filter |= RNDIS_PACKET_TYPE_MULTICAST; | 1676 | filter |= cpu_to_le32(RNDIS_PACKET_TYPE_MULTICAST); |
1677 | else | 1677 | else |
1678 | filter |= RNDIS_PACKET_TYPE_ALL_MULTICAST; | 1678 | filter |= cpu_to_le32(RNDIS_PACKET_TYPE_ALL_MULTICAST); |
1679 | 1679 | ||
1680 | netdev_dbg(usbdev->net, "OID_802_3_MULTICAST_LIST(%d, max: %d) -> %d\n", | 1680 | netdev_dbg(usbdev->net, "OID_802_3_MULTICAST_LIST(%d, max: %d) -> %d\n", |
1681 | mc_count, priv->multicast_size, ret); | 1681 | mc_count, priv->multicast_size, ret); |
1682 | } | 1682 | } |
1683 | 1683 | ||
1684 | set_filter: | 1684 | set_filter: |
1685 | ret = rndis_set_oid(usbdev, OID_GEN_CURRENT_PACKET_FILTER, &filter, | 1685 | ret = rndis_set_oid(usbdev, cpu_to_le32(OID_GEN_CURRENT_PACKET_FILTER), &filter, |
1686 | sizeof(filter)); | 1686 | sizeof(filter)); |
1687 | if (ret < 0) { | 1687 | if (ret < 0) { |
1688 | netdev_warn(usbdev->net, "couldn't set packet filter: %08x\n", | 1688 | netdev_warn(usbdev->net, "couldn't set packet filter: %08x\n", |
@@ -1748,7 +1748,7 @@ static struct ndis_80211_pmkid *get_device_pmkids(struct usbnet *usbdev) | |||
1748 | pmkids->length = cpu_to_le32(len); | 1748 | pmkids->length = cpu_to_le32(len); |
1749 | pmkids->bssid_info_count = cpu_to_le32(max_pmkids); | 1749 | pmkids->bssid_info_count = cpu_to_le32(max_pmkids); |
1750 | 1750 | ||
1751 | ret = rndis_query_oid(usbdev, OID_802_11_PMKID, pmkids, &len); | 1751 | ret = rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_PMKID), pmkids, &len); |
1752 | if (ret < 0) { | 1752 | if (ret < 0) { |
1753 | netdev_dbg(usbdev->net, "%s(): OID_802_11_PMKID(%d, %d)" | 1753 | netdev_dbg(usbdev->net, "%s(): OID_802_11_PMKID(%d, %d)" |
1754 | " -> %d\n", __func__, len, max_pmkids, ret); | 1754 | " -> %d\n", __func__, len, max_pmkids, ret); |
@@ -1776,7 +1776,7 @@ static int set_device_pmkids(struct usbnet *usbdev, | |||
1776 | 1776 | ||
1777 | debug_print_pmkids(usbdev, pmkids, __func__); | 1777 | debug_print_pmkids(usbdev, pmkids, __func__); |
1778 | 1778 | ||
1779 | ret = rndis_set_oid(usbdev, OID_802_11_PMKID, pmkids, | 1779 | ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_PMKID), pmkids, |
1780 | le32_to_cpu(pmkids->length)); | 1780 | le32_to_cpu(pmkids->length)); |
1781 | if (ret < 0) { | 1781 | if (ret < 0) { |
1782 | netdev_dbg(usbdev->net, "%s(): OID_802_11_PMKID(%d, %d) -> %d" | 1782 | netdev_dbg(usbdev->net, "%s(): OID_802_11_PMKID(%d, %d) -> %d" |
@@ -2113,7 +2113,7 @@ resize_buf: | |||
2113 | * resizing until it won't get any bigger. | 2113 | * resizing until it won't get any bigger. |
2114 | */ | 2114 | */ |
2115 | new_len = len; | 2115 | new_len = len; |
2116 | ret = rndis_query_oid(usbdev, OID_802_11_BSSID_LIST, buf, &new_len); | 2116 | ret = rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_BSSID_LIST), buf, &new_len); |
2117 | if (ret != 0 || new_len < sizeof(struct ndis_80211_bssid_list_ex)) | 2117 | if (ret != 0 || new_len < sizeof(struct ndis_80211_bssid_list_ex)) |
2118 | goto out; | 2118 | goto out; |
2119 | 2119 | ||
@@ -2511,14 +2511,14 @@ static void rndis_fill_station_info(struct usbnet *usbdev, | |||
2511 | memset(sinfo, 0, sizeof(*sinfo)); | 2511 | memset(sinfo, 0, sizeof(*sinfo)); |
2512 | 2512 | ||
2513 | len = sizeof(linkspeed); | 2513 | len = sizeof(linkspeed); |
2514 | ret = rndis_query_oid(usbdev, OID_GEN_LINK_SPEED, &linkspeed, &len); | 2514 | ret = rndis_query_oid(usbdev, cpu_to_le32(OID_GEN_LINK_SPEED), &linkspeed, &len); |
2515 | if (ret == 0) { | 2515 | if (ret == 0) { |
2516 | sinfo->txrate.legacy = le32_to_cpu(linkspeed) / 1000; | 2516 | sinfo->txrate.legacy = le32_to_cpu(linkspeed) / 1000; |
2517 | sinfo->filled |= STATION_INFO_TX_BITRATE; | 2517 | sinfo->filled |= STATION_INFO_TX_BITRATE; |
2518 | } | 2518 | } |
2519 | 2519 | ||
2520 | len = sizeof(rssi); | 2520 | len = sizeof(rssi); |
2521 | ret = rndis_query_oid(usbdev, OID_802_11_RSSI, &rssi, &len); | 2521 | ret = rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_RSSI), &rssi, &len); |
2522 | if (ret == 0) { | 2522 | if (ret == 0) { |
2523 | sinfo->signal = level_to_qual(le32_to_cpu(rssi)); | 2523 | sinfo->signal = level_to_qual(le32_to_cpu(rssi)); |
2524 | sinfo->filled |= STATION_INFO_SIGNAL; | 2524 | sinfo->filled |= STATION_INFO_SIGNAL; |
@@ -2624,7 +2624,7 @@ static int rndis_flush_pmksa(struct wiphy *wiphy, struct net_device *netdev) | |||
2624 | pmkid.length = cpu_to_le32(sizeof(pmkid)); | 2624 | pmkid.length = cpu_to_le32(sizeof(pmkid)); |
2625 | pmkid.bssid_info_count = cpu_to_le32(0); | 2625 | pmkid.bssid_info_count = cpu_to_le32(0); |
2626 | 2626 | ||
2627 | return rndis_set_oid(usbdev, OID_802_11_PMKID, &pmkid, sizeof(pmkid)); | 2627 | return rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_PMKID), &pmkid, sizeof(pmkid)); |
2628 | } | 2628 | } |
2629 | 2629 | ||
2630 | static int rndis_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, | 2630 | static int rndis_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, |
@@ -2654,7 +2654,7 @@ static int rndis_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, | |||
2654 | priv->power_mode = power_mode; | 2654 | priv->power_mode = power_mode; |
2655 | 2655 | ||
2656 | mode = cpu_to_le32(power_mode); | 2656 | mode = cpu_to_le32(power_mode); |
2657 | ret = rndis_set_oid(usbdev, OID_802_11_POWER_MODE, &mode, sizeof(mode)); | 2657 | ret = rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_POWER_MODE), &mode, sizeof(mode)); |
2658 | 2658 | ||
2659 | netdev_dbg(usbdev->net, "%s(): OID_802_11_POWER_MODE -> %d\n", | 2659 | netdev_dbg(usbdev->net, "%s(): OID_802_11_POWER_MODE -> %d\n", |
2660 | __func__, ret); | 2660 | __func__, ret); |
@@ -2693,7 +2693,7 @@ static void rndis_wlan_craft_connected_bss(struct usbnet *usbdev, u8 *bssid, | |||
2693 | /* Get signal quality, in case of error use rssi=0 and ignore error. */ | 2693 | /* Get signal quality, in case of error use rssi=0 and ignore error. */ |
2694 | len = sizeof(rssi); | 2694 | len = sizeof(rssi); |
2695 | rssi = 0; | 2695 | rssi = 0; |
2696 | ret = rndis_query_oid(usbdev, OID_802_11_RSSI, &rssi, &len); | 2696 | ret = rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_RSSI), &rssi, &len); |
2697 | signal = level_to_qual(le32_to_cpu(rssi)); | 2697 | signal = level_to_qual(le32_to_cpu(rssi)); |
2698 | 2698 | ||
2699 | netdev_dbg(usbdev->net, "%s(): OID_802_11_RSSI -> %d, " | 2699 | netdev_dbg(usbdev->net, "%s(): OID_802_11_RSSI -> %d, " |
@@ -2720,7 +2720,7 @@ static void rndis_wlan_craft_connected_bss(struct usbnet *usbdev, u8 *bssid, | |||
2720 | /* Get SSID, in case of error, use zero length SSID and ignore error. */ | 2720 | /* Get SSID, in case of error, use zero length SSID and ignore error. */ |
2721 | len = sizeof(ssid); | 2721 | len = sizeof(ssid); |
2722 | memset(&ssid, 0, sizeof(ssid)); | 2722 | memset(&ssid, 0, sizeof(ssid)); |
2723 | ret = rndis_query_oid(usbdev, OID_802_11_SSID, &ssid, &len); | 2723 | ret = rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_SSID), &ssid, &len); |
2724 | netdev_dbg(usbdev->net, "%s(): OID_802_11_SSID -> %d, len: %d, ssid: " | 2724 | netdev_dbg(usbdev->net, "%s(): OID_802_11_SSID -> %d, len: %d, ssid: " |
2725 | "'%.32s'\n", __func__, ret, | 2725 | "'%.32s'\n", __func__, ret, |
2726 | le32_to_cpu(ssid.length), ssid.essid); | 2726 | le32_to_cpu(ssid.length), ssid.essid); |
@@ -3096,8 +3096,8 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen) | |||
3096 | struct rndis_indicate *msg = ind; | 3096 | struct rndis_indicate *msg = ind; |
3097 | 3097 | ||
3098 | switch (msg->status) { | 3098 | switch (msg->status) { |
3099 | case RNDIS_STATUS_MEDIA_CONNECT: | 3099 | case cpu_to_le32(RNDIS_STATUS_MEDIA_CONNECT): |
3100 | if (priv->current_command_oid == OID_802_11_ADD_KEY) { | 3100 | if (priv->current_command_oid == cpu_to_le32(OID_802_11_ADD_KEY)) { |
3101 | /* OID_802_11_ADD_KEY causes sometimes extra | 3101 | /* OID_802_11_ADD_KEY causes sometimes extra |
3102 | * "media connect" indications which confuses driver | 3102 | * "media connect" indications which confuses driver |
3103 | * and userspace to think that device is | 3103 | * and userspace to think that device is |
@@ -3116,7 +3116,7 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen) | |||
3116 | queue_work(priv->workqueue, &priv->work); | 3116 | queue_work(priv->workqueue, &priv->work); |
3117 | break; | 3117 | break; |
3118 | 3118 | ||
3119 | case RNDIS_STATUS_MEDIA_DISCONNECT: | 3119 | case cpu_to_le32(RNDIS_STATUS_MEDIA_DISCONNECT): |
3120 | netdev_info(usbdev->net, "media disconnect\n"); | 3120 | netdev_info(usbdev->net, "media disconnect\n"); |
3121 | 3121 | ||
3122 | /* queue work to avoid recursive calls into rndis_command */ | 3122 | /* queue work to avoid recursive calls into rndis_command */ |
@@ -3124,7 +3124,7 @@ static void rndis_wlan_indication(struct usbnet *usbdev, void *ind, int buflen) | |||
3124 | queue_work(priv->workqueue, &priv->work); | 3124 | queue_work(priv->workqueue, &priv->work); |
3125 | break; | 3125 | break; |
3126 | 3126 | ||
3127 | case RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION: | 3127 | case cpu_to_le32(RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION): |
3128 | rndis_wlan_media_specific_indication(usbdev, msg, buflen); | 3128 | rndis_wlan_media_specific_indication(usbdev, msg, buflen); |
3129 | break; | 3129 | break; |
3130 | 3130 | ||
@@ -3148,7 +3148,7 @@ static int rndis_wlan_get_caps(struct usbnet *usbdev, struct wiphy *wiphy) | |||
3148 | 3148 | ||
3149 | /* determine supported modes */ | 3149 | /* determine supported modes */ |
3150 | len = sizeof(networks_supported); | 3150 | len = sizeof(networks_supported); |
3151 | retval = rndis_query_oid(usbdev, OID_802_11_NETWORK_TYPES_SUPPORTED, | 3151 | retval = rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_NETWORK_TYPES_SUPPORTED), |
3152 | &networks_supported, &len); | 3152 | &networks_supported, &len); |
3153 | if (retval >= 0) { | 3153 | if (retval >= 0) { |
3154 | n = le32_to_cpu(networks_supported.num_items); | 3154 | n = le32_to_cpu(networks_supported.num_items); |
@@ -3173,7 +3173,7 @@ static int rndis_wlan_get_caps(struct usbnet *usbdev, struct wiphy *wiphy) | |||
3173 | /* get device 802.11 capabilities, number of PMKIDs */ | 3173 | /* get device 802.11 capabilities, number of PMKIDs */ |
3174 | caps = (struct ndis_80211_capability *)caps_buf; | 3174 | caps = (struct ndis_80211_capability *)caps_buf; |
3175 | len = sizeof(caps_buf); | 3175 | len = sizeof(caps_buf); |
3176 | retval = rndis_query_oid(usbdev, OID_802_11_CAPABILITY, caps, &len); | 3176 | retval = rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_CAPABILITY), caps, &len); |
3177 | if (retval >= 0) { | 3177 | if (retval >= 0) { |
3178 | netdev_dbg(usbdev->net, "OID_802_11_CAPABILITY -> len %d, " | 3178 | netdev_dbg(usbdev->net, "OID_802_11_CAPABILITY -> len %d, " |
3179 | "ver %d, pmkids %d, auth-encr-pairs %d\n", | 3179 | "ver %d, pmkids %d, auth-encr-pairs %d\n", |
@@ -3247,7 +3247,7 @@ static void rndis_device_poller(struct work_struct *work) | |||
3247 | } | 3247 | } |
3248 | 3248 | ||
3249 | len = sizeof(rssi); | 3249 | len = sizeof(rssi); |
3250 | ret = rndis_query_oid(usbdev, OID_802_11_RSSI, &rssi, &len); | 3250 | ret = rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_RSSI), &rssi, &len); |
3251 | if (ret == 0) { | 3251 | if (ret == 0) { |
3252 | priv->last_qual = level_to_qual(le32_to_cpu(rssi)); | 3252 | priv->last_qual = level_to_qual(le32_to_cpu(rssi)); |
3253 | rndis_do_cqm(usbdev, le32_to_cpu(rssi)); | 3253 | rndis_do_cqm(usbdev, le32_to_cpu(rssi)); |
@@ -3275,7 +3275,7 @@ static void rndis_device_poller(struct work_struct *work) | |||
3275 | * working. | 3275 | * working. |
3276 | */ | 3276 | */ |
3277 | tmp = cpu_to_le32(1); | 3277 | tmp = cpu_to_le32(1); |
3278 | rndis_set_oid(usbdev, OID_802_11_BSSID_LIST_SCAN, &tmp, | 3278 | rndis_set_oid(usbdev, cpu_to_le32(OID_802_11_BSSID_LIST_SCAN), &tmp, |
3279 | sizeof(tmp)); | 3279 | sizeof(tmp)); |
3280 | 3280 | ||
3281 | len = CONTROL_BUFFER_SIZE; | 3281 | len = CONTROL_BUFFER_SIZE; |
@@ -3283,7 +3283,7 @@ static void rndis_device_poller(struct work_struct *work) | |||
3283 | if (!buf) | 3283 | if (!buf) |
3284 | goto end; | 3284 | goto end; |
3285 | 3285 | ||
3286 | rndis_query_oid(usbdev, OID_802_11_BSSID_LIST, buf, &len); | 3286 | rndis_query_oid(usbdev, cpu_to_le32(OID_802_11_BSSID_LIST), buf, &len); |
3287 | kfree(buf); | 3287 | kfree(buf); |
3288 | } | 3288 | } |
3289 | 3289 | ||
@@ -3465,13 +3465,15 @@ static int rndis_wlan_bind(struct usbnet *usbdev, struct usb_interface *intf) | |||
3465 | */ | 3465 | */ |
3466 | usbdev->net->netdev_ops = &rndis_wlan_netdev_ops; | 3466 | usbdev->net->netdev_ops = &rndis_wlan_netdev_ops; |
3467 | 3467 | ||
3468 | tmp = RNDIS_PACKET_TYPE_DIRECTED | RNDIS_PACKET_TYPE_BROADCAST; | 3468 | tmp = cpu_to_le32(RNDIS_PACKET_TYPE_DIRECTED | RNDIS_PACKET_TYPE_BROADCAST); |
3469 | retval = rndis_set_oid(usbdev, OID_GEN_CURRENT_PACKET_FILTER, &tmp, | 3469 | retval = rndis_set_oid(usbdev, |
3470 | sizeof(tmp)); | 3470 | cpu_to_le32(OID_GEN_CURRENT_PACKET_FILTER), |
3471 | &tmp, sizeof(tmp)); | ||
3471 | 3472 | ||
3472 | len = sizeof(tmp); | 3473 | len = sizeof(tmp); |
3473 | retval = rndis_query_oid(usbdev, OID_802_3_MAXIMUM_LIST_SIZE, &tmp, | 3474 | retval = rndis_query_oid(usbdev, |
3474 | &len); | 3475 | cpu_to_le32(OID_802_3_MAXIMUM_LIST_SIZE), |
3476 | &tmp, &len); | ||
3475 | priv->multicast_size = le32_to_cpu(tmp); | 3477 | priv->multicast_size = le32_to_cpu(tmp); |
3476 | if (retval < 0 || priv->multicast_size < 0) | 3478 | if (retval < 0 || priv->multicast_size < 0) |
3477 | priv->multicast_size = 0; | 3479 | priv->multicast_size = 0; |
@@ -3601,7 +3603,7 @@ static int rndis_wlan_stop(struct usbnet *usbdev) | |||
3601 | /* Set current packet filter zero to block receiving data packets from | 3603 | /* Set current packet filter zero to block receiving data packets from |
3602 | device. */ | 3604 | device. */ |
3603 | filter = 0; | 3605 | filter = 0; |
3604 | rndis_set_oid(usbdev, OID_GEN_CURRENT_PACKET_FILTER, &filter, | 3606 | rndis_set_oid(usbdev, cpu_to_le32(OID_GEN_CURRENT_PACKET_FILTER), &filter, |
3605 | sizeof(filter)); | 3607 | sizeof(filter)); |
3606 | 3608 | ||
3607 | return retval; | 3609 | return retval; |
diff --git a/include/linux/usb/rndis_host.h b/include/linux/usb/rndis_host.h index 88fceb718c77..9a005b627eb2 100644 --- a/include/linux/usb/rndis_host.h +++ b/include/linux/usb/rndis_host.h | |||
@@ -49,46 +49,46 @@ struct rndis_msg_hdr { | |||
49 | */ | 49 | */ |
50 | #define RNDIS_CONTROL_TIMEOUT_MS (5 * 1000) | 50 | #define RNDIS_CONTROL_TIMEOUT_MS (5 * 1000) |
51 | 51 | ||
52 | #define RNDIS_MSG_COMPLETION cpu_to_le32(0x80000000) | 52 | #define RNDIS_MSG_COMPLETION 0x80000000 |
53 | 53 | ||
54 | /* codes for "msg_type" field of rndis messages; | 54 | /* codes for "msg_type" field of rndis messages; |
55 | * only the data channel uses packet messages (maybe batched); | 55 | * only the data channel uses packet messages (maybe batched); |
56 | * everything else goes on the control channel. | 56 | * everything else goes on the control channel. |
57 | */ | 57 | */ |
58 | #define RNDIS_MSG_PACKET cpu_to_le32(0x00000001) /* 1-N packets */ | 58 | #define RNDIS_MSG_PACKET 0x00000001 /* 1-N packets */ |
59 | #define RNDIS_MSG_INIT cpu_to_le32(0x00000002) | 59 | #define RNDIS_MSG_INIT 0x00000002 |
60 | #define RNDIS_MSG_INIT_C (RNDIS_MSG_INIT|RNDIS_MSG_COMPLETION) | 60 | #define RNDIS_MSG_INIT_C (RNDIS_MSG_INIT|RNDIS_MSG_COMPLETION) |
61 | #define RNDIS_MSG_HALT cpu_to_le32(0x00000003) | 61 | #define RNDIS_MSG_HALT 0x00000003 |
62 | #define RNDIS_MSG_QUERY cpu_to_le32(0x00000004) | 62 | #define RNDIS_MSG_QUERY 0x00000004 |
63 | #define RNDIS_MSG_QUERY_C (RNDIS_MSG_QUERY|RNDIS_MSG_COMPLETION) | 63 | #define RNDIS_MSG_QUERY_C (RNDIS_MSG_QUERY|RNDIS_MSG_COMPLETION) |
64 | #define RNDIS_MSG_SET cpu_to_le32(0x00000005) | 64 | #define RNDIS_MSG_SET 0x00000005 |
65 | #define RNDIS_MSG_SET_C (RNDIS_MSG_SET|RNDIS_MSG_COMPLETION) | 65 | #define RNDIS_MSG_SET_C (RNDIS_MSG_SET|RNDIS_MSG_COMPLETION) |
66 | #define RNDIS_MSG_RESET cpu_to_le32(0x00000006) | 66 | #define RNDIS_MSG_RESET 0x00000006 |
67 | #define RNDIS_MSG_RESET_C (RNDIS_MSG_RESET|RNDIS_MSG_COMPLETION) | 67 | #define RNDIS_MSG_RESET_C (RNDIS_MSG_RESET|RNDIS_MSG_COMPLETION) |
68 | #define RNDIS_MSG_INDICATE cpu_to_le32(0x00000007) | 68 | #define RNDIS_MSG_INDICATE 0x00000007 |
69 | #define RNDIS_MSG_KEEPALIVE cpu_to_le32(0x00000008) | 69 | #define RNDIS_MSG_KEEPALIVE 0x00000008 |
70 | #define RNDIS_MSG_KEEPALIVE_C (RNDIS_MSG_KEEPALIVE|RNDIS_MSG_COMPLETION) | 70 | #define RNDIS_MSG_KEEPALIVE_C (RNDIS_MSG_KEEPALIVE|RNDIS_MSG_COMPLETION) |
71 | 71 | ||
72 | /* codes for "status" field of completion messages */ | 72 | /* codes for "status" field of completion messages */ |
73 | #define RNDIS_STATUS_SUCCESS cpu_to_le32(0x00000000) | 73 | #define RNDIS_STATUS_SUCCESS 0x00000000 |
74 | #define RNDIS_STATUS_FAILURE cpu_to_le32(0xc0000001) | 74 | #define RNDIS_STATUS_FAILURE 0xc0000001 |
75 | #define RNDIS_STATUS_INVALID_DATA cpu_to_le32(0xc0010015) | 75 | #define RNDIS_STATUS_INVALID_DATA 0xc0010015 |
76 | #define RNDIS_STATUS_NOT_SUPPORTED cpu_to_le32(0xc00000bb) | 76 | #define RNDIS_STATUS_NOT_SUPPORTED 0xc00000bb |
77 | #define RNDIS_STATUS_MEDIA_CONNECT cpu_to_le32(0x4001000b) | 77 | #define RNDIS_STATUS_MEDIA_CONNECT 0x4001000b |
78 | #define RNDIS_STATUS_MEDIA_DISCONNECT cpu_to_le32(0x4001000c) | 78 | #define RNDIS_STATUS_MEDIA_DISCONNECT 0x4001000c |
79 | #define RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION cpu_to_le32(0x40010012) | 79 | #define RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION 0x40010012 |
80 | 80 | ||
81 | /* codes for OID_GEN_PHYSICAL_MEDIUM */ | 81 | /* codes for OID_GEN_PHYSICAL_MEDIUM */ |
82 | #define RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED cpu_to_le32(0x00000000) | 82 | #define RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED 0x00000000 |
83 | #define RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN cpu_to_le32(0x00000001) | 83 | #define RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN 0x00000001 |
84 | #define RNDIS_PHYSICAL_MEDIUM_CABLE_MODEM cpu_to_le32(0x00000002) | 84 | #define RNDIS_PHYSICAL_MEDIUM_CABLE_MODEM 0x00000002 |
85 | #define RNDIS_PHYSICAL_MEDIUM_PHONE_LINE cpu_to_le32(0x00000003) | 85 | #define RNDIS_PHYSICAL_MEDIUM_PHONE_LINE 0x00000003 |
86 | #define RNDIS_PHYSICAL_MEDIUM_POWER_LINE cpu_to_le32(0x00000004) | 86 | #define RNDIS_PHYSICAL_MEDIUM_POWER_LINE 0x00000004 |
87 | #define RNDIS_PHYSICAL_MEDIUM_DSL cpu_to_le32(0x00000005) | 87 | #define RNDIS_PHYSICAL_MEDIUM_DSL 0x00000005 |
88 | #define RNDIS_PHYSICAL_MEDIUM_FIBRE_CHANNEL cpu_to_le32(0x00000006) | 88 | #define RNDIS_PHYSICAL_MEDIUM_FIBRE_CHANNEL 0x00000006 |
89 | #define RNDIS_PHYSICAL_MEDIUM_1394 cpu_to_le32(0x00000007) | 89 | #define RNDIS_PHYSICAL_MEDIUM_1394 0x00000007 |
90 | #define RNDIS_PHYSICAL_MEDIUM_WIRELESS_WAN cpu_to_le32(0x00000008) | 90 | #define RNDIS_PHYSICAL_MEDIUM_WIRELESS_WAN 0x00000008 |
91 | #define RNDIS_PHYSICAL_MEDIUM_MAX cpu_to_le32(0x00000009) | 91 | #define RNDIS_PHYSICAL_MEDIUM_MAX 0x00000009 |
92 | 92 | ||
93 | struct rndis_data_hdr { | 93 | struct rndis_data_hdr { |
94 | __le32 msg_type; /* RNDIS_MSG_PACKET */ | 94 | __le32 msg_type; /* RNDIS_MSG_PACKET */ |
@@ -226,24 +226,24 @@ struct rndis_keepalive_c { /* IN (optionally OUT) */ | |||
226 | * there are gobs more that may optionally be supported. We'll avoid as much | 226 | * there are gobs more that may optionally be supported. We'll avoid as much |
227 | * of that mess as possible. | 227 | * of that mess as possible. |
228 | */ | 228 | */ |
229 | #define OID_802_3_PERMANENT_ADDRESS cpu_to_le32(0x01010101) | 229 | #define OID_802_3_PERMANENT_ADDRESS 0x01010101 |
230 | #define OID_GEN_MAXIMUM_FRAME_SIZE cpu_to_le32(0x00010106) | 230 | #define OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106 |
231 | #define OID_GEN_CURRENT_PACKET_FILTER cpu_to_le32(0x0001010e) | 231 | #define OID_GEN_CURRENT_PACKET_FILTER 0x0001010e |
232 | #define OID_GEN_PHYSICAL_MEDIUM cpu_to_le32(0x00010202) | 232 | #define OID_GEN_PHYSICAL_MEDIUM 0x00010202 |
233 | 233 | ||
234 | /* packet filter bits used by OID_GEN_CURRENT_PACKET_FILTER */ | 234 | /* packet filter bits used by OID_GEN_CURRENT_PACKET_FILTER */ |
235 | #define RNDIS_PACKET_TYPE_DIRECTED cpu_to_le32(0x00000001) | 235 | #define RNDIS_PACKET_TYPE_DIRECTED 0x00000001 |
236 | #define RNDIS_PACKET_TYPE_MULTICAST cpu_to_le32(0x00000002) | 236 | #define RNDIS_PACKET_TYPE_MULTICAST 0x00000002 |
237 | #define RNDIS_PACKET_TYPE_ALL_MULTICAST cpu_to_le32(0x00000004) | 237 | #define RNDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004 |
238 | #define RNDIS_PACKET_TYPE_BROADCAST cpu_to_le32(0x00000008) | 238 | #define RNDIS_PACKET_TYPE_BROADCAST 0x00000008 |
239 | #define RNDIS_PACKET_TYPE_SOURCE_ROUTING cpu_to_le32(0x00000010) | 239 | #define RNDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010 |
240 | #define RNDIS_PACKET_TYPE_PROMISCUOUS cpu_to_le32(0x00000020) | 240 | #define RNDIS_PACKET_TYPE_PROMISCUOUS 0x00000020 |
241 | #define RNDIS_PACKET_TYPE_SMT cpu_to_le32(0x00000040) | 241 | #define RNDIS_PACKET_TYPE_SMT 0x00000040 |
242 | #define RNDIS_PACKET_TYPE_ALL_LOCAL cpu_to_le32(0x00000080) | 242 | #define RNDIS_PACKET_TYPE_ALL_LOCAL 0x00000080 |
243 | #define RNDIS_PACKET_TYPE_GROUP cpu_to_le32(0x00001000) | 243 | #define RNDIS_PACKET_TYPE_GROUP 0x00001000 |
244 | #define RNDIS_PACKET_TYPE_ALL_FUNCTIONAL cpu_to_le32(0x00002000) | 244 | #define RNDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00002000 |
245 | #define RNDIS_PACKET_TYPE_FUNCTIONAL cpu_to_le32(0x00004000) | 245 | #define RNDIS_PACKET_TYPE_FUNCTIONAL 0x00004000 |
246 | #define RNDIS_PACKET_TYPE_MAC_FRAME cpu_to_le32(0x00008000) | 246 | #define RNDIS_PACKET_TYPE_MAC_FRAME 0x00008000 |
247 | 247 | ||
248 | /* default filter used with RNDIS devices */ | 248 | /* default filter used with RNDIS devices */ |
249 | #define RNDIS_DEFAULT_FILTER ( \ | 249 | #define RNDIS_DEFAULT_FILTER ( \ |