Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Jul 2009 15:12:07 +0000 (UTC)
From:      Rui Paulo <rpaulo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r195311 - projects/mesh11s/sys/net80211
Message-ID:  <200907031512.n63FC7db081199@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rpaulo
Date: Fri Jul  3 15:12:07 2009
New Revision: 195311
URL: http://svn.freebsd.org/changeset/base/195311

Log:
  Add little endian macros.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  projects/mesh11s/sys/net80211/ieee80211_hwmp.c

Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_hwmp.c	Fri Jul  3 15:10:05 2009	(r195310)
+++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c	Fri Jul  3 15:12:07 2009	(r195311)
@@ -140,6 +140,19 @@ static const struct timeval ieee80211_hw
 #define	HWMP_LOCK(hs)		mtx_lock(&(hs)->hs_lock)
 #define	HWMP_UNLOCK(hs)		mtx_unlock(&(hs)->hs_lock)
 
+/* unalligned little endian access */
+#define LE_WRITE_2(p, v) do {				\
+	((uint8_t *)(p))[0] = (v) & 0xff;		\
+	((uint8_t *)(p))[1] = ((v) >> 8) & 0xff;	\
+} while (0)
+#define LE_WRITE_4(p, v) do {				\                                             
+	((uint8_t *)(p))[0] = (v) & 0xff;		\
+	((uint8_t *)(p))[1] = ((v) >> 8) & 0xff;	\
+	((uint8_t *)(p))[2] = ((v) >> 16) & 0xff;	\
+	((uint8_t *)(p))[3] = ((v) >> 24) & 0xff;	\
+} while (0)
+
+
 /* NB: the Target Address set in a Proactive PREQ is the broadcast address. */
 static const uint8_t	broadcastaddr[IEEE80211_ADDR_LEN] =
 	{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907031512.n63FC7db081199>