Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Feb 2006 06:14:01 GMT
From:      Kip Macy <kmacy@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 92373 for review
Message-ID:  <200602250614.k1P6E1Xs070552@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=92373

Change 92373 by kmacy@kmacy_storage:sun4v_work on 2006/02/25 06:13:42

	IFC #2

Affected files ...

.. //depot/projects/kmacy_sun4v/src/sbin/mount/mount.8#3 integrate
.. //depot/projects/kmacy_sun4v/src/sys/boot/ofw/libofw/Makefile#3 integrate
.. //depot/projects/kmacy_sun4v/src/sys/boot/ofw/libofw/openfirm.c#3 integrate
.. //depot/projects/kmacy_sun4v/src/sys/boot/sparc64/loader/main.c#4 integrate
.. //depot/projects/kmacy_sun4v/src/sys/i386/cpufreq/est.c#3 integrate
.. //depot/projects/kmacy_sun4v/src/sys/net80211/ieee80211_output.c#3 integrate

Differences ...

==== //depot/projects/kmacy_sun4v/src/sbin/mount/mount.8#3 (text+ko) ====

@@ -26,7 +26,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)mount.8	8.8 (Berkeley) 6/16/94
-.\" $FreeBSD: src/sbin/mount/mount.8,v 1.74 2006/01/10 15:56:46 pav Exp $
+.\" $FreeBSD: src/sbin/mount/mount.8,v 1.75 2006/02/25 00:47:53 rodrigc Exp $
 .\"
 .Dd November 26, 2004
 .Dt MOUNT 8
@@ -52,7 +52,7 @@
 The
 .Nm
 utility calls the
-.Xr mount 2
+.Xr nmount 2
 system call to prepare and graft a
 .Ar "special device"
 or the remote node (rhost:path) on to the file system tree at the point
@@ -377,13 +377,39 @@
 and
 .Tn NULLFS .
 .Pp
-If the type is not one of the internally known types,
+The default behavior of
+.Nm
+is to pass the
+.Fl t
+option directly to the
+.Xr nmount 2
+system call in the
+.Li fstype
+option.
+.Pp
+However, for the following file system types:
+.Ar cd9660 ,
+.Ar mfs , 
+.Ar msdosfs ,
+.Ar nfs ,
+.Ar nfs4 ,
+.Ar ntfs ,
+.Ar nwfs ,
+.Ar nullfs ,
+.Ar portalfs ,
+.Ar smbfs ,
+.Ar udf ,
+.Ar umapfs ,
+and
+.Ar unionfs ,
 .Nm
-will attempt to execute a program in
+will not call
+.Xr nmount 2
+directly and will instead attempt to execute a program in
 .Pa /sbin/mount_ Ns Sy XXX
 where
 .Sy XXX
-is replaced by the type name.
+is replaced by the file system type name.
 For example, nfs file systems are mounted by the program
 .Pa /sbin/mount_nfs .
 .Pp
@@ -449,16 +475,13 @@
 .Sh SEE ALSO
 .Xr getfacl 1 ,
 .Xr setfacl 1 ,
-.Xr mount 2 ,
+.Xr nmount 2 ,
 .Xr acl 3 ,
 .Xr mac 4 ,
 .Xr fstab 5 ,
 .Xr kldload 8 ,
 .Xr mount_cd9660 8 ,
-.Xr mount_devfs 8 ,
 .Xr mount_ext2fs 8 ,
-.Xr mount_fdescfs 8 ,
-.Xr mount_linprocfs 8 ,
 .Xr mount_msdosfs 8 ,
 .Xr mount_nfs 8 ,
 .Xr mount_ntfs 8 ,
@@ -466,7 +489,6 @@
 .Xr mount_nwfs 8 ,
 .Xr mount_portalfs 8 ,
 .Xr mount_procfs 8 ,
-.Xr mount_reiserfs 8 ,
 .Xr mount_smbfs 8 ,
 .Xr mount_std 8 ,
 .Xr mount_udf 8 ,

==== //depot/projects/kmacy_sun4v/src/sys/boot/ofw/libofw/Makefile#3 (text+ko) ====


==== //depot/projects/kmacy_sun4v/src/sys/boot/ofw/libofw/openfirm.c#3 (text+ko) ====

