aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/usb/rndis_host.c25
-rw-r--r--drivers/net/wireless/rndis_wlan.c90
-rw-r--r--drivers/usb/gadget/rndis.c92
3 files changed, 102 insertions, 105 deletions
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
index bcd858c567e0..b7f763e1298c 100644
--- a/drivers/net/usb/rndis_host.c
+++ b/drivers/net/usb/rndis_host.c
@@ -169,7 +169,7 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen)
169 struct rndis_keepalive_c *msg = (void *)buf; 169 struct rndis_keepalive_c *msg = (void *)buf;
170 170
171 msg->msg_type = RNDIS_MSG_KEEPALIVE_C; 171 msg->msg_type = RNDIS_MSG_KEEPALIVE_C;
172 msg->msg_len = ccpu2(sizeof *msg); 172 msg->msg_len = cpu_to_le32(sizeof *msg);
173 msg->status = RNDIS_STATUS_SUCCESS; 173 msg->status = RNDIS_STATUS_SUCCESS;
174 retval = usb_control_msg(dev->udev, 174 retval = usb_control_msg(dev->udev,
175 usb_sndctrlpipe(dev->udev, 0), 175 usb_sndctrlpipe(dev->udev, 0),
@@ -237,7 +237,7 @@ static int rndis_query(struct usbnet *dev, struct usb_interface *intf,
237 u.get->msg_len = cpu_to_le32(sizeof *u.get + in_len); 237 u.get->msg_len = cpu_to_le32(sizeof *u.get + in_len);
238 u.get->oid = oid; 238 u.get->oid = oid;
239 u.get->len = cpu_to_le32(in_len); 239 u.get->len = cpu_to_le32(in_len);
240 u.get->offset = ccpu2(20); 240 u.get->offset = cpu_to_le32(20);
241 241
242 retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE); 242 retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE);
243 if (unlikely(retval < 0)) { 243 if (unlikely(retval < 0)) {
@@ -297,9 +297,9 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
297 goto fail; 297 goto fail;
298 298
299 u.init->msg_type = RNDIS_MSG_INIT; 299 u.init->msg_type = RNDIS_MSG_INIT;
300 u.init->msg_len = ccpu2(sizeof *u.init); 300 u.init->msg_len = cpu_to_le32(sizeof *u.init);
301 u.init->major_version = ccpu2(1); 301 u.init->major_version = cpu_to_le32(1);
302 u.init->minor_version = ccpu2(0); 302 u.init->minor_version = cpu_to_le32(0);
303 303
304 /* max transfer (in spec) is 0x4000 at full speed, but for 304 /* max transfer (in spec) is 0x4000 at full speed, but for
305 * TX we'll stick to one Ethernet packet plus RNDIS framing. 305 * TX we'll stick to one Ethernet packet plus RNDIS framing.
@@ -403,10 +403,10 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
403 /* set a nonzero filter to enable data transfers */ 403 /* set a nonzero filter to enable data transfers */
404 memset(u.set, 0, sizeof *u.set); 404 memset(u.set, 0, sizeof *u.set);
405 u.set->msg_type = RNDIS_MSG_SET; 405 u.set->msg_type = RNDIS_MSG_SET;
406 u.set->msg_len = ccpu2(4 + sizeof *u.set); 406 u.set->msg_len = cpu_to_le32(4 + sizeof *u.set);
407 u.set->oid = OID_GEN_CURRENT_PACKET_FILTER; 407 u.set->oid = OID_GEN_CURRENT_PACKET_FILTER;
408 u.set->len = ccpu2(4); 408 u.set->len = cpu_to_le32(4);
409 u.set->offset = ccpu2((sizeof *u.set) - 8); 409 u.set->offset = cpu_to_le32((sizeof *u.set) - 8);
410 *(__le32 *)(u.buf + sizeof *u.set) = RNDIS_DEFAULT_FILTER; 410 *(__le32 *)(u.buf + sizeof *u.set) = RNDIS_DEFAULT_FILTER;
411 411
412 retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE); 412 retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE);
@@ -423,7 +423,7 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
423halt_fail_and_release: 423halt_fail_and_release:
424 memset(u.halt, 0, sizeof *u.halt); 424 memset(u.halt, 0, sizeof *u.halt);
425 u.halt->msg_type = RNDIS_MSG_HALT; 425 u.halt->msg_type = RNDIS_MSG_HALT;
426 u.halt->msg_len = ccpu2(sizeof *u.halt); 426 u.halt->msg_len = cpu_to_le32(sizeof *u.halt);
427 (void) rndis_command(dev, (void *)u.halt, CONTROL_BUFFER_SIZE); 427 (void) rndis_command(dev, (void *)u.halt, CONTROL_BUFFER_SIZE);
428fail_and_release: 428fail_and_release:
429 usb_set_intfdata(info->data, NULL); 429 usb_set_intfdata(info->data, NULL);
@@ -448,7 +448,7 @@ void rndis_unbind(struct usbnet *dev, struct usb_interface *intf)
448 halt = kzalloc(CONTROL_BUFFER_SIZE, GFP_KERNEL); 448 halt = kzalloc(CONTROL_BUFFER_SIZE, GFP_KERNEL);
449 if (halt) { 449 if (halt) {
450 halt->msg_type = RNDIS_MSG_HALT; 450 halt->msg_type = RNDIS_MSG_HALT;
451 halt->msg_len = ccpu2(sizeof *halt); 451 halt->msg_len = cpu_to_le32(sizeof *halt);
452 (void) rndis_command(dev, (void *)halt, CONTROL_BUFFER_SIZE); 452 (void) rndis_command(dev, (void *)halt, CONTROL_BUFFER_SIZE);
453 kfree(halt); 453 kfree(halt);
454 } 454 }
@@ -543,7 +543,7 @@ fill:
543 memset(hdr, 0, sizeof *hdr); 543 memset(hdr, 0, sizeof *hdr);
544 hdr->msg_type = RNDIS_MSG_PACKET; 544 hdr->msg_type = RNDIS_MSG_PACKET;
545 hdr->msg_len = cpu_to_le32(skb->len); 545 hdr->msg_len = cpu_to_le32(skb->len);
546 hdr->data_offset = ccpu2(sizeof(*hdr) - 8); 546 hdr->data_offset = cpu_to_le32(sizeof(*hdr) - 8);
547 hdr->data_len = cpu_to_le32(len); 547 hdr->data_len = cpu_to_le32(len);
548 548
549 /* FIXME make the last packet always be short ... */ 549 /* FIXME make the last packet always be short ... */
@@ -562,9 +562,6 @@ static const struct driver_info rndis_info = {
562 .tx_fixup = rndis_tx_fixup, 562 .tx_fixup = rndis_tx_fixup,
563}; 563};
564 564
565#undef ccpu2
566
567
568/*-------------------------------------------------------------------------*/ 565/*-------------------------------------------------------------------------*/
569 566
570static const struct usb_device_id products [] = { 567static const struct usb_device_id products [] = {
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 105f214e21f4..82af21eeb592 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -90,44 +90,44 @@ 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 ccpu2(0x00010107) 93#define OID_GEN_LINK_SPEED cpu_to_le32(0x00010107)
94#define OID_GEN_RNDIS_CONFIG_PARAMETER ccpu2(0x0001021b) 94#define OID_GEN_RNDIS_CONFIG_PARAMETER cpu_to_le32(0x0001021b)
95 95
96#define OID_GEN_XMIT_OK ccpu2(0x00020101) 96#define OID_GEN_XMIT_OK cpu_to_le32(0x00020101)
97#define OID_GEN_RCV_OK ccpu2(0x00020102) 97#define OID_GEN_RCV_OK cpu_to_le32(0x00020102)
98#define OID_GEN_XMIT_ERROR ccpu2(0x00020103) 98#define OID_GEN_XMIT_ERROR cpu_to_le32(0x00020103)
99#define OID_GEN_RCV_ERROR ccpu2(0x00020104) 99#define OID_GEN_RCV_ERROR cpu_to_le32(0x00020104)
100#define OID_GEN_RCV_NO_BUFFER ccpu2(0x00020105) 100#define OID_GEN_RCV_NO_BUFFER cpu_to_le32(0x00020105)
101 101
102#define OID_802_3_PERMANENT_ADDRESS ccpu2(0x01010101) 102#define OID_802_3_PERMANENT_ADDRESS cpu_to_le32(0x01010101)
103#define OID_802_3_CURRENT_ADDRESS ccpu2(0x01010102) 103#define OID_802_3_CURRENT_ADDRESS cpu_to_le32(0x01010102)
104#define OID_802_3_MULTICAST_LIST ccpu2(0x01010103) 104#define OID_802_3_MULTICAST_LIST cpu_to_le32(0x01010103)
105#define OID_802_3_MAXIMUM_LIST_SIZE ccpu2(0x01010104) 105#define OID_802_3_MAXIMUM_LIST_SIZE cpu_to_le32(0x01010104)
106 106
107#define OID_802_11_BSSID ccpu2(0x0d010101) 107#define OID_802_11_BSSID cpu_to_le32(0x0d010101)
108#define OID_802_11_SSID ccpu2(0x0d010102) 108#define OID_802_11_SSID cpu_to_le32(0x0d010102)
109#define OID_802_11_INFRASTRUCTURE_MODE ccpu2(0x0d010108) 109#define OID_802_11_INFRASTRUCTURE_MODE cpu_to_le32(0x0d010108)
110#define OID_802_11_ADD_WEP ccpu2(0x0d010113) 110#define OID_802_11_ADD_WEP cpu_to_le32(0x0d010113)
111#define OID_802_11_REMOVE_WEP ccpu2(0x0d010114) 111#define OID_802_11_REMOVE_WEP cpu_to_le32(0x0d010114)
112#define OID_802_11_DISASSOCIATE ccpu2(0x0d010115) 112#define OID_802_11_DISASSOCIATE cpu_to_le32(0x0d010115)
113#define OID_802_11_AUTHENTICATION_MODE ccpu2(0x0d010118) 113#define OID_802_11_AUTHENTICATION_MODE cpu_to_le32(0x0d010118)
114#define OID_802_11_PRIVACY_FILTER ccpu2(0x0d010119) 114#define OID_802_11_PRIVACY_FILTER cpu_to_le32(0x0d010119)
115#define OID_802_11_BSSID_LIST_SCAN ccpu2(0x0d01011a) 115#define OID_802_11_BSSID_LIST_SCAN cpu_to_le32(0x0d01011a)
116#define OID_802_11_ENCRYPTION_STATUS ccpu2(0x0d01011b) 116#define OID_802_11_ENCRYPTION_STATUS cpu_to_le32(0x0d01011b)
117#define OID_802_11_ADD_KEY ccpu2(0x0d01011d) 117#define OID_802_11_ADD_KEY cpu_to_le32(0x0d01011d)
118#define OID_802_11_REMOVE_KEY ccpu2(0x0d01011e) 118#define OID_802_11_REMOVE_KEY cpu_to_le32(0x0d01011e)
119#define OID_802_11_ASSOCIATION_INFORMATION ccpu2(0x0d01011f) 119#define OID_802_11_ASSOCIATION_INFORMATION cpu_to_le32(0x0d01011f)
120#define OID_802_11_PMKID ccpu2(0x0d010123) 120#define OID_802_11_PMKID cpu_to_le32(0x0d010123)
121#define OID_802_11_NETWORK_TYPES_SUPPORTED ccpu2(0x0d010203) 121#define OID_802_11_NETWORK_TYPES_SUPPORTED cpu_to_le32(0x0d010203)
122#define OID_802_11_NETWORK_TYPE_IN_USE ccpu2(0x0d010204) 122#define OID_802_11_NETWORK_TYPE_IN_USE cpu_to_le32(0x0d010204)
123#define OID_802_11_TX_POWER_LEVEL ccpu2(0x0d010205) 123#define OID_802_11_TX_POWER_LEVEL cpu_to_le32(0x0d010205)
124#define OID_802_11_RSSI ccpu2(0x0d010206) 124#define OID_802_11_RSSI cpu_to_le32(0x0d010206)
125#define OID_802_11_RSSI_TRIGGER ccpu2(0x0d010207) 125#define OID_802_11_RSSI_TRIGGER cpu_to_le32(0x0d010207)
126#define OID_802_11_FRAGMENTATION_THRESHOLD ccpu2(0x0d010209) 126#define OID_802_11_FRAGMENTATION_THRESHOLD cpu_to_le32(0x0d010209)
127#define OID_802_11_RTS_THRESHOLD ccpu2(0x0d01020a) 127#define OID_802_11_RTS_THRESHOLD cpu_to_le32(0x0d01020a)
128#define OID_802_11_SUPPORTED_RATES ccpu2(0x0d01020e) 128#define OID_802_11_SUPPORTED_RATES cpu_to_le32(0x0d01020e)
129#define OID_802_11_CONFIGURATION ccpu2(0x0d010211) 129#define OID_802_11_CONFIGURATION cpu_to_le32(0x0d010211)
130#define OID_802_11_BSSID_LIST ccpu2(0x0d010217) 130#define OID_802_11_BSSID_LIST cpu_to_le32(0x0d010217)
131 131
132 132
133/* Typical noise/maximum signal level values taken from ndiswrapper iw_ndis.h */ 133/* Typical noise/maximum signal level values taken from ndiswrapper iw_ndis.h */
@@ -144,8 +144,8 @@ MODULE_PARM_DESC(workaround_interval,
144 144
145 145
146/* codes for "status" field of completion messages */ 146/* codes for "status" field of completion messages */
147#define RNDIS_STATUS_ADAPTER_NOT_READY ccpu2(0xc0010011) 147#define RNDIS_STATUS_ADAPTER_NOT_READY cpu_to_le32(0xc0010011)
148#define RNDIS_STATUS_ADAPTER_NOT_OPEN ccpu2(0xc0010012) 148#define RNDIS_STATUS_ADAPTER_NOT_OPEN cpu_to_le32(0xc0010012)
149 149
150 150
151/* NDIS data structures. Taken from wpa_supplicant driver_ndis.c 151/* NDIS data structures. Taken from wpa_supplicant driver_ndis.c
@@ -442,7 +442,7 @@ static int rndis_query_oid(struct usbnet *dev, __le32 oid, void *data, int *len)
442 442
443 memset(u.get, 0, sizeof *u.get); 443 memset(u.get, 0, sizeof *u.get);
444 u.get->msg_type = RNDIS_MSG_QUERY; 444 u.get->msg_type = RNDIS_MSG_QUERY;
445 u.get->msg_len = ccpu2(sizeof *u.get); 445 u.get->msg_len = cpu_to_le32(sizeof *u.get);
446 u.get->oid = oid; 446 u.get->oid = oid;
447 447
448 ret = rndis_command(dev, u.header, buflen); 448 ret = rndis_command(dev, u.header, buflen);
@@ -491,8 +491,8 @@ static int rndis_set_oid(struct usbnet *dev, __le32 oid, void *data, int len)
491 u.set->msg_len = cpu_to_le32(sizeof(*u.set) + len); 491 u.set->msg_len = cpu_to_le32(sizeof(*u.set) + len);
492 u.set->oid = oid; 492 u.set->oid = oid;
493 u.set->len = cpu_to_le32(len); 493 u.set->len = cpu_to_le32(len);
494 u.set->offset = ccpu2(sizeof(*u.set) - 8); 494 u.set->offset = cpu_to_le32(sizeof(*u.set) - 8);
495 u.set->handle = ccpu2(0); 495 u.set->handle = cpu_to_le32(0);
496 memcpy(u.buf + sizeof(*u.set), data, len); 496 memcpy(u.buf + sizeof(*u.set), data, len);
497 497
498 ret = rndis_command(dev, u.header, buflen); 498 ret = rndis_command(dev, u.header, buflen);
@@ -1630,7 +1630,7 @@ static int rndis_iw_set_scan(struct net_device *dev,
1630 devdbg(usbdev, "SIOCSIWSCAN"); 1630 devdbg(usbdev, "SIOCSIWSCAN");
1631 1631
1632 if (wrqu->data.flags == 0) { 1632 if (wrqu->data.flags == 0) {
1633 tmp = ccpu2(1); 1633 tmp = cpu_to_le32(1);
1634 ret = rndis_set_oid(usbdev, OID_802_11_BSSID_LIST_SCAN, &tmp, 1634 ret = rndis_set_oid(usbdev, OID_802_11_BSSID_LIST_SCAN, &tmp,
1635 sizeof(tmp)); 1635 sizeof(tmp));
1636 evt.data.flags = 0; 1636 evt.data.flags = 0;
@@ -2428,7 +2428,7 @@ static void rndis_update_wireless_stats(struct work_struct *work)
2428 /* Send scan OID. Use of both OIDs is required to get device 2428 /* Send scan OID. Use of both OIDs is required to get device
2429 * working. 2429 * working.
2430 */ 2430 */
2431 tmp = ccpu2(1); 2431 tmp = cpu_to_le32(1);
2432 rndis_set_oid(usbdev, OID_802_11_BSSID_LIST_SCAN, &tmp, 2432 rndis_set_oid(usbdev, OID_802_11_BSSID_LIST_SCAN, &tmp,
2433 sizeof(tmp)); 2433 sizeof(tmp));
2434 2434
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c
index 8c26f5ea2b83..d2860a823680 100644
--- a/drivers/usb/gadget/rndis.c
+++ b/drivers/usb/gadget/rndis.c
@@ -63,7 +63,7 @@ MODULE_PARM_DESC (rndis_debug, "enable debugging");
63static rndis_params rndis_per_dev_params [RNDIS_MAX_CONFIGS]; 63static rndis_params rndis_per_dev_params [RNDIS_MAX_CONFIGS];
64 64
65/* Driver Version */ 65/* Driver Version */
66static const __le32 rndis_driver_version = __constant_cpu_to_le32 (1); 66static const __le32 rndis_driver_version = cpu_to_le32 (1);
67 67
68/* Function Prototypes */ 68/* Function Prototypes */
69static rndis_resp_t *rndis_add_response (int configNr, u32 length); 69static rndis_resp_t *rndis_add_response (int configNr, u32 length);
@@ -190,7 +190,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
190 190
191 /* response goes here, right after the header */ 191 /* response goes here, right after the header */
192 outbuf = (__le32 *) &resp[1]; 192 outbuf = (__le32 *) &resp[1];
193 resp->InformationBufferOffset = __constant_cpu_to_le32 (16); 193 resp->InformationBufferOffset = cpu_to_le32 (16);
194 194
195 net = rndis_per_dev_params[configNr].dev; 195 net = rndis_per_dev_params[configNr].dev;
196 if (net->get_stats) 196 if (net->get_stats)
@@ -221,7 +221,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
221 * reddite ergo quae sunt Caesaris Caesari 221 * reddite ergo quae sunt Caesaris Caesari
222 * et quae sunt Dei Deo! 222 * et quae sunt Dei Deo!
223 */ 223 */
224 *outbuf = __constant_cpu_to_le32 (0); 224 *outbuf = cpu_to_le32 (0);
225 retval = 0; 225 retval = 0;
226 break; 226 break;
227 227
@@ -256,7 +256,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
256 pr_debug("%s: OID_GEN_LINK_SPEED\n", __func__); 256 pr_debug("%s: OID_GEN_LINK_SPEED\n", __func__);
257 if (rndis_per_dev_params [configNr].media_state 257 if (rndis_per_dev_params [configNr].media_state
258 == NDIS_MEDIA_STATE_DISCONNECTED) 258 == NDIS_MEDIA_STATE_DISCONNECTED)
259 *outbuf = __constant_cpu_to_le32 (0); 259 *outbuf = cpu_to_le32 (0);
260 else 260 else
261 *outbuf = cpu_to_le32 ( 261 *outbuf = cpu_to_le32 (
262 rndis_per_dev_params [configNr].speed); 262 rndis_per_dev_params [configNr].speed);
@@ -317,7 +317,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
317 /* mandatory */ 317 /* mandatory */
318 case OID_GEN_MAXIMUM_TOTAL_SIZE: 318 case OID_GEN_MAXIMUM_TOTAL_SIZE:
319 pr_debug("%s: OID_GEN_MAXIMUM_TOTAL_SIZE\n", __func__); 319 pr_debug("%s: OID_GEN_MAXIMUM_TOTAL_SIZE\n", __func__);
320 *outbuf = __constant_cpu_to_le32(RNDIS_MAX_TOTAL_SIZE); 320 *outbuf = cpu_to_le32(RNDIS_MAX_TOTAL_SIZE);
321 retval = 0; 321 retval = 0;
322 break; 322 break;
323 323
@@ -332,7 +332,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
332 332
333 case OID_GEN_PHYSICAL_MEDIUM: 333 case OID_GEN_PHYSICAL_MEDIUM:
334 pr_debug("%s: OID_GEN_PHYSICAL_MEDIUM\n", __func__); 334 pr_debug("%s: OID_GEN_PHYSICAL_MEDIUM\n", __func__);
335 *outbuf = __constant_cpu_to_le32 (0); 335 *outbuf = cpu_to_le32 (0);
336 retval = 0; 336 retval = 0;
337 break; 337 break;
338 338
@@ -342,7 +342,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
342 */ 342 */
343 case OID_GEN_MAC_OPTIONS: /* from WinME */ 343 case OID_GEN_MAC_OPTIONS: /* from WinME */
344 pr_debug("%s: OID_GEN_MAC_OPTIONS\n", __func__); 344 pr_debug("%s: OID_GEN_MAC_OPTIONS\n", __func__);
345 *outbuf = __constant_cpu_to_le32( 345 *outbuf = cpu_to_le32(
346 NDIS_MAC_OPTION_RECEIVE_SERIALIZED 346 NDIS_MAC_OPTION_RECEIVE_SERIALIZED
347 | NDIS_MAC_OPTION_FULL_DUPLEX); 347 | NDIS_MAC_OPTION_FULL_DUPLEX);
348 retval = 0; 348 retval = 0;
@@ -431,7 +431,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
431 case OID_802_3_MULTICAST_LIST: 431 case OID_802_3_MULTICAST_LIST:
432 pr_debug("%s: OID_802_3_MULTICAST_LIST\n", __func__); 432 pr_debug("%s: OID_802_3_MULTICAST_LIST\n", __func__);
433 /* Multicast base address only */ 433 /* Multicast base address only */
434 *outbuf = __constant_cpu_to_le32 (0xE0000000); 434 *outbuf = cpu_to_le32 (0xE0000000);
435 retval = 0; 435 retval = 0;
436 break; 436 break;
437 437
@@ -439,7 +439,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
439 case OID_802_3_MAXIMUM_LIST_SIZE: 439 case OID_802_3_MAXIMUM_LIST_SIZE:
440 pr_debug("%s: OID_802_3_MAXIMUM_LIST_SIZE\n", __func__); 440 pr_debug("%s: OID_802_3_MAXIMUM_LIST_SIZE\n", __func__);
441 /* Multicast base address only */ 441 /* Multicast base address only */
442 *outbuf = __constant_cpu_to_le32 (1); 442 *outbuf = cpu_to_le32 (1);
443 retval = 0; 443 retval = 0;
444 break; 444 break;
445 445
@@ -461,14 +461,14 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
461 /* mandatory */ 461 /* mandatory */
462 case OID_802_3_XMIT_ONE_COLLISION: 462 case OID_802_3_XMIT_ONE_COLLISION:
463 pr_debug("%s: OID_802_3_XMIT_ONE_COLLISION\n", __func__); 463 pr_debug("%s: OID_802_3_XMIT_ONE_COLLISION\n", __func__);
464 *outbuf = __constant_cpu_to_le32 (0); 464 *outbuf = cpu_to_le32 (0);
465 retval = 0; 465 retval = 0;
466 break; 466 break;
467 467
468 /* mandatory */ 468 /* mandatory */
469 case OID_802_3_XMIT_MORE_COLLISIONS: 469 case OID_802_3_XMIT_MORE_COLLISIONS:
470 pr_debug("%s: OID_802_3_XMIT_MORE_COLLISIONS\n", __func__); 470 pr_debug("%s: OID_802_3_XMIT_MORE_COLLISIONS\n", __func__);
471 *outbuf = __constant_cpu_to_le32 (0); 471 *outbuf = cpu_to_le32 (0);
472 retval = 0; 472 retval = 0;
473 break; 473 break;
474 474
@@ -572,24 +572,24 @@ static int rndis_init_response (int configNr, rndis_init_msg_type *buf)
572 return -ENOMEM; 572 return -ENOMEM;
573 resp = (rndis_init_cmplt_type *) r->buf; 573 resp = (rndis_init_cmplt_type *) r->buf;
574 574
575 resp->MessageType = __constant_cpu_to_le32 ( 575 resp->MessageType = cpu_to_le32 (
576 REMOTE_NDIS_INITIALIZE_CMPLT); 576 REMOTE_NDIS_INITIALIZE_CMPLT);
577 resp->MessageLength = __constant_cpu_to_le32 (52); 577 resp->MessageLength = cpu_to_le32 (52);
578 resp->RequestID = buf->RequestID; /* Still LE in msg buffer */ 578 resp->RequestID = buf->RequestID; /* Still LE in msg buffer */
579 resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_SUCCESS); 579 resp->Status = cpu_to_le32 (RNDIS_STATUS_SUCCESS);
580 resp->MajorVersion = __constant_cpu_to_le32 (RNDIS_MAJOR_VERSION); 580 resp->MajorVersion = cpu_to_le32 (RNDIS_MAJOR_VERSION);
581 resp->MinorVersion = __constant_cpu_to_le32 (RNDIS_MINOR_VERSION); 581 resp->MinorVersion = cpu_to_le32 (RNDIS_MINOR_VERSION);
582 resp->DeviceFlags = __constant_cpu_to_le32 (RNDIS_DF_CONNECTIONLESS); 582 resp->DeviceFlags = cpu_to_le32 (RNDIS_DF_CONNECTIONLESS);
583 resp->Medium = __constant_cpu_to_le32 (RNDIS_MEDIUM_802_3); 583 resp->Medium = cpu_to_le32 (RNDIS_MEDIUM_802_3);
584 resp->MaxPacketsPerTransfer = __constant_cpu_to_le32 (1); 584 resp->MaxPacketsPerTransfer = cpu_to_le32 (1);
585 resp->MaxTransferSize = cpu_to_le32 ( 585 resp->MaxTransferSize = cpu_to_le32 (
586 params->dev->mtu 586 params->dev->mtu
587 + sizeof (struct ethhdr) 587 + sizeof (struct ethhdr)
588 + sizeof (struct rndis_packet_msg_type) 588 + sizeof (struct rndis_packet_msg_type)
589 + 22); 589 + 22);
590 resp->PacketAlignmentFactor = __constant_cpu_to_le32 (0); 590 resp->PacketAlignmentFactor = cpu_to_le32 (0);
591 resp->AFListOffset = __constant_cpu_to_le32 (0); 591 resp->AFListOffset = cpu_to_le32 (0);
592 resp->AFListSize = __constant_cpu_to_le32 (0); 592 resp->AFListSize = cpu_to_le32 (0);
593 593
594 params->resp_avail(params->v); 594 params->resp_avail(params->v);
595 return 0; 595 return 0;
@@ -617,7 +617,7 @@ static int rndis_query_response (int configNr, rndis_query_msg_type *buf)
617 return -ENOMEM; 617 return -ENOMEM;
618 resp = (rndis_query_cmplt_type *) r->buf; 618 resp = (rndis_query_cmplt_type *) r->buf;
619 619
620 resp->MessageType = __constant_cpu_to_le32 (REMOTE_NDIS_QUERY_CMPLT); 620 resp->MessageType = cpu_to_le32 (REMOTE_NDIS_QUERY_CMPLT);
621 resp->RequestID = buf->RequestID; /* Still LE in msg buffer */ 621 resp->RequestID = buf->RequestID; /* Still LE in msg buffer */
622 622
623 if (gen_ndis_query_resp (configNr, le32_to_cpu (buf->OID), 623 if (gen_ndis_query_resp (configNr, le32_to_cpu (buf->OID),
@@ -626,13 +626,13 @@ static int rndis_query_response (int configNr, rndis_query_msg_type *buf)
626 le32_to_cpu(buf->InformationBufferLength), 626 le32_to_cpu(buf->InformationBufferLength),
627 r)) { 627 r)) {
628 /* OID not supported */ 628 /* OID not supported */
629 resp->Status = __constant_cpu_to_le32 ( 629 resp->Status = cpu_to_le32 (
630 RNDIS_STATUS_NOT_SUPPORTED); 630 RNDIS_STATUS_NOT_SUPPORTED);
631 resp->MessageLength = __constant_cpu_to_le32 (sizeof *resp); 631 resp->MessageLength = cpu_to_le32 (sizeof *resp);
632 resp->InformationBufferLength = __constant_cpu_to_le32 (0); 632 resp->InformationBufferLength = cpu_to_le32 (0);
633 resp->InformationBufferOffset = __constant_cpu_to_le32 (0); 633 resp->InformationBufferOffset = cpu_to_le32 (0);
634 } else 634 } else
635 resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_SUCCESS); 635 resp->Status = cpu_to_le32 (RNDIS_STATUS_SUCCESS);
636 636
637 params->resp_avail(params->v); 637 params->resp_avail(params->v);
638 return 0; 638 return 0;
@@ -665,14 +665,14 @@ static int rndis_set_response (int configNr, rndis_set_msg_type *buf)
665 pr_debug("\n"); 665 pr_debug("\n");
666#endif 666#endif
667 667
668 resp->MessageType = __constant_cpu_to_le32 (REMOTE_NDIS_SET_CMPLT); 668 resp->MessageType = cpu_to_le32 (REMOTE_NDIS_SET_CMPLT);
669 resp->MessageLength = __constant_cpu_to_le32 (16); 669 resp->MessageLength = cpu_to_le32 (16);
670 resp->RequestID = buf->RequestID; /* Still LE in msg buffer */ 670 resp->RequestID = buf->RequestID; /* Still LE in msg buffer */
671 if (gen_ndis_set_resp (configNr, le32_to_cpu (buf->OID), 671 if (gen_ndis_set_resp (configNr, le32_to_cpu (buf->OID),
672 ((u8 *) buf) + 8 + BufOffset, BufLength, r)) 672 ((u8 *) buf) + 8 + BufOffset, BufLength, r))
673 resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_NOT_SUPPORTED); 673 resp->Status = cpu_to_le32 (RNDIS_STATUS_NOT_SUPPORTED);
674 else 674 else
675 resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_SUCCESS); 675 resp->Status = cpu_to_le32 (RNDIS_STATUS_SUCCESS);
676 676
677 params->resp_avail(params->v); 677 params->resp_avail(params->v);
678 return 0; 678 return 0;
@@ -689,11 +689,11 @@ static int rndis_reset_response (int configNr, rndis_reset_msg_type *buf)
689 return -ENOMEM; 689 return -ENOMEM;
690 resp = (rndis_reset_cmplt_type *) r->buf; 690 resp = (rndis_reset_cmplt_type *) r->buf;
691 691
692 resp->MessageType = __constant_cpu_to_le32 (REMOTE_NDIS_RESET_CMPLT); 692 resp->MessageType = cpu_to_le32 (REMOTE_NDIS_RESET_CMPLT);
693 resp->MessageLength = __constant_cpu_to_le32 (16); 693 resp->MessageLength = cpu_to_le32 (16);
694 resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_SUCCESS); 694 resp->Status = cpu_to_le32 (RNDIS_STATUS_SUCCESS);
695 /* resent information */ 695 /* resent information */
696 resp->AddressingReset = __constant_cpu_to_le32 (1); 696 resp->AddressingReset = cpu_to_le32 (1);
697 697
698 params->resp_avail(params->v); 698 params->resp_avail(params->v);
699 return 0; 699 return 0;
@@ -713,11 +713,11 @@ static int rndis_keepalive_response (int configNr,
713 return -ENOMEM; 713 return -ENOMEM;
714 resp = (rndis_keepalive_cmplt_type *) r->buf; 714 resp = (rndis_keepalive_cmplt_type *) r->buf;
715 715
716 resp->MessageType = __constant_cpu_to_le32 ( 716 resp->MessageType = cpu_to_le32 (
717 REMOTE_NDIS_KEEPALIVE_CMPLT); 717 REMOTE_NDIS_KEEPALIVE_CMPLT);
718 resp->MessageLength = __constant_cpu_to_le32 (16); 718 resp->MessageLength = cpu_to_le32 (16);
719 resp->RequestID = buf->RequestID; /* Still LE in msg buffer */ 719 resp->RequestID = buf->RequestID; /* Still LE in msg buffer */
720 resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_SUCCESS); 720 resp->Status = cpu_to_le32 (RNDIS_STATUS_SUCCESS);
721 721
722 params->resp_avail(params->v); 722 params->resp_avail(params->v);
723 return 0; 723 return 0;
@@ -742,12 +742,12 @@ static int rndis_indicate_status_msg (int configNr, u32 status)
742 return -ENOMEM; 742 return -ENOMEM;
743 resp = (rndis_indicate_status_msg_type *) r->buf; 743 resp = (rndis_indicate_status_msg_type *) r->buf;
744 744
745 resp->MessageType = __constant_cpu_to_le32 ( 745 resp->MessageType = cpu_to_le32 (
746 REMOTE_NDIS_INDICATE_STATUS_MSG); 746 REMOTE_NDIS_INDICATE_STATUS_MSG);
747 resp->MessageLength = __constant_cpu_to_le32 (20); 747 resp->MessageLength = cpu_to_le32 (20);
748 resp->Status = cpu_to_le32 (status); 748 resp->Status = cpu_to_le32 (status);
749 resp->StatusBufferLength = __constant_cpu_to_le32 (0); 749 resp->StatusBufferLength = cpu_to_le32 (0);
750 resp->StatusBufferOffset = __constant_cpu_to_le32 (0); 750 resp->StatusBufferOffset = cpu_to_le32 (0);
751 751
752 params->resp_avail(params->v); 752 params->resp_avail(params->v);
753 return 0; 753 return 0;
@@ -963,9 +963,9 @@ void rndis_add_hdr (struct sk_buff *skb)
963 return; 963 return;
964 header = (void *) skb_push (skb, sizeof *header); 964 header = (void *) skb_push (skb, sizeof *header);
965 memset (header, 0, sizeof *header); 965 memset (header, 0, sizeof *header);
966 header->MessageType = __constant_cpu_to_le32(REMOTE_NDIS_PACKET_MSG); 966 header->MessageType = cpu_to_le32(REMOTE_NDIS_PACKET_MSG);
967 header->MessageLength = cpu_to_le32(skb->len); 967 header->MessageLength = cpu_to_le32(skb->len);
968 header->DataOffset = __constant_cpu_to_le32 (36); 968 header->DataOffset = cpu_to_le32 (36);
969 header->DataLength = cpu_to_le32(skb->len - sizeof *header); 969 header->DataLength = cpu_to_le32(skb->len - sizeof *header);
970} 970}
971 971
@@ -1029,7 +1029,7 @@ int rndis_rm_hdr(struct sk_buff *skb)
1029 __le32 *tmp = (void *) skb->data; 1029 __le32 *tmp = (void *) skb->data;
1030 1030
1031 /* MessageType, MessageLength */ 1031 /* MessageType, MessageLength */
1032 if (__constant_cpu_to_le32(REMOTE_NDIS_PACKET_MSG) 1032 if (cpu_to_le32(REMOTE_NDIS_PACKET_MSG)
1033 != get_unaligned(tmp++)) 1033 != get_unaligned(tmp++))
1034 return -EINVAL; 1034 return -EINVAL;
1035 tmp++; 1035 tmp++;