aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2009-02-15 01:56:56 -0500
committerDavid S. Miller <davem@davemloft.net>2009-02-15 01:56:56 -0500
commit35c26c2cf6a6a2d1c48add732d8ba002bd90784c (patch)
treeace3fb06bd279cf90ab8994d56ae12051488b2c8 /drivers/net/usb
parentab46d779661d7a03b7aa00279eead5dc3f0b3901 (diff)
rndis: remove private wrapper of __constant_cpu_to_le32
Use cpu_to_le32 directly as it handles constant folding now, replace direct uses of __constant_cpu_to_{endian} as well. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/rndis_host.c25
1 files changed, 11 insertions, 14 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 [] = {