@@ -747,6 +747,9 @@
 	args.ihandle = mmu;
 	args.align = align;
 	args.size = size;
+	args.ihandle = mmu;
+	args.align = align;
+	args.size = size;
 	args.virt = virt;
 
 	if (openfirmware(&args) == -1)

==== //depot/projects/kmacy_sun4v/src/sys/boot/sparc64/loader/main.c#4 (text+ko) ====

@@ -36,7 +36,6 @@
 #include <machine/upa.h>
 #include <machine/hypervisor_api.h>
 
-
 #include "bootstrap.h"
 #include "libofw.h"
 #include "dev_net.h"
@@ -99,6 +98,15 @@
 #define SUN4V_TLB_SLOT_MAX (1 << 10)
 
 
+extern char bootprog_name[], bootprog_rev[], bootprog_date[], bootprog_maker[];
+
+struct tlb_entry *dtlb_store;
+struct tlb_entry *itlb_store;
+
+int dtlb_slot;
+int itlb_slot;
+int dtlb_slot_max;
+int itlb_slot_max;
 
 vm_offset_t curkva = 0;
 vm_offset_t heapva;

==== //depot/projects/kmacy_sun4v/src/sys/i386/cpufreq/est.c#3 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/cpufreq/est.c,v 1.9 2005/07/31 06:42:27 cperciva Exp $");
+__FBSDID("$FreeBSD: src/sys/i386/cpufreq/est.c,v 1.10 2006/02/25 04:55:38 cperciva Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -464,6 +464,33 @@
 	FREQ_INFO( 600,  988, INTEL_BUS_CLK),
 	FREQ_INFO(   0,    0, 1),
 };
+static freq_info PM_778_90[] = {
+	/* 90 nm 1.60GHz Low Voltage Pentium M */
+	FREQ_INFO(1600, 1116, INTEL_BUS_CLK),
+	FREQ_INFO(1500, 1116, INTEL_BUS_CLK),
+	FREQ_INFO(1400, 1100, INTEL_BUS_CLK),
+	FREQ_INFO(1300, 1084, INTEL_BUS_CLK),
+	FREQ_INFO(1200, 1068, INTEL_BUS_CLK),
+	FREQ_INFO(1100, 1052, INTEL_BUS_CLK),
+	FREQ_INFO(1000, 1052, INTEL_BUS_CLK),
+	FREQ_INFO( 900, 1036, INTEL_BUS_CLK),
+	FREQ_INFO( 800, 1020, INTEL_BUS_CLK),
+	FREQ_INFO( 600,  988, INTEL_BUS_CLK),
+	FREQ_INFO(   0,    0, 1),
+};
+static freq_info PM_758_90[] = {
+	/* 90 nm 1.50GHz Low Voltage Pentium M */
+	FREQ_INFO(1500, 1116, INTEL_BUS_CLK),
+	FREQ_INFO(1400, 1116, INTEL_BUS_CLK),
+	FREQ_INFO(1300, 1100, INTEL_BUS_CLK),
+	FREQ_INFO(1200, 1084, INTEL_BUS_CLK),
+	FREQ_INFO(1100, 1068, INTEL_BUS_CLK),
+	FREQ_INFO(1000, 1052, INTEL_BUS_CLK),
+	FREQ_INFO( 900, 1036, INTEL_BUS_CLK),
+	FREQ_INFO( 800, 1020, INTEL_BUS_CLK),
+	FREQ_INFO( 600,  988, INTEL_BUS_CLK),
+	FREQ_INFO(   0,    0, 1),
+};
 static freq_info PM_738_90[] = {
 	/* 90 nm 1.40GHz Low Voltage Pentium M */
 	FREQ_INFO(1400, 1116, INTEL_BUS_CLK),
@@ -476,6 +503,169 @@
 	FREQ_INFO( 600,  988, INTEL_BUS_CLK),
 	FREQ_INFO(   0,    0, 1),
 };
