aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ehea/ehea.h2
-rw-r--r--drivers/net/ehea/ehea_main.c1
-rw-r--r--drivers/net/tun.c2
-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
-rw-r--r--include/linux/if_pppox.h20
-rw-r--r--include/linux/if_tunnel.h16
-rw-r--r--include/linux/ncp_no.h26
-rw-r--r--include/linux/netdevice.h4
-rw-r--r--include/linux/netfilter_bridge.h4
-rw-r--r--include/linux/pim.h4
-rw-r--r--include/linux/sctp.h90
-rw-r--r--include/linux/tcp.h20
-rw-r--r--include/linux/usb/rndis_host.h85
-rw-r--r--include/net/inet_ecn.h4
-rw-r--r--include/net/ip_vs.h4
-rw-r--r--include/net/ipv6.h4
-rw-r--r--include/net/ipx.h2
-rw-r--r--include/net/transp_v6.h2
-rw-r--r--include/rdma/ib_verbs.h2
-rw-r--r--net/core/skbuff.c7
22 files changed, 253 insertions, 253 deletions
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index f7e2ccfd3e8..656cf1b8d32 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -40,7 +40,7 @@
#include <asm/io.h>
#define DRV_NAME "ehea"
-#define DRV_VERSION "EHEA_0097"
+#define DRV_VERSION "EHEA_0098"
/* eHEA capability flags */
#define DLPAR_PORT_ADD_REM 1
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 489fdb90f76..958dacbb497 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -3448,6 +3448,7 @@ out_kill_eq:
ehea_destroy_eq(adapter->neq);
out_free_ad:
+ list_del(&adapter->list);
kfree(adapter);
out:
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 4825c52924b..a1b0697340b 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -660,7 +660,7 @@ static ssize_t tun_chr_aio_write(struct kiocb *iocb, const struct iovec *iv,
unsigned long count, loff_t pos)
{
struct file *file = iocb->ki_filp;
- struct tun_struct *tun = file->private_data;
+ struct tun_struct *tun = tun_get(file);
ssize_t result;
if (!tun)
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));
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c
index 8c26f5ea2b8..d2860a82368 100644
--- a/drivers/usb/gadget/rndis.c
+++ b/drivers/usb/gadget/rndis.c
@@ -63,7 +63,7 @@ MODULE_PARM_DESC (rndis_debug, "enable debugging");
static rndis_params rndis_per_dev_params [RNDIS_MAX_CONFIGS];
/* Driver Version */
-static const __le32 rndis_driver_version = __constant_cpu_to_le32 (1);
+static const __le32 rndis_driver_version = cpu_to_le32 (1);
/* Function Prototypes */
static 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,
/* response goes here, right after the header */
outbuf = (__le32 *) &resp[1];
- resp->InformationBufferOffset = __constant_cpu_to_le32 (16);
+ resp->InformationBufferOffset = cpu_to_le32 (16);
net = rndis_per_dev_params[configNr].dev;
if (net->get_stats)
@@ -221,7 +221,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
* reddite ergo quae sunt Caesaris Caesari
* et quae sunt Dei Deo!
*/
- *outbuf = __constant_cpu_to_le32 (0);
+ *outbuf = cpu_to_le32 (0);
retval = 0;
break;
@@ -256,7 +256,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
pr_debug("%s: OID_GEN_LINK_SPEED\n", __func__);
if (rndis_per_dev_params [configNr].media_state
== NDIS_MEDIA_STATE_DISCONNECTED)
- *outbuf = __constant_cpu_to_le32 (0);
+ *outbuf = cpu_to_le32 (0);
else
*outbuf = cpu_to_le32 (
rndis_per_dev_params [configNr].speed);
@@ -317,7 +317,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */
case OID_GEN_MAXIMUM_TOTAL_SIZE:
pr_debug("%s: OID_GEN_MAXIMUM_TOTAL_SIZE\n", __func__);
- *outbuf = __constant_cpu_to_le32(RNDIS_MAX_TOTAL_SIZE);
+ *outbuf = cpu_to_le32(RNDIS_MAX_TOTAL_SIZE);
retval = 0;
break;
@@ -332,7 +332,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
case OID_GEN_PHYSICAL_MEDIUM:
pr_debug("%s: OID_GEN_PHYSICAL_MEDIUM\n", __func__);
- *outbuf = __constant_cpu_to_le32 (0);
+ *outbuf = cpu_to_le32 (0);
retval = 0;
break;
@@ -342,7 +342,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
*/
case OID_GEN_MAC_OPTIONS: /* from WinME */
pr_debug("%s: OID_GEN_MAC_OPTIONS\n", __func__);
- *outbuf = __constant_cpu_to_le32(
+ *outbuf = cpu_to_le32(
NDIS_MAC_OPTION_RECEIVE_SERIALIZED
| NDIS_MAC_OPTION_FULL_DUPLEX);
retval = 0;
@@ -431,7 +431,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
case OID_802_3_MULTICAST_LIST:
pr_debug("%s: OID_802_3_MULTICAST_LIST\n", __func__);
/* Multicast base address only */
- *outbuf = __constant_cpu_to_le32 (0xE0000000);
+ *outbuf = cpu_to_le32 (0xE0000000);
retval = 0;
break;
@@ -439,7 +439,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
case OID_802_3_MAXIMUM_LIST_SIZE:
pr_debug("%s: OID_802_3_MAXIMUM_LIST_SIZE\n", __func__);
/* Multicast base address only */
- *outbuf = __constant_cpu_to_le32 (1);
+ *outbuf = cpu_to_le32 (1);
retval = 0;
break;
@@ -461,14 +461,14 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
/* mandatory */
case OID_802_3_XMIT_ONE_COLLISION:
pr_debug("%s: OID_802_3_XMIT_ONE_COLLISION\n", __func__);
- *outbuf = __constant_cpu_to_le32 (0);
+ *outbuf = cpu_to_le32 (0);
retval = 0;
break;
/* mandatory */
case OID_802_3_XMIT_MORE_COLLISIONS:
pr_debug("%s: OID_802_3_XMIT_MORE_COLLISIONS\n", __func__);
- *outbuf = __constant_cpu_to_le32 (0);
+ *outbuf = cpu_to_le32 (0);
retval = 0;
break;
@@ -572,24 +572,24 @@ static int rndis_init_response (int configNr, rndis_init_msg_type *buf)
return -ENOMEM;
resp = (rndis_init_cmplt_type *) r->buf;
- resp->MessageType = __constant_cpu_to_le32 (
+ resp->MessageType = cpu_to_le32 (
REMOTE_NDIS_INITIALIZE_CMPLT);
- resp->MessageLength = __constant_cpu_to_le32 (52);
+ resp->MessageLength = cpu_to_le32 (52);
resp->RequestID = buf->RequestID; /* Still LE in msg buffer */
- resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_SUCCESS);
- resp->MajorVersion = __constant_cpu_to_le32 (RNDIS_MAJOR_VERSION);
- resp->MinorVersion = __constant_cpu_to_le32 (RNDIS_MINOR_VERSION);
- resp->DeviceFlags = __constant_cpu_to_le32 (RNDIS_DF_CONNECTIONLESS);
- resp->Medium = __constant_cpu_to_le32 (RNDIS_MEDIUM_802_3);
- resp->MaxPacketsPerTransfer = __constant_cpu_to_le32 (1);
+ resp->Status = cpu_to_le32 (RNDIS_STATUS_SUCCESS);
+ resp->MajorVersion = cpu_to_le32 (RNDIS_MAJOR_VERSION);
+ resp->MinorVersion = cpu_to_le32 (RNDIS_MINOR_VERSION);
+ resp->DeviceFlags = cpu_to_le32 (RNDIS_DF_CONNECTIONLESS);
+ resp->Medium = cpu_to_le32 (RNDIS_MEDIUM_802_3);
+ resp->MaxPacketsPerTransfer = cpu_to_le32 (1);
resp->MaxTransferSize = cpu_to_le32 (
params->dev->mtu
+ sizeof (struct ethhdr)
+ sizeof (struct rndis_packet_msg_type)
+ 22);
- resp->PacketAlignmentFactor = __constant_cpu_to_le32 (0);
- resp->AFListOffset = __constant_cpu_to_le32 (0);
- resp->AFListSize = __constant_cpu_to_le32 (0);
+ resp->PacketAlignmentFactor = cpu_to_le32 (0);
+ resp->AFListOffset = cpu_to_le32 (0);
+ resp->AFListSize = cpu_to_le32 (0);
params->resp_avail(params->v);
return 0;
@@ -617,7 +617,7 @@ static int rndis_query_response (int configNr, rndis_query_msg_type *buf)
return -ENOMEM;
resp = (rndis_query_cmplt_type *) r->buf;
- resp->MessageType = __constant_cpu_to_le32 (REMOTE_NDIS_QUERY_CMPLT);
+ resp->MessageType = cpu_to_le32 (REMOTE_NDIS_QUERY_CMPLT);
resp->RequestID = buf->RequestID; /* Still LE in msg buffer */
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)
le32_to_cpu(buf->InformationBufferLength),
r)) {
/* OID not supported */
- resp->Status = __constant_cpu_to_le32 (
+ resp->Status = cpu_to_le32 (
RNDIS_STATUS_NOT_SUPPORTED);
- resp->MessageLength = __constant_cpu_to_le32 (sizeof *resp);
- resp->InformationBufferLength = __constant_cpu_to_le32 (0);
- resp->InformationBufferOffset = __constant_cpu_to_le32 (0);
+ resp->MessageLength = cpu_to_le32 (sizeof *resp);
+ resp->InformationBufferLength = cpu_to_le32 (0);
+ resp->InformationBufferOffset = cpu_to_le32 (0);
} else
- resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_SUCCESS);
+ resp->Status = cpu_to_le32 (RNDIS_STATUS_SUCCESS);
params->resp_avail(params->v);
return 0;
@@ -665,14 +665,14 @@ static int rndis_set_response (int configNr, rndis_set_msg_type *buf)
pr_debug("\n");
#endif
- resp->MessageType = __constant_cpu_to_le32 (REMOTE_NDIS_SET_CMPLT);
- resp->MessageLength = __constant_cpu_to_le32 (16);
+ resp->MessageType = cpu_to_le32 (REMOTE_NDIS_SET_CMPLT);
+ resp->MessageLength = cpu_to_le32 (16);
resp->RequestID = buf->RequestID; /* Still LE in msg buffer */
if (gen_ndis_set_resp (configNr, le32_to_cpu (buf->OID),
((u8 *) buf) + 8 + BufOffset, BufLength, r))
- resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_NOT_SUPPORTED);
+ resp->Status = cpu_to_le32 (RNDIS_STATUS_NOT_SUPPORTED);
else
- resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_SUCCESS);
+ resp->Status = cpu_to_le32 (RNDIS_STATUS_SUCCESS);
params->resp_avail(params->v);
return 0;
@@ -689,11 +689,11 @@ static int rndis_reset_response (int configNr, rndis_reset_msg_type *buf)
return -ENOMEM;
resp = (rndis_reset_cmplt_type *) r->buf;
- resp->MessageType = __constant_cpu_to_le32 (REMOTE_NDIS_RESET_CMPLT);
- resp->MessageLength = __constant_cpu_to_le32 (16);
- resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_SUCCESS);
+ resp->MessageType = cpu_to_le32 (REMOTE_NDIS_RESET_CMPLT);
+ resp->MessageLength = cpu_to_le32 (16);
+ resp->Status = cpu_to_le32 (RNDIS_STATUS_SUCCESS);
/* resent information */
- resp->AddressingReset = __constant_cpu_to_le32 (1);
+ resp->AddressingReset = cpu_to_le32 (1);
params->resp_avail(params->v);
return 0;
@@ -713,11 +713,11 @@ static int rndis_keepalive_response (int configNr,
return -ENOMEM;
resp = (rndis_keepalive_cmplt_type *) r->buf;
- resp->MessageType = __constant_cpu_to_le32 (
+ resp->MessageType = cpu_to_le32 (
REMOTE_NDIS_KEEPALIVE_CMPLT);
- resp->MessageLength = __constant_cpu_to_le32 (16);
+ resp->MessageLength = cpu_to_le32 (16);
resp->RequestID = buf->RequestID; /* Still LE in msg buffer */
- resp->Status = __constant_cpu_to_le32 (RNDIS_STATUS_SUCCESS);
+ resp->Status = cpu_to_le32 (RNDIS_STATUS_SUCCESS);
params->resp_avail(params->v);
return 0;
@@ -742,12 +742,12 @@ static int rndis_indicate_status_msg (int configNr, u32 status)
return -ENOMEM;
resp = (rndis_indicate_status_msg_type *) r->buf;
- resp->MessageType = __constant_cpu_to_le32 (
+ resp->MessageType = cpu_to_le32 (
REMOTE_NDIS_INDICATE_STATUS_MSG);
- resp->MessageLength = __constant_cpu_to_le32 (20);
+ resp->MessageLength = cpu_to_le32 (20);
resp->Status = cpu_to_le32 (status);
- resp->StatusBufferLength = __constant_cpu_to_le32 (0);
- resp->StatusBufferOffset = __constant_cpu_to_le32 (0);
+ resp->StatusBufferLength = cpu_to_le32 (0);
+ resp->StatusBufferOffset = cpu_to_le32 (0);
params->resp_avail(params->v);
return 0;
@@ -963,9 +963,9 @@ void rndis_add_hdr (struct sk_buff *skb)
return;
header = (void *) skb_push (skb, sizeof *header);
memset (header, 0, sizeof *header);
- header->MessageType = __constant_cpu_to_le32(REMOTE_NDIS_PACKET_MSG);
+ header->MessageType = cpu_to_le32(REMOTE_NDIS_PACKET_MSG);
header->MessageLength = cpu_to_le32(skb->len);
- header->DataOffset = __constant_cpu_to_le32 (36);
+ header->DataOffset = cpu_to_le32 (36);
header->DataLength = cpu_to_le32(skb->len - sizeof *header);
}
@@ -1029,7 +1029,7 @@ int rndis_rm_hdr(struct sk_buff *skb)
__le32 *tmp = (void *) skb->data;
/* MessageType, MessageLength */
- if (__constant_cpu_to_le32(REMOTE_NDIS_PACKET_MSG)
+ if (cpu_to_le32(REMOTE_NDIS_PACKET_MSG)
!= get_unaligned(tmp++))
return -EINVAL;
tmp++;
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h
index 30c88b2245f..90b5fae5d71 100644
--- a/include/linux/if_pppox.h
+++ b/include/linux/if_pppox.h
@@ -95,16 +95,16 @@ struct pppoe_tag {
} __attribute ((packed));
/* Tag identifiers */
-#define PTT_EOL __constant_htons(0x0000)
-#define PTT_SRV_NAME __constant_htons(0x0101)
-#define PTT_AC_NAME __constant_htons(0x0102)
-#define PTT_HOST_UNIQ __constant_htons(0x0103)
-#define PTT_AC_COOKIE __constant_htons(0x0104)
-#define PTT_VENDOR __constant_htons(0x0105)
-#define PTT_RELAY_SID __constant_htons(0x0110)
-#define PTT_SRV_ERR __constant_htons(0x0201)
-#define PTT_SYS_ERR __constant_htons(0x0202)
-#define PTT_GEN_ERR __constant_htons(0x0203)
+#define PTT_EOL __cpu_to_be16(0x0000)
+#define PTT_SRV_NAME __cpu_to_be16(0x0101)
+#define PTT_AC_NAME __cpu_to_be16(0x0102)
+#define PTT_HOST_UNIQ __cpu_to_be16(0x0103)
+#define PTT_AC_COOKIE __cpu_to_be16(0x0104)
+#define PTT_VENDOR __cpu_to_be16(0x0105)
+#define PTT_RELAY_SID __cpu_to_be16(0x0110)
+#define PTT_SRV_ERR __cpu_to_be16(0x0201)
+#define PTT_SYS_ERR __cpu_to_be16(0x0202)
+#define PTT_GEN_ERR __cpu_to_be16(0x0203)
struct pppoe_hdr {
#if defined(__LITTLE_ENDIAN_BITFIELD)
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index 82c43624c06..5a9aae4adb4 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -16,14 +16,14 @@
#define SIOCDELPRL (SIOCDEVPRIVATE + 6)
#define SIOCCHGPRL (SIOCDEVPRIVATE + 7)
-#define GRE_CSUM __constant_htons(0x8000)
-#define GRE_ROUTING __constant_htons(0x4000)
-#define GRE_KEY __constant_htons(0x2000)
-#define GRE_SEQ __constant_htons(0x1000)
-#define GRE_STRICT __constant_htons(0x0800)
-#define GRE_REC __constant_htons(0x0700)
-#define GRE_FLAGS __constant_htons(0x00F8)
-#define GRE_VERSION __constant_htons(0x0007)
+#define GRE_CSUM __cpu_to_be16(0x8000)
+#define GRE_ROUTING __cpu_to_be16(0x4000)
+#define GRE_KEY __cpu_to_be16(0x2000)
+#define GRE_SEQ __cpu_to_be16(0x1000)
+#define GRE_STRICT __cpu_to_be16(0x0800)
+#define GRE_REC __cpu_to_be16(0x0700)
+#define GRE_FLAGS __cpu_to_be16(0x00F8)
+#define GRE_VERSION __cpu_to_be16(0x0007)
struct ip_tunnel_parm
{
diff --git a/include/linux/ncp_no.h b/include/linux/ncp_no.h
index f56a696a7cc..cddaa48fb18 100644
--- a/include/linux/ncp_no.h
+++ b/include/linux/ncp_no.h
@@ -2,18 +2,18 @@
#define _NCP_NO
/* these define the attribute byte as seen by NCP */
-#define aRONLY (__constant_cpu_to_le32(1))
-#define aHIDDEN (__constant_cpu_to_le32(2))
-#define aSYSTEM (__constant_cpu_to_le32(4))
-#define aEXECUTE (__constant_cpu_to_le32(8))
-#define aDIR (__constant_cpu_to_le32(0x10))
-#define aARCH (__constant_cpu_to_le32(0x20))
-#define aSHARED (__constant_cpu_to_le32(0x80))
-#define aDONTSUBALLOCATE (__constant_cpu_to_le32(1L<<11))
-#define aTRANSACTIONAL (__constant_cpu_to_le32(1L<<12))
-#define aPURGE (__constant_cpu_to_le32(1L<<16))
-#define aRENAMEINHIBIT (__constant_cpu_to_le32(1L<<17))
-#define aDELETEINHIBIT (__constant_cpu_to_le32(1L<<18))
-#define aDONTCOMPRESS (__constant_cpu_to_le32(1L<<27))
+#define aRONLY (__cpu_to_le32(1))
+#define aHIDDEN (__cpu_to_le32(2))
+#define aSYSTEM (__cpu_to_le32(4))
+#define aEXECUTE (__cpu_to_le32(8))
+#define aDIR (__cpu_to_le32(0x10))
+#define aARCH (__cpu_to_le32(0x20))
+#define aSHARED (__cpu_to_le32(0x80))
+#define aDONTSUBALLOCATE (__cpu_to_le32(1L<<11))
+#define aTRANSACTIONAL (__cpu_to_le32(1L<<12))
+#define aPURGE (__cpu_to_le32(1L<<16))
+#define aRENAMEINHIBIT (__cpu_to_le32(1L<<17))
+#define aDELETEINHIBIT (__cpu_to_le32(1L<<18))
+#define aDONTCOMPRESS (__cpu_to_le32(1L<<27))
#endif /* _NCP_NO */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 355662aac94..bd8b4ca85a2 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1863,7 +1863,7 @@ static inline int skb_bond_should_drop(struct sk_buff *skb)
if (dev->priv_flags & IFF_SLAVE_INACTIVE) {
if ((dev->priv_flags & IFF_SLAVE_NEEDARP) &&
- skb->protocol == __constant_htons(ETH_P_ARP))
+ skb->protocol == __cpu_to_be16(ETH_P_ARP))
return 0;
if (master->priv_flags & IFF_MASTER_ALB) {
@@ -1872,7 +1872,7 @@ static inline int skb_bond_should_drop(struct sk_buff *skb)
return 0;
}
if (master->priv_flags & IFF_MASTER_8023AD &&
- skb->protocol == __constant_htons(ETH_P_SLOW))
+ skb->protocol == __cpu_to_be16(ETH_P_SLOW))
return 0;
return 1;
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h
index 499aa937590..f8105e54716 100644
--- a/include/linux/netfilter_bridge.h
+++ b/include/linux/netfilter_bridge.h
@@ -59,9 +59,9 @@ static inline int nf_bridge_maybe_copy_header(struct sk_buff *skb)
static inline unsigned int nf_bridge_encap_header_len(const struct sk_buff *skb)
{
switch (skb->protocol) {
- case __constant_htons(ETH_P_8021Q):
+ case __cpu_to_be16(ETH_P_8021Q):
return VLAN_HLEN;
- case __constant_htons(ETH_P_PPP_SES):
+ case __cpu_to_be16(ETH_P_PPP_SES):
return PPPOE_SES_HLEN;
default:
return 0;
diff --git a/include/linux/pim.h b/include/linux/pim.h
index 1ba0661561a..252bf6644c5 100644
--- a/include/linux/pim.h
+++ b/include/linux/pim.h
@@ -4,14 +4,14 @@
#include <asm/byteorder.h>
/* Message types - V1 */
-#define PIM_V1_VERSION __constant_htonl(0x10000000)
+#define PIM_V1_VERSION cpu_to_be32(0x10000000)
#define PIM_V1_REGISTER 1
/* Message types - V2 */
#define PIM_VERSION 2
#define PIM_REGISTER 1
-#define PIM_NULL_REGISTER __constant_htonl(0x40000000)
+#define PIM_NULL_REGISTER cpu_to_be32(0x40000000)
/* PIMv2 register message header layout (ietf-draft-idmr-pimvsm-v2-00.ps */
struct pimreghdr
diff --git a/include/linux/sctp.h b/include/linux/sctp.h
index 8ba1c320f97..bd50b371ffa 100644
--- a/include/linux/sctp.h
+++ b/include/linux/sctp.h
@@ -172,35 +172,35 @@ typedef struct sctp_paramhdr {
typedef enum {
/* RFC 2960 Section 3.3.5 */
- SCTP_PARAM_HEARTBEAT_INFO = __constant_htons(1),
+ SCTP_PARAM_HEARTBEAT_INFO = cpu_to_be16(1),
/* RFC 2960 Section 3.3.2.1 */
- SCTP_PARAM_IPV4_ADDRESS = __constant_htons(5),
- SCTP_PARAM_IPV6_ADDRESS = __constant_htons(6),
- SCTP_PARAM_STATE_COOKIE = __constant_htons(7),
- SCTP_PARAM_UNRECOGNIZED_PARAMETERS = __constant_htons(8),
- SCTP_PARAM_COOKIE_PRESERVATIVE = __constant_htons(9),
- SCTP_PARAM_HOST_NAME_ADDRESS = __constant_htons(11),
- SCTP_PARAM_SUPPORTED_ADDRESS_TYPES = __constant_htons(12),
- SCTP_PARAM_ECN_CAPABLE = __constant_htons(0x8000),
+ SCTP_PARAM_IPV4_ADDRESS = cpu_to_be16(5),
+ SCTP_PARAM_IPV6_ADDRESS = cpu_to_be16(6),
+ SCTP_PARAM_STATE_COOKIE = cpu_to_be16(7),
+ SCTP_PARAM_UNRECOGNIZED_PARAMETERS = cpu_to_be16(8),
+ SCTP_PARAM_COOKIE_PRESERVATIVE = cpu_to_be16(9),
+ SCTP_PARAM_HOST_NAME_ADDRESS = cpu_to_be16(11),
+ SCTP_PARAM_SUPPORTED_ADDRESS_TYPES = cpu_to_be16(12),
+ SCTP_PARAM_ECN_CAPABLE = cpu_to_be16(0x8000),
/* AUTH Extension Section 3 */
- SCTP_PARAM_RANDOM = __constant_htons(0x8002),
- SCTP_PARAM_CHUNKS = __constant_htons(0x8003),
- SCTP_PARAM_HMAC_ALGO = __constant_htons(0x8004),
+ SCTP_PARAM_RANDOM = cpu_to_be16(0x8002),
+ SCTP_PARAM_CHUNKS = cpu_to_be16(0x8003),
+ SCTP_PARAM_HMAC_ALGO = cpu_to_be16(0x8004),
/* Add-IP: Supported Extensions, Section 4.2 */
- SCTP_PARAM_SUPPORTED_EXT = __constant_htons(0x8008),
+ SCTP_PARAM_SUPPORTED_EXT = cpu_to_be16(0x8008),
/* PR-SCTP Sec 3.1 */
- SCTP_PARAM_FWD_TSN_SUPPORT = __constant_htons(0xc000),
+ SCTP_PARAM_FWD_TSN_SUPPORT = cpu_to_be16(0xc000),
/* Add-IP Extension. Section 3.2 */
- SCTP_PARAM_ADD_IP = __constant_htons(0xc001),
- SCTP_PARAM_DEL_IP = __constant_htons(0xc002),
- SCTP_PARAM_ERR_CAUSE = __constant_htons(0xc003),
- SCTP_PARAM_SET_PRIMARY = __constant_htons(0xc004),
- SCTP_PARAM_SUCCESS_REPORT = __constant_htons(0xc005),
- SCTP_PARAM_ADAPTATION_LAYER_IND = __constant_htons(0xc006),
+ SCTP_PARAM_ADD_IP = cpu_to_be16(0xc001),
+ SCTP_PARAM_DEL_IP = cpu_to_be16(0xc002),
+ SCTP_PARAM_ERR_CAUSE = cpu_to_be16(0xc003),
+ SCTP_PARAM_SET_PRIMARY = cpu_to_be16(0xc004),
+ SCTP_PARAM_SUCCESS_REPORT = cpu_to_be16(0xc005),
+ SCTP_PARAM_ADAPTATION_LAYER_IND = cpu_to_be16(0xc006),
} sctp_param_t; /* enum */
@@ -212,13 +212,13 @@ typedef enum {
*
*/
typedef enum {
- SCTP_PARAM_ACTION_DISCARD = __constant_htons(0x0000),
- SCTP_PARAM_ACTION_DISCARD_ERR = __constant_htons(0x4000),
- SCTP_PARAM_ACTION_SKIP = __constant_htons(0x8000),
- SCTP_PARAM_ACTION_SKIP_ERR = __constant_htons(0xc000),
+ SCTP_PARAM_ACTION_DISCARD = cpu_to_be16(0x0000),
+ SCTP_PARAM_ACTION_DISCARD_ERR = cpu_to_be16(0x4000),
+ SCTP_PARAM_ACTION_SKIP = cpu_to_be16(0x8000),
+ SCTP_PARAM_ACTION_SKIP_ERR = cpu_to_be16(0xc000),
} sctp_param_action_t;
-enum { SCTP_PARAM_ACTION_MASK = __constant_htons(0xc000), };
+enum { SCTP_PARAM_ACTION_MASK = cpu_to_be16(0xc000), };
/* RFC 2960 Section 3.3.1 Payload Data (DATA) (0) */
@@ -457,17 +457,17 @@ typedef struct sctp_operr_chunk {
*/
typedef enum {
- SCTP_ERROR_NO_ERROR = __constant_htons(0x00),
- SCTP_ERROR_INV_STRM = __constant_htons(0x01),
- SCTP_ERROR_MISS_PARAM = __constant_htons(0x02),
- SCTP_ERROR_STALE_COOKIE = __constant_htons(0x03),
- SCTP_ERROR_NO_RESOURCE = __constant_htons(0x04),
- SCTP_ERROR_DNS_FAILED = __constant_htons(0x05),
- SCTP_ERROR_UNKNOWN_CHUNK = __constant_htons(0x06),
- SCTP_ERROR_INV_PARAM = __constant_htons(0x07),
- SCTP_ERROR_UNKNOWN_PARAM = __constant_htons(0x08),
- SCTP_ERROR_NO_DATA = __constant_htons(0x09),
- SCTP_ERROR_COOKIE_IN_SHUTDOWN = __constant_htons(0x0a),
+ SCTP_ERROR_NO_ERROR = cpu_to_be16(0x00),
+ SCTP_ERROR_INV_STRM = cpu_to_be16(0x01),
+ SCTP_ERROR_MISS_PARAM = cpu_to_be16(0x02),
+ SCTP_ERROR_STALE_COOKIE = cpu_to_be16(0x03),
+ SCTP_ERROR_NO_RESOURCE = cpu_to_be16(0x04),
+ SCTP_ERROR_DNS_FAILED = cpu_to_be16(0x05),
+ SCTP_ERROR_UNKNOWN_CHUNK = cpu_to_be16(0x06),
+ SCTP_ERROR_INV_PARAM = cpu_to_be16(0x07),
+ SCTP_ERROR_UNKNOWN_PARAM = cpu_to_be16(0x08),
+ SCTP_ERROR_NO_DATA = cpu_to_be16(0x09),
+ SCTP_ERROR_COOKIE_IN_SHUTDOWN = cpu_to_be16(0x0a),
/* SCTP Implementation Guide:
@@ -476,9 +476,9 @@ typedef enum {
* 13 Protocol Violation
*/
- SCTP_ERROR_RESTART = __constant_htons(0x0b),
- SCTP_ERROR_USER_ABORT = __constant_htons(0x0c),
- SCTP_ERROR_PROTO_VIOLATION = __constant_htons(0x0d),
+ SCTP_ERROR_RESTART = cpu_to_be16(0x0b),
+ SCTP_ERROR_USER_ABORT = cpu_to_be16(0x0c),
+ SCTP_ERROR_PROTO_VIOLATION = cpu_to_be16(0x0d),
/* ADDIP Section 3.3 New Error Causes
*
@@ -493,11 +493,11 @@ typedef enum {
* 0x0103 Association Aborted due to illegal ASCONF-ACK
* 0x0104 Request refused - no authorization.
*/
- SCTP_ERROR_DEL_LAST_IP = __constant_htons(0x0100),
- SCTP_ERROR_RSRC_LOW = __constant_htons(0x0101),
- SCTP_ERROR_DEL_SRC_IP = __constant_htons(0x0102),
- SCTP_ERROR_ASCONF_ACK = __constant_htons(0x0103),
- SCTP_ERROR_REQ_REFUSED = __constant_htons(0x0104),
+ SCTP_ERROR_DEL_LAST_IP = cpu_to_be16(0x0100),
+ SCTP_ERROR_RSRC_LOW = cpu_to_be16(0x0101),
+ SCTP_ERROR_DEL_SRC_IP = cpu_to_be16(0x0102),
+ SCTP_ERROR_ASCONF_ACK = cpu_to_be16(0x0103),
+ SCTP_ERROR_REQ_REFUSED = cpu_to_be16(0x0104),
/* AUTH Section 4. New Error Cause
*
@@ -509,7 +509,7 @@ typedef enum {
* --------------------------------------------------------------
* 0x0105 Unsupported HMAC Identifier
*/
- SCTP_ERROR_UNSUP_HMAC = __constant_htons(0x0105)
+ SCTP_ERROR_UNSUP_HMAC = cpu_to_be16(0x0105)
} sctp_error_t;
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index fe77e1499ab..0cd99e6baca 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -69,16 +69,16 @@ union tcp_word_hdr {
#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3])
enum {
- TCP_FLAG_CWR = __constant_htonl(0x00800000),
- TCP_FLAG_ECE = __constant_htonl(0x00400000),
- TCP_FLAG_URG = __constant_htonl(0x00200000),
- TCP_FLAG_ACK = __constant_htonl(0x00100000),
- TCP_FLAG_PSH = __constant_htonl(0x00080000),
- TCP_FLAG_RST = __constant_htonl(0x00040000),
- TCP_FLAG_SYN = __constant_htonl(0x00020000),
- TCP_FLAG_FIN = __constant_htonl(0x00010000),
- TCP_RESERVED_BITS = __constant_htonl(0x0F000000),
- TCP_DATA_OFFSET = __constant_htonl(0xF0000000)
+ TCP_FLAG_CWR = __cpu_to_be32(0x00800000),
+ TCP_FLAG_ECE = __cpu_to_be32(0x00400000),
+ TCP_FLAG_URG = __cpu_to_be32(0x00200000),
+ TCP_FLAG_ACK = __cpu_to_be32(0x00100000),
+ TCP_FLAG_PSH = __cpu_to_be32(0x00080000),
+ TCP_FLAG_RST = __cpu_to_be32(0x00040000),
+ TCP_FLAG_SYN = __cpu_to_be32(0x00020000),
+ TCP_FLAG_FIN = __cpu_to_be32(0x00010000),
+ TCP_RESERVED_BITS = __cpu_to_be32(0x0F000000),
+ TCP_DATA_OFFSET = __cpu_to_be32(0xF0000000)
};
/* TCP socket options */
diff --git a/include/linux/usb/rndis_host.h b/include/linux/usb/rndis_host.h
index 0a6e6d4b929..37836b937d9 100644
--- a/include/linux/usb/rndis_host.h
+++ b/include/linux/usb/rndis_host.h
@@ -49,48 +49,45 @@ struct rndis_msg_hdr {
*/
#define RNDIS_CONTROL_TIMEOUT_MS (5 * 1000)
-
-#define ccpu2 __constant_cpu_to_le32
-
-#define RNDIS_MSG_COMPLETION ccpu2(0x80000000)
+#define RNDIS_MSG_COMPLETION cpu_to_le32(0x80000000)
/* codes for "msg_type" field of rndis messages;
* only the data channel uses packet messages (maybe batched);
* everything else goes on the control channel.
*/
-#define RNDIS_MSG_PACKET ccpu2(0x00000001) /* 1-N packets */
-#define RNDIS_MSG_INIT ccpu2(0x00000002)
+#define RNDIS_MSG_PACKET cpu_to_le32(0x00000001) /* 1-N packets */
+#define RNDIS_MSG_INIT cpu_to_le32(0x00000002)
#define RNDIS_MSG_INIT_C (RNDIS_MSG_INIT|RNDIS_MSG_COMPLETION)
-#define RNDIS_MSG_HALT ccpu2(0x00000003)
-#define RNDIS_MSG_QUERY ccpu2(0x00000004)
+#define RNDIS_MSG_HALT cpu_to_le32(0x00000003)
+#define RNDIS_MSG_QUERY cpu_to_le32(0x00000004)
#define RNDIS_MSG_QUERY_C (RNDIS_MSG_QUERY|RNDIS_MSG_COMPLETION)
-#define RNDIS_MSG_SET ccpu2(0x00000005)
+#define RNDIS_MSG_SET cpu_to_le32(0x00000005)
#define RNDIS_MSG_SET_C (RNDIS_MSG_SET|RNDIS_MSG_COMPLETION)
-#define RNDIS_MSG_RESET ccpu2(0x00000006)
+#define RNDIS_MSG_RESET cpu_to_le32(0x00000006)
#define RNDIS_MSG_RESET_C (RNDIS_MSG_RESET|RNDIS_MSG_COMPLETION)
-#define RNDIS_MSG_INDICATE ccpu2(0x00000007)
-#define RNDIS_MSG_KEEPALIVE ccpu2(0x00000008)
+#define RNDIS_MSG_INDICATE cpu_to_le32(0x00000007)
+#define RNDIS_MSG_KEEPALIVE cpu_to_le32(0x00000008)
#define RNDIS_MSG_KEEPALIVE_C (RNDIS_MSG_KEEPALIVE|RNDIS_MSG_COMPLETION)
/* codes for "status" field of completion messages */
-#define RNDIS_STATUS_SUCCESS ccpu2(0x00000000)
-#define RNDIS_STATUS_FAILURE ccpu2(0xc0000001)
-#define RNDIS_STATUS_INVALID_DATA ccpu2(0xc0010015)
-#define RNDIS_STATUS_NOT_SUPPORTED ccpu2(0xc00000bb)
-#define RNDIS_STATUS_MEDIA_CONNECT ccpu2(0x4001000b)
-#define RNDIS_STATUS_MEDIA_DISCONNECT ccpu2(0x4001000c)
+#define RNDIS_STATUS_SUCCESS cpu_to_le32(0x00000000)
+#define RNDIS_STATUS_FAILURE cpu_to_le32(0xc0000001)
+#define RNDIS_STATUS_INVALID_DATA cpu_to_le32(0xc0010015)
+#define RNDIS_STATUS_NOT_SUPPORTED cpu_to_le32(0xc00000bb)
+#define RNDIS_STATUS_MEDIA_CONNECT cpu_to_le32(0x4001000b)
+#define RNDIS_STATUS_MEDIA_DISCONNECT cpu_to_le32(0x4001000c)
/* codes for OID_GEN_PHYSICAL_MEDIUM */
-#define RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED ccpu2(0x00000000)
-#define RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN ccpu2(0x00000001)
-#define RNDIS_PHYSICAL_MEDIUM_CABLE_MODEM ccpu2(0x00000002)
-#define RNDIS_PHYSICAL_MEDIUM_PHONE_LINE ccpu2(0x00000003)
-#define RNDIS_PHYSICAL_MEDIUM_POWER_LINE ccpu2(0x00000004)
-#define RNDIS_PHYSICAL_MEDIUM_DSL ccpu2(0x00000005)
-#define RNDIS_PHYSICAL_MEDIUM_FIBRE_CHANNEL ccpu2(0x00000006)
-#define RNDIS_PHYSICAL_MEDIUM_1394 ccpu2(0x00000007)
-#define RNDIS_PHYSICAL_MEDIUM_WIRELESS_WAN ccpu2(0x00000008)
-#define RNDIS_PHYSICAL_MEDIUM_MAX ccpu2(0x00000009)
+#define RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED cpu_to_le32(0x00000000)
+#define RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN cpu_to_le32(0x00000001)
+#define RNDIS_PHYSICAL_MEDIUM_CABLE_MODEM cpu_to_le32(0x00000002)
+#define RNDIS_PHYSICAL_MEDIUM_PHONE_LINE cpu_to_le32(0x00000003)
+#define RNDIS_PHYSICAL_MEDIUM_POWER_LINE cpu_to_le32(0x00000004)
+#define RNDIS_PHYSICAL_MEDIUM_DSL cpu_to_le32(0x00000005)
+#define RNDIS_PHYSICAL_MEDIUM_FIBRE_CHANNEL cpu_to_le32(0x00000006)
+#define RNDIS_PHYSICAL_MEDIUM_1394 cpu_to_le32(0x00000007)
+#define RNDIS_PHYSICAL_MEDIUM_WIRELESS_WAN cpu_to_le32(0x00000008)
+#define RNDIS_PHYSICAL_MEDIUM_MAX cpu_to_le32(0x00000009)
struct rndis_data_hdr {
__le32 msg_type; /* RNDIS_MSG_PACKET */
@@ -228,24 +225,24 @@ struct rndis_keepalive_c { /* IN (optionally OUT) */
* there are gobs more that may optionally be supported. We'll avoid as much
* of that mess as possible.
*/
-#define OID_802_3_PERMANENT_ADDRESS ccpu2(0x01010101)
-#define OID_GEN_MAXIMUM_FRAME_SIZE ccpu2(0x00010106)
-#define OID_GEN_CURRENT_PACKET_FILTER ccpu2(0x0001010e)
-#define OID_GEN_PHYSICAL_MEDIUM ccpu2(0x00010202)
+#define OID_802_3_PERMANENT_ADDRESS cpu_to_le32(0x01010101)
+#define OID_GEN_MAXIMUM_FRAME_SIZE cpu_to_le32(0x00010106)
+#define OID_GEN_CURRENT_PACKET_FILTER cpu_to_le32(0x0001010e)
+#define OID_GEN_PHYSICAL_MEDIUM cpu_to_le32(0x00010202)
/* packet filter bits used by OID_GEN_CURRENT_PACKET_FILTER */
-#define RNDIS_PACKET_TYPE_DIRECTED ccpu2(0x00000001)
-#define RNDIS_PACKET_TYPE_MULTICAST ccpu2(0x00000002)
-#define RNDIS_PACKET_TYPE_ALL_MULTICAST ccpu2(0x00000004)
-#define RNDIS_PACKET_TYPE_BROADCAST ccpu2(0x00000008)
-#define RNDIS_PACKET_TYPE_SOURCE_ROUTING ccpu2(0x00000010)
-#define RNDIS_PACKET_TYPE_PROMISCUOUS ccpu2(0x00000020)
-#define RNDIS_PACKET_TYPE_SMT ccpu2(0x00000040)
-#define RNDIS_PACKET_TYPE_ALL_LOCAL ccpu2(0x00000080)
-#define RNDIS_PACKET_TYPE_GROUP ccpu2(0x00001000)
-#define RNDIS_PACKET_TYPE_ALL_FUNCTIONAL ccpu2(0x00002000)
-#define RNDIS_PACKET_TYPE_FUNCTIONAL ccpu2(0x00004000)
-#define RNDIS_PACKET_TYPE_MAC_FRAME ccpu2(0x00008000)
+#define RNDIS_PACKET_TYPE_DIRECTED cpu_to_le32(0x00000001)
+#define RNDIS_PACKET_TYPE_MULTICAST cpu_to_le32(0x00000002)
+#define RNDIS_PACKET_TYPE_ALL_MULTICAST cpu_to_le32(0x00000004)
+#define RNDIS_PACKET_TYPE_BROADCAST cpu_to_le32(0x00000008)
+#define RNDIS_PACKET_TYPE_SOURCE_ROUTING cpu_to_le32(0x00000010)
+#define RNDIS_PACKET_TYPE_PROMISCUOUS cpu_to_le32(0x00000020)
+#define RNDIS_PACKET_TYPE_SMT cpu_to_le32(0x00000040)
+#define RNDIS_PACKET_TYPE_ALL_LOCAL cpu_to_le32(0x00000080)
+#define RNDIS_PACKET_TYPE_GROUP cpu_to_le32(0x00001000)
+#define RNDIS_PACKET_TYPE_ALL_FUNCTIONAL cpu_to_le32(0x00002000)
+#define RNDIS_PACKET_TYPE_FUNCTIONAL cpu_to_le32(0x00004000)
+#define RNDIS_PACKET_TYPE_MAC_FRAME cpu_to_le32(0x00008000)
/* default filter used with RNDIS devices */
#define RNDIS_DEFAULT_FILTER ( \
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h
index 7040a782c65..9b5d08f4f6e 100644
--- a/include/net/inet_ecn.h
+++ b/include/net/inet_ecn.h
@@ -113,12 +113,12 @@ static inline void ipv6_copy_dscp(unsigned int dscp, struct ipv6hdr *inner)
static inline int INET_ECN_set_ce(struct sk_buff *skb)
{
switch (skb->protocol) {
- case __constant_htons(ETH_P_IP):
+ case cpu_to_be16(ETH_P_IP):
if (skb->network_header + sizeof(struct iphdr) <= skb->tail)
return IP_ECN_set_ce(ip_hdr(skb));
break;
- case __constant_htons(ETH_P_IPV6):
+ case cpu_to_be16(ETH_P_IPV6):
if (skb->network_header + sizeof(struct ipv6hdr) <= skb->tail)
return IP6_ECN_set_ce(ipv6_hdr(skb));
break;
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index ab9b003ab67..bbae1e87efc 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -184,8 +184,8 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,
/*
* The port number of FTP service (in network order).
*/
-#define FTPPORT __constant_htons(21)
-#define FTPDATA __constant_htons(20)
+#define FTPPORT cpu_to_be16(21)
+#define FTPDATA cpu_to_be16(20)
/*
* TCP State Values
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 6d5b58a1c74..c1f16fc49ad 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -196,8 +196,8 @@ struct ip6_flowlabel
struct net *fl_net;
};
-#define IPV6_FLOWINFO_MASK __constant_htonl(0x0FFFFFFF)
-#define IPV6_FLOWLABEL_MASK __constant_htonl(0x000FFFFF)
+#define IPV6_FLOWINFO_MASK cpu_to_be32(0x0FFFFFFF)
+#define IPV6_FLOWLABEL_MASK cpu_to_be32(0x000FFFFF)
struct ipv6_fl_socklist
{
diff --git a/include/net/ipx.h b/include/net/ipx.h
index 4cc0b4eca94..a14121dd193 100644
--- a/include/net/ipx.h
+++ b/include/net/ipx.h
@@ -27,7 +27,7 @@ struct ipx_address {
struct ipxhdr {
__be16 ipx_checksum __attribute__ ((packed));
-#define IPX_NO_CHECKSUM __constant_htons(0xFFFF)
+#define IPX_NO_CHECKSUM cpu_to_be16(0xFFFF)
__be16 ipx_pktsize __attribute__ ((packed));
__u8 ipx_tctrl;
__u8 ipx_type;
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h
index 876b6f2bb4f..bfb240c6cf7 100644
--- a/include/net/transp_v6.h
+++ b/include/net/transp_v6.h
@@ -46,7 +46,7 @@ extern int datagram_send_ctl(struct net *net,
struct ipv6_txoptions *opt,
int *hlimit, int *tclass);
-#define LOOPBACK4_IPV6 __constant_htonl(0x7f000006)
+#define LOOPBACK4_IPV6 cpu_to_be32(0x7f000006)
/*
* address family specific functions
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 936e333e7ce..c179318edd9 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -388,7 +388,7 @@ enum {
IB_MULTICAST_QPN = 0xffffff
};
-#define IB_LID_PERMISSIVE __constant_htons(0xFFFF)
+#define IB_LID_PERMISSIVE cpu_to_be16(0xFFFF)
enum ib_ah_flags {
IB_AH_GRH = 1
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 7657cec5973..ab7d2e9f02f 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1412,8 +1412,13 @@ static inline int spd_fill_page(struct splice_pipe_desc *spd, struct page *page,
static inline void __segment_seek(struct page **page, unsigned int *poff,
unsigned int *plen, unsigned int off)
{
+ unsigned long n;
+
*poff += off;
- *page += *poff / PAGE_SIZE;
+ n = *poff / PAGE_SIZE;
+ if (n)
+ *page = nth_page(*page, n);
+
*poff = *poff % PAGE_SIZE;
*plen -= off;
}