PERFORCE change 66754 for review

Sam Leffler sam at FreeBSD.org
Thu Dec 9 15:19:05 PST 2004


http://perforce.freebsd.org/chv.cgi?CH=66754

Change 66754 by sam at sam_ebb on 2004/12/09 23:18:43

	IFC

Affected files ...

.. //depot/projects/wifi/lib/libsdp/search.c#2 integrate
.. //depot/projects/wifi/share/man/man4/wlan_acl.4#2 integrate
.. //depot/projects/wifi/share/man/man4/wlan_ccmp.4#2 integrate
.. //depot/projects/wifi/share/man/man4/wlan_tkip.4#2 integrate
.. //depot/projects/wifi/share/man/man4/wlan_xauth.4#2 integrate
.. //depot/projects/wifi/sys/sys/aac_ioctl.h#1 branch
.. //depot/projects/wifi/sys/ufs/ffs/ffs_alloc.c#3 integrate
.. //depot/projects/wifi/sys/ufs/ffs/ffs_snapshot.c#5 integrate

Differences ...

==== //depot/projects/wifi/lib/libsdp/search.c#2 (text+ko) ====

@@ -26,7 +26,7 @@
  * SUCH DAMAGE.
  *
  * $Id: search.c,v 1.2 2003/09/04 22:12:13 max Exp $
- * $FreeBSD: src/lib/libsdp/search.c,v 1.6 2004/02/26 20:44:55 emax Exp $
+ * $FreeBSD: src/lib/libsdp/search.c,v 1.7 2004/12/09 18:57:12 emax Exp $
  */
 
 #include <sys/uio.h>
@@ -55,7 +55,8 @@
 
 	sdp_session_p			 ss = (sdp_session_p) xss;
 	uint8_t				*req = NULL, *rsp = NULL, *rsp_tmp = NULL;
-	int32_t				 type, len;
+	int32_t				 t, len;
+	uint16_t			 lo, hi;
 
 	if (ss == NULL)
 		return (-1);
@@ -66,11 +67,29 @@
 		return (-1);
 	}
 
-	/* Calculate length of the request */
 	req = ss->req;
+
+	/* Calculate ServiceSearchPattern length */
 	plen = plen * (sizeof(pp[0]) + 1);
-	alen = alen * (sizeof(ap[0]) + 1);
+
+	/* Calculate AttributeIDList length */
+	for (len = 0, t = 0; t < alen; t ++) {
+		lo = (uint16_t) (ap[t] >> 16);
+		hi = (uint16_t) (ap[t]);
+
+		if (lo > hi) {
+			ss->error = EINVAL;
+			return (-1);
+		}
+
+		if (lo != hi)
+			len += (sizeof(ap[t]) + 1);
+		else
+			len += (sizeof(lo) + 1);
+	}
+	alen = len;
 
+	/* Calculate length of the request */
 	len =	plen + sizeof(uint8_t) + sizeof(uint16_t) +
 			/* ServiceSearchPattern */
 		sizeof(uint16_t) +
@@ -97,9 +116,21 @@
 	/* Put AttributeIDList */
 	SDP_PUT8(SDP_DATA_SEQ16, req);
 	SDP_PUT16(alen, req);