+static freq_info PM_773G_90[] = {
+	/* 90 nm 1.30GHz Ultra Low Voltage Pentium M, VID #G */
+	FREQ_INFO(1300,  956, INTEL_BUS_CLK),
+	FREQ_INFO(1200,  940, INTEL_BUS_CLK),
+	FREQ_INFO(1100,  924, INTEL_BUS_CLK),
+	FREQ_INFO(1000,  908, INTEL_BUS_CLK),
+	FREQ_INFO( 900,  876, INTEL_BUS_CLK),
+	FREQ_INFO( 800,  860, INTEL_BUS_CLK),
+	FREQ_INFO( 600,  812, INTEL_BUS_CLK),
+};
+static freq_info PM_773H_90[] = {
+	/* 90 nm 1.30GHz Ultra Low Voltage Pentium M, VID #H */
+	FREQ_INFO(1300,  940, INTEL_BUS_CLK),
+	FREQ_INFO(1200,  924, INTEL_BUS_CLK),
+	FREQ_INFO(1100,  908, INTEL_BUS_CLK),
+	FREQ_INFO(1000,  892, INTEL_BUS_CLK),
+	FREQ_INFO( 900,  876, INTEL_BUS_CLK),
+	FREQ_INFO( 800,  860, INTEL_BUS_CLK),
+	FREQ_INFO( 600,  812, INTEL_BUS_CLK),
+};
+static freq_info PM_773I_90[] = {
+	/* 90 nm 1.30GHz Ultra Low Voltage Pentium M, VID #I */
+	FREQ_INFO(1300,  924, INTEL_BUS_CLK),
+	FREQ_INFO(1200,  908, INTEL_BUS_CLK),
+	FREQ_INFO(1100,  892, INTEL_BUS_CLK),
+	FREQ_INFO(1000,  876, INTEL_BUS_CLK),
+	FREQ_INFO( 900,  860, INTEL_BUS_CLK),
+	FREQ_INFO( 800,  844, INTEL_BUS_CLK),
+	FREQ_INFO( 600,  812, INTEL_BUS_CLK),
+};
+static freq_info PM_773J_90[] = {
+	/* 90 nm 1.30GHz Ultra Low Voltage Pentium M, VID #J */
+	FREQ_INFO(1300,  908, INTEL_BUS_CLK),
+	FREQ_INFO(1200,  908, INTEL_BUS_CLK),
+	FREQ_INFO(1100,  892, INTEL_BUS_CLK),
+	FREQ_INFO(1000,  876, INTEL_BUS_CLK),
+	FREQ_INFO( 900,  860, INTEL_BUS_CLK),
+	FREQ_INFO( 800,  844, INTEL_BUS_CLK),
+	FREQ_INFO( 600,  812, INTEL_BUS_CLK),
+};
+static freq_info PM_773K_90[] = {
+	/* 90 nm 1.30GHz Ultra Low Voltage Pentium M, VID #K */
+	FREQ_INFO(1300,  892, INTEL_BUS_CLK),
+	FREQ_INFO(1200,  892, INTEL_BUS_CLK),
+	FREQ_INFO(1100,  876, INTEL_BUS_CLK),
+	FREQ_INFO(1000,  860, INTEL_BUS_CLK),
+	FREQ_INFO( 900,  860, INTEL_BUS_CLK),
+	FREQ_INFO( 800,  844, INTEL_BUS_CLK),
+	FREQ_INFO( 600,  812, INTEL_BUS_CLK),
+};
+static freq_info PM_773L_90[] = {
+	/* 90 nm 1.30GHz Ultra Low Voltage Pentium M, VID #L */
+	FREQ_INFO(1300,  876, INTEL_BUS_CLK),
+	FREQ_INFO(1200,  876, INTEL_BUS_CLK),
+	FREQ_INFO(1100,  860, INTEL_BUS_CLK),
+	FREQ_INFO(1000,  860, INTEL_BUS_CLK),
+	FREQ_INFO( 900,  844, INTEL_BUS_CLK),
+	FREQ_INFO( 800,  844, INTEL_BUS_CLK),
+	FREQ_INFO( 600,  812, INTEL_BUS_CLK),
+};
+static freq_info PM_753G_90[] = {
+	/* 90 nm 1.20GHz Ultra Low Voltage Pentium M, VID #G */
+	FREQ_INFO(1200,  956, INTEL_BUS_CLK),
+	FREQ_INFO(1100,  940, INTEL_BUS_CLK),
+	FREQ_INFO(1000,  908, INTEL_BUS_CLK),
+	FREQ_INFO( 900,  892, INTEL_BUS_CLK),
+	FREQ_INFO( 800,  860, INTEL_BUS_CLK),
+	FREQ_INFO( 600,  812, INTEL_BUS_CLK),
+};
+static freq_info PM_753H_90[] = {
+	/* 90 nm 1.20GHz Ultra Low Voltage Pentium M, VID #H */
+	FREQ_INFO(1200,  940, INTEL_BUS_CLK),
+	FREQ_INFO(1100,  924, INTEL_BUS_CLK),
+	FREQ_INFO(1000,  908, INTEL_BUS_CLK),
+	FREQ_INFO( 900,  876, INTEL_BUS_CLK),
+	FREQ_INFO( 800,  860, INTEL_BUS_CLK),
+	FREQ_INFO( 600,  812, INTEL_BUS_CLK),
+};
+static freq_info PM_753I_90[] = {
+	/* 90 nm 1.20GHz Ultra Low Voltage Pentium M, VID #I */
+	FREQ_INFO(1200,  924, INTEL_BUS_CLK),
+	FREQ_INFO(1100,  908, INTEL_BUS_CLK),
+	FREQ_INFO(1000,  892, INTEL_BUS_CLK),
+	FREQ_INFO( 900,  876, INTEL_BUS_CLK),
+	FREQ_INFO( 800,  860, INTEL_BUS_CLK),
+	FREQ_INFO( 600,  812, INTEL_BUS_CLK),
+};
+static freq_info PM_753J_90[] = {
+	/* 90 nm 1.20GHz Ultra Low Voltage Pentium M, VID #J */
+	FREQ_INFO(1200,  908, INTEL_BUS_CLK),
+	FREQ_INFO(1100,  892, INTEL_BUS_CLK),
+	FREQ_INFO(1000,  876, INTEL_BUS_CLK),
+	FREQ_INFO( 900,  860, INTEL_BUS_CLK),
+	FREQ_INFO( 800,  844, INTEL_BUS_CLK),
+	FREQ_INFO( 600,  812, INTEL_BUS_CLK),
+};
+static freq_info PM_753K_90[] = {
+	/* 90 nm 1.20GHz Ultra Low Voltage Pentium M, VID #K */
+	FREQ_INFO(1200,  892, INTEL_BUS_CLK),
+	FREQ_INFO(1100,  892, INTEL_BUS_CLK),
+	FREQ_INFO(1000,  876, INTEL_BUS_CLK),
+	FREQ_INFO( 900,  860, INTEL_BUS_CLK),
+	FREQ_INFO( 800,  844, INTEL_BUS_CLK),
+	FREQ_INFO( 600,  812, INTEL_BUS_CLK),
+};
+static freq_info PM_753L_90[] = {
+	/* 90 nm 1.20GHz Ultra Low Voltage Pentium M, VID #L */
+	FREQ_INFO(1200,  876, INTEL_BUS_CLK),
+	FREQ_INFO(1100,  876, INTEL_BUS_CLK),
+	FREQ_INFO(1000,  860, INTEL_BUS_CLK),
+	FREQ_INFO( 900,  844, INTEL_BUS_CLK),
+	FREQ_INFO( 800,  844, INTEL_BUS_CLK),
+	FREQ_INFO( 600,  812, INTEL_BUS_CLK),
+};
+
+static freq_info PM_733JG_90[] = {
+	/* 90 nm 1.10GHz Ultra Low Voltage Pentium M, VID #G */
+	FREQ_INFO(1100,  956, INTEL_BUS_CLK),
+	FREQ_INFO(1000,  940, INTEL_BUS_CLK),
+	FREQ_INFO( 900,  908, INTEL_BUS_CLK),
+	FREQ_INFO( 800,  876, INTEL_BUS_CLK),
+	FREQ_INFO( 600,  812, INTEL_BUS_CLK),
+};
+static freq_info PM_733JH_90[] = {
+	/* 90 nm 1.10GHz Ultra Low Voltage Pentium M, VID #H */
+	FREQ_INFO(1100,  940, INTEL_BUS_CLK),
+	FREQ_INFO(1000,  924, INTEL_BUS_CLK),
+	FREQ_INFO( 900,  892, INTEL_BUS_CLK),
+	FREQ_INFO( 800,  876, INTEL_BUS_CLK),
+	FREQ_INFO( 600,  812, INTEL_BUS_CLK),
+};
+static freq_info PM_733JI_90[] = {
+	/* 90 nm 1.10GHz Ultra Low Voltage Pentium M, VID #I */
+	FREQ_INFO(1100,  924, INTEL_BUS_CLK),
+	FREQ_INFO(1000,  908, INTEL_BUS_CLK),
+	FREQ_INFO( 900,  892, INTEL_BUS_CLK),
+	FREQ_INFO( 800,  860, INTEL_BUS_CLK),
+	FREQ_INFO( 600,  812, INTEL_BUS_CLK),
+};
+static freq_info PM_733JJ_90[] = {
+	/* 90 nm 1.10GHz Ultra Low Voltage Pentium M, VID #J */
+	FREQ_INFO(1100,  908, INTEL_BUS_CLK),
+	FREQ_INFO(1000,  892, INTEL_BUS_CLK),
+	FREQ_INFO( 900,  876, INTEL_BUS_CLK),
+	FREQ_INFO( 800,  860, INTEL_BUS_CLK),
+	FREQ_INFO( 600,  812, INTEL_BUS_CLK),
+};
+static freq_info PM_733JK_90[] = {
+	/* 90 nm 1.10GHz Ultra Low Voltage Pentium M, VID #K */
+	FREQ_INFO(1100,  892, INTEL_BUS_CLK),
+	FREQ_INFO(1000,  876, INTEL_BUS_CLK),
+	FREQ_INFO( 900,  860, INTEL_BUS_CLK),
+	FREQ_INFO( 800,  844, INTEL_BUS_CLK),
+	FREQ_INFO( 600,  812, INTEL_BUS_CLK),
+};
+static freq_info PM_733JL_90[] = {
+	/* 90 nm 1.10GHz Ultra Low Voltage Pentium M, VID #L */
+	FREQ_INFO(1100,  876, INTEL_BUS_CLK),
+	FREQ_INFO(1000,  876, INTEL_BUS_CLK),
+	FREQ_INFO( 900,  860, INTEL_BUS_CLK),
+	FREQ_INFO( 800,  844, INTEL_BUS_CLK),
+	FREQ_INFO( 600,  812, INTEL_BUS_CLK),
+};
 static freq_info PM_733_90[] = {
 	/* 90 nm 1.10GHz Ultra Low Voltage Pentium M */
 	FREQ_INFO(1100,  940, INTEL_BUS_CLK),
@@ -529,7 +719,27 @@
 	INTEL(PM_715B_90,	1500, 1324, 600, 988, INTEL_BUS_CLK),
 	INTEL(PM_715C_90,	1500, 1308, 600, 988, INTEL_BUS_CLK),
 	INTEL(PM_715D_90,	1500, 1276, 600, 988, INTEL_BUS_CLK),
+	INTEL(PM_778_90,	1600, 1116, 600, 988, INTEL_BUS_CLK),
+	INTEL(PM_758_90,	1500, 1116, 600, 988, INTEL_BUS_CLK),
 	INTEL(PM_738_90,	1400, 1116, 600, 988, INTEL_BUS_CLK),
+	INTEL(PM_773G_90,	1300,  956, 600, 812, INTEL_BUS_CLK),
+	INTEL(PM_773H_90,	1300,  940, 600, 812, INTEL_BUS_CLK),
+	INTEL(PM_773I_90,	1300,  924, 600, 812, INTEL_BUS_CLK),
+	INTEL(PM_773J_90,	1300,  908, 600, 812, INTEL_BUS_CLK),
+	INTEL(PM_773K_90,	1300,  892, 600, 812, INTEL_BUS_CLK),
+	INTEL(PM_773L_90,	1300,  876, 600, 812, INTEL_BUS_CLK),
+	INTEL(PM_753G_90,	1200,  956, 600, 812, INTEL_BUS_CLK),
+	INTEL(PM_753H_90,	1200,  940, 600, 812, INTEL_BUS_CLK),
+	INTEL(PM_753I_90,	1200,  924, 600, 812, INTEL_BUS_CLK),
+	INTEL(PM_753J_90,	1200,  908, 600, 812, INTEL_BUS_CLK),
+	INTEL(PM_753K_90,	1200,  892, 600, 812, INTEL_BUS_CLK),
+	INTEL(PM_753L_90,	1200,  876, 600, 812, INTEL_BUS_CLK),
+	INTEL(PM_733JG_90,	1100,  956, 600, 812, INTEL_BUS_CLK),
+	INTEL(PM_733JH_90,	1100,  940, 600, 812, INTEL_BUS_CLK),
+	INTEL(PM_733JI_90,	1100,  924, 600, 812, INTEL_BUS_CLK),
+	INTEL(PM_733JJ_90,	1100,  908, 600, 812, INTEL_BUS_CLK),
+	INTEL(PM_733JK_90,	1100,  892, 600, 812, INTEL_BUS_CLK),
+	INTEL(PM_733JL_90,	1100,  876, 600, 812, INTEL_BUS_CLK),
 	INTEL(PM_733_90,	1100,  940, 600, 812, INTEL_BUS_CLK),
 	INTEL(PM_723_90,	1000,  940, 600, 812, INTEL_BUS_CLK),
 	{ NULL, 0, 0, NULL },

==== //depot/projects/kmacy_sun4v/src/sys/net80211/ieee80211_output.c#3 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_output.c,v 1.38 2006/02/08 17:30:31 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_output.c,v 1.39 2006/02/25 05:36:43 sam Exp $");
 
 #include "opt_inet.h"
 
@@ -1041,6 +1041,32 @@
 }
 
 /*
+ * Calculate capability information for mgt frames.
+ */
+static u_int16_t
+getcapinfo(struct ieee80211com *ic, struct ieee80211_channel *chan)
+{
+	u_int16_t capinfo;
+
+	KASSERT(ic->ic_opmode != IEEE80211_M_STA, ("station mode"));
+
+	if (ic->ic_opmode == IEEE80211_M_HOSTAP)
+		capinfo = IEEE80211_CAPINFO_ESS;
+	else if (ic->ic_opmode == IEEE80211_M_IBSS)
+		capinfo = IEEE80211_CAPINFO_IBSS;
+	else
+		capinfo = 0;
+	if (ic->ic_flags & IEEE80211_F_PRIVACY)
+		capinfo |= IEEE80211_CAPINFO_PRIVACY;
+	if ((ic->ic_flags & IEEE80211_F_SHPREAMBLE) &&
+	    IEEE80211_IS_CHAN_2GHZ(chan))
+		capinfo |= IEEE80211_CAPINFO_SHORT_PREAMBLE;
+	if (ic->ic_flags & IEEE80211_F_SHSLOT)
+		capinfo |= IEEE80211_CAPINFO_SHORT_SLOTTIME;
+	return capinfo;
+}
+
+/*
  * Send a management frame.  The node is for the destination (or ic_bss
  * when in station mode).  Nodes other than ic_bss have their reference
  * count bumped to reflect our use for an indeterminant time.
@@ -1108,17 +1134,7 @@
 		frm += 8;
 		*(u_int16_t *)frm = htole16(ic->ic_bss->ni_intval);
 		frm += 2;
-		if (ic->ic_opmode == IEEE80211_M_IBSS)
-			capinfo = IEEE80211_CAPINFO_IBSS;
-		else
-			capinfo = IEEE80211_CAPINFO_ESS;
-		if (ic->ic_flags & IEEE80211_F_PRIVACY)
-			capinfo |= IEEE80211_CAPINFO_PRIVACY;
-		if ((ic->ic_flags & IEEE80211_F_SHPREAMBLE) &&
-		    IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan))
-			capinfo |= IEEE80211_CAPINFO_SHORT_PREAMBLE;
-		if (ic->ic_flags & IEEE80211_F_SHSLOT)
-			capinfo |= IEEE80211_CAPINFO_SHORT_SLOTTIME;
+		capinfo = getcapinfo(ic, ic->ic_curchan);
 		*(u_int16_t *)frm = htole16(capinfo);
 		frm += 2;
 
@@ -1259,11 +1275,9 @@
 		if (m == NULL)
 			senderr(ENOMEM, is_tx_nobuf);
 
-		capinfo = 0;
-		if (ic->ic_opmode == IEEE80211_M_IBSS)
-			capinfo |= IEEE80211_CAPINFO_IBSS;
-		else		/* IEEE80211_M_STA */
-			capinfo |= IEEE80211_CAPINFO_ESS;
+		KASSERT(ic->ic_opmode == IEEE80211_M_STA,
+		    ("wrong mode %u", ic->ic_opmode));
+		capinfo = IEEE80211_CAPINFO_ESS;
 		if (ic->ic_flags & IEEE80211_F_PRIVACY)
 			capinfo |= IEEE80211_CAPINFO_PRIVACY;
 		/*
@@ -1323,14 +1337,7 @@
 		if (m == NULL)
 			senderr(ENOMEM, is_tx_nobuf);
 
-		capinfo = IEEE80211_CAPINFO_ESS;
-		if (ic->ic_flags & IEEE80211_F_PRIVACY)
-			capinfo |= IEEE80211_CAPINFO_PRIVACY;
-		if ((ic->ic_flags & IEEE80211_F_SHPREAMBLE) &&
-		    IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan))
-			capinfo |= IEEE80211_CAPINFO_SHORT_PREAMBLE;
-		if (ic->ic_flags & IEEE80211_F_SHSLOT)
-			capinfo |= IEEE80211_CAPINFO_SHORT_SLOTTIME;
+		capinfo = getcapinfo(ic, ic->ic_curchan);
 		*(u_int16_t *)frm = htole16(capinfo);
 		frm += 2;
 
@@ -1439,17 +1446,7 @@
 	frm += 8;
 	*(u_int16_t *)frm = htole16(ni->ni_intval);
 	frm += 2;
-	if (ic->ic_opmode == IEEE80211_M_IBSS)
-		capinfo = IEEE80211_CAPINFO_IBSS;
-	else
-		capinfo = IEEE80211_CAPINFO_ESS;
-	if (ic->ic_flags & IEEE80211_F_PRIVACY)
-		capinfo |= IEEE80211_CAPINFO_PRIVACY;
-	if ((ic->ic_flags & IEEE80211_F_SHPREAMBLE) &&
-	    IEEE80211_IS_CHAN_2GHZ(ni->ni_chan))
-		capinfo |= IEEE80211_CAPINFO_SHORT_PREAMBLE;
-	if (ic->ic_flags & IEEE80211_F_SHSLOT)
-		capinfo |= IEEE80211_CAPINFO_SHORT_SLOTTIME;
+	capinfo = getcapinfo(ic, ni->ni_chan);
 	bo->bo_caps = (u_int16_t *)frm;
 	*(u_int16_t *)frm = htole16(capinfo);
 	frm += 2;
@@ -1472,7 +1469,7 @@
 		*frm++ = 2;
 		*frm++ = 0; *frm++ = 0;		/* TODO: ATIM window */
 		bo->bo_tim_len = 0;
