diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2009-02-14 22:56:56 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-14 22:56:56 -0800 |
commit | 35c26c2cf6a6a2d1c48add732d8ba002bd90784c (patch) | |
tree | ace3fb06bd279cf90ab8994d56ae12051488b2c8 /drivers/net | |
parent | ab46d779661d7a03b7aa00279eead5dc3f0b3901 (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')
-rw-r--r-- | drivers/net/usb/rndis_host.c | 25 | ||||
-rw-r--r-- | drivers/net/wireless/rndis_wlan.c | 90 |
2 files changed, 56 insertions, 59 deletions
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c index bcd858c567e..b7f763e1298 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) struct rndis_keepalive_c *msg = (void *)buf; msg->msg_type = RNDIS_MSG_KEEPALIVE_C; - msg->msg_len = ccpu2(sizeof *msg); + msg->msg_len = cpu_to_le32(sizeof *msg); msg->status = RNDIS_STATUS_SUCCESS; retval = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0), @@ -237,7 +237,7 @@ static int rndis_query(struct usbnet *dev, struct usb_interface *intf, u.get->msg_len = cpu_to_le32(sizeof *u.get + in_len); u.get->oid = oid; u.get->len = cpu_to_le32(in_len); - u.get->offset = ccpu2(20); + u.get->offset = cpu_to_le32(20); retval = rndis_command(dev, u.header, CONTROL_BUFFER_SIZE); if (unlikely(retval < 0)) { @@ -297,9 +297,9 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags) goto fail; u.init->msg_type = RNDIS_MSG_INIT; - u.init->msg_len = ccpu2(sizeof *u.init); - u.init->major_version = ccpu2(1); - u.init->minor_version = ccpu2(0); + u.init->msg_len = cpu_to_le32(sizeof *u.init); + u.init->major_version = cpu_to_le32(1); + u.init->minor_version = cpu_to_le32(0); /* max transfer (in spec) is 0x4000 at full speed, but for * 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) /* set a nonzero filter to enable data transfers */ memset(u.set, 0, sizeof *u.set); u.set->msg_type = RNDIS_MSG_SET; - u.set->msg_len = ccpu2(4 + sizeof *u.set); + u.set->msg_len = cpu_to_le32(4 + sizeof *u.set); u.set->oid = OID_GEN_CURRENT_PACKET_FILTER; - u.set->len = ccpu2(4); - u.set->offset = ccpu2((sizeof *u.set) - 8); + u.set->len = cpu_to_le32(4); + u.set->offset = cpu_to_le32((sizeof *u.set) - 8); *(__le32 *)(u.buf + sizeof *u.set) = RNDIS_DEFAULT_FILTER; 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) halt_fail_and_release: memset(u.halt, 0, sizeof *u.halt); u.halt->msg_type = RNDIS_MSG_HALT; - u.halt->msg_len = ccpu2(sizeof *u.halt); + u.halt->msg_len = cpu_to_le32(sizeof *u.halt); (void) rndis_command(dev, (void *)u.halt, CONTROL_BUFFER_SIZE); fail_and_release: usb_set_intfdata(info->data, NULL); @@ -448,7 +448,7 @@ void rndis_unbind(struct usbnet *dev, struct usb_interface *intf) halt = kzalloc(CONTROL_BUFFER_SIZE, GFP_KERNEL); if (halt) { halt->msg_type = RNDIS_MSG_HALT; - halt->msg_len = ccpu2(sizeof *halt); + halt->msg_len = cpu_to_le32(sizeof *halt); (void) rndis_command(dev, (void *)halt, CONTROL_BUFFER_SIZE); kfree(halt); } @@ -543,7 +543,7 @@ fill: memset(hdr, 0, sizeof *hdr); hdr->msg_type = RNDIS_MSG_PACKET; hdr->msg_len = cpu_to_le32(skb->len); - hdr->data_offset = ccpu2(sizeof(*hdr) - 8); + hdr->data_offset = cpu_to_le32(sizeof(*hdr) - 8); hdr->data_len = cpu_to_le32(len); /* FIXME make the last packet always be short ... */ @@ -562,9 +562,6 @@ static const struct driver_info rndis_info = { .tx_fixup = rndis_tx_fixup, }; -#undef ccpu2 - - /*-------------------------------------------------------------------------*/ static const struct usb_device_id products [] = { diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c index 105f214e21f..82af21eeb59 100644 --- a/drivers/net/wireless/rndis_wlan.c +++ b/drivers/net/wireless/rndis_wlan.c @@ -90,44 +90,44 @@ MODULE_PARM_DESC(workaround_interval, /* various RNDIS OID defs */ -#define OID_GEN_LINK_SPEED ccpu2(0x00010107) -#define OID_GEN_RNDIS_CONFIG_PARAMETER ccpu2(0x0001021b) - -#define OID_GEN_XMIT_OK ccpu2(0x00020101) -#define OID_GEN_RCV_OK ccpu2(0x00020102) -#define OID_GEN_XMIT_ERROR ccpu2(0x00020103) -#define OID_GEN_RCV_ERROR ccpu2(0x00020104) -#define OID_GEN_RCV_NO_BUFFER ccpu2(0x00020105) - -#define OID_802_3_PERMANENT_ADDRESS ccpu2(0x01010101) -#define OID_802_3_CURRENT_ADDRESS ccpu2(0x01010102) -#define OID_802_3_MULTICAST_LIST ccpu2(0x01010103) -#define OID_802_3_MAXIMUM_LIST_SIZE ccpu2(0x01010104) - -#define OID_802_11_BSSID ccpu2(0x0d010101) -#define OID_802_11_SSID ccpu2(0x0d010102) -#define OID_802_11_INFRASTRUCTURE_MODE ccpu2(0x0d010108) -#define OID_802_11_ADD_WEP ccpu2(0x0d010113) -#define OID_802_11_REMOVE_WEP ccpu2(0x0d010114) -#define OID_802_11_DISASSOCIATE ccpu2(0x0d010115) -#define OID_802_11_AUTHENTICATION_MODE ccpu2(0x0d010118) -#define OID_802_11_PRIVACY_FILTER ccpu2(0x0d010119) -#define OID_802_11_BSSID_LIST_SCAN ccpu2(0x0d01011a) -#define OID_802_11_ENCRYPTION_STATUS ccpu2(0x0d01011b) -#define OID_802_11_ADD_KEY ccpu2(0x0d01011d) -#define OID_802_11_REMOVE_KEY ccpu2(0x0d01011e) -#define OID_802_11_ASSOCIATION_INFORMATION ccpu2(0x0d01011f) -#define OID_802_11_PMKID ccpu2(0x0d010123) -#define OID_802_11_NETWORK_TYPES_SUPPORTED ccpu2(0x0d010203) -#define OID_802_11_NETWORK_TYPE_IN_USE ccpu2(0x0d010204) -#define OID_802_11_TX_POWER_LEVEL ccpu2(0x0d010205) -#define OID_802_11_RSSI ccpu2(0x0d010206) -#define OID_802_11_RSSI_TRIGGER ccpu2(0x0d010207) -#define OID_802_11_FRAGMENTATION_THRESHOLD ccpu2(0x0d010209) -#define OID_802_11_RTS_THRESHOLD ccpu2(0x0d01020a) -#define OID_802_11_SUPPORTED_RATES ccpu2(0x0d01020e) -#define OID_802_11_CONFIGURATION ccpu2(0x0d010211) -#define OID_802_11_BSSID_LIST ccpu2(0x0d010217) +#define OID_GEN_LINK_SPEED cpu_to_le32(0x00010107) +#define OID_GEN_RNDIS_CONFIG_PARAMETER cpu_to_le32(0x0001021b) + +#define OID_GEN_XMIT_OK cpu_to_le32(0x00020101) +#define OID_GEN_RCV_OK cpu_to_le32(0x00020102) +#define OID_GEN_XMIT_ERROR cpu_to_le32(0x00020103) +#define OID_GEN_RCV_ERROR cpu_to_le32(0x00020104) +#define OID_GEN_RCV_NO_BUFFER cpu_to_le32(0x00020105) + +#define OID_802_3_PERMANENT_ADDRESS cpu_to_le32(0x01010101) +#define OID_802_3_CURRENT_ADDRESS cpu_to_le32(0x01010102) +#define OID_802_3_MULTICAST_LIST cpu_to_le32(0x01010103) +#define OID_802_3_MAXIMUM_LIST_SIZE cpu_to_le32(0x01010104) + +#define OID_802_11_BSSID cpu_to_le32(0x0d010101) +#define OID_802_11_SSID cpu_to_le32(0x0d010102) +#define OID_802_11_INFRASTRUCTURE_MODE cpu_to_le32(0x0d010108) +#define OID_802_11_ADD_WEP cpu_to_le32(0x0d010113) +#define OID_802_11_REMOVE_WEP cpu_to_le32(0x0d010114) +#define OID_802_11_DISASSOCIATE cpu_to_le32(0x0d010115) +#define OID_802_11_AUTHENTICATION_MODE cpu_to_le32(0x0d010118) +#define OID_802_11_PRIVACY_FILTER cpu_to_le32(0x0d010119) +#define OID_802_11_BSSID_LIST_SCAN cpu_to_le32(0x0d01011a) +#define OID_802_11_ENCRYPTION_STATUS cpu_to_le32(0x0d01011b) +#define OID_802_11_ADD_KEY cpu_to_le32(0x0d01011d) +#define OID_802_11_REMOVE_KEY cpu_to_le32(0x0d01011e) +#define OID_802_11_ASSOCIATION_INFORMATION cpu_to_le32(0x0d01011f) +#define OID_802_11_PMKID cpu_to_le32(0x0d010123) +#define OID_802_11_NETWORK_TYPES_SUPPORTED cpu_to_le32(0x0d010203) +#define OID_802_11_NETWORK_TYPE_IN_USE cpu_to_le32(0x0d010204) +#define OID_802_11_TX_POWER_LEVEL cpu_to_le32(0x0d010205) +#define OID_802_11_RSSI cpu_to_le32(0x0d010206) +#define OID_802_11_RSSI_TRIGGER cpu_to_le32(0x0d010207) +#define OID_802_11_FRAGMENTATION_THRESHOLD cpu_to_le32(0x0d010209) +#define OID_802_11_RTS_THRESHOLD cpu_to_le32(0x0d01020a) +#define OID_802_11_SUPPORTED_RATES cpu_to_le32(0x0d01020e) +#define OID_802_11_CONFIGURATION cpu_to_le32(0x0d010211) +#define OID_802_11_BSSID_LIST cpu_to_le32(0x0d010217) /* Typical noise/maximum signal level values taken from ndiswrapper iw_ndis.h */ @@ -144,8 +144,8 @@ MODULE_PARM_DESC(workaround_interval, /* codes for "status" field of completion messages */ -#define RNDIS_STATUS_ADAPTER_NOT_READY ccpu2(0xc0010011) -#define RNDIS_STATUS_ADAPTER_NOT_OPEN ccpu2(0xc0010012) +#define RNDIS_STATUS_ADAPTER_NOT_READY cpu_to_le32(0xc0010011) +#define RNDIS_STATUS_ADAPTER_NOT_OPEN cpu_to_le32(0xc0010012) /* 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) memset(u.get, 0, sizeof *u.get); u.get->msg_type = RNDIS_MSG_QUERY; - u.get->msg_len = ccpu2(sizeof *u.get); + u.get->msg_len = cpu_to_le32(sizeof *u.get); u.get->oid = oid; 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) u.set->msg_len = cpu_to_le32(sizeof(*u.set) + len); u.set->oid = oid; u.set->len = cpu_to_le32(len); - u.set->offset = ccpu2(sizeof(*u.set) - 8); - u.set->handle = ccpu2(0); + u.set->offset = cpu_to_le32(sizeof(*u.set) - 8); + u.set->handle = cpu_to_le32(0); memcpy(u.buf + sizeof(*u.set), data, len); ret = rndis_command(dev, u.header, buflen); @@ -1630,7 +1630,7 @@ static int rndis_iw_set_scan(struct net_device *dev, devdbg(usbdev, "SIOCSIWSCAN"); if (wrqu->data.flags == 0) { - tmp = ccpu2(1); + tmp = cpu_to_le32(1); ret = rndis_set_oid(usbdev, OID_802_11_BSSID_LIST_SCAN, &tmp, sizeof(tmp)); evt.data.flags = 0; @@ -2428,7 +2428,7 @@ static void rndis_update_wireless_stats(struct work_struct *work) /* Send scan OID. Use of both OIDs is required to get device * working. */ - tmp = ccpu2(1); + tmp = cpu_to_le32(1); rndis_set_oid(usbdev, OID_802_11_BSSID_LIST_SCAN, &tmp, sizeof(tmp)); |