PERFORCE change 154381 for review
Marko Zec
zec at FreeBSD.org
Mon Dec 8 20:28:13 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=154381
Change 154381 by zec at zec_tca51 on 2008/12/09 04:28:02
IFC @ 154379
Affected files ...
.. //depot/projects/vimage-commit2/src/sys/amd64/amd64/pmap.c#9 integrate
.. //depot/projects/vimage-commit2/src/sys/boot/common/loader.8#2 integrate
.. //depot/projects/vimage-commit2/src/sys/boot/forth/support.4th#2 integrate
.. //depot/projects/vimage-commit2/src/sys/boot/i386/boot0/boot0.S#5 integrate
.. //depot/projects/vimage-commit2/src/sys/boot/i386/btx/btxldr/btxldr.S#2 integrate
.. //depot/projects/vimage-commit2/src/sys/boot/zfs/Makefile#3 integrate
.. //depot/projects/vimage-commit2/src/sys/compat/linprocfs/linprocfs.c#15 integrate
.. //depot/projects/vimage-commit2/src/sys/contrib/pf/net/pf_table.c#2 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/adb/adb.h#2 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/adb/adb_bus.c#4 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/adb/adb_kbd.c#2 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/adb/adb_mouse.c#3 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/adb/adbvar.h#3 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/ae/if_ae.c#2 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/ath/if_ath.c#7 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/ath/if_athvar.h#7 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/cxgb/common/cxgb_t3_hw.c#8 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/cxgb/cxgb_main.c#12 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/dc/if_dc.c#4 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/dc/if_dcreg.h#3 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/e1000/if_em.c#4 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/fxp/if_fxp.c#6 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/mmc/mmc.c#7 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/mmc/mmcsd.c#8 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/pccbb/pccbb.c#4 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/pccbb/pccbb_pci.c#4 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/re/if_re.c#7 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/sdhci/sdhci.c#3 integrate
.. //depot/projects/vimage-commit2/src/sys/dev/usb/if_ural.c#3 integrate
.. //depot/projects/vimage-commit2/src/sys/fs/procfs/procfs_map.c#4 integrate
.. //depot/projects/vimage-commit2/src/sys/geom/geom_subr.c#3 integrate
.. //depot/projects/vimage-commit2/src/sys/geom/journal/g_journal.c#5 integrate
.. //depot/projects/vimage-commit2/src/sys/geom/journal/g_journal.h#2 integrate
.. //depot/projects/vimage-commit2/src/sys/i386/include/atomic.h#4 integrate
.. //depot/projects/vimage-commit2/src/sys/kern/kern_proc.c#11 integrate
.. //depot/projects/vimage-commit2/src/sys/kern/kern_rwlock.c#3 integrate
.. //depot/projects/vimage-commit2/src/sys/kern/subr_param.c#4 integrate
.. //depot/projects/vimage-commit2/src/sys/kern/subr_witness.c#9 integrate
.. //depot/projects/vimage-commit2/src/sys/kern/vfs_export.c#5 integrate
.. //depot/projects/vimage-commit2/src/sys/net/radix.c#2 integrate
.. //depot/projects/vimage-commit2/src/sys/net/radix.h#2 integrate
.. //depot/projects/vimage-commit2/src/sys/net/route.c#25 integrate
.. //depot/projects/vimage-commit2/src/sys/net/route.h#6 integrate
.. //depot/projects/vimage-commit2/src/sys/net/rtsock.c#15 integrate
.. //depot/projects/vimage-commit2/src/sys/netgraph/ng_mppc.c#3 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/if_ether.c#23 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/in_pcb.c#30 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/in_pcb.h#10 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctp.h#4 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctp_asconf.c#7 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctp_asconf.h#3 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctp_auth.c#5 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctp_auth.h#2 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctp_constants.h#5 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctp_header.h#3 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctp_indata.c#8 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctp_indata.h#3 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctp_input.c#8 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctp_os_bsd.h#19 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctp_output.c#12 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctp_output.h#3 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctp_pcb.c#16 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctp_pcb.h#7 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctp_structs.h#2 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctp_sysctl.c#6 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctp_sysctl.h#5 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctp_timer.c#9 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctp_uio.h#5 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctp_usrreq.c#11 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctp_var.h#7 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctputil.c#10 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/sctputil.h#3 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet/tcp_input.c#29 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet6/in6_rmx.c#21 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet6/nd6_rtr.c#18 integrate
.. //depot/projects/vimage-commit2/src/sys/netinet6/sctp6_usrreq.c#9 integrate
.. //depot/projects/vimage-commit2/src/sys/pci/if_rlreg.h#9 integrate
.. //depot/projects/vimage-commit2/src/sys/powerpc/conf/NOTES#2 integrate
.. //depot/projects/vimage-commit2/src/sys/powerpc/powermac/cuda.c#3 integrate
.. //depot/projects/vimage-commit2/src/sys/powerpc/powermac/cudavar.h#2 integrate
.. //depot/projects/vimage-commit2/src/sys/powerpc/powermac/macgpio.c#2 integrate
.. //depot/projects/vimage-commit2/src/sys/powerpc/powermac/macgpiovar.h#2 integrate
.. //depot/projects/vimage-commit2/src/sys/powerpc/powermac/pmu.c#3 integrate
.. //depot/projects/vimage-commit2/src/sys/powerpc/powermac/pmuvar.h#2 integrate
.. //depot/projects/vimage-commit2/src/sys/sys/rwlock.h#2 integrate
.. //depot/projects/vimage-commit2/src/sys/ufs/ufs/ufs_quota.c#3 integrate
Differences ...
==== //depot/projects/vimage-commit2/src/sys/amd64/amd64/pmap.c#9 (text+ko) ====
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.645 2008/08/09 05:46:13 alc Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.646 2008/12/06 19:37:52 alc Exp $");
/*
* Manages physical address maps.
@@ -180,7 +180,7 @@
SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters");
-static int pg_ps_enabled;
+static int pg_ps_enabled = 1;
SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RD, &pg_ps_enabled, 0,
"Are large page mappings enabled?");
==== //depot/projects/vimage-commit2/src/sys/boot/common/loader.8#2 (text+ko) ====
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/sys/boot/common/loader.8,v 1.94 2007/11/08 11:59:38 ru Exp $
+.\" $FreeBSD: src/sys/boot/common/loader.8,v 1.95 2008/12/06 11:21:10 danger Exp $
.\"
.Dd November 8, 2007
.Dt LOADER 8
@@ -454,7 +454,7 @@
or if a SIGTERM is delivered to the
.Xr init 8
process (PID 1).
-.It Va init_script
+.It Va init_shell
Defines the shell binary to be used for executing the various shell scripts.
The default is
.Dq Li /bin/sh .
==== //depot/projects/vimage-commit2/src/sys/boot/forth/support.4th#2 (text+ko) ====
@@ -22,7 +22,7 @@
\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
\ SUCH DAMAGE.
\
-\ $FreeBSD: src/sys/boot/forth/support.4th,v 1.17 2007/12/19 17:06:32 ambrisko Exp $
+\ $FreeBSD: src/sys/boot/forth/support.4th,v 1.18 2008/12/07 19:42:20 luigi Exp $
\ Loader.rc support functions:
\
@@ -288,6 +288,17 @@
: free-memory free if free_error throw then ;
+: strget { var -- addr len } var .addr @ var .len @ ;
+
+\ assign addr len to variable.
+: strset { addr len var -- } addr var .addr ! len var .len ! ;
+
+\ free memory and reset fields
+: strfree { var -- } var .addr @ ?dup if free-memory 0 0 var strset then ;
+
+\ free old content, make a copy of the string and assign to variable
+: string= { addr len var -- } var strfree addr len strdup var strset ;
+
\ Assignment data temporary storage
string name_buffer
@@ -712,19 +723,6 @@
module_loaderror_suffix suffix_type?
;
-: set_conf_files
- conf_files .addr @ ?dup if
- free-memory
- then
- value_buffer .addr @ c@ [char] " = if
- value_buffer .addr @ char+ value_buffer .len @ 2 chars -
- else
- value_buffer .addr @ value_buffer .len @
- then
- strdup
- conf_files .len ! conf_files .addr !
-;
-
: set_nextboot_conf
nextboot_conf_file .addr @ ?dup if
free-memory
@@ -888,6 +886,11 @@
then
;
+: set_conf_files
+ set_environment_variable
+ s" loader_conf_files" getenv conf_files string=
+;
+
: set_nextboot_flag
yes_value? to nextboot?
;
@@ -1045,7 +1048,6 @@
\ Variables used for processing multiple conf files
string current_file_name
-variable current_conf_files
\ Indicates if any conf file was succesfully read
@@ -1053,18 +1055,10 @@
\ loader_conf_files processing support functions
-: set_current_conf_files
- conf_files .addr @ current_conf_files !
+: get_conf_files ( -- addr len ) \ put addr/len on stack, reset var
+ conf_files strget 0 0 conf_files strset
;
-: get_conf_files
- conf_files .addr @ conf_files .len @ strdup
-;
-
-: recurse_on_conf_files?
- current_conf_files @ conf_files .addr @ <>
-;
-
: skip_leading_spaces { addr len pos -- addr len pos' }
begin
pos len = if addr len pos exit then
@@ -1133,7 +1127,6 @@
\ Interface to loader_conf_files processing
: include_conf_files
- set_current_conf_files
get_conf_files 0
begin
get_next_file ?dup
@@ -1141,7 +1134,7 @@
set_current_file_name
['] load_conf catch
process_conf_errors
- recurse_on_conf_files? if recurse then
+ conf_files .addr @ if recurse then
repeat
;
==== //depot/projects/vimage-commit2/src/sys/boot/i386/boot0/boot0.S#5 (text+ko) ====
@@ -14,7 +14,7 @@
* warranties of merchantability and fitness for a particular
* purpose.
*
- * $FreeBSD: src/sys/boot/i386/boot0/boot0.S,v 1.20 2008/12/03 14:53:59 luigi Exp $
+ * $FreeBSD: src/sys/boot/i386/boot0/boot0.S,v 1.21 2008/12/08 20:53:27 sobomax Exp $
*/
/* build options: */
@@ -93,7 +93,7 @@
* %si pointer to the partition table from which we were loaded.
* Some boot code (e.g. syslinux) use this info to relocate
* themselves, so we want to pass a valid one to the next stage.
- * NOTE: the use of %is is not a standard.
+ * NOTE: the use of %si is not a standard.
*
* This boot block first relocates itself at a different address (0:0x600),
* to free the space at 0:0x7c00 for the next stage boot block.
==== //depot/projects/vimage-commit2/src/sys/boot/i386/btx/btxldr/btxldr.S#2 (text+ko) ====
@@ -12,9 +12,12 @@
* warranties of merchantability and fitness for a particular
* purpose.
*
- * $FreeBSD: src/sys/boot/i386/btx/btxldr/btxldr.S,v 1.17 2004/05/14 20:29:30 ru Exp $
+ * $FreeBSD: src/sys/boot/i386/btx/btxldr/btxldr.S,v 1.20 2008/12/09 00:25:57 sobomax Exp $
*/
+#define RBX_MUTE 0x10 /* -m */
+#define OPT_SET(opt) (1 << (opt))
+
/*
* Prototype BTX loader program, written in a couple of hours. The
* real thing should probably be more flexible, and in C.
@@ -64,6 +67,8 @@
* BTX program loader for ELF clients.
*/
start: cld # String ops inc
+ testl $OPT_SET(RBX_MUTE), 4(%esp) # Check first argument
+ setnz muted # for RBX_MUTE, set flag
movl $m_logo,%esi # Identify
call putstr # ourselves
movzwl BDA_MEM,%eax # Get base memory
@@ -288,7 +293,9 @@
/*
* Output character AL to the console.
*/
-putchr: pusha # Save
+putchr: testb $1,muted # Check muted
+ jnz putchr.5 # do a nop
+ pusha # Save
xorl %ecx,%ecx # Zero for loops
movb $SCR_MAT,%ah # Mode/attribute
movl $BDA_POS,%ebx # BDA pointer
@@ -325,7 +332,7 @@
movb $SCR_ROW-1,%dh # Bottom line
putchr.4: movw %dx,(%ebx) # Update position
popa # Restore
- ret # To caller
+putchr.5: ret # To caller
/*
* Convert EAX, AX, or AL to hex, saving the result to [EDI].
*/
@@ -390,6 +397,12 @@
.asciz " memsz=\0\n"
m_done: .asciz "Loading complete\n"
#endif
+
+/*
+ * Flags
+ */
+muted: .byte 0x0
+
/*
* Uninitialized data area.
*/
==== //depot/projects/vimage-commit2/src/sys/boot/zfs/Makefile#3 (text+ko) ====
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/boot/zfs/Makefile,v 1.2 2008/11/22 14:24:55 dfr Exp $
+# $FreeBSD: src/sys/boot/zfs/Makefile,v 1.3 2008/12/06 14:45:03 ps Exp $
LIB= zfsboot
INTERNALLIB=
@@ -29,7 +29,7 @@
.if ${MACHINE_ARCH} == "amd64"
CLEANFILES+= machine
machine:
- ln -sf ${.CURDIR}/../../../i386/include machine
+ ln -sf ${.CURDIR}/../../i386/include machine
.endif
.include <bsd.lib.mk>
==== //depot/projects/vimage-commit2/src/sys/compat/linprocfs/linprocfs.c#15 (text+ko) ====
@@ -42,7 +42,7 @@
#include "opt_compat.h"
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.128 2008/12/02 21:37:28 bz Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/linprocfs/linprocfs.c,v 1.130 2008/12/08 13:15:31 kib Exp $");
#include <sys/param.h>
#include <sys/queue.h>
@@ -273,8 +273,7 @@
/* XXX per-cpu vendor / class / model / id? */
}
- sbuf_cat(sb,
- "flags\t\t:");
+ sbuf_cat(sb, "flags\t\t:");
if (!strcmp(cpu_vendor, "AuthenticAMD") && (class < 6)) {
flags[16] = "fcmov";
@@ -876,10 +875,12 @@
linprocfs_doprocmaps(PFS_FILL_ARGS)
{
vm_map_t map = &p->p_vmspace->vm_map;
- vm_map_entry_t entry;
+ vm_map_entry_t entry, tmp_entry;
vm_object_t obj, tobj, lobj;
- vm_offset_t saved_end;
+ vm_offset_t e_start, e_end;
vm_ooffset_t off = 0;
+ vm_prot_t e_prot;
+ unsigned int last_timestamp;
char *name = "", *freename = NULL;
ino_t ino;
int ref_count, shadow_count, flags;
@@ -905,7 +906,9 @@
freename = NULL;
if (entry->eflags & MAP_ENTRY_IS_SUB_MAP)
continue;
- saved_end = entry->end;
+ e_prot = entry->protection;
+ e_start = entry->start;
+ e_end = entry->end;
obj = entry->object.vm_object;
for (lobj = tobj = obj; tobj; tobj = tobj->backing_object) {
VM_OBJECT_LOCK(tobj);
@@ -913,6 +916,8 @@
VM_OBJECT_UNLOCK(lobj);
lobj = tobj;
}
+ last_timestamp = map->timestamp;
+ vm_map_unlock_read(map);
ino = 0;
if (lobj) {
off = IDX_TO_OFF(lobj->size);
@@ -950,10 +955,10 @@
*/
error = sbuf_printf(sb,
"%08lx-%08lx %s%s%s%s %08lx %02x:%02x %lu%s%s\n",
- (u_long)entry->start, (u_long)entry->end,
- (entry->protection & VM_PROT_READ)?"r":"-",
- (entry->protection & VM_PROT_WRITE)?"w":"-",
- (entry->protection & VM_PROT_EXECUTE)?"x":"-",
+ (u_long)e_start, (u_long)e_end,
+ (e_prot & VM_PROT_READ)?"r":"-",
+ (e_prot & VM_PROT_WRITE)?"w":"-",
+ (e_prot & VM_PROT_EXECUTE)?"x":"-",
"p",
(u_long)off,
0,
@@ -968,6 +973,16 @@
error = 0;
break;
}
+ vm_map_lock_read(map);
+ if (last_timestamp + 1 != map->timestamp) {
+ /*
+ * Look again for the entry because the map was
+ * modified while it was unlocked. Specifically,
+ * the entry may have been clipped, merged, or deleted.
+ */
+ vm_map_lookup_entry(map, e_end - 1, &tmp_entry);
+ entry = tmp_entry;
+ }
}
vm_map_unlock_read(map);
==== //depot/projects/vimage-commit2/src/sys/contrib/pf/net/pf_table.c#2 (text+ko) ====
@@ -35,7 +35,7 @@
#include "opt_inet6.h"
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/contrib/pf/net/pf_table.c,v 1.9 2007/10/24 20:57:17 mlaier Exp $");
+__FBSDID("$FreeBSD: src/sys/contrib/pf/net/pf_table.c,v 1.10 2008/12/07 21:15:43 kmacy Exp $");
#endif
#include <sys/param.h>
@@ -43,6 +43,8 @@
#include <sys/socket.h>
#include <sys/mbuf.h>
#include <sys/kernel.h>
+#include <sys/lock.h>
+#include <sys/rwlock.h>
#ifdef __FreeBSD__
#include <sys/malloc.h>
#endif
==== //depot/projects/vimage-commit2/src/sys/dev/adb/adb.h#2 (text+ko) ====
@@ -22,7 +22,7 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/adb/adb.h,v 1.1 2008/10/26 19:37:38 nwhitehorn Exp $
+ * $FreeBSD: src/sys/dev/adb/adb.h,v 1.2 2008/12/06 23:26:02 nwhitehorn Exp $
*/
#ifndef _POWERPC_ADB_H_
@@ -68,7 +68,7 @@
uint8_t adb_get_device_handler(device_t dev);
uint8_t adb_set_device_handler(device_t dev, uint8_t newhandler);
-uint8_t adb_read_register(device_t dev, u_char reg, size_t *len, void *data);
+size_t adb_read_register(device_t dev, u_char reg, void *data);
/* Bits for implementing ADB host bus adapters */
extern devclass_t adb_devclass;
==== //depot/projects/vimage-commit2/src/sys/dev/adb/adb_bus.c#4 (text+ko) ====
@@ -22,7 +22,7 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/adb/adb_bus.c,v 1.3 2008/11/12 17:33:36 nwhitehorn Exp $
+ * $FreeBSD: src/sys/dev/adb/adb_bus.c,v 1.4 2008/12/06 23:26:02 nwhitehorn Exp $
*/
#include <sys/cdefs.h>
@@ -48,7 +48,7 @@
static void adb_probe_nomatch(device_t dev, device_t child);
static int adb_print_child(device_t dev, device_t child);
-static int adb_send_raw_packet_sync(device_t dev, uint8_t to, uint8_t command, uint8_t reg, int len, u_char *data);
+static int adb_send_raw_packet_sync(device_t dev, uint8_t to, uint8_t command, uint8_t reg, int len, u_char *data, u_char *reply);
static char *adb_device_string[] = {
"HOST", "dongle", "keyboard", "mouse", "tablet", "modem", "RESERVED", "misc"
@@ -118,9 +118,8 @@
sc->packet_reply = 0;
sc->autopoll_mask = 0;
+ sc->sync_packet = 0xffff;
- mtx_init(&sc->sc_sync_mtx,"adbsyn",NULL,MTX_DEF | MTX_RECURSE);
-
/* Initialize devinfo */
for (i = 0; i < 16; i++) {
sc->devinfo[i].address = i;
@@ -128,7 +127,7 @@
}
/* Reset ADB bus */
- adb_send_raw_packet_sync(dev,0,ADB_COMMAND_BUS_RESET,0,0,NULL);
+ adb_send_raw_packet_sync(dev,0,ADB_COMMAND_BUS_RESET,0,0,NULL,NULL);
DELAY(1500);
/* Enumerate bus */
@@ -140,7 +139,7 @@
do {
reply = adb_send_raw_packet_sync(dev,i,
- ADB_COMMAND_TALK,3,0,NULL);
+ ADB_COMMAND_TALK,3,0,NULL,NULL);
if (reply) {
/* If we got a response, relocate to next_free */
@@ -150,10 +149,10 @@
r3 |= 0x00fe;
adb_send_raw_packet_sync(dev,i, ADB_COMMAND_LISTEN,3,
- sizeof(uint16_t),(u_char *)(&r3));
+ sizeof(uint16_t),(u_char *)(&r3),NULL);
adb_send_raw_packet_sync(dev,next_free,
- ADB_COMMAND_TALK,3,0,NULL);
+ ADB_COMMAND_TALK,3,0,NULL,NULL);
sc->devinfo[next_free].default_address = i;
if (first_relocated < 0)
@@ -169,9 +168,9 @@
adb_send_raw_packet_sync(dev,first_relocated,
ADB_COMMAND_LISTEN,3,
- sizeof(uint16_t),(u_char *)(&r3));
+ sizeof(uint16_t),(u_char *)(&r3),NULL);
adb_send_raw_packet_sync(dev,i,
- ADB_COMMAND_TALK,3,0,NULL);
+ ADB_COMMAND_TALK,3,0,NULL,NULL);
sc->devinfo[i].default_address = i;
sc->devinfo[(int)(first_relocated)].default_address = 0;
@@ -194,10 +193,6 @@
static int adb_bus_detach(device_t dev)
{
- struct adb_softc *sc = device_get_softc(dev);
-
- mtx_destroy(&sc->sc_sync_mtx);
-
return (bus_generic_detach(dev));
}
@@ -230,6 +225,7 @@
if (sc->sync_packet == command) {
memcpy(sc->syncreg,data,(len > 8) ? 8 : len);
atomic_store_rel_int(&sc->packet_reply,len + 1);
+ wakeup(sc);
}
if (sc->children[addr] != NULL) {
@@ -317,12 +313,12 @@
static int
adb_send_raw_packet_sync(device_t dev, uint8_t to, uint8_t command,
- uint8_t reg, int len, u_char *data)
+ uint8_t reg, int len, u_char *data, u_char *reply)
{
u_char command_byte = 0;
struct adb_softc *sc;
int result = -1;
- int i = 0;
+ int i = 1;
sc = device_get_softc(dev);
@@ -331,7 +327,8 @@
command_byte |= reg;
/* Wait if someone else has a synchronous request pending */
- mtx_lock(&sc->sc_sync_mtx);
+ while (!atomic_cmpset_int(&sc->sync_packet, 0xffff, command_byte))
+ tsleep(sc, 0, "ADB sync", hz/10);
sc->packet_reply = 0;
sc->sync_packet = command_byte;
@@ -343,21 +340,27 @@
* Maybe the command got lost? Try resending and polling the
* controller.
*/
- if (i > 40)
+ if (i % 40 == 0)
ADB_HB_SEND_RAW_PACKET(sc->parent, command_byte,
len, data, 1);
- DELAY(100);
+ tsleep(sc, 0, "ADB sync", hz/10);
i++;
}
result = sc->packet_reply - 1;
+ if (reply != NULL && result > 0)
+ memcpy(reply,sc->syncreg,result);
+
/* Clear packet sync */
sc->packet_reply = 0;
- sc->sync_packet = 0xffff; /* We can't match a 16 bit value */
- mtx_unlock(&sc->sc_sync_mtx);
+ /*
+ * We can't match a value beyond 8 bits, so set sync_packet to
+ * 0xffff to avoid collisions.
+ */
+ atomic_set_int(&sc->sync_packet, 0xffff);
return (result);
}
@@ -375,37 +378,27 @@
newr3 = dinfo->register3 & 0xff00;
newr3 |= (uint16_t)(newhandler);
+ adb_send_raw_packet_sync(sc->sc_dev,dinfo->address, ADB_COMMAND_LISTEN,
+ 3, sizeof(uint16_t), (u_char *)(&newr3), NULL);
adb_send_raw_packet_sync(sc->sc_dev,dinfo->address,
- ADB_COMMAND_LISTEN, 3, sizeof(uint16_t), (u_char *)(&newr3));
- adb_send_raw_packet_sync(sc->sc_dev,dinfo->address,
- ADB_COMMAND_TALK, 3, 0, NULL);
+ ADB_COMMAND_TALK, 3, 0, NULL, NULL);
return (dinfo->handler_id);
}
-uint8_t
-adb_read_register(device_t dev, u_char reg,
- size_t *len, void *data)
+size_t
+adb_read_register(device_t dev, u_char reg, void *data)
{
struct adb_softc *sc;
struct adb_devinfo *dinfo;
- size_t orig_len;
+ size_t result;
dinfo = device_get_ivars(dev);
sc = device_get_softc(device_get_parent(dev));
- orig_len = *len;
+ result = adb_send_raw_packet_sync(sc->sc_dev,dinfo->address,
+ ADB_COMMAND_TALK, reg, 0, NULL, data);
- mtx_lock(&sc->sc_sync_mtx);
-
- *len = adb_send_raw_packet_sync(sc->sc_dev,dinfo->address,
- ADB_COMMAND_TALK, reg, 0, NULL);
-
- if (*len > 0)
- memcpy(data,sc->syncreg,*len);
-
- mtx_unlock(&sc->sc_sync_mtx);
-
- return ((*len > 0) ? 0 : -1);
+ return (result);
}
==== //depot/projects/vimage-commit2/src/sys/dev/adb/adb_kbd.c#2 (text+ko) ====
@@ -22,7 +22,7 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/adb/adb_kbd.c,v 1.1 2008/10/26 19:37:38 nwhitehorn Exp $
+ * $FreeBSD: src/sys/dev/adb/adb_kbd.c,v 1.2 2008/12/06 23:26:02 nwhitehorn Exp $
*/
#include <sys/cdefs.h>
@@ -271,12 +271,13 @@
}
#endif
+ /* Check if we can read out the LED state from
+ this keyboard by reading the key state register */
+ if (adb_read_register(dev, 2, NULL) == 2)
+ sc->have_led_control = 1;
+
adb_set_autopoll(dev,1);
- /* Check (asynchronously) if we can read out the LED state from
- this keyboard by reading the key state register */
- adb_send_packet(dev,ADB_COMMAND_TALK,2,0,NULL);
-
return (0);
}
@@ -323,11 +324,6 @@
if (command != ADB_COMMAND_TALK)
return 0;
- if (reg == 2 && len == 2) {
- sc->have_led_control = 1;
- return 0;
- }
-
if (reg != 0 || len != 2)
return (0);
==== //depot/projects/vimage-commit2/src/sys/dev/adb/adb_mouse.c#3 (text+ko) ====
@@ -22,7 +22,7 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/adb/adb_mouse.c,v 1.3 2008/11/02 19:08:10 ed Exp $
+ * $FreeBSD: src/sys/dev/adb/adb_mouse.c,v 1.4 2008/12/06 23:26:02 nwhitehorn Exp $
*/
#include <sys/cdefs.h>
@@ -181,7 +181,7 @@
sc->mode.resolution = 200;
break;
case 4:
- adb_read_register(dev,1,&r1_len,r1);
+ r1_len = adb_read_register(dev,1,r1);
if (r1_len < 8)
break;
==== //depot/projects/vimage-commit2/src/sys/dev/adb/adbvar.h#3 (text+ko) ====
@@ -22,7 +22,7 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/adb/adbvar.h,v 1.2 2008/10/30 15:27:13 nwhitehorn Exp $
+ * $FreeBSD: src/sys/dev/adb/adbvar.h,v 1.3 2008/12/06 23:26:02 nwhitehorn Exp $
*/
#ifndef _POWERPC_ADBVAR_H_
@@ -40,7 +40,6 @@
device_t parent;
struct intr_config_hook enum_hook;
- struct mtx sc_sync_mtx;
volatile int sync_packet;
volatile int packet_reply;
==== //depot/projects/vimage-commit2/src/sys/dev/ae/if_ae.c#2 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ae/if_ae.c,v 1.1 2008/10/03 10:31:31 stas Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ae/if_ae.c,v 1.2 2008/12/06 14:23:45 stas Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1105,12 +1105,9 @@
static int
ae_alloc_rings(ae_softc_t *sc)
{
- bus_dma_tag_t bustag;
bus_addr_t busaddr;
int error;
- bustag = bus_get_dma_tag(sc->dev);
-
/*
* Create parent DMA tag.
*/
@@ -1903,8 +1900,8 @@
if_printf(ifp, "Rx interrupt occuried.\n");
#endif
size = le16toh(rxd->len) - ETHER_CRC_LEN;
- if (size < 0) {
- if_printf(ifp, "Negative length packet received.");
+ if (size < (ETHER_MIN_LEN - ETHER_CRC_LEN - ETHER_VLAN_ENCAP_LEN)) {
+ if_printf(ifp, "Runt frame received.");
return (EIO);
}
==== //depot/projects/vimage-commit2/src/sys/dev/ath/if_ath.c#7 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.221 2008/12/01 16:53:01 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.223 2008/12/07 19:29:11 sam Exp $");
/*
* Driver for the Atheros Wireless LAN controller.
@@ -219,9 +219,15 @@
SYSCTL_DECL(_hw_ath);
/* XXX validate sysctl values */
-static int ath_calinterval = 30; /* calibrate every 30 secs */
-SYSCTL_INT(_hw_ath, OID_AUTO, calibrate, CTLFLAG_RW, &ath_calinterval,
- 0, "chip calibration interval (secs)");
+static int ath_longcalinterval = 30; /* long cals every 30 secs */
+SYSCTL_INT(_hw_ath, OID_AUTO, longcal, CTLFLAG_RW, &ath_longcalinterval,
+ 0, "long chip calibration interval (secs)");
+static int ath_shortcalinterval = 100; /* short cals every 100 ms */
+SYSCTL_INT(_hw_ath, OID_AUTO, shortcal, CTLFLAG_RW, &ath_shortcalinterval,
+ 0, "short chip calibration interval (msecs)");
+static int ath_resetcalinterval = 20*60; /* reset cal state 20 mins */
+SYSCTL_INT(_hw_ath, OID_AUTO, resetcal, CTLFLAG_RW, &ath_resetcalinterval,
+ 0, "reset chip calibration results (secs)");
static int ath_rxbuf = ATH_RXBUF; /* # rx buffers to allocate */
SYSCTL_INT(_hw_ath, OID_AUTO, rxbuf, CTLFLAG_RW, &ath_rxbuf,
@@ -1433,8 +1439,9 @@
* state cached in the driver.
*/
sc->sc_diversity = ath_hal_getdiversity(ah);
- sc->sc_calinterval = 1;
- sc->sc_caltries = 0;
+ sc->sc_lastlongcal = 0;
+ sc->sc_resetcal = 1;
+ sc->sc_lastcalreset = 0;
/*
* Setup the hardware after reset: the key cache
@@ -1566,8 +1573,6 @@
if_printf(ifp, "%s: unable to reset hardware; hal status %u\n",
__func__, status);
sc->sc_diversity = ath_hal_getdiversity(ah);
- sc->sc_calinterval = 1;
- sc->sc_caltries = 0;
if (ath_startrecv(sc) != 0) /* restart recv */
if_printf(ifp, "%s: unable to start recv logic\n", __func__);
/*
@@ -5493,8 +5498,6 @@
}
sc->sc_curchan = hchan;
sc->sc_diversity = ath_hal_getdiversity(ah);
- sc->sc_calinterval = 1;
- sc->sc_caltries = 0;
/*
* Re-enable rx framework.
@@ -5528,54 +5531,76 @@
{
struct ath_softc *sc = arg;
struct ath_hal *ah = sc->sc_ah;
- HAL_BOOL iqCalDone;
+ struct ifnet *ifp = sc->sc_ifp;
+ HAL_BOOL longCal, isCalDone;
+ int nextcal;
- sc->sc_stats.ast_per_cal++;
-
- if (ath_hal_getrfgain(ah) == HAL_RFGAIN_NEED_CHANGE) {
+ longCal = (ticks - sc->sc_lastlongcal >= ath_longcalinterval*hz);
+ if (longCal) {
+ sc->sc_stats.ast_per_cal++;
+ if (ath_hal_getrfgain(ah) == HAL_RFGAIN_NEED_CHANGE) {
+ /*
+ * Rfgain is out of bounds, reset the chip
+ * to load new gain values.
+ */
+ DPRINTF(sc, ATH_DEBUG_CALIBRATE,
+ "%s: rfgain change\n", __func__);
+ sc->sc_stats.ast_per_rfgain++;
+ ath_reset(ifp);
+ }
/*
- * Rfgain is out of bounds, reset the chip
- * to load new gain values.
+ * If this long cal is after an idle period, then
+ * reset the data collection state so we start fresh.
*/
- DPRINTF(sc, ATH_DEBUG_CALIBRATE,
- "%s: rfgain change\n", __func__);
- sc->sc_stats.ast_per_rfgain++;
- ath_reset(sc->sc_ifp);
+ if (sc->sc_resetcal) {
+ (void) ath_hal_calreset(ah, &sc->sc_curchan);
+ sc->sc_lastcalreset = ticks;
+ sc->sc_resetcal = 0;
+ }
}
- if (!ath_hal_calibrate(ah, &sc->sc_curchan, &iqCalDone)) {
+ if (ath_hal_calibrateN(ah, &sc->sc_curchan, longCal, &isCalDone)) {
+ if (longCal) {
+ /*
+ * Calibrate noise floor data again in case of change.
+ */
+ ath_hal_process_noisefloor(ah);
+ }
+ } else {
DPRINTF(sc, ATH_DEBUG_ANY,
"%s: calibration of channel %u failed\n",
__func__, sc->sc_curchan.channel);
sc->sc_stats.ast_per_calfail++;
}
- /*
- * Calibrate noise floor data again in case of change.
- */
- ath_hal_process_noisefloor(ah);
- /*
- * Poll more frequently when the IQ calibration is in
- * progress to speedup loading the final settings.
- * We temper this aggressive polling with an exponential
- * back off after 4 tries up to ath_calinterval.
- */
- if (iqCalDone || sc->sc_calinterval >= ath_calinterval) {
- sc->sc_caltries = 0;
- sc->sc_calinterval = ath_calinterval;
- } else if (sc->sc_caltries > 4) {
- sc->sc_caltries = 0;
- sc->sc_calinterval <<= 1;
- if (sc->sc_calinterval > ath_calinterval)
- sc->sc_calinterval = ath_calinterval;
+ if (!isCalDone) {
+ /*
+ * Use a shorter interval to potentially collect multiple
+ * data samples required to complete calibration. Once
+ * we're told the work is done we drop back to a longer
+ * interval between requests. We're more aggressive doing
+ * work when operating as an AP to improve operation right
+ * after startup.
+ */
+ nextcal = (1000*ath_shortcalinterval)/hz;
+ if (sc->sc_opmode != HAL_M_HOSTAP)
+ nextcal *= 10;
+ } else {
+ nextcal = ath_longcalinterval*hz;
+ sc->sc_lastlongcal = ticks;
+ if (sc->sc_lastcalreset == 0)
+ sc->sc_lastcalreset = sc->sc_lastlongcal;
+ else if (ticks - sc->sc_lastcalreset >= ath_resetcalinterval*hz)
+ sc->sc_resetcal = 1; /* setup reset next trip */
}
- KASSERT(0 < sc->sc_calinterval && sc->sc_calinterval <= ath_calinterval,
- ("bad calibration interval %u", sc->sc_calinterval));
- DPRINTF(sc, ATH_DEBUG_CALIBRATE,
- "%s: next +%u (%siqCalDone tries %u)\n", __func__,
- sc->sc_calinterval, iqCalDone ? "" : "!", sc->sc_caltries);
- sc->sc_caltries++;
- callout_reset(&sc->sc_cal_ch, sc->sc_calinterval * hz,
- ath_calibrate, sc);
+ if (nextcal != 0) {
+ DPRINTF(sc, ATH_DEBUG_CALIBRATE, "%s: next +%u (%sisCalDone)\n",
+ __func__, nextcal, isCalDone ? "" : "!");
+ callout_reset(&sc->sc_cal_ch, nextcal, ath_calibrate, sc);
+ } else {
+ DPRINTF(sc, ATH_DEBUG_CALIBRATE, "%s: calibration disabled\n",
+ __func__);
+ /* NB: don't rearm timer */
+ }
}
static void
@@ -5803,10 +5828,12 @@
* Finally, start any timers and the task q thread
* (in case we didn't go through SCAN state).
*/
- if (sc->sc_calinterval != 0) {
+ if (ath_longcalinterval != 0) {
/* start periodic recalibration timer */
- callout_reset(&sc->sc_cal_ch, sc->sc_calinterval * hz,
- ath_calibrate, sc);
+ callout_reset(&sc->sc_cal_ch, 1, ath_calibrate, sc);
+ } else {
+ DPRINTF(sc, ATH_DEBUG_CALIBRATE,
+ "%s: calibration disabled\n", __func__);
}
taskqueue_unblock(sc->sc_tq);
} else if (nstate == IEEE80211_S_INIT) {
@@ -6885,7 +6912,7 @@
struct ieee80211com *ic = ifp->if_l2com;
struct ath_hal *ah = sc->sc_ah;
int error, ismcast, ismrr;
- int hdrlen, pktlen, try0, txantenna;
+ int keyix, hdrlen, pktlen, try0, txantenna;
u_int8_t rix, cix, txrate, ctsrate, rate1, rate2, rate3;
struct ieee80211_frame *wh;
u_int flags, ctsduration;
@@ -6904,6 +6931,54 @@
/* XXX honor IEEE80211_BPF_DATAPAD */
pktlen = m0->m_pkthdr.len - (hdrlen & 3) + IEEE80211_CRC_LEN;
+ if (params->ibp_flags & IEEE80211_BPF_CRYPTO) {
+ const struct ieee80211_cipher *cip;
+ struct ieee80211_key *k;
+
+ /*
+ * Construct the 802.11 header+trailer for an encrypted
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list