-	} else {
+	} else if (ic->ic_opmode == IEEE80211_M_HOSTAP) {
 		struct ieee80211_tim_ie *tie = (struct ieee80211_tim_ie *) frm;
 
 		tie->tim_ie = IEEE80211_ELEMID_TIM;
@@ -1527,17 +1524,7 @@
 
 	IEEE80211_BEACON_LOCK(ic);
 	/* XXX faster to recalculate entirely or just changes? */
-	if (ic->ic_opmode == IEEE80211_M_IBSS)
-		capinfo = IEEE80211_CAPINFO_IBSS;
-	else
-		capinfo = IEEE80211_CAPINFO_ESS;
-	if (ic->ic_flags & IEEE80211_F_PRIVACY)
-		capinfo |= IEEE80211_CAPINFO_PRIVACY;
-	if ((ic->ic_flags & IEEE80211_F_SHPREAMBLE) &&
-	    IEEE80211_IS_CHAN_2GHZ(ni->ni_chan))
-		capinfo |= IEEE80211_CAPINFO_SHORT_PREAMBLE;
-	if (ic->ic_flags & IEEE80211_F_SHSLOT)
-		capinfo |= IEEE80211_CAPINFO_SHORT_SLOTTIME;
+	capinfo = getcapinfo(ic, ni->ni_chan);
 	*bo->bo_caps = htole16(capinfo);
 
 	if (ic->ic_flags & IEEE80211_F_WME) {



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