-	for (; alen > 0; ap ++, alen -= (sizeof(ap[0]) + 1)) {
-		SDP_PUT8(SDP_DATA_UINT32, req);
-		SDP_PUT32(*ap, req);
+	for (; alen > 0; ap ++) {
+		lo = (uint16_t) (*ap >> 16);
+		hi = (uint16_t) (*ap);
+
+		if (lo != hi) {
+			/* Put attribute range */
+			SDP_PUT8(SDP_DATA_UINT32, req);
+			SDP_PUT32(*ap, req);
+			alen -= (sizeof(ap[0]) + 1);
+		} else {
+			/* Put attribute */
+			SDP_PUT8(SDP_DATA_UINT16, req);
+			SDP_PUT16(lo, req);
+			alen -= (sizeof(lo) + 1);
+		}
 	}
 
 	/* Submit ServiceSearchAttributeRequest and wait for response */
@@ -241,8 +272,8 @@
 	rsp_tmp = ss->rsp;
 
 	/* Skip the first SEQ */
-	SDP_GET8(type, rsp_tmp);
-	switch (type) {
+	SDP_GET8(t, rsp_tmp);
+	switch (t) {
 	case SDP_DATA_SEQ8:
 		SDP_GET8(len, rsp_tmp);
 		break;
@@ -263,8 +294,8 @@
 
 	for (; rsp_tmp < rsp && vlen > 0; ) {
 		/* Get set of attributes for the next record */
-		SDP_GET8(type, rsp_tmp);
-		switch (type) {
+		SDP_GET8(t, rsp_tmp);
+		switch (t) {
 		case SDP_DATA_SEQ8:
 			SDP_GET8(len, rsp_tmp);
 			break;
@@ -286,8 +317,8 @@
 		/* Now rsp_tmp points to list of (attr,value) pairs */
 		for (; len > 0 && vlen > 0; vp ++, vlen --) {
 			/* Attribute */
-			SDP_GET8(type, rsp_tmp);
-			if (type != SDP_DATA_UINT16) {
+			SDP_GET8(t, rsp_tmp);
+			if (t != SDP_DATA_UINT16) {
 				ss->error = ENOATTR;
 				return (-1);
 			}

==== //depot/projects/wifi/share/man/man4/wlan_acl.4#2 (text+ko) ====

@@ -23,7 +23,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man4/wlan_acl.4,v 1.1 2004/12/08 17:47:32 sam Exp $
+.\" $FreeBSD: src/share/man/man4/wlan_acl.4,v 1.2 2004/12/09 13:57:12 brueffer Exp $
 .\"
 .Dd December 7, 2004
 .Dt WLAN_ACL 4
@@ -42,7 +42,7 @@
 is an 802.11 access control plugin module for use with the
 .Xr wlan 4
 module.
-This module is automatically loaded if an applications configures
+This module is automatically loaded if an application configures
 an access control policy for an 802.11 device operating as an access
 point.
 .Sh SEE ALSO

==== //depot/projects/wifi/share/man/man4/wlan_ccmp.4#2 (text+ko) ====

@@ -23,7 +23,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man4/wlan_ccmp.4,v 1.1 2004/12/08 17:47:32 sam Exp $
+.\" $FreeBSD: src/share/man/man4/wlan_ccmp.4,v 1.2 2004/12/09 13:57:12 brueffer Exp $
 .\"
 .Dd December 7, 2004
 .Dt WLAN_CCMP 4
@@ -46,7 +46,7 @@
 .Xr wlan 4
 module.
 This module is automatically loaded if an AES-CCMP key is configured;
-typically by a WPA supplicant program such as wpa_suplicant,
+typically by a WPA supplicant program such as wpa_supplicant,
 or a WPA authenticator program such as hostapd.
 Should the underlying network device not be capable of doing the AES-CCMP
 calculations in hardware, the

==== //depot/projects/wifi/share/man/man4/wlan_tkip.4#2 (text+ko) ====

@@ -23,7 +23,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man4/wlan_tkip.4,v 1.1 2004/12/08 17:47:32 sam Exp $
+.\" $FreeBSD: src/share/man/man4/wlan_tkip.4,v 1.2 2004/12/09 13:57:12 brueffer Exp $
 .\"
 .Dd December 7, 2004
 .Dt WLAN_TKIP 4
@@ -46,7 +46,7 @@
 .Xr wlan 4
 module.
 This module is automatically loaded if a TKIP key is configured;
-typically by a WPA supplicant program such as wpa_suplicant,
+typically by a WPA supplicant program such as wpa_supplicant,
 or a WPA authenticator program such as hostapd.
 Should the underlying network device not be capable of doing the TKIP
 and/or Michael calculations in hardware, the

==== //depot/projects/wifi/share/man/man4/wlan_xauth.4#2 (text+ko) ====

@@ -23,7 +23,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/share/man/man4/wlan_xauth.4,v 1.1 2004/12/08 17:47:32 sam Exp $
+.\" $FreeBSD: src/share/man/man4/wlan_xauth.4,v 1.2 2004/12/09 13:57:12 brueffer Exp $
 .\"
 .Dd December 7, 2004
 .Dt WLAN_XAUTH 4
@@ -49,7 +49,7 @@
 is an 802.11 authenticator plugin module for use by the
 .Xr wlan 4
 module.
-This module is automatically loaded if an applications configures
+This module is automatically loaded if an application configures
 an 802.11 device for operation as an AP with WPA or 802.1x authentication.
 .Sh SEE ALSO
 .Xr wlan 4

==== //depot/projects/wifi/sys/ufs/ffs/ffs_alloc.c#3 (text+ko) ====

@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/ufs/ffs/ffs_alloc.c,v 1.126 2004/10/29 10:15:55 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/ufs/ffs/ffs_alloc.c,v 1.127 2004/12/09 21:24:00 mckusick Exp $");
 
 #include "opt_quota.h"
 
@@ -1066,7 +1066,7 @@
 	if (indx % fs->fs_maxbpg == 0 || bap[indx - 1] == 0) {
 		if (lbn < NDADDR + NINDIR(fs)) {
 			cg = ino_to_cg(fs, ip->i_number);
-			return (fs->fs_fpg * cg + fs->fs_frag);
+			return (cgbase(fs, cg) + fs->fs_frag);
 		}
 		/*
 		 * Find a cylinder with greater than average number of
@@ -1082,12 +1082,12 @@
 		for (cg = startcg; cg < fs->fs_ncg; cg++)
 			if (fs->fs_cs(fs, cg).cs_nbfree >= avgbfree) {
 				fs->fs_cgrotor = cg;
-				return (fs->fs_fpg * cg + fs->fs_frag);
+				return (cgbase(fs, cg) + fs->fs_frag);
 			}
 		for (cg = 0; cg <= startcg; cg++)
 			if (fs->fs_cs(fs, cg).cs_nbfree >= avgbfree) {
 				fs->fs_cgrotor = cg;
-				return (fs->fs_fpg * cg + fs->fs_frag);
+				return (cgbase(fs, cg) + fs->fs_frag);
 			}
 		return (0);
 	}
@@ -1115,7 +1115,7 @@
 	if (indx % fs->fs_maxbpg == 0 || bap[indx - 1] == 0) {
 		if (lbn < NDADDR + NINDIR(fs)) {
 			cg = ino_to_cg(fs, ip->i_number);
-			return (fs->fs_fpg * cg + fs->fs_frag);
+			return (cgbase(fs, cg) + fs->fs_frag);
 		}
 		/*
 		 * Find a cylinder with greater than average number of
@@ -1131,12 +1131,12 @@
 		for (cg = startcg; cg < fs->fs_ncg; cg++)
 			if (fs->fs_cs(fs, cg).cs_nbfree >= avgbfree) {
 				fs->fs_cgrotor = cg;
-				return (fs->fs_fpg * cg + fs->fs_frag);
+				return (cgbase(fs, cg) + fs->fs_frag);
 			}
 		for (cg = 0; cg <= startcg; cg++)
 			if (fs->fs_cs(fs, cg).cs_nbfree >= avgbfree) {
 				fs->fs_cgrotor = cg;
-				return (fs->fs_fpg * cg + fs->fs_frag);
+				return (cgbase(fs, cg) + fs->fs_frag);
 			}
 		return (0);
 	}
@@ -1376,7 +1376,7 @@
 	cgp->cg_frsum[allocsiz]--;
 	if (frags != allocsiz)
 		cgp->cg_frsum[allocsiz - frags]++;
-	blkno = cg * fs->fs_fpg + bno;
+	blkno = cgbase(fs, cg) + bno;
 	if (DOINGSOFTDEP(ITOV(ip)))
 		softdep_setup_blkmapdep(bp, fs, blkno);
 	if (fs->fs_active != 0)
@@ -1437,7 +1437,7 @@
 	fs->fs_cstotal.cs_nbfree--;
 	fs->fs_cs(fs, cgp->cg_cgx).cs_nbfree--;
 	fs->fs_fmod = 1;
-	blkno = cgp->cg_cgx * fs->fs_fpg + bno;
+	blkno = cgbase(fs, cgp->cg_cgx) + bno;
 	if (DOINGSOFTDEP(ITOV(ip)))
 		softdep_setup_blkmapdep(bp, fs, blkno);
 	return (blkno);
@@ -1541,7 +1541,7 @@
 	for (i = 1; i <= len; i++)
 		if (!ffs_isblock(fs, blksfree, got - run + i))
 			panic("ffs_clusteralloc: map mismatch");
-	bno = cg * fs->fs_fpg + blkstofrags(fs, got - run + 1);
+	bno = cgbase(fs, cg) + blkstofrags(fs, got - run + 1);
 	if (dtog(fs, bno) != cg)
 		panic("ffs_clusteralloc: allocated out of group");
 	len = blkstofrags(fs, len);

==== //depot/projects/wifi/sys/ufs/ffs/ffs_snapshot.c#5 (text+ko) ====

@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/ufs/ffs/ffs_snapshot.c,v 1.90 2004/12/08 11:54:06 phk Exp $");
+__FBSDID("$FreeBSD: src/sys/ufs/ffs/ffs_snapshot.c,v 1.91 2004/12/09 21:24:00 mckusick Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -743,7 +743,7 @@
 		nbp->b_flags |= B_VALIDSUSPWRT;
 	numblks = howmany(fs->fs_size, fs->fs_frag);
 	len = howmany(fs->fs_fpg, fs->fs_frag);
-	base = cg * fs->fs_fpg / fs->fs_frag;
+	base = cgbase(fs, cg) / fs->fs_frag;
 	if (base + len >= numblks)
 		len = numblks - base - 1;
 	loc = 0;


More information about the p4-projects mailing list