Netdev List
 help / color / mirror / Atom feed
From: Masakazu Mokuno <mokuno-DfbDroY8Xu1L9jVzuh4AOg@public.gmane.org>
To: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: : Emit event stream compat iw_point objects correctly.
Date: Thu, 27 Dec 2007 17:51:49 +0900	[thread overview]
Message-ID: <20071227173802.6F56.40F06B3A@sm.sony.co.jp> (raw)
In-Reply-To: <20071221.205808.213484078.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>

	Hi

On Fri, 21 Dec 2007 20:58:08 -0800 (PST)
David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> wrote:

> @@ -520,7 +530,7 @@ iwe_stream_add_point(char *	stream,		/* Stream of events */
>  		memcpy(stream + IW_EV_LCP_LEN,
>  		       ((char *) iwe) + IW_EV_LCP_LEN + IW_EV_POINT_OFF,
>  		       IW_EV_POINT_PK_LEN - IW_EV_LCP_PK_LEN);

As the alignment of 64bit platforms may be defferent from 32bit one,
should it be like the following?

static inline char *
iwe_stream_add_point(char *	stream,		/* Stream of events */
		     char *	ends,		/* End of stream */
		     struct iw_event *iwe,	/* Payload length + flags */
		     char *	extra,		/* More payload */
		     struct iw_request_info *info)
{
	int	event_len = IW_EV_POINT_LEN + iwe->u.data.length;
	int	point_len = IW_EV_POINT_LEN;
	int	lcp_len = IW_EV_LCP_LEN;

#ifdef CONFIG_COMPAT
	if (info->flags & IW_REQUEST_FLAG_COMPAT) {
		event_len = IW_EV_COMPAT_POINT_LEN + iwe->u.data.length;
		point_len = IW_EV_COMPAT_POINT_LEN;
		lcp_len = IW_EV_COMPAT_LCP_LEN;
	}
#endif

	/* Check if it's possible */
	if(likely((stream + event_len) < ends)) {
		iwe->len = event_len;
		memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN);
		memcpy(stream + lcp_len,
		       ((char *) iwe) + IW_EV_LCP_LEN + IW_EV_POINT_OFF,
		       IW_EV_POINT_PK_LEN - IW_EV_LCP_PK_LEN);
		memcpy(stream + point_len, extra, iwe->u.data.length);
		stream += event_len;
	}
	return stream;
}

(Note that IW_EV_COMPAT_LCP_LEN is just a example; not defined anywhere)

-- 
Masakazu MOKUNO

  parent reply	other threads:[~2007-12-27  8:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-22  4:58 [WEXT 12/12]: Emit event stream compat iw_point objects correctly David Miller
     [not found] ` <20071221.205808.213484078.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2007-12-27  8:51   ` Masakazu Mokuno [this message]
2007-12-27  8:57     ` : " David Miller
     [not found]       ` <20071227.005725.144782426.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2007-12-27  9:24         ` Masakazu Mokuno
     [not found]           ` <20071227181439.6F59.40F06B3A-DfbDroY8Xu1L9jVzuh4AOg@public.gmane.org>
2007-12-27  9:26             ` David Miller
2008-01-10  9:16           ` David Miller
     [not found]             ` <20080110.011602.74511551.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2008-01-11  4:16               ` Masakazu Mokuno
2008-06-03 16:57                 ` David Miller
     [not found]                   ` <20080603.095750.120470495.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2008-06-03 17:37                     ` David Miller
2008-01-21 11:23               ` Masakazu Mokuno
     [not found]                 ` <20080121194942.613C.40F06B3A-DfbDroY8Xu1L9jVzuh4AOg@public.gmane.org>
2008-01-21 11:37                   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071227173802.6F56.40F06B3A@sm.sony.co.jp \
    --to=mokuno-dfbdroy8xu1l9jvzuh4aog@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox