svn commit: r269115 - head/lib/libpam/modules/pam_lastlog

2014-07-26 Thread Dag-Erling Smørgrav
Author: des
Date: Sat Jul 26 07:40:31 2014
New Revision: 269115
URL: http://svnweb.freebsd.org/changeset/base/269115

Log:
  Remove useless getpwnam() call.
  
  Submitted by: Arthur Mesh am...@juniper.net
  MFC after:1 week

Modified:
  head/lib/libpam/modules/pam_lastlog/pam_lastlog.c

Modified: head/lib/libpam/modules/pam_lastlog/pam_lastlog.c
==
--- head/lib/libpam/modules/pam_lastlog/pam_lastlog.c   Sat Jul 26 04:38:09 
2014(r269114)
+++ head/lib/libpam/modules/pam_lastlog/pam_lastlog.c   Sat Jul 26 07:40:31 
2014(r269115)
@@ -49,7 +49,6 @@ __FBSDID($FreeBSD$);
 #include sys/time.h
 
 #include paths.h
-#include pwd.h
 #include stdlib.h
 #include string.h
 #include time.h
@@ -68,7 +67,6 @@ PAM_EXTERN int
 pam_sm_open_session(pam_handle_t *pamh, int flags,
 int argc __unused, const char *argv[] __unused)
 {
-   struct passwd *pwd;
struct utmpx *utx, utl;
time_t t;
const char *user;
@@ -79,7 +77,7 @@ pam_sm_open_session(pam_handle_t *pamh, 
pam_err = pam_get_user(pamh, user, NULL);
if (pam_err != PAM_SUCCESS)
return (pam_err);
-   if (user == NULL || (pwd = getpwnam(user)) == NULL)
+   if (user == NULL)
return (PAM_SERVICE_ERR);
PAM_LOG(Got user: %s, user);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269116 - head/lib/libc/stdio

2014-07-26 Thread Andrey A. Chernov
Author: ache
Date: Sat Jul 26 08:41:03 2014
New Revision: 269116
URL: http://svnweb.freebsd.org/changeset/base/269116

Log:
  In the Too many open files edge cases don't try to preserve old
  number for non-std* descriptors, but close old file and retry.
  
  Obtained from:  inspired by Apple's change from pfg@
  MFC after:  2 weeks

Modified:
  head/lib/libc/stdio/freopen.c

Modified: head/lib/libc/stdio/freopen.c
==
--- head/lib/libc/stdio/freopen.c   Sat Jul 26 07:40:31 2014
(r269115)
+++ head/lib/libc/stdio/freopen.c   Sat Jul 26 08:41:03 2014
(r269116)
@@ -151,6 +151,14 @@ freopen(const char * __restrict file, co
 
/* Get a new descriptor to refer to the new file. */
f = _open(file, oflags, DEFFILEMODE);
+   /* If out of fd's close the old one and try again. */
+   if (f  0  isopen  wantfd  STDERR_FILENO 
+   (errno == ENFILE || errno == EMFILE)) {
+   (void) (*fp-_close)(fp-_cookie);
+   isopen = 0;
+   wantfd = -1;
+   f = _open(file, oflags, DEFFILEMODE);
+   }
sverrno = errno;
 
 finish:
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269117 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2014-07-26 Thread Alexander Motin
Author: mav
Date: Sat Jul 26 09:09:14 2014
New Revision: 269117
URL: http://svnweb.freebsd.org/changeset/base/269117

Log:
  Make sysctls under vfs.zfs.zfetch writeable.
  
  I don't see any reason for them to be read-only, while tuning them without
  reboot is much more convenient for experiments.
  
  MFC after:2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.cSat Jul 
26 08:41:03 2014(r269116)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.cSat Jul 
26 09:09:14 2014(r269117)
@@ -57,11 +57,11 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_
 SYSCTL_NODE(_vfs_zfs, OID_AUTO, zfetch, CTLFLAG_RW, 0, ZFS ZFETCH);
 SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_streams, CTLFLAG_RWTUN,
 zfetch_max_streams, 0, Max # of streams per zfetch);
-SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, min_sec_reap, CTLFLAG_RDTUN,
+SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, min_sec_reap, CTLFLAG_RWTUN,
 zfetch_min_sec_reap, 0, Min time before stream reclaim);
-SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, block_cap, CTLFLAG_RDTUN,
+SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, block_cap, CTLFLAG_RWTUN,
 zfetch_block_cap, 0, Max number of blocks to fetch at a time);
-SYSCTL_UQUAD(_vfs_zfs_zfetch, OID_AUTO, array_rd_sz, CTLFLAG_RDTUN,
+SYSCTL_UQUAD(_vfs_zfs_zfetch, OID_AUTO, array_rd_sz, CTLFLAG_RWTUN,
 zfetch_array_rd_sz, 0,
 Number of bytes in a array_read at which we stop prefetching);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269118 - in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contri...

2014-07-26 Thread Xin LI
Author: delphij
Date: Sat Jul 26 10:20:48 2014
New Revision: 269118
URL: http://svnweb.freebsd.org/changeset/base/269118

Log:
  MFV r269010:
  
  Import Illumos changes to address the following Illumos issues:
4976 zfs should only avoid writing to a failing non-redundant
 top-level vdev
4978 ztest fails in get_metaslab_refcount()
4979 extend free space histogram to device and pool
4980 metaslabs should have a fragmentation metric
4981 remove fragmented ops vector from block allocator
4982 space_map object should proactively upgrade when feature
 is enabled
4984 device selection should use fragmentation metric
  
  MFC after:2 weeks

Modified:
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.8
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
  head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
  head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
  head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/cddl/contrib/opensolaris/lib/libzfs/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8
==
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sat Jul 26 09:09:14 2014
(r269117)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sat Jul 26 10:20:48 2014
(r269118)
@@ -19,7 +19,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd July 1, 2014
+.Dd July 26, 2014
 .Dt ZDB 8
 .Os
 .Sh NAME
@@ -27,11 +27,11 @@
 .Nd Display zpool debugging and consistency information
 .Sh SYNOPSIS
 .Nm
-.Op Fl CumdibcsDvhLXFPA
+.Op Fl CumdibcsDvhLMXFPA
 .Op Fl e Op Fl p Ar path...
 .Op Fl t Ar txg
 .Op Fl U Ar cache
-.Op Fl M Ar inflight I/Os
+.Op Fl I Ar inflight I/Os
 .Op Fl x Ar dumpdir
 .Ar poolname
 .Op Ar object ...
@@ -42,7 +42,7 @@
 .Ar dataset
 .Op Ar object ...
 .Nm
-.Fl m Op Fl LXFPA
+.Fl m Op Fl MLXFPA
 .Op Fl t Ar txg
 .Op Fl e Op Fl p Ar path...
 .Op Fl U Ar cache
@@ -155,6 +155,13 @@ By default,
 verifies that all non-free blocks are referenced, which can be very expensive.
 .It Fl m
 Display the offset, spacemap, and free space of each metaslab.
+When specified twice, also display information about the on-disk free
+space histogram associated with each metaslab. When specified three time,
+display the maximum contiguous free space, the in-core free space histogram,
+and the percentage of free space in each space map.  When specified
+four times display every spacemap record.
+.It Fl M
+Display the offset, spacemap, and free space of each metaslab.
 When specified twice, also display information about the maximum contiguous
 free space and the percentage of free space in each space map.
 When specified three times display every spacemap record.
@@ -229,7 +236,7 @@ all metadata on the pool.
 .It Fl F
 Attempt to make an unreadable pool readable by trying progressively older
 transactions.
-.It Fl M Ar inflight I/Os
+.It Fl I Ar inflight I/Os
 Limit the number of outstanding checksum I/Os to the specified value.
 The default value is 200. This option affects the performance of the
 .Fl c

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Jul 26 09:09:14 2014
(r269117)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Jul 26 10:20:48 2014
(r269118)
@@ -111,11 +111,11 @@ static void
 usage(void)
 {
(void) fprintf(stderr,
-   Usage: %s [-CumdibcsDvhLXFPA] [-t txg] [-e [-p path...]] 
-   [-U config] [-M inflight I/Os] [-x dumpdir] poolname [object...]\n
+   Usage: %s [-CumMdibcsDvhLXFPA] [-t txg] [-e [-p path...]] 
+   [-U config] [-I inflight I/Os] [-x dumpdir] poolname [object...]\n
   %s [-divPA] [-e -p path...] [-U config] dataset 
[object...]\n
-  %s -m [-LXFPA] [-t txg] [-e [-p path...]] [-U config] 
+  %s -mM [-LXFPA] [-t txg] [-e [-p path...]] [-U config] 
poolname [vdev [metaslab...]]\n
   %s -R [-A] [-e [-p path...]] poolname 
vdev:offset:size[:flags]\n
@@ 

svn commit: r269119 - head/usr.sbin/kbdcontrol

2014-07-26 Thread Stefan Esser
Author: se
Date: Sat Jul 26 12:17:26 2014
New Revision: 269119
URL: http://svnweb.freebsd.org/changeset/base/269119

Log:
  Fix obvious off by one error: prefix[1] should be set to the path of the
  newcons specific keymap files, not prefix[2]. The result of this bug was
  that kbdcontrol ignored the files in the syscons keymap directory, which
  apparently still work under newcons, for most locales.
  
  MFC after:1 week

Modified:
  head/usr.sbin/kbdcontrol/kbdcontrol.c

Modified: head/usr.sbin/kbdcontrol/kbdcontrol.c
==
--- head/usr.sbin/kbdcontrol/kbdcontrol.c   Sat Jul 26 10:20:48 2014
(r269118)
+++ head/usr.sbin/kbdcontrol/kbdcontrol.c   Sat Jul 26 12:17:26 2014
(r269119)
@@ -804,7 +804,7 @@ load_keymap(char *opt, int dumponly)
char*postfix[] = {blank, dotkbd, NULL};
 
if (is_vt4())
-   prefix[2] = vt_keymap_path;
+   prefix[1] = vt_keymap_path;
cp = getenv(KEYMAP_PATH);
if (cp != NULL)
asprintf((prefix[0]), %s/, cp);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269120 - head/usr.sbin/kbdcontrol

2014-07-26 Thread Stefan Esser
Author: se
Date: Sat Jul 26 13:14:28 2014
New Revision: 269120
URL: http://svnweb.freebsd.org/changeset/base/269120

Log:
  The previous commit (r269119) introduced a regression: It removed the
  ability to specify the the full path name of the keymap file.
  
  Instead leave the original search order intact, but insert the path for
  newcons-specific fonts (if run on a system using newcons):
  
- KEYMAP_PATH in environment
- full path name
- /usr/share/vt/keymaps (only if newcons is in use!)
- /usr/share/syscons/keymaps(also as fall-back for newcons)
  
  MFC after:1 week

Modified:
  head/usr.sbin/kbdcontrol/kbdcontrol.c

Modified: head/usr.sbin/kbdcontrol/kbdcontrol.c
==
--- head/usr.sbin/kbdcontrol/kbdcontrol.c   Sat Jul 26 12:17:26 2014
(r269119)
+++ head/usr.sbin/kbdcontrol/kbdcontrol.c   Sat Jul 26 13:14:28 2014
(r269120)
@@ -800,11 +800,11 @@ load_keymap(char *opt, int dumponly)
char*name, *cp;
charblank[] = , keymap_path[] = KEYMAP_PATH;
charvt_keymap_path[] = VT_KEYMAP_PATH, dotkbd[] = .kbd;
-   char*prefix[]  = {blank, blank, keymap_path, NULL};
+   char*prefix[]  = {blank, blank, blank, keymap_path, NULL};
char*postfix[] = {blank, dotkbd, NULL};
 
if (is_vt4())
-   prefix[1] = vt_keymap_path;
+   prefix[2] = vt_keymap_path;
cp = getenv(KEYMAP_PATH);
if (cp != NULL)
asprintf((prefix[0]), %s/, cp);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269122 - head/sys/cam/ctl

2014-07-26 Thread Alexander Motin
Author: mav
Date: Sat Jul 26 13:43:25 2014
New Revision: 269122
URL: http://svnweb.freebsd.org/changeset/base/269122

Log:
  Fix infinite loop, when doing WRITE SAME on file-backed LUN.
  
  MFC after:3 days

Modified:
  head/sys/cam/ctl/ctl_backend_block.c

Modified: head/sys/cam/ctl/ctl_backend_block.c
==
--- head/sys/cam/ctl/ctl_backend_block.cSat Jul 26 13:37:25 2014
(r269121)
+++ head/sys/cam/ctl/ctl_backend_block.cSat Jul 26 13:43:25 2014
(r269122)
@@ -722,10 +722,11 @@ ctl_be_block_dispatch_file(struct ctl_be
}
 
/*
-* If this is a write, we're all done.
+* If this is a write or a verify, we're all done.
 * If this is a read, we can now send the data to the user.
 */
-   if (ARGS(io)-flags  (CTL_LLF_WRITE | CTL_LLF_VERIFY)) {
+   if ((beio-bio_cmd == BIO_WRITE) ||
+   (ARGS(io)-flags  CTL_LLF_VERIFY)) {
ctl_set_success(io-scsiio);
ctl_complete_beio(beio);
} else {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269123 - head/sys/cam/ctl

2014-07-26 Thread Alexander Motin
Author: mav
Date: Sat Jul 26 13:56:50 2014
New Revision: 269123
URL: http://svnweb.freebsd.org/changeset/base/269123

Log:
  Implement separate I/O dispatch method for ZVOLs in dev mode.
  
  Unlike disk devices ZVOLs process all requests synchronously.  That makes
  impossible sending multiple requests to them from single thread.  From the
  other side ZVOLs have real d_read/d_write methods, which unlike d_strategy
  can handle uio scatter/gather and have no strict I/O size limitations.
  
  So, if ZVOL in dev mode is detected, use of d_read/d_write methods instead
  of d_strategy allows to avoid pointless splitting of large requests into
  MAXPHYS (128K) sized chunks.
  
  MFC after:1 week

Modified:
  head/sys/cam/ctl/ctl_backend_block.c

Modified: head/sys/cam/ctl/ctl_backend_block.c
==
--- head/sys/cam/ctl/ctl_backend_block.cSat Jul 26 13:43:25 2014
(r269122)
+++ head/sys/cam/ctl/ctl_backend_block.cSat Jul 26 13:56:50 2014
(r269123)
@@ -738,6 +738,88 @@ ctl_be_block_dispatch_file(struct ctl_be
 }
 
 static void
+ctl_be_block_dispatch_zvol(struct ctl_be_block_lun *be_lun,
+  struct ctl_be_block_io *beio)
+{
+   struct ctl_be_block_devdata *dev_data;
+   union ctl_io *io;
+   struct uio xuio;
+   struct iovec *xiovec;
+   int flags;
+   int error, i;
+
+   DPRINTF(entered\n);
+
+   dev_data = be_lun-backend.dev;
+   io = beio-io;
+   flags = beio-bio_flags;
+
+   bzero(xuio, sizeof(xuio));
+   if (beio-bio_cmd == BIO_READ) {
+   SDT_PROBE(cbb, kernel, read, file_start, 0, 0, 0, 0, 0);
+   xuio.uio_rw = UIO_READ;
+   } else {
+   SDT_PROBE(cbb, kernel, write, file_start, 0, 0, 0, 0, 0);
+   xuio.uio_rw = UIO_WRITE;
+   }
+   xuio.uio_offset = beio-io_offset;
+   xuio.uio_resid = beio-io_len;
+   xuio.uio_segflg = UIO_SYSSPACE;
+   xuio.uio_iov = beio-xiovecs;
+   xuio.uio_iovcnt = beio-num_segs;
+   xuio.uio_td = curthread;
+
+   for (i = 0, xiovec = xuio.uio_iov; i  xuio.uio_iovcnt; i++, xiovec++) {
+   xiovec-iov_base = beio-sg_segs[i].addr;
+   xiovec-iov_len = beio-sg_segs[i].len;
+   }
+
+   binuptime(beio-ds_t0);
+   mtx_lock(be_lun-io_lock);
+   devstat_start_transaction(beio-lun-disk_stats, beio-ds_t0);
+   mtx_unlock(be_lun-io_lock);
+
+   if (beio-bio_cmd == BIO_READ) {
+   error = (*dev_data-csw-d_read)(dev_data-cdev, xuio, 0);
+   SDT_PROBE(cbb, kernel, read, file_done, 0, 0, 0, 0, 0);
+   } else {
+   error = (*dev_data-csw-d_write)(dev_data-cdev, xuio, 0);
+   SDT_PROBE(cbb, kernel, write, file_done, 0, 0, 0, 0, 0);
+   }
+
+   mtx_lock(be_lun-io_lock);
+   devstat_end_transaction(beio-lun-disk_stats, beio-io_len,
+   beio-ds_tag_type, beio-ds_trans_type,
+   /*now*/ NULL, /*then*/beio-ds_t0);
+   mtx_unlock(be_lun-io_lock);
+
+   /*
+* If we got an error, set the sense data to MEDIUM ERROR and
+* return the I/O to the user.
+*/
+   if (error != 0) {
+   ctl_set_medium_error(io-scsiio);
+   ctl_complete_beio(beio);
+   return;
+   }
+
+   /*
+* If this is a write or a verify, we're all done.
+* If this is a read, we can now send the data to the user.
+*/
+   if ((beio-bio_cmd == BIO_WRITE) ||
+   (ARGS(io)-flags  CTL_LLF_VERIFY)) {
+   ctl_set_success(io-scsiio);
+   ctl_complete_beio(beio);
+   } else {
+#ifdef CTL_TIME_IO
+   getbintime(io-io_hdr.dma_start_bt);
+#endif  
+   ctl_datamove(io);
+   }
+}
+
+static void
 ctl_be_block_flush_dev(struct ctl_be_block_lun *be_lun,
   struct ctl_be_block_io *beio)
 {
@@ -1578,14 +1660,17 @@ ctl_be_block_open_dev(struct ctl_be_bloc
params = req-reqdata.create;
 
be_lun-dev_type = CTL_BE_BLOCK_DEV;
-   be_lun-dispatch = ctl_be_block_dispatch_dev;
-   be_lun-lun_flush = ctl_be_block_flush_dev;
-   be_lun-unmap = ctl_be_block_unmap_dev;
be_lun-backend.dev.cdev = be_lun-vn-v_rdev;
be_lun-backend.dev.csw = dev_refthread(be_lun-backend.dev.cdev,
 be_lun-backend.dev.dev_ref);
if (be_lun-backend.dev.csw == NULL)
panic(Unable to retrieve device switch);
+   if (strcmp(be_lun-backend.dev.csw-d_name, zvol) == 0)
+   be_lun-dispatch = ctl_be_block_dispatch_zvol;
+   else
+   be_lun-dispatch = ctl_be_block_dispatch_dev;
+   be_lun-lun_flush = ctl_be_block_flush_dev;
+   be_lun-unmap = ctl_be_block_unmap_dev;
 
error = VOP_GETATTR(be_lun-vn, vattr, NOCRED);
if (error) {
___

svn commit: r269124 - head/lib/libc/stdtime

2014-07-26 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Jul 26 14:24:13 2014
New Revision: 269124
URL: http://svnweb.freebsd.org/changeset/base/269124

Log:
  strftime() xlocale cleanups.
  
  Replace fprintf_l with fputs when output is unformatted.
  Use locale_t in _conv() since it was using sprintf (now sprintf_l)
  Use locale_t on _yconv() sinci it calls _conv()
  
  Obtained from:Apple Inc. (Libc 997.90.3)
  CR:   D482
  Reviewed by:  theraven
  MFC after:1 week

Modified:
  head/lib/libc/stdtime/strftime.c

Modified: head/lib/libc/stdtime/strftime.c
==
--- head/lib/libc/stdtime/strftime.cSat Jul 26 13:56:50 2014
(r269123)
+++ head/lib/libc/stdtime/strftime.cSat Jul 26 14:24:13 2014
(r269124)
@@ -46,10 +46,10 @@ __FBSDID($FreeBSD$);
 #include timelocal.h
 
 static char *  _add(const char *, char *, const char *);
-static char *  _conv(int, const char *, char *, const char *);
+static char *  _conv(int, const char *, char *, const char *, locale_t);
 static char *  _fmt(const char *, const struct tm *, char *, const char *,
int *, locale_t);
-static char *  _yconv(int, int, int, int, char *, const char *);
+static char *  _yconv(int, int, int, int, char *, const char *, locale_t);
 
 extern char *  tzname[];
 
@@ -101,16 +101,16 @@ strftime_l(char * __restrict s, size_t m
if (warn != IN_NONE  getenv(YEAR_2000_NAME) != NULL) {
(void) fprintf_l(stderr, loc, \n);
if (format == NULL)
-   (void) fprintf_l(stderr, loc, NULL strftime format );
+   (void) fputs(NULL strftime format , stderr);
else(void) fprintf_l(stderr, loc, strftime format \%s\ ,
format);
-   (void) fprintf_l(stderr, loc, yields only two digits of years 
in );
+   (void) fputs(yields only two digits of years in , stderr);
if (warn == IN_SOME)
-   (void) fprintf_l(stderr, loc, some locales);
+   (void) fputs(some locales, stderr);
else if (warn == IN_THIS)
-   (void) fprintf_l(stderr, loc, the current locale);
-   else(void) fprintf_l(stderr, loc, all locales);
-   (void) fprintf_l(stderr, loc, \n);
+   (void) fputs(the current locale, stderr);
+   else(void) fputs(all locales, stderr);
+   (void) fputs(\n, stderr);
}
 #endif /* !defined NO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU */
if (p == s + maxsize)
@@ -183,7 +183,7 @@ label:
 * (ado, 1993-05-24)
 */
pt = _yconv(t-tm_year, TM_YEAR_BASE, 1, 0,
-   pt, ptlim);
+   pt, ptlim, loc);
continue;
case 'c':
{
@@ -200,8 +200,9 @@ label:
pt = _fmt(%m/%d/%y, t, pt, ptlim, warnp, loc);
continue;
case 'd':
-   pt = _conv(t-tm_mday, 
fmt_padding[PAD_FMT_DAYOFMONTH][PadIndex],
-   pt, ptlim);
+   pt = _conv(t-tm_mday,
+   
fmt_padding[PAD_FMT_DAYOFMONTH][PadIndex],
+   pt, ptlim, loc);
continue;
case 'E':
if (Ealternative || Oalternative)
@@ -227,24 +228,26 @@ label:
goto label;
case 'e':
pt = _conv(t-tm_mday,
-   
fmt_padding[PAD_FMT_SDAYOFMONTH][PadIndex], pt, ptlim);
+   
fmt_padding[PAD_FMT_SDAYOFMONTH][PadIndex],
+   pt, ptlim, loc);
continue;
case 'F':
pt = _fmt(%Y-%m-%d, t, pt, ptlim, warnp, loc);
continue;
case 'H':
pt = _conv(t-tm_hour, 
fmt_padding[PAD_FMT_HMS][PadIndex],
-   pt, ptlim);
+   pt, ptlim, loc);
continue;
case 'I':
pt = _conv((t-tm_hour % 12) ?
(t-tm_hour % 12) : 12,
fmt_padding[PAD_FMT_HMS][PadIndex],
-   pt, ptlim);
+   pt, ptlim, loc);

Re: svn commit: r269112 - head/sys/boot/arm/at91/boot2

2014-07-26 Thread Benjamin Kaduk
On Sat, Jul 26, 2014 at 12:09 AM, Ian Lepore i...@freebsd.org wrote:

 Author: ian
 Date: Sat Jul 26 04:09:43 2014
 New Revision: 269112
 URL: http://svnweb.freebsd.org/changeset/base/269112

 Log:
   The 'flags' variable is conflicting with some inline code in a header
 file
   (variable flags shadows a global...), just rename this variable to
   wish away the problem.


Not trying to pick on you, but we have lots of places where we get
variable foo shadows a global... -- we have a global variable 'buf' in
the kernel namespace, for one :)
Do we think it's a good use of our time to try and get this to zero
instances?

-Ben
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r269112 - head/sys/boot/arm/at91/boot2

2014-07-26 Thread Ian Lepore
On Sat, 2014-07-26 at 10:33 -0400, Benjamin Kaduk wrote:
 On Sat, Jul 26, 2014 at 12:09 AM, Ian Lepore i...@freebsd.org wrote:
 
  Author: ian
  Date: Sat Jul 26 04:09:43 2014
  New Revision: 269112
  URL: http://svnweb.freebsd.org/changeset/base/269112
 
  Log:
The 'flags' variable is conflicting with some inline code in a header
  file
(variable flags shadows a global...), just rename this variable to
wish away the problem.
 
 
 Not trying to pick on you, but we have lots of places where we get
 variable foo shadows a global... -- we have a global variable 'buf' in
 the kernel namespace, for one :)
 Do we think it's a good use of our time to try and get this to zero
 instances?
 
 -Ben

It was breakage I had to fix to get it to build so I could move ahead to
the changes I was actually trying to make.  (We use this stuff at $work;
it has actually been disconnected from the build in freebsd for quite a
while and has bitrotted.  My goal is basically diff reduction between
our repo at work and the base, and closing a 3 year old PR.)  I guess
boot2 must build with -Werror or something -- I didn't even think about
changing the flags, I just did the same thing we did at work a couple
years ago.

-- Ian


___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269125 - in head: lib/libarchive rescue/rescue

2014-07-26 Thread Dimitry Andric
Author: dim
Date: Sat Jul 26 15:33:20 2014
New Revision: 269125
URL: http://svnweb.freebsd.org/changeset/base/269125

Log:
  In r232153, libarchive 3.0.3 was imported, replacing the archive_hash.h
  header with archive_crypto_private.h, and its ARCHIVE_HASH_xxx macros
  were renamed to ARCHIVE_CRYPTO_xxx.
  
  Rename these macros in lib/libarchive/config_freebsd.h, to re-enable the
  hashes for libarchive again.  This affects the mtree format writer, and
  the xar format reader and writer modules.
  
  This also requires changes in the library order for statically linking
  rescue, otherwise ld would complain about redefined symbols.  Thanks to
  jkim for pointing out the solution.
  
  Reviewed by:  kientzle
  MFC after:1 week

Modified:
  head/lib/libarchive/config_freebsd.h
  head/rescue/rescue/Makefile

Modified: head/lib/libarchive/config_freebsd.h
==
--- head/lib/libarchive/config_freebsd.hSat Jul 26 14:24:13 2014
(r269124)
+++ head/lib/libarchive/config_freebsd.hSat Jul 26 15:33:20 2014
(r269125)
@@ -228,15 +228,15 @@
 
 /* FreeBSD defines for archive_hash.h */
 #ifdef WITH_OPENSSL
-#define ARCHIVE_HASH_MD5_OPENSSL 1
-#define ARCHIVE_HASH_RMD160_OPENSSL 1
-#define ARCHIVE_HASH_SHA1_OPENSSL
-#define ARCHIVE_HASH_SHA256_OPENSSL 1
-#define ARCHIVE_HASH_SHA384_OPENSSL 1
-#define ARCHIVE_HASH_SHA512_OPENSSL 1
+#define ARCHIVE_CRYPTO_MD5_OPENSSL 1
+#define ARCHIVE_CRYPTO_RMD160_OPENSSL 1
+#define ARCHIVE_CRYPTO_SHA1_OPENSSL
+#define ARCHIVE_CRYPTO_SHA256_OPENSSL 1
+#define ARCHIVE_CRYPTO_SHA384_OPENSSL 1
+#define ARCHIVE_CRYPTO_SHA512_OPENSSL 1
 #else
-#define ARCHIVE_HASH_MD5_LIBMD 1
-#define ARCHIVE_HASH_SHA1_LIBMD 1
-#define ARCHIVE_HASH_SHA256_LIBMD 1
-#define ARCHIVE_HASH_SHA512_LIBMD 1
+#define ARCHIVE_CRYPTO_MD5_LIBMD 1
+#define ARCHIVE_CRYPTO_SHA1_LIBMD 1
+#define ARCHIVE_CRYPTO_SHA256_LIBMD 1
+#define ARCHIVE_CRYPTO_SHA512_LIBMD 1
 #endif

Modified: head/rescue/rescue/Makefile
==
--- head/rescue/rescue/Makefile Sat Jul 26 14:24:13 2014(r269124)
+++ head/rescue/rescue/Makefile Sat Jul 26 15:33:20 2014(r269125)
@@ -122,7 +122,11 @@ CRUNCH_LIBS+= -lalias -lcam -lncursesw -
 .if ${MK_ZFS} != no
 CRUNCH_LIBS+= -lavl -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem
 .endif
-CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv -lmd -lsbuf -lufs -lz
+CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv
+.if ${MK_OPENSSL} == no
+CRUNCH_LIBS+= -lmd
+.endif
+CRUNCH_LIBS+= -lsbuf -lufs -lz
 
 .if ${MACHINE_CPUARCH} == i386
 CRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk
@@ -187,10 +191,11 @@ CRUNCH_ALIAS_xz= unxz lzma unlzma xzcat 
 CRUNCH_LIBS+= -llzma
 
 CRUNCH_PROGS_usr.bin+= tar
-CRUNCH_LIBS+= -larchive -lmd
+CRUNCH_LIBS+= -larchive
 .if ${MK_OPENSSL} != no
 CRUNCH_LIBS+= -lcrypto
 .endif
+CRUNCH_LIBS+= -lmd
 
 CRUNCH_PROGS_usr.bin+= vi
 CRUNCH_ALIAS_vi= ex
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269126 - head/sys/kern

2014-07-26 Thread Marcel Moolenaar
Author: marcel
Date: Sat Jul 26 15:46:41 2014
New Revision: 269126
URL: http://svnweb.freebsd.org/changeset/base/269126

Log:
  Don't return ERESTART when the device is gone. In ttydev_leave() ERESTART
  is the indication that draining got interrupted due to a revoke(2) and
  that tty_drain() is to be called again for draining to complete. If the
  device is flagged as gone, then waiting/draining is not possible. Only
  return ERESTART when waiting is still possible.
  
  Obtained from:Juniper Networks, Inc.

Modified:
  head/sys/kern/tty.c

Modified: head/sys/kern/tty.c
==
--- head/sys/kern/tty.c Sat Jul 26 15:33:20 2014(r269125)
+++ head/sys/kern/tty.c Sat Jul 26 15:46:41 2014(r269126)
@@ -1370,14 +1370,14 @@ tty_wait(struct tty *tp, struct cv *cv)
 
error = cv_wait_sig(cv, tp-t_mtx);
 
-   /* Restart the system call when we may have been revoked. */
-   if (tp-t_revokecnt != revokecnt)
-   return (ERESTART);
-
/* Bail out when the device slipped away. */
if (tty_gone(tp))
return (ENXIO);
 
+   /* Restart the system call when we may have been revoked. */
+   if (tp-t_revokecnt != revokecnt)
+   return (ERESTART);
+
return (error);
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269127 - head/sys/dev/usb/wlan

2014-07-26 Thread Hans Petter Selasky
Author: hselasky
Date: Sat Jul 26 16:06:01 2014
New Revision: 269127
URL: http://svnweb.freebsd.org/changeset/base/269127

Log:
  Fix for division by zero.
  
  MFC after:3 days

Modified:
  head/sys/dev/usb/wlan/if_rum.c
  head/sys/dev/usb/wlan/if_ural.c
  head/sys/dev/usb/wlan/if_zyd.c
  head/sys/dev/usb/wlan/if_zydreg.h

Modified: head/sys/dev/usb/wlan/if_rum.c
==
--- head/sys/dev/usb/wlan/if_rum.c  Sat Jul 26 15:46:41 2014
(r269126)
+++ head/sys/dev/usb/wlan/if_rum.c  Sat Jul 26 16:06:01 2014
(r269127)
@@ -1035,6 +1035,8 @@ rum_setup_tx_desc(struct rum_softc *sc, 
desc-plcp_length_hi = plcp_length  6;
desc-plcp_length_lo = plcp_length  0x3f;
} else {
+   if (rate == 0)
+   rate = 2;   /* avoid division by zero */
plcp_length = (16 * len + rate - 1) / rate;
if (rate == 22) {
remainder = (16 * len) % 22;

Modified: head/sys/dev/usb/wlan/if_ural.c
==
--- head/sys/dev/usb/wlan/if_ural.c Sat Jul 26 15:46:41 2014
(r269126)
+++ head/sys/dev/usb/wlan/if_ural.c Sat Jul 26 16:06:01 2014
(r269127)
@@ -1038,6 +1038,8 @@ ural_setup_tx_desc(struct ural_softc *sc
desc-plcp_length_hi = plcp_length  6;
desc-plcp_length_lo = plcp_length  0x3f;
} else {
+   if (rate == 0)
+   rate = 2;   /* avoid division by zero */
plcp_length = (16 * len + rate - 1) / rate;
if (rate == 22) {
remainder = (16 * len) % 22;

Modified: head/sys/dev/usb/wlan/if_zyd.c
==
--- head/sys/dev/usb/wlan/if_zyd.c  Sat Jul 26 15:46:41 2014
(r269126)
+++ head/sys/dev/usb/wlan/if_zyd.c  Sat Jul 26 16:06:01 2014
(r269127)
@@ -2480,7 +2480,7 @@ zyd_tx_start(struct zyd_softc *sc, struc
const struct ieee80211_txparam *tp;
struct ieee80211_key *k;
int rate, totlen;
-   static uint8_t ratediv[] = ZYD_TX_RATEDIV;
+   static const uint8_t ratediv[] = ZYD_TX_RATEDIV;
uint8_t phy;
uint16_t pktlen;
uint32_t bits;

Modified: head/sys/dev/usb/wlan/if_zydreg.h
==
--- head/sys/dev/usb/wlan/if_zydreg.h   Sat Jul 26 15:46:41 2014
(r269126)
+++ head/sys/dev/usb/wlan/if_zydreg.h   Sat Jul 26 16:06:01 2014
(r269127)
@@ -970,7 +970,7 @@
 
 #defineZYD_TX_RATEDIV  
\
 {  \
-   0x1, 0x2, 0xb, 0xb, 0x0, 0x0, 0x0, 0x0, 0x30, 0x18, 0xc, 0x6,   \
+   0x1, 0x2, 0xb, 0xb, 0x1, 0x1, 0x1, 0x1, 0x30, 0x18, 0xc, 0x6,   \
0x36, 0x24, 0x12, 0x9   \
 }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269128 - head/usr.bin/gcore

2014-07-26 Thread Marcel Moolenaar
Author: marcel
Date: Sat Jul 26 16:45:11 2014
New Revision: 269128
URL: http://svnweb.freebsd.org/changeset/base/269128

Log:
  Create 32-bit core files for 32-bit processes on 64-bit machines.
  The 64-bit machine supported right now is amd64, but it's not too
  hard to add powerpc64.
  
  Obtained from:Juniper Networks, Inc.

Added:
  head/usr.bin/gcore/elf32core.c   (contents, props changed)
Modified:
  head/usr.bin/gcore/Makefile
  head/usr.bin/gcore/elfcore.c

Modified: head/usr.bin/gcore/Makefile
==
--- head/usr.bin/gcore/Makefile Sat Jul 26 16:06:01 2014(r269127)
+++ head/usr.bin/gcore/Makefile Sat Jul 26 16:45:11 2014(r269128)
@@ -6,6 +6,10 @@ SRCS=  elfcore.c gcore.c
 DPADD= ${LIBSBUF} ${LIBUTIL}
 LDADD= -lsbuf -lutil
 
+.if ${MACHINE_ARCH} == amd64
+SRCS+= elf32core.c
+.endif
+
 WARNS?=1
 
 .include bsd.prog.mk

Added: head/usr.bin/gcore/elf32core.c
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/usr.bin/gcore/elf32core.c  Sat Jul 26 16:45:11 2014
(r269128)
@@ -0,0 +1,66 @@
+/* $FreeBSD$ */
+#ifndef __LP64__
+#error this file must be compiled for LP64.
+#endif
+
+#define __ELF_WORD_SIZE 32
+#define _MACHINE_ELF_WANT_32BIT
+
+#include sys/procfs.h
+
+struct prpsinfo32 {
+   int pr_version;
+   u_int   pr_psinfosz;
+   charpr_fname[PRFNAMESZ+1];
+   charpr_psargs[PRARGSZ+1];
+};
+
+struct prstatus32 {
+   int pr_version;
+   u_int   pr_statussz;
+   u_int   pr_gregsetsz;
+   u_int   pr_fpregsetsz;
+   int pr_osreldate;
+   int pr_cursig;
+   pid_t   pr_pid;
+   struct reg32 pr_reg;
+};
+
+#defineELFCORE_COMPAT_32   1
+#include elfcore.c
+
+static void
+elf_convert_gregset(elfcore_gregset_t *rd, struct reg *rs)
+{
+#ifdef __amd64__
+   rd-r_gs = rs-r_gs;
+   rd-r_fs = rs-r_fs;
+   rd-r_es = rs-r_es;
+   rd-r_ds = rs-r_ds;
+   rd-r_edi = rs-r_rdi;
+   rd-r_esi = rs-r_rsi;
+   rd-r_ebp = rs-r_rbp;
+   rd-r_ebx = rs-r_rbx;
+   rd-r_edx = rs-r_rdx;
+   rd-r_ecx = rs-r_rcx;
+   rd-r_eax = rs-r_rax;
+   rd-r_eip = rs-r_rip;
+   rd-r_cs = rs-r_cs;
+   rd-r_eflags = rs-r_rflags;
+   rd-r_esp = rs-r_rsp;
+   rd-r_ss = rs-r_ss;
+#else
+#error Unsupported architecture
+#endif
+}
+
+static void
+elf_convert_fpregset(elfcore_fpregset_t *rd, struct fpreg *rs)
+{
+#ifdef __amd64__
+   /* XXX this is wrong... */
+   memcpy(rd, rs, sizeof(*rd));
+#else
+#error Unsupported architecture
+#endif
+}

Modified: head/usr.bin/gcore/elfcore.c
==
--- head/usr.bin/gcore/elfcore.cSat Jul 26 16:06:01 2014
(r269127)
+++ head/usr.bin/gcore/elfcore.cSat Jul 26 16:45:11 2014
(r269128)
@@ -28,6 +28,7 @@
 #include sys/cdefs.h
 __FBSDID($FreeBSD$);
 
+#include sys/endian.h
 #include sys/param.h
 #include sys/procfs.h
 #include sys/ptrace.h
@@ -73,6 +74,22 @@ struct sseg_closure {
size_t size;/* Total size of all writable segments. */
 };
 
+#ifdef ELFCORE_COMPAT_32
+typedef struct fpreg32 elfcore_fpregset_t;
+typedef struct reg32   elfcore_gregset_t;
+typedef struct prpsinfo32 elfcore_prpsinfo_t;
+typedef struct prstatus32 elfcore_prstatus_t;
+static void elf_convert_gregset(elfcore_gregset_t *rd, struct reg *rs);
+static void elf_convert_fpregset(elfcore_fpregset_t *rd, struct fpreg *rs);
+#else
+typedef fpregset_t elfcore_fpregset_t;
+typedef gregset_t  elfcore_gregset_t;
+typedef prpsinfo_t elfcore_prpsinfo_t;
+typedef prstatus_t elfcore_prstatus_t;
+#define elf_convert_gregset(d,s)   *d = *s
+#define elf_convert_fpregset(d,s)  *d = *s
+#endif
+
 typedef void* (*notefunc_t)(void *, size_t *);
 
 static void cb_put_phdr(vm_map_entry_t, void *);
@@ -108,13 +125,28 @@ elf_ident(int efd, pid_t pid __unused, c
 {
Elf_Ehdr hdr;
int cnt;
+   uint16_t machine;
 
cnt = read(efd, hdr, sizeof(hdr));
if (cnt != sizeof(hdr))
return (0);
-   if (IS_ELF(hdr))
-   return (1);
-   return (0);
+   if (!IS_ELF(hdr))
+   return (0);
+   switch (hdr.e_ident[EI_DATA]) {
+   case ELFDATA2LSB:
+   machine = le16toh(hdr.e_machine);
+   break;
+   case ELFDATA2MSB:
+   machine = be16toh(hdr.e_machine);
+   break;
+   default:
+   return (0);
+   }
+   if (!ELF_MACHINE_OK(machine))
+   return (0);
+
+   /* Looks good. */
+   return (1);
 }
 
 static void
@@ -194,7 +226,7 @@ elf_coredump(int efd __unused, int fd, p
uintmax_t nleft = php-p_filesz;
 
iorequest.piod_op = PIOD_READ_D;
-   iorequest.piod_offs = 

svn commit: r269129 - head/sys/powerpc/powerpc

2014-07-26 Thread Marcel Moolenaar
Author: marcel
Date: Sat Jul 26 17:07:32 2014
New Revision: 269129
URL: http://svnweb.freebsd.org/changeset/base/269129

Log:
  Fix relocations related to dpcpu and vnet sets. The address is
  rebased to point to the allocated memory, but for architectures
  that have non-zero relocation addends, the address comparison
  happens on the unfinalized address.
  After the addend is taken into account, call elf_relocaddr() to
  make sure we rebase properly.

Modified:
  head/sys/powerpc/powerpc/elf32_machdep.c

Modified: head/sys/powerpc/powerpc/elf32_machdep.c
==
--- head/sys/powerpc/powerpc/elf32_machdep.cSat Jul 26 16:45:11 2014
(r269128)
+++ head/sys/powerpc/powerpc/elf32_machdep.cSat Jul 26 17:07:32 2014
(r269129)
@@ -190,8 +190,7 @@ elf_reloc_internal(linker_file_t lf, Elf
addr = lookup(lf, symidx, 1);
if (addr == 0)
return -1;
-   addr += addend;
-   *where = addr;
+   *where = elf_relocaddr(lf, addr + addend);
break;
 
case R_PPC_ADDR16_LO: /* #lo(S) */
@@ -204,9 +203,8 @@ elf_reloc_internal(linker_file_t lf, Elf
 * are relative to relocbase. Detect this condition.
 */
if (addr  relocbase  addr = (relocbase + addend))
-   addr = relocbase + addend;
-   else
-   addr += addend;
+   addr = relocbase;
+   addr = elf_relocaddr(lf, addr + addend);
*hwhere = addr  0x;
break;
 
@@ -220,9 +218,8 @@ elf_reloc_internal(linker_file_t lf, Elf
 * are relative to relocbase. Detect this condition.
 */
if (addr  relocbase  addr = (relocbase + addend))
-   addr = relocbase + addend;
-   else
-   addr += addend;
+   addr = relocbase;
+   addr = elf_relocaddr(lf, addr + addend);
*hwhere = ((addr  16) + ((addr  0x8000) ? 1 : 0))
 0x;
break;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269130 - in head/sys/modules: bxe dtrace/fasttrap zfs

2014-07-26 Thread Marcel Moolenaar
Author: marcel
Date: Sat Jul 26 17:24:58 2014
New Revision: 269130
URL: http://svnweb.freebsd.org/changeset/base/269130

Log:
  Avoid using ${.CURDIR} so that the module can be built from multiple
  directories.
  
  Obtained from:Juniper Networks, Inc.

Modified:
  head/sys/modules/bxe/Makefile
  head/sys/modules/dtrace/fasttrap/Makefile
  head/sys/modules/zfs/Makefile

Modified: head/sys/modules/bxe/Makefile
==
--- head/sys/modules/bxe/Makefile   Sat Jul 26 17:07:32 2014
(r269129)
+++ head/sys/modules/bxe/Makefile   Sat Jul 26 17:24:58 2014
(r269130)
@@ -1,5 +1,8 @@
 # $FreeBSD$
-BXE= ${.CURDIR}/../../dev/bxe
+
+SYSDIR ?= ${.CURDIR}/../..
+
+BXE= ${SYSDIR}/dev/bxe
 .PATH: ${BXE}
 
 KMOD   = if_bxe

Modified: head/sys/modules/dtrace/fasttrap/Makefile
==
--- head/sys/modules/dtrace/fasttrap/Makefile   Sat Jul 26 17:07:32 2014
(r269129)
+++ head/sys/modules/dtrace/fasttrap/Makefile   Sat Jul 26 17:24:58 2014
(r269130)
@@ -20,7 +20,7 @@ CFLAGS+=  -I${SYSDIR}/cddl/contrib/openso
 .PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/powerpc/dtrace
 .endif
 
-.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/common/unicode
+.PATH: ${SYSDIR}/cddl/contrib/opensolaris/common/unicode
 SRCS+= u8_textprep.c
 
 CFLAGS+=   -DSMP

Modified: head/sys/modules/zfs/Makefile
==
--- head/sys/modules/zfs/Makefile   Sat Jul 26 17:07:32 2014
(r269129)
+++ head/sys/modules/zfs/Makefile   Sat Jul 26 17:24:58 2014
(r269130)
@@ -1,10 +1,12 @@
 # $FreeBSD$
 
+SYSDIR?=${.CURDIR}/../..
+
 KMOD=  zfs
 
 SRCS=  bus_if.h device_if.h vnode_if.h
 
-SUNW=  ${.CURDIR}/../../cddl/contrib/opensolaris
+SUNW=  ${SYSDIR}/cddl/contrib/opensolaris
 
 .PATH: ${SUNW}/common/acl
 SRCS+= acl_common.c
@@ -14,10 +16,10 @@ SRCS+=  avl.c
 SRCS+= nvpair.c
 SRCS+= nvpair_alloc_fixed.c
 SRCS+= fnvpair.c
-.PATH: ${.CURDIR}/../../cddl/contrib/opensolaris/common/unicode
+.PATH: ${SYSDIR}/cddl/contrib/opensolaris/common/unicode
 SRCS+= u8_textprep.c
 
-.PATH: ${.CURDIR}/../../cddl/compat/opensolaris/kern
+.PATH: ${SYSDIR}/cddl/compat/opensolaris/kern
 SRCS+= opensolaris_acl.c
 SRCS+= opensolaris_kobj.c
 SRCS+= opensolaris_kstat.c
@@ -31,7 +33,7 @@ SRCS+=opensolaris_vfs.c
 SRCS+= opensolaris_vm.c
 SRCS+= opensolaris_zone.c
 
-_A=${.CURDIR}/../../cddl/contrib/opensolaris/common/atomic
+_A=${SYSDIR}/cddl/contrib/opensolaris/common/atomic
 .if exists(${_A}/${MACHINE_CPUARCH}/opensolaris_atomic.S)
 .PATH: ${_A}/${MACHINE_CPUARCH}
 SRCS+= opensolaris_atomic.S
@@ -64,7 +66,7 @@ SRCS+=zmod.c
 SRCS+= zmod_subr.c
 SRCS+= zutil.c
 
-.PATH: ${.CURDIR}/../../crypto/sha2
+.PATH: ${SYSDIR}/crypto/sha2
 SRCS+= sha2.c sha256c.c
 
 .PATH: ${SUNW}/common/zfs
@@ -78,11 +80,11 @@ SRCS+=  trim_map.c
 # Use FreeBSD's namecache.
 CFLAGS+=-DFREEBSD_NAMECACHE
 
-CFLAGS+=-I${.CURDIR}/../../cddl/compat/opensolaris
+CFLAGS+=-I${SYSDIR}/cddl/compat/opensolaris
 CFLAGS+=-I${SUNW}/uts/common/fs/zfs
 CFLAGS+=-I${SUNW}/uts/common/zmod
 CFLAGS+=-I${SUNW}/uts/common
-CFLAGS+=-I${.CURDIR}/../..
+CFLAGS+=-I${SYSDIR}
 CFLAGS+=-I${SUNW}/common/zfs
 CFLAGS+=-I${SUNW}/common
 CFLAGS+=-DBUILDING_ZFS
@@ -96,7 +98,7 @@ CFLAGS+=-mminimal-toc
 
 .include bsd.kmod.mk
 
-CFLAGS+=   -include 
${.CURDIR}/../../cddl/compat/opensolaris/sys/debug_compat.h
+CFLAGS+=   -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h
 
 CWARNFLAGS+=-Wno-unknown-pragmas
 CWARNFLAGS+=-Wno-missing-prototypes
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269131 - head/sys/dev/uart

2014-07-26 Thread Marcel Moolenaar
Author: marcel
Date: Sat Jul 26 17:49:40 2014
New Revision: 269131
URL: http://svnweb.freebsd.org/changeset/base/269131

Log:
  Do not fail the low-level device probe simply because the kernel
  doesn't have support for the Z8530. Embedded PowerPC platforms
  typically don't. Fail when the device class we actually need is
  not present.
  
  Obtained from:Juniper Networks, Inc.

Modified:
  head/sys/dev/uart/uart_cpu_powerpc.c

Modified: head/sys/dev/uart/uart_cpu_powerpc.c
==
--- head/sys/dev/uart/uart_cpu_powerpc.cSat Jul 26 17:24:58 2014
(r269130)
+++ head/sys/dev/uart/uart_cpu_powerpc.cSat Jul 26 17:49:40 2014
(r269131)
@@ -113,10 +113,6 @@ uart_cpu_getdev(int devtype, struct uart
phandle_t input, opts, chosen;
int error;
 
-   class = uart_z8530_class;
-   if (class == NULL)
-   return (ENXIO);
-
opts = OF_finddevice(/options);
chosen = OF_finddevice(/chosen);
switch (devtype) {
@@ -181,6 +177,9 @@ uart_cpu_getdev(int devtype, struct uart
} else
return (ENXIO);
 
+   if (class == NULL)
+   return (ENXIO);
+
error = OF_decode_addr(input, 0, di-bas.bst, di-bas.bsh);
if (error)
return (error);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269132 - head/sys/dev/tsec

2014-07-26 Thread Marcel Moolenaar
Author: marcel
Date: Sat Jul 26 17:57:13 2014
New Revision: 269132
URL: http://svnweb.freebsd.org/changeset/base/269132

Log:
  Remove bogus module dependencies.

Modified:
  head/sys/dev/tsec/if_tsec_fdt.c

Modified: head/sys/dev/tsec/if_tsec_fdt.c
==
--- head/sys/dev/tsec/if_tsec_fdt.c Sat Jul 26 17:49:40 2014
(r269131)
+++ head/sys/dev/tsec/if_tsec_fdt.c Sat Jul 26 17:57:13 2014
(r269132)
@@ -101,8 +101,6 @@ static driver_t tsec_fdt_driver = {
 };
 
 DRIVER_MODULE(tsec, simplebus, tsec_fdt_driver, tsec_devclass, 0, 0);
-MODULE_DEPEND(tsec, simplebus, 1, 1, 1);
-MODULE_DEPEND(tsec, ether, 1, 1, 1);
 
 static int
 tsec_fdt_probe(device_t dev)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269133 - head/sys/modules/tsec

2014-07-26 Thread Marcel Moolenaar
Author: marcel
Date: Sat Jul 26 17:59:25 2014
New Revision: 269133
URL: http://svnweb.freebsd.org/changeset/base/269133

Log:
  Build tsec(4) as a module.
  
  Obtained from:Juniper Networks, Inc.

Added:
  head/sys/modules/tsec/
  head/sys/modules/tsec/Makefile   (contents, props changed)

Added: head/sys/modules/tsec/Makefile
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/modules/tsec/Makefile  Sat Jul 26 17:59:25 2014
(r269133)
@@ -0,0 +1,11 @@
+# $FreeBSD$
+
+SYSDIR?=${.CURDIR}/../..
+
+.PATH: ${SYSDIR}/dev/tsec
+
+KMOD=  if_tsec
+SRCS=  if_tsec.c if_tsec_fdt.c
+SRCS+= bus_if.h device_if.h miibus_if.h miidevs.h ofw_bus_if.h
+
+.include bsd.kmod.mk
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269134 - head/sys/vm

2014-07-26 Thread Alan Cox
Author: alc
Date: Sat Jul 26 18:10:18 2014
New Revision: 269134
URL: http://svnweb.freebsd.org/changeset/base/269134

Log:
  When unwiring a region of an address space, do not assume that the
  underlying physical pages are mapped by the pmap.  If, for example, the
  application has performed an mprotect(..., PROT_NONE) on any part of the
  wired region, then those pages will no longer be mapped by the pmap.
  So, using the pmap to lookup the wired pages in order to unwire them
  doesn't always work, and when it doesn't work wired pages are leaked.
  
  To avoid the leak, introduce and use a new function vm_object_unwire()
  that locates the wired pages by traversing the object and its backing
  objects.
  
  At the same time, switch from using pmap_change_wiring() to the recently
  introduced function pmap_unwire() for unwiring the region's mappings.
  pmap_unwire() is faster, because it operates a range of virtual addresses
  rather than a single virtual page at a time.  Moreover, by operating on
  a range, it is superpage friendly.  It doesn't waste time performing
  unnecessary demotions.
  
  Reported by:  markj
  Reviewed by:  kib
  Tested by:pho, jmg (arm)
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/sys/vm/vm_extern.h
  head/sys/vm/vm_fault.c
  head/sys/vm/vm_map.c
  head/sys/vm/vm_object.c
  head/sys/vm/vm_object.h

Modified: head/sys/vm/vm_extern.h
==
--- head/sys/vm/vm_extern.h Sat Jul 26 17:59:25 2014(r269133)
+++ head/sys/vm/vm_extern.h Sat Jul 26 18:10:18 2014(r269134)
@@ -81,7 +81,6 @@ int vm_fault_hold(vm_map_t map, vm_offse
 int fault_flags, vm_page_t *m_hold);
 int vm_fault_quick_hold_pages(vm_map_t map, vm_offset_t addr, vm_size_t len,
 vm_prot_t prot, vm_page_t *ma, int max_count);
-void vm_fault_unwire(vm_map_t, vm_offset_t, vm_offset_t, boolean_t);
 int vm_fault_wire(vm_map_t, vm_offset_t, vm_offset_t, boolean_t);
 int vm_forkproc(struct thread *, struct proc *, struct thread *, struct 
vmspace *, int);
 void vm_waitproc(struct proc *);

Modified: head/sys/vm/vm_fault.c
==
--- head/sys/vm/vm_fault.c  Sat Jul 26 17:59:25 2014(r269133)
+++ head/sys/vm/vm_fault.c  Sat Jul 26 18:10:18 2014(r269134)
@@ -106,6 +106,7 @@ __FBSDID($FreeBSD$);
 #define PFFOR 4
 
 static int vm_fault_additional_pages(vm_page_t, int, int, vm_page_t *, int *);
+static void vm_fault_unwire(vm_map_t, vm_offset_t, vm_offset_t, boolean_t);
 
 #defineVM_FAULT_READ_BEHIND8
 #defineVM_FAULT_READ_MAX   (1 + VM_FAULT_READ_AHEAD_MAX)
@@ -1186,7 +1187,7 @@ vm_fault_wire(vm_map_t map, vm_offset_t 
  *
  * Unwire a range of virtual addresses in a map.
  */
-void
+static void
 vm_fault_unwire(vm_map_t map, vm_offset_t start, vm_offset_t end,
 boolean_t fictitious)
 {

Modified: head/sys/vm/vm_map.c
==
--- head/sys/vm/vm_map.cSat Jul 26 17:59:25 2014(r269133)
+++ head/sys/vm/vm_map.cSat Jul 26 18:10:18 2014(r269134)
@@ -132,6 +132,7 @@ static void _vm_map_init(vm_map_t map, p
 vm_offset_t max);
 static void vm_map_entry_deallocate(vm_map_entry_t entry, boolean_t 
system_map);
 static void vm_map_entry_dispose(vm_map_t map, vm_map_entry_t entry);
+static void vm_map_entry_unwire(vm_map_t map, vm_map_entry_t entry);
 #ifdef INVARIANTS
 static void vm_map_zdtor(void *mem, int size, void *arg);
 static void vmspace_zdtor(void *mem, int size, void *arg);
@@ -2393,16 +2394,10 @@ done:
(entry-eflags  MAP_ENTRY_USER_WIRED))) {
if (user_unwire)
entry-eflags = ~MAP_ENTRY_USER_WIRED;
-   entry-wired_count--;
-   if (entry-wired_count == 0) {
-   /*
-* Retain the map lock.
-*/
-   vm_fault_unwire(map, entry-start, entry-end,
-   entry-object.vm_object != NULL 
-   (entry-object.vm_object-flags 
-   OBJ_FICTITIOUS) != 0);
-   }
+   if (entry-wired_count == 1)
+   vm_map_entry_unwire(map, entry);
+   else
+   entry-wired_count--;
}
KASSERT((entry-eflags  MAP_ENTRY_IN_TRANSITION) != 0,
(vm_map_unwire: in-transition flag missing %p, entry));
@@ -2635,19 +2630,12 @@ done:
 * unnecessary.
 */
entry-wired_count = 0;
-   } else {
-   if (!user_wire ||
-   

svn commit: r269135 - head/sys/arm/arm

2014-07-26 Thread Ian Lepore
Author: ian
Date: Sat Jul 26 18:14:16 2014
New Revision: 269135
URL: http://svnweb.freebsd.org/changeset/base/269135

Log:
  Remove completely bogus alignment check -- it's the physical address that
  needs to be aligned, not the virtual, and it doesn't seem worth the cost
  of a vtophys() call just to see if kmem_alloc_contig() works properly.

Modified:
  head/sys/arm/arm/busdma_machdep-v6.c

Modified: head/sys/arm/arm/busdma_machdep-v6.c
==
--- head/sys/arm/arm/busdma_machdep-v6.cSat Jul 26 18:10:18 2014
(r269134)
+++ head/sys/arm/arm/busdma_machdep-v6.cSat Jul 26 18:14:16 2014
(r269135)
@@ -721,8 +721,6 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi
free(*mapp, M_DEVBUF);
*mapp = NULL;
return (ENOMEM);
-   } else if ((uintptr_t)*vaddr  (dmat-alignment - 1)) {
-   printf(bus_dmamem_alloc failed to align memory properly.\n);
}
dmat-map_count++;
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269136 - head/sys/arm/arm

2014-07-26 Thread Ian Lepore
Author: ian
Date: Sat Jul 26 18:19:43 2014
New Revision: 269136
URL: http://svnweb.freebsd.org/changeset/base/269136

Log:
  Pull in the armv4 fast out code for checking whether busdma can bounce
  due to an excluded region of physical memory.

Modified:
  head/sys/arm/arm/busdma_machdep-v6.c

Modified: head/sys/arm/arm/busdma_machdep-v6.c
==
--- head/sys/arm/arm/busdma_machdep-v6.cSat Jul 26 18:14:16 2014
(r269135)
+++ head/sys/arm/arm/busdma_machdep-v6.cSat Jul 26 18:19:43 2014
(r269136)
@@ -229,10 +229,26 @@ busdma_init(void *dummy)
  */
 SYSINIT(busdma, SI_SUB_KMEM, SI_ORDER_FOURTH, busdma_init, NULL);
 
+/*
+ * This routine checks the exclusion zone constraints from a tag against the
+ * physical RAM available on the machine.  If a tag specifies an exclusion zone
+ * but there's no RAM in that zone, then we avoid allocating resources to 
bounce
+ * a request, and we can use any memory allocator (as opposed to needing
+ * kmem_alloc_contig() just because it can allocate pages in an address range).
+ *
+ * Most tags have BUS_SPACE_MAXADDR or BUS_SPACE_MAXADDR_32BIT (they are the
+ * same value on 32-bit architectures) as their lowaddr constraint, and we 
can't
+ * possibly have RAM at an address higher than the highest address we can
+ * express, so we take a fast out.
+ */
 static __inline int
 _bus_dma_can_bounce(vm_offset_t lowaddr, vm_offset_t highaddr)
 {
int i;
+
+   if (lowaddr = BUS_SPACE_MAXADDR)
+   return (0);
+
for (i = 0; phys_avail[i]  phys_avail[i + 1]; i += 2) {
if ((lowaddr = phys_avail[i]  lowaddr = phys_avail[i + 1])
|| (lowaddr  phys_avail[i] 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r269106 - head/tools/tools/cxgbetool

2014-07-26 Thread Konstantin Belousov
On Sat, Jul 26, 2014 at 12:51:45AM +, Navdeep Parhar wrote:
 Author: np
 Date: Sat Jul 26 00:51:45 2014
 New Revision: 269106
 URL: http://svnweb.freebsd.org/changeset/base/269106
 
 Log:
   Add a 'raw' parameter to the 'modinfo' subcommand.  This is handy when
   trying to figure out why a QSFP+/SFP+ connector or cable wasn't
   identified correctly by cxgbe(4).  Its output looks like this:
   
   # cxgbetool t5nex0 modinfo 0 raw
   00:  03 04 21 00  00 00 00 00  ..!. 
   08:  04 00 00 00  67 00 00 00   g...
   10:  00 00 05 00  41 6d 70 68   Amph
   18:  65 6e 6f 6c  20 20 20 20  enol
   20:  20 20 20 20  00 41 50 48   .APH
   28:  35 37 31 35  34 30 30 30  5715 4000
   30:  33 20 20 20  20 20 20 20  3
   38:  4b 20 20 20  01 00 00 fa  K
   40:  00 00 00 00  41 50 46 31   APF1
   48:  30 30 34 30  30 33 30 30  0040 0300
   50:  30 33 20 20  31 30 30 31  03   1001
   58:  33 30 20 20  00 00 00 97  30   
   
   MFC after:  3 days
 
 Modified:
   head/tools/tools/cxgbetool/cxgbetool.c

I do not remember if this question was already asked.

Why cxgbetool lives in tools and not installed into /usr/sbin as
cxgbecontrol(8) ?


pgpzawCf6QvNl.pgp
Description: PGP signature


Re: svn commit: r269112 - head/sys/boot/arm/at91/boot2

2014-07-26 Thread Bruce Evans

On Sat, 26 Jul 2014, Benjamin Kaduk wrote:


On Sat, Jul 26, 2014 at 12:09 AM, Ian Lepore i...@freebsd.org wrote:


Author: ian
Date: Sat Jul 26 04:09:43 2014
New Revision: 269112
URL: http://svnweb.freebsd.org/changeset/base/269112

Log:
  The 'flags' variable is conflicting with some inline code in a header
file
  (variable flags shadows a global...), just rename this variable to
  wish away the problem.


Not trying to pick on you, but we have lots of places where we get
variable foo shadows a global... -- we have a global variable 'buf' in
the kernel namespace, for one :)
Do we think it's a good use of our time to try and get this to zero
instances?


Not very good, and it is negatively good to unimprove local names because
of namespace pollution in global names.

The shadowing for 'buf' can only be seen by C compilers that look only
at source files for the file being compiled if sys/buf.h is included,
but namespace pollution makes it more visible.  The pollution is
relatively small.  In freefall's kernel now, according to word counts
of .depend, there are approx. 187338 included files only 174 of them are
sys/buf.h.  The number of nested includes (adjusted for kernel feature
expansion) has increased by about a factor of 3 in the last 15 years
since I stopped trying to police it.

Bruce
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r269127 - head/sys/dev/usb/wlan

2014-07-26 Thread Adrian Chadd
Hi,

We should likely review how the PLCP bits are being used and why it's
getting a rate of 0 in the first place.

So, why's it getting a rate of 0 passed into the transmit path?


-a


On 26 July 2014 09:06, Hans Petter Selasky hsela...@freebsd.org wrote:
 Author: hselasky
 Date: Sat Jul 26 16:06:01 2014
 New Revision: 269127
 URL: http://svnweb.freebsd.org/changeset/base/269127

 Log:
   Fix for division by zero.

   MFC after:3 days

 Modified:
   head/sys/dev/usb/wlan/if_rum.c
   head/sys/dev/usb/wlan/if_ural.c
   head/sys/dev/usb/wlan/if_zyd.c
   head/sys/dev/usb/wlan/if_zydreg.h

 Modified: head/sys/dev/usb/wlan/if_rum.c
 ==
 --- head/sys/dev/usb/wlan/if_rum.c  Sat Jul 26 15:46:41 2014
 (r269126)
 +++ head/sys/dev/usb/wlan/if_rum.c  Sat Jul 26 16:06:01 2014
 (r269127)
 @@ -1035,6 +1035,8 @@ rum_setup_tx_desc(struct rum_softc *sc,
 desc-plcp_length_hi = plcp_length  6;
 desc-plcp_length_lo = plcp_length  0x3f;
 } else {
 +   if (rate == 0)
 +   rate = 2;   /* avoid division by zero */
 plcp_length = (16 * len + rate - 1) / rate;
 if (rate == 22) {
 remainder = (16 * len) % 22;

 Modified: head/sys/dev/usb/wlan/if_ural.c
 ==
 --- head/sys/dev/usb/wlan/if_ural.c Sat Jul 26 15:46:41 2014
 (r269126)
 +++ head/sys/dev/usb/wlan/if_ural.c Sat Jul 26 16:06:01 2014
 (r269127)
 @@ -1038,6 +1038,8 @@ ural_setup_tx_desc(struct ural_softc *sc
 desc-plcp_length_hi = plcp_length  6;
 desc-plcp_length_lo = plcp_length  0x3f;
 } else {
 +   if (rate == 0)
 +   rate = 2;   /* avoid division by zero */
 plcp_length = (16 * len + rate - 1) / rate;
 if (rate == 22) {
 remainder = (16 * len) % 22;

 Modified: head/sys/dev/usb/wlan/if_zyd.c
 ==
 --- head/sys/dev/usb/wlan/if_zyd.c  Sat Jul 26 15:46:41 2014
 (r269126)
 +++ head/sys/dev/usb/wlan/if_zyd.c  Sat Jul 26 16:06:01 2014
 (r269127)
 @@ -2480,7 +2480,7 @@ zyd_tx_start(struct zyd_softc *sc, struc
 const struct ieee80211_txparam *tp;
 struct ieee80211_key *k;
 int rate, totlen;
 -   static uint8_t ratediv[] = ZYD_TX_RATEDIV;
 +   static const uint8_t ratediv[] = ZYD_TX_RATEDIV;
 uint8_t phy;
 uint16_t pktlen;
 uint32_t bits;

 Modified: head/sys/dev/usb/wlan/if_zydreg.h
 ==
 --- head/sys/dev/usb/wlan/if_zydreg.h   Sat Jul 26 15:46:41 2014
 (r269126)
 +++ head/sys/dev/usb/wlan/if_zydreg.h   Sat Jul 26 16:06:01 2014
 (r269127)
 @@ -970,7 +970,7 @@

  #defineZYD_TX_RATEDIV
   \
  {  \
 -   0x1, 0x2, 0xb, 0xb, 0x0, 0x0, 0x0, 0x0, 0x30, 0x18, 0xc, 0x6,   \
 +   0x1, 0x2, 0xb, 0xb, 0x1, 0x1, 0x1, 0x1, 0x30, 0x18, 0xc, 0x6,   \
 0x36, 0x24, 0x12, 0x9   \
  }


___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269137 - head/sys/mips/include

2014-07-26 Thread Marcel Moolenaar
Author: marcel
Date: Sat Jul 26 18:52:23 2014
New Revision: 269137
URL: http://svnweb.freebsd.org/changeset/base/269137

Log:
  Add missing definition of ELF_MACHINE_OK, now used by gcore(1).

Modified:
  head/sys/mips/include/elf.h

Modified: head/sys/mips/include/elf.h
==
--- head/sys/mips/include/elf.h Sat Jul 26 18:19:43 2014(r269136)
+++ head/sys/mips/include/elf.h Sat Jul 26 18:52:23 2014(r269137)
@@ -77,6 +77,8 @@
 #define ELF_ARCH   EM_MIPS
 #define ELF_ARCH32 EM_MIPS
 
+#defineELF_MACHINE_OK(x)   ((x) == ELF_ARCH)
+
 /* Define machine characteristics */
 #if __ELF_WORD_SIZE == 32
 #defineELF_TARG_CLASS  ELFCLASS32
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269138 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

2014-07-26 Thread Xin LI
Author: delphij
Date: Sat Jul 26 19:07:08 2014
New Revision: 269138
URL: http://svnweb.freebsd.org/changeset/base/269138

Log:
  Add two sysctls for newly added tunables.
  
  MFC after:2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
==
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c  Sat Jul 
26 18:52:23 2014(r269137)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c  Sat Jul 
26 19:07:08 2014(r269138)
@@ -114,6 +114,11 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_noallo
  * class have also crossed this threshold.
  */
 int zfs_mg_fragmentation_threshold = 85;
+SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_fragmentation_threshold, CTLFLAG_RWTUN,
+zfs_mg_fragmentation_threshold, 0,
+Percentage of metaslab group size that should be considered 
+eligible for allocations unless all metaslab groups within the metaslab 
class 
+have also crossed this threshold);
 
 /*
  * Allow metaslabs to keep their active state as long as their fragmentation
@@ -122,6 +127,9 @@ int zfs_mg_fragmentation_threshold = 85;
  * status allowing better metaslabs to be selected.
  */
 int zfs_metaslab_fragmentation_threshold = 70;
+SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, fragmentation_threshold, CTLFLAG_RWTUN,
+zfs_metaslab_fragmentation_threshold, 0,
+Maximum percentage of metaslab fragmentation level to keep their active 
state);
 
 /*
  * When set will load all metaslabs when pool is first opened.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269139 - head/sys/dev/usb/controller

2014-07-26 Thread Hans Petter Selasky
Author: hselasky
Date: Sat Jul 26 19:08:52 2014
New Revision: 269139
URL: http://svnweb.freebsd.org/changeset/base/269139

Log:
  Split the XHCI TRB allocations into smaller parts, so that we don't
  end up allocating contiguous busdma buffers above PAGE_SIZE bytes.
  
  MFC after:1 week
  Tested by:Ruslan Bukin b...@bsdpad.com

Modified:
  head/sys/dev/usb/controller/xhci.c
  head/sys/dev/usb/controller/xhci.h

Modified: head/sys/dev/usb/controller/xhci.c
==
--- head/sys/dev/usb/controller/xhci.c  Sat Jul 26 19:07:08 2014
(r269138)
+++ head/sys/dev/usb/controller/xhci.c  Sat Jul 26 19:08:52 2014
(r269139)
@@ -2678,24 +2678,23 @@ xhci_alloc_device_ext(struct usb_device 
goto error;
}
 
-   pc = sc-sc_hw.devs[index].endpoint_pc;
-   pg = sc-sc_hw.devs[index].endpoint_pg;
+   /* initialise all endpoint LINK TRBs */
 
-   /* need to initialize the page cache */
-   pc-tag_parent = sc-sc_bus.dma_parent_tag;
+   for (i = 0; i != XHCI_MAX_ENDPOINTS; i++) {
 
-   if (usb_pc_alloc_mem(pc, pg,
-   sizeof(struct xhci_dev_endpoint_trbs), XHCI_PAGE_SIZE)) {
-   goto error;
-   }
+   pc = sc-sc_hw.devs[index].endpoint_pc[i];
+   pg = sc-sc_hw.devs[index].endpoint_pg[i];
 
-   /* initialise all endpoint LINK TRBs */
+   /* need to initialize the page cache */
+   pc-tag_parent = sc-sc_bus.dma_parent_tag;
 
-   for (i = 0; i != XHCI_MAX_ENDPOINTS; i++) {
+   if (usb_pc_alloc_mem(pc, pg,
+   sizeof(struct xhci_dev_endpoint_trbs), XHCI_TRB_ALIGN)) {
+   goto error;
+   }
 
/* lookup endpoint TRB ring */
-   usbd_get_page(pc, (uintptr_t)
-   ((struct xhci_dev_endpoint_trbs *)0)-trb[i][0], buf_ep);
+   usbd_get_page(pc, 0, buf_ep);
 
/* get TRB pointer */
trb = buf_ep.buffer;
@@ -2709,9 +2708,9 @@ xhci_alloc_device_ext(struct usb_device 
trb-dwTrb2 = htole32(XHCI_TRB_2_IRQ_SET(0));
trb-dwTrb3 = htole32(XHCI_TRB_3_CYCLE_BIT |
XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_LINK));
-   }
 
-   usb_pc_cpu_flush(pc);
+   usb_pc_cpu_flush(pc);
+   }
 
xhci_set_slot_pointer(sc, index, buf_dev.physaddr);
 
@@ -2728,13 +2727,15 @@ xhci_free_device_ext(struct usb_device *
 {
struct xhci_softc *sc = XHCI_BUS2SC(udev-bus);
uint8_t index;
+   uint8_t i;
 
index = udev-controller_slot_id;
xhci_set_slot_pointer(sc, index, 0);
 
usb_pc_free_mem(sc-sc_hw.devs[index].device_pc);
usb_pc_free_mem(sc-sc_hw.devs[index].input_pc);
-   usb_pc_free_mem(sc-sc_hw.devs[index].endpoint_pc);
+   for (i = 0; i != XHCI_MAX_ENDPOINTS; i++)
+   usb_pc_free_mem(sc-sc_hw.devs[index].endpoint_pc[i]);
 }
 
 static struct xhci_endpoint_ext *
@@ -2755,10 +2756,9 @@ xhci_get_endpoint_ext(struct usb_device 
 
index = udev-controller_slot_id;
 
-   pc = sc-sc_hw.devs[index].endpoint_pc;
+   pc = sc-sc_hw.devs[index].endpoint_pc[epno];
 
-   usbd_get_page(pc, (uintptr_t)((struct xhci_dev_endpoint_trbs *)0)-
-   trb[epno][0], buf_ep);
+   usbd_get_page(pc, 0, buf_ep);
 
pepext = sc-sc_hw.devs[index].endp[epno];
pepext-page_cache = pc;

Modified: head/sys/dev/usb/controller/xhci.h
==
--- head/sys/dev/usb/controller/xhci.h  Sat Jul 26 19:07:08 2014
(r269138)
+++ head/sys/dev/usb/controller/xhci.h  Sat Jul 26 19:08:52 2014
(r269139)
@@ -316,8 +316,8 @@ struct xhci_trb {
 } __aligned(4);
 
 struct xhci_dev_endpoint_trbs {
-   struct xhci_trb trb[XHCI_MAX_ENDPOINTS]
-   [(XHCI_MAX_STREAMS * XHCI_MAX_TRANSFERS) + XHCI_MAX_STREAMS];
+   struct xhci_trb trb[(XHCI_MAX_STREAMS *
+   XHCI_MAX_TRANSFERS) + XHCI_MAX_STREAMS];
 };
 
 #defineXHCI_TD_PAGE_NBUF   17  /* units, room enough for 
64Kbytes */
@@ -385,11 +385,11 @@ enum {
 struct xhci_hw_dev {
struct usb_page_cache   device_pc;
struct usb_page_cache   input_pc;
-   struct usb_page_cache   endpoint_pc;
+   struct usb_page_cache   endpoint_pc[XHCI_MAX_ENDPOINTS];
 
struct usb_page device_pg;
struct usb_page input_pg;
-   struct usb_page endpoint_pg;
+   struct usb_page endpoint_pg[XHCI_MAX_ENDPOINTS];
 
struct xhci_endpoint_ext endp[XHCI_MAX_ENDPOINTS];
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r269127 - head/sys/dev/usb/wlan

2014-07-26 Thread Hans Petter Selasky

On 07/26/14 20:36, Adrian Chadd wrote:

Hi,

We should likely review how the PLCP bits are being used and why it's
getting a rate of 0 in the first place.

So, why's it getting a rate of 0 passed into the transmit path?




Hi Adrian,

Here is the backtrace of the panic:

Fatal trap 18: integer divide fault while in kernel mode
cpuid = 2; apic id = 02
instruction pointer = 0x20:0x807826cf
stack pointer   = 0x28:0xff8000305090
frame pointer   = 0x28:0xff80003050a0
code segment= base 0x0, limit 0xf, type 0x1b
= DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags= interrupt enabled, resume, IOPL = 0
current process = 15 (usbus0)
trap number = 18
panic: integer divide fault
cpuid = 2
KDB: stack backtrace:
#0 0x809257e6 at kdb_backtrace+0x66
#1 0x808eb3ae at panic+0x1ce
#2 0x80cd2c30 at trap_fatal+0x290
#3 0x80cd3480 at trap+0x250
#4 0x80cbc783 at calltrap+0x8
#5 0x80783d90 at ural_start+0x1d0
#6 0x809aa2ea at if_transmit+0xea
#7 0x809ef7b2 at ieee80211_start+0x542
#8 0x809aa2ea at if_transmit+0xea
#9 0x809ae8b3 at ether_output_frame+0x33
#10 0x809aee30 at ether_output+0x530
#11 0x80a186b4 at ip_output+0xd74
#12 0x80a87d2a at tcp_output+0xfea
#13 0x80a8 at tcp_do_segment+0xc02
#14 0x80a85219 at tcp_input+0xa29
#15 0x80a155fa at ip_input+0xaa
#16 0x809b7808 at netisr_dispatch_src+0x218
#17 0x809ae3fd at ether_demux+0x14d

#0  doadump (textdump=value optimized out) at pcpu.h:235
235 pcpu.h: No such file or directory.
in pcpu.h
(kgdb) #0  doadump (textdump=value optimized out) at pcpu.h:235
#1  0x808eae86 in kern_reboot (howto=260)
at /usr/img/freebsd.9/sys/kern/kern_shutdown.c:454
#2  0x808eb387 in panic (fmt=0x1 Address 0x1 out of bounds)
at /usr/img/freebsd.9/sys/kern/kern_shutdown.c:642
#3  0x80cd2c30 in trap_fatal (frame=0x12, eva=value optimized out)
at /usr/img/freebsd.9/sys/amd64/amd64/trap.c:878
#4  0x80cd3480 in trap (frame=0xff8000304fe0)
at /usr/img/freebsd.9/sys/amd64/amd64/trap.c:598
#5  0x80cbc783 in calltrap ()
at /usr/img/freebsd.9/sys/amd64/amd64/exception.S:232
#6  0x807826cf in ural_setup_tx_desc (sc=value optimized out,
desc=0xfe0002c2a500, flags=value optimized out,
len=value optimized out, rate=0)
at /usr/img/freebsd.9/sys/dev/usb/wlan/if_ural.c:1040
#7  0x80783d90 in ural_start (ifp=0xfe0005a64800)
at /usr/img/freebsd.9/sys/dev/usb/wlan/if_ural.c:1335
#8  0x809aa2ea in if_transmit (ifp=0xfe0005a64800,
m=value optimized out) at /usr/img/freebsd.9/sys/net/if.c:3395
#9  0x809ef7b2 in ieee80211_start (ifp=0xfe00054f2800)
at /usr/img/freebsd.9/sys/net80211/ieee80211_output.c:365
#10 0x809aa2ea in if_transmit (ifp=0xfe00054f2800,
m=value optimized out) at /usr/img/freebsd.9/sys/net/if.c:3395
#11 0x809ae8b3 in ether_output_frame (ifp=0xfe00054f2800,
m=0xfe014400a200) at /usr/img/freebsd.9/sys/net/if_ethersubr.c:447
#12 0x809aee30 in ether_output (ifp=0xfe00054f2800,
m=0xfe014400a200, dst=value optimized out, ro=value 
optimized out)

at /usr/img/freebsd.9/sys/net/if_ethersubr.c:418
#13 0x80a186b4 in ip_output (m=0xfe014400a200,
opt=value optimized out, ro=0xff8000305480,
flags=value optimized out, imo=0x0, inp=0xfe0005911498)
at /usr/img/freebsd.9/sys/netinet/ip_output.c:631
#14 0x80a87d2a in tcp_output (tp=0xfe0005908b70)
at /usr/img/freebsd.9/sys/netinet/tcp_output.c:1281
#15 0x80a8 in tcp_do_segment (m=0xfe0005701700,
th=0xfe0144913338, so=0xfe01449132a8, tp=0xfe0005908b70,
drop_hdrlen=52, tlen=1424, iptos=0 '\0', ti_locked=1)
at /usr/img/freebsd.9/sys/netinet/tcp_input.c:1860
#16 0x80a85219 in tcp_input (m=0xfe0005701700,
off0=value optimized out)
at /usr/img/freebsd.9/sys/netinet/tcp_input.c:1410
#17 0x80a155fa in ip_input (m=0xfe0005701700)
at /usr/img/freebsd.9/sys/netinet/ip_input.c:760
#18 0x809b7808 in netisr_dispatch_src (proto=1,
source=value optimized out, m=value optimized out)
at /usr/img/freebsd.9/sys/net/netisr.c:1013
#19 0x809ae3fd in ether_demux (ifp=0xfe00054f2800,
m=0xfe0005701700) at /usr/img/freebsd.9/sys/net/if_ethersubr.c:943
#20 0x809ae6de in ether_nh_input (m=value optimized out)
at /usr/img/freebsd.9/sys/net/if_ethersubr.c:762
#21 0x809b7808 in netisr_dispatch_src (proto=9,
source=value optimized out, m=value optimized out)
at /usr/img/freebsd.9/sys/net/netisr.c:1013
#22 0x809fdf7d in sta_input (ni=0xff8001f5d000,
m=0xfe0005701700, rssi=73, nf=-95)
at /usr/img/freebsd.9/sys/net80211/ieee80211_sta.c:827

svn commit: r269140 - head/cddl/contrib/dtracetoolkit

2014-07-26 Thread George V. Neville-Neil
Author: gnn
Date: Sat Jul 26 19:21:53 2014
New Revision: 269140
URL: http://svnweb.freebsd.org/changeset/base/269140

Log:
  Port the rwsnoop DTrace Toolkit script to FreeBSD.
  Remove dependency on the Korn Shell.
  Remove Zones in favor of Jails.
  Remove support (for now) for filename printing.

Modified:
  head/cddl/contrib/dtracetoolkit/rwsnoop

Modified: head/cddl/contrib/dtracetoolkit/rwsnoop
==
--- head/cddl/contrib/dtracetoolkit/rwsnoop Sat Jul 26 19:08:52 2014
(r269139)
+++ head/cddl/contrib/dtracetoolkit/rwsnoop Sat Jul 26 19:21:53 2014
(r269140)
@@ -1,10 +1,10 @@
-#!/usr/bin/ksh
+#!/bin/sh
 #
 # rwsnoop - snoop read/write events.
-#   Written using DTrace (Solaris 10 3/05).
+#   Originally written using DTrace (Solaris 10 3/05).
 #
 # This is measuring reads and writes at the application level. This matches
-# the syscalls read, write, pread and pwrite.
+# the syscalls read, and write.
 #
 # $Id: rwsnoop 3 2007-08-01 10:50:08Z brendan $
 #
@@ -12,15 +12,14 @@
 # 
 #  rwsnoop # default output
 #
-#  -j  # print project ID
 #  -P  # print parent process ID
 #  -t  # print timestamp, us
 #  -v  # print time, string
-#  -Z  # print zone ID
+#  -J  # print jail ID
 #  -n name # this process name only
 #  -p PID  # this PID only
 #  eg,
-#  rwsnoop -Z  # print zone ID
+#  rwsnoop -J  # print jail ID
 #  rwsnoop -n bash # monitor processes named bash
 #  rwsnoop  out.txt   # recommended
 #
@@ -32,8 +31,7 @@
 # FIELDS:
 #  TIMETimestamp, us
 #  TIMESTR Time, string
-#  ZONEZone ID
-#  PROJProject ID
+#  JAILJAIL ID
 #  UID User ID
 #  PID Process ID
 #  PPIDParent Process ID
@@ -71,6 +69,7 @@
 # 24-Jul-2005   Brendan Gregg   Created this.
 # 17-Sep-2005Increased switchrate.
 # 17-Sep-2005Last update.
+# 26-Jul-2014   George Neville-NeilPort to FreeBSD
 #
 
 
@@ -78,9 +77,11 @@
 # --- Process Arguments ---
 #
 
+set -x
+set -v
 ### default variables
-opt_name=0; opt_pid=0; opt_proj=0; opt_zone=0; opt_time=0; opt_timestr=0
-opt_bytes=1; filter=0; pname=.; pid=0; opt_ppid=0
+opt_name=0; opt_pid=0; opt_jailid=0; opt_time=0; opt_timestr=0
+opt_bytes=1; filter=0; pname=.; pid=0; opt_ppid=0;
 
 ### process options
 while getopts n:Pp:jtvZ name
@@ -89,23 +90,21 @@ do
n)  opt_name=1; pname=$OPTARG ;;
p)  opt_pid=1; pid=$OPTARG ;;
P)  opt_ppid=1 ;;
-   j)  opt_proj=1 ;;
t)  opt_time=1 ;;
v)  opt_timestr=1 ;;
-   Z)  opt_zone=1 ;;
+   J)  opt_jailid=1 ;;
h|?)cat -END 2
USAGE: rwsnoop [-jPtvZ] [-n name] [-p pid]
  
-   -j   # print project ID
-P   # print parent process ID
-t   # print timestamp, us
-v   # print time, string
-   -Z   # print zone ID
+   -J   # print jail ID
-n name  # this process name only
-p PID   # this PID only
   eg,
rwsnoop  # default output
-   rwsnoop -Z   # print zone ID
+   rwsnoop -J   # print jail ID
rwsnoop -n bash  # monitor processes named bash
END
exit 1
@@ -115,11 +114,13 @@ done
 shift $(( $OPTIND - 1 ))
 
 ### option logic
-if (( opt_name || opt_pid )); then
+if [ $opt_name -ne 0 ]; then
filter=1
 fi
 
-
+if [ $opt_pid -ne 0 ]; then
+   filter=1
+fi
 
 #
 # --- Main Program, DTrace ---
@@ -128,8 +129,7 @@ fi
  /*
   * Command line arguments
   */
- inline int OPT_proj   = '$opt_proj';
- inline int OPT_zone   = '$opt_zone';
+ inline int OPT_jailid = '$opt_jailid';
  inline int OPT_bytes  = '$opt_bytes';
  inline int OPT_name   = '$opt_name';
  inline int OPT_ppid   = '$opt_ppid';
@@ -151,8 +151,7 @@ fi
/* print header */
OPT_time? printf(%-14s , TIME) : 1;
OPT_timestr ? printf(%-20s , TIMESTR) : 1;
-   OPT_proj? printf(%5s , PROJ) : 1;
-   OPT_zone? printf(%5s , ZONE) : 1;
+   OPT_jailid? printf(%5s , JAILID) : 1;
OPT_ppid? printf(%6s , PPID) : 1;
printf(%5s %6s %-12s %1s %7s %s\n,
UID, PID, CMD, D, 

svn commit: r269141 - head/cddl/contrib/dtracetoolkit

2014-07-26 Thread George V. Neville-Neil
Author: gnn
Date: Sat Jul 26 19:25:52 2014
New Revision: 269141
URL: http://svnweb.freebsd.org/changeset/base/269141

Log:
  Remove debugging options from the rwsnoop script.

Modified:
  head/cddl/contrib/dtracetoolkit/rwsnoop

Modified: head/cddl/contrib/dtracetoolkit/rwsnoop
==
--- head/cddl/contrib/dtracetoolkit/rwsnoop Sat Jul 26 19:21:53 2014
(r269140)
+++ head/cddl/contrib/dtracetoolkit/rwsnoop Sat Jul 26 19:25:52 2014
(r269141)
@@ -77,8 +77,6 @@
 # --- Process Arguments ---
 #
 
-set -x
-set -v
 ### default variables
 opt_name=0; opt_pid=0; opt_jailid=0; opt_time=0; opt_timestr=0
 opt_bytes=1; filter=0; pname=.; pid=0; opt_ppid=0;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269142 - in head/sys: conf kern netinet

2014-07-26 Thread Marcel Moolenaar
Author: marcel
Date: Sat Jul 26 19:27:34 2014
New Revision: 269142
URL: http://svnweb.freebsd.org/changeset/base/269142

Log:
  The accept filter code is not specific to the FreeBSD IPv4 network stack,
  so it really should not be under optional inet. The fact that uipc_accf.c
  lives under kern/ lends some weight to making it a standard file.
  
  Moving kern/uipc_accf.c from optional inet to standard eliminates the
  need for #ifdef INET in kern/uipc_socket.c.
  
  Also, this meant the net.inet.accf.unloadable sysctl needed to move, as
  net.inet does not exist without networking compiled in (as it lives in
  netinet/in_proto.c.) The new sysctl has been named net.accf.unloadable.
  
  In order to support existing accept filter sysctls, the net.inet.accf node
  has been added netinet/in_proto.c.
  
  Submitted by: Steve Kiernan ste...@juniper.net
  Obtained from:Juniper Networks, Inc.

Modified:
  head/sys/conf/files
  head/sys/kern/uipc_accf.c
  head/sys/kern/uipc_socket.c
  head/sys/netinet/in_proto.c

Modified: head/sys/conf/files
==
--- head/sys/conf/files Sat Jul 26 19:25:52 2014(r269141)
+++ head/sys/conf/files Sat Jul 26 19:27:34 2014(r269142)
@@ -3017,7 +3017,7 @@ kern/tty_outq.c   standard
 kern/tty_pts.c standard
 kern/tty_tty.c standard
 kern/tty_ttydisc.c standard
-kern/uipc_accf.c   optional inet
+kern/uipc_accf.c   standard
 kern/uipc_debug.c  optional ddb
 kern/uipc_domain.c standard
 kern/uipc_mbuf.c   standard

Modified: head/sys/kern/uipc_accf.c
==
--- head/sys/kern/uipc_accf.c   Sat Jul 26 19:25:52 2014(r269141)
+++ head/sys/kern/uipc_accf.c   Sat Jul 26 19:27:34 2014(r269142)
@@ -60,9 +60,8 @@ MALLOC_DEFINE(M_ACCF, accf, accept fi
 
 static int unloadable = 0;
 
-SYSCTL_DECL(_net_inet);/* XXX: some header should do this for me */
-SYSCTL_NODE(_net_inet, OID_AUTO, accf, CTLFLAG_RW, 0, Accept filters);
-SYSCTL_INT(_net_inet_accf, OID_AUTO, unloadable, CTLFLAG_RW, unloadable, 0,
+SYSCTL_NODE(_net, OID_AUTO, accf, CTLFLAG_RW, 0, Accept filters);
+SYSCTL_INT(_net_accf, OID_AUTO, unloadable, CTLFLAG_RW, unloadable, 0,
Allow unload of accept filters (not recommended));
 
 /*

Modified: head/sys/kern/uipc_socket.c
==
--- head/sys/kern/uipc_socket.c Sat Jul 26 19:25:52 2014(r269141)
+++ head/sys/kern/uipc_socket.c Sat Jul 26 19:27:34 2014(r269142)
@@ -378,11 +378,9 @@ sodealloc(struct socket *so)
if (so-so_snd.sb_hiwat)
(void)chgsbsize(so-so_cred-cr_uidinfo,
so-so_snd.sb_hiwat, 0, RLIM_INFINITY);
-#ifdef INET
/* remove acccept filter if one is present. */
if (so-so_accf != NULL)
do_setopt_accept_filter(so, NULL);
-#endif
 #ifdef MAC
mac_socket_destroy(so);
 #endif
@@ -2402,13 +2400,12 @@ sosetopt(struct socket *so, struct socko
error = ENOPROTOOPT;
} else {
switch (sopt-sopt_name) {
-#ifdef INET
case SO_ACCEPTFILTER:
error = do_setopt_accept_filter(so, sopt);
if (error)
goto bad;
break;
-#endif
+
case SO_LINGER:
error = sooptcopyin(sopt, l, sizeof l, sizeof l);
if (error)
@@ -2635,11 +2632,10 @@ sogetopt(struct socket *so, struct socko
return (error);
} else {
switch (sopt-sopt_name) {
-#ifdef INET
case SO_ACCEPTFILTER:
error = do_getopt_accept_filter(so, sopt);
break;
-#endif
+
case SO_LINGER:
SOCK_LOCK(so);
l.l_onoff = so-so_options  SO_LINGER;

Modified: head/sys/netinet/in_proto.c
==
--- head/sys/netinet/in_proto.c Sat Jul 26 19:25:52 2014(r269141)
+++ head/sys/netinet/in_proto.c Sat Jul 26 19:27:34 2014(r269142)
@@ -394,3 +394,5 @@ SYSCTL_NODE(_net_inet, IPPROTO_IPCOMP,  i
 SYSCTL_NODE(_net_inet, IPPROTO_IPIP,   ipip,   CTLFLAG_RW, 0,  IPIP);
 #endif /* IPSEC */
 SYSCTL_NODE(_net_inet, IPPROTO_RAW,raw,CTLFLAG_RW, 0,  RAW);
+SYSCTL_NODE(_net_inet, OID_AUTO,   accf,   CTLFLAG_RW, 0,
+Accept filters);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269143 - head/usr.bin/elfdump

2014-07-26 Thread Andreas Tobler
Author: andreast
Date: Sat Jul 26 19:44:45 2014
New Revision: 269143
URL: http://svnweb.freebsd.org/changeset/base/269143

Log:
  Further improvements on elfdump, to follow up r269092:
  
  - Add ARM specific section header types.
  - Add SHT_GNU_HASH section header type.
  - Improve reporting of undefined tags in d_tags.
  - Add DT_GNU_HASH tag.
  
  Reviewed by:  emaste

Modified:
  head/usr.bin/elfdump/elfdump.c

Modified: head/usr.bin/elfdump/elfdump.c
==
--- head/usr.bin/elfdump/elfdump.c  Sat Jul 26 19:27:34 2014
(r269142)
+++ head/usr.bin/elfdump/elfdump.c  Sat Jul 26 19:44:45 2014
(r269143)
@@ -167,7 +167,10 @@ static int elf64_offsets[] = {
 
 /* http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#tag_encodings */
 static const char *
-d_tags(u_int64_t tag) {
+d_tags(u_int64_t tag)
+{
+   static char unknown_tag[48];
+
switch (tag) {
case 0: return DT_NULL;
case 1: return DT_NEEDED;
@@ -215,6 +218,7 @@ d_tags(u_int64_t tag) {
case 0x6dfe: return DT_SYMINSZ;
case 0x6dff: return DT_SYMINENT (DT_VALRNGHI);
case 0x6e00: return DT_ADDRRNGLO;
+   case 0x6ef5: return DT_GNU_HASH;
case 0x6ef8: return DT_GNU_CONFLICT;
case 0x6ef9: return DT_GNU_LIBLIST;
case 0x6efa: return DT_SUNW_CONFIG;
@@ -236,8 +240,10 @@ d_tags(u_int64_t tag) {
case 0x7ffd: return DT_SUNW_AUXILIARY;
case 0x7ffe: return DT_SUNW_USED;
case 0x7fff: return DT_SUNW_FILTER;
-   default: return ERROR: TAG NOT DEFINED;
}
+   snprintf(unknown_tag, sizeof(unknown_tag),
+   ERROR: TAG NOT DEFINED -- tag 0x%jx, (uintmax_t)tag);
+   return (unknown_tag);
 }
 
 static const char *
@@ -334,6 +340,7 @@ sh_types(uint64_t machine, uint64_t sht)
switch (sht) {
case 0x6ff0: return XXX:VERSYM;
case 0x6ff4: return SHT_SUNW_dof;
+   case 0x6ff6: return SHT_GNU_HASH;
case 0x6ff7: return SHT_GNU_LIBLIST;
case 0x6ffc: return XXX:VERDEF;
case 0x6ffd: return SHT_SUNW(GNU)_verdef;
@@ -347,6 +354,15 @@ sh_types(uint64_t machine, uint64_t sht)
} else if (sht  0x8000) {
/* 0x7000-0x7fff processor-specific semantics */
switch (machine) {
+   case EM_ARM:
+   switch (sht) {
+   case 0x7001: return SHT_ARM_EXIDX;
+   case 0x7002: return SHT_ARM_PREEMPTMAP;
+   case 0x7003: return SHT_ARM_ATTRIBUTES;
+   case 0x7004: return SHT_ARM_DEBUGOVERLAY;
+   case 0x7005: return SHT_ARM_OVERLAYSECTION;
+   }
+   break;
case EM_MIPS:
switch (sht) {
case 0x700d: return SHT_MIPS_OPTIONS;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r269143 - head/usr.bin/elfdump

2014-07-26 Thread Ian Lepore
On Sat, 2014-07-26 at 19:44 +, Andreas Tobler wrote:
 Author: andreast
 Date: Sat Jul 26 19:44:45 2014
 New Revision: 269143
 URL: http://svnweb.freebsd.org/changeset/base/269143
 
 Log:
   Further improvements on elfdump, to follow up r269092:
   
   - Add ARM specific section header types.
   - Add SHT_GNU_HASH section header type.
   - Improve reporting of undefined tags in d_tags.
   - Add DT_GNU_HASH tag.
   
   Reviewed by:emaste
 
 Modified:
   head/usr.bin/elfdump/elfdump.c
 
 Modified: head/usr.bin/elfdump/elfdump.c
 ==
 --- head/usr.bin/elfdump/elfdump.cSat Jul 26 19:27:34 2014
 (r269142)
 +++ head/usr.bin/elfdump/elfdump.cSat Jul 26 19:44:45 2014
 (r269143)
 @@ -167,7 +167,10 @@ static int elf64_offsets[] = {
  
  /* http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#tag_encodings 
 */
  static const char *
 -d_tags(u_int64_t tag) {
 +d_tags(u_int64_t tag)
 +{
 + static char unknown_tag[48];
 +
   switch (tag) {
   case 0: return DT_NULL;
   case 1: return DT_NEEDED;
 @@ -215,6 +218,7 @@ d_tags(u_int64_t tag) {
   case 0x6dfe: return DT_SYMINSZ;
   case 0x6dff: return DT_SYMINENT (DT_VALRNGHI);
   case 0x6e00: return DT_ADDRRNGLO;
 + case 0x6ef5: return DT_GNU_HASH;
   case 0x6ef8: return DT_GNU_CONFLICT;
   case 0x6ef9: return DT_GNU_LIBLIST;
   case 0x6efa: return DT_SUNW_CONFIG;
 @@ -236,8 +240,10 @@ d_tags(u_int64_t tag) {
   case 0x7ffd: return DT_SUNW_AUXILIARY;
   case 0x7ffe: return DT_SUNW_USED;
   case 0x7fff: return DT_SUNW_FILTER;
 - default: return ERROR: TAG NOT DEFINED;
   }
 + snprintf(unknown_tag, sizeof(unknown_tag),
 + ERROR: TAG NOT DEFINED -- tag 0x%jx, (uintmax_t)tag);
 + return (unknown_tag);
  }
  
  static const char *
 @@ -334,6 +340,7 @@ sh_types(uint64_t machine, uint64_t sht)
   switch (sht) {
   case 0x6ff0: return XXX:VERSYM;
   case 0x6ff4: return SHT_SUNW_dof;
 + case 0x6ff6: return SHT_GNU_HASH;
   case 0x6ff7: return SHT_GNU_LIBLIST;
   case 0x6ffc: return XXX:VERDEF;
   case 0x6ffd: return SHT_SUNW(GNU)_verdef;
 @@ -347,6 +354,15 @@ sh_types(uint64_t machine, uint64_t sht)
   } else if (sht  0x8000) {
   /* 0x7000-0x7fff processor-specific semantics */
   switch (machine) {
 + case EM_ARM:
 + switch (sht) {
 + case 0x7001: return SHT_ARM_EXIDX;
 + case 0x7002: return SHT_ARM_PREEMPTMAP;
 + case 0x7003: return SHT_ARM_ATTRIBUTES;
 + case 0x7004: return SHT_ARM_DEBUGOVERLAY;
 + case 0x7005: return SHT_ARM_OVERLAYSECTION;
 + }
 + break;
   case EM_MIPS:
   switch (sht) {
   case 0x700d: return SHT_MIPS_OPTIONS;
 

I'm curious why this code is all full of 0x numbers when there
are named constants defined for all this stuff.

-- Ian



___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269144 - head/cddl/contrib/dtracetoolkit

2014-07-26 Thread George V. Neville-Neil
Author: gnn
Date: Sat Jul 26 20:11:36 2014
New Revision: 269144
URL: http://svnweb.freebsd.org/changeset/base/269144

Log:
  Since we cannot yet display the name print the file descriptor so that
  it can be looked up manually using procstat(1).

Modified:
  head/cddl/contrib/dtracetoolkit/rwsnoop

Modified: head/cddl/contrib/dtracetoolkit/rwsnoop
==
--- head/cddl/contrib/dtracetoolkit/rwsnoop Sat Jul 26 19:44:45 2014
(r269143)
+++ head/cddl/contrib/dtracetoolkit/rwsnoop Sat Jul 26 20:11:36 2014
(r269144)
@@ -152,7 +152,7 @@ fi
OPT_jailid? printf(%5s , JAILID) : 1;
OPT_ppid? printf(%6s , PPID) : 1;
printf(%5s %6s %-12s %1s %7s %s\n,
-   UID, PID, CMD, D, BYTES, FILE);
+   UID, PID, CMD, FD, D, BYTES);
  }
 
  /*
@@ -221,8 +221,8 @@ fi
OPT_timestr ? printf(%-20Y , walltimestamp) : 1;
OPT_jailid? printf(%5d , curpsinfo-pr_jailid) : 1;
OPT_ppid? printf(%6d , ppid) : 1;
-   printf(%5d %6d %-12.12s %1s %7d \n,
-   uid, pid, execname, self-rw, (int)self-size);
+   printf(%5d %6d %-12.12s %4d %1s %7d\n,
+   uid, pid, execname, self-fd, self-rw, (int)self-size);

self-ok = 0;
self-fd = 0;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r269143 - head/usr.bin/elfdump

2014-07-26 Thread Andreas Tobler

On 26.07.14 22:00, Ian Lepore wrote:

On Sat, 2014-07-26 at 19:44 +, Andreas Tobler wrote:

Author: andreast
Date: Sat Jul 26 19:44:45 2014
New Revision: 269143
URL: http://svnweb.freebsd.org/changeset/base/269143

Log:
   Further improvements on elfdump, to follow up r269092:

   - Add ARM specific section header types.
   - Add SHT_GNU_HASH section header type.
   - Improve reporting of undefined tags in d_tags.
   - Add DT_GNU_HASH tag.

   Reviewed by: emaste

Modified:
   head/usr.bin/elfdump/elfdump.c

Modified: head/usr.bin/elfdump/elfdump.c
==
--- head/usr.bin/elfdump/elfdump.c  Sat Jul 26 19:27:34 2014
(r269142)
+++ head/usr.bin/elfdump/elfdump.c  Sat Jul 26 19:44:45 2014
(r269143)
@@ -167,7 +167,10 @@ static int elf64_offsets[] = {

  /* http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#tag_encodings */
  static const char *
-d_tags(u_int64_t tag) {
+d_tags(u_int64_t tag)
+{
+   static char unknown_tag[48];
+
switch (tag) {
case 0: return DT_NULL;
case 1: return DT_NEEDED;
@@ -215,6 +218,7 @@ d_tags(u_int64_t tag) {
case 0x6dfe: return DT_SYMINSZ;
case 0x6dff: return DT_SYMINENT (DT_VALRNGHI);
case 0x6e00: return DT_ADDRRNGLO;
+   case 0x6ef5: return DT_GNU_HASH;
case 0x6ef8: return DT_GNU_CONFLICT;
case 0x6ef9: return DT_GNU_LIBLIST;
case 0x6efa: return DT_SUNW_CONFIG;
@@ -236,8 +240,10 @@ d_tags(u_int64_t tag) {
case 0x7ffd: return DT_SUNW_AUXILIARY;
case 0x7ffe: return DT_SUNW_USED;
case 0x7fff: return DT_SUNW_FILTER;
-   default: return ERROR: TAG NOT DEFINED;
}
+   snprintf(unknown_tag, sizeof(unknown_tag),
+   ERROR: TAG NOT DEFINED -- tag 0x%jx, (uintmax_t)tag);
+   return (unknown_tag);
  }

  static const char *
@@ -334,6 +340,7 @@ sh_types(uint64_t machine, uint64_t sht)
switch (sht) {
case 0x6ff0: return XXX:VERSYM;
case 0x6ff4: return SHT_SUNW_dof;
+   case 0x6ff6: return SHT_GNU_HASH;
case 0x6ff7: return SHT_GNU_LIBLIST;
case 0x6ffc: return XXX:VERDEF;
case 0x6ffd: return SHT_SUNW(GNU)_verdef;
@@ -347,6 +354,15 @@ sh_types(uint64_t machine, uint64_t sht)
} else if (sht  0x8000) {
/* 0x7000-0x7fff processor-specific semantics */
switch (machine) {
+   case EM_ARM:
+   switch (sht) {
+   case 0x7001: return SHT_ARM_EXIDX;
+   case 0x7002: return SHT_ARM_PREEMPTMAP;
+   case 0x7003: return SHT_ARM_ATTRIBUTES;
+   case 0x7004: return SHT_ARM_DEBUGOVERLAY;
+   case 0x7005: return SHT_ARM_OVERLAYSECTION;
+   }
+   break;
case EM_MIPS:
switch (sht) {
case 0x700d: return SHT_MIPS_OPTIONS;



I'm curious why this code is all full of 0x numbers when there
are named constants defined for all this stuff.


No clue. I continued the used pattern.
It would make more sense to use the defines from elf_common.h, less 
error prone.


Andreas

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269145 - head/cddl/contrib/dtracetoolkit

2014-07-26 Thread George V. Neville-Neil
Author: gnn
Date: Sat Jul 26 20:42:54 2014
New Revision: 269145
URL: http://svnweb.freebsd.org/changeset/base/269145

Log:
  Update the header printing to match the rest of the output.
  
  Pointed out by: mdf

Modified:
  head/cddl/contrib/dtracetoolkit/rwsnoop

Modified: head/cddl/contrib/dtracetoolkit/rwsnoop
==
--- head/cddl/contrib/dtracetoolkit/rwsnoop Sat Jul 26 20:11:36 2014
(r269144)
+++ head/cddl/contrib/dtracetoolkit/rwsnoop Sat Jul 26 20:42:54 2014
(r269145)
@@ -151,7 +151,7 @@ fi
OPT_timestr ? printf(%-20s , TIMESTR) : 1;
OPT_jailid? printf(%5s , JAILID) : 1;
OPT_ppid? printf(%6s , PPID) : 1;
-   printf(%5s %6s %-12s %1s %7s %s\n,
+   printf(%5s %6s %-12s %4s %1s %7s\n,
UID, PID, CMD, FD, D, BYTES);
  }
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269146 - head/sys/contrib/dev/ath/ath_hal/ar9300

2014-07-26 Thread Adrian Chadd
Author: adrian
Date: Sat Jul 26 21:32:03 2014
New Revision: 269146
URL: http://svnweb.freebsd.org/changeset/base/269146

Log:
  store the AR9300 interrupts away when doing interrupt debugging.

Modified:
  head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_interrupts.c

Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_interrupts.c
==
--- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_interrupts.c Sat Jul 26 
20:42:54 2014(r269145)
+++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_interrupts.c Sat Jul 26 
21:32:03 2014(r269146)
@@ -142,6 +142,21 @@ ar9300_get_pending_interrupts(
 sync_en_def = AR9340_INTR_SYNC_DEFAULT;
 }
 
+/* Store away the async and sync cause registers */
+/* XXX Do this before the filtering done below */
+#ifdef AH_INTERRUPT_DEBUGGING
+   ah-ah_intrstate[0] = OS_REG_READ(ah, AR_ISR);
+   ah-ah_intrstate[1] = OS_REG_READ(ah, AR_ISR_S0);
+   ah-ah_intrstate[2] = OS_REG_READ(ah, AR_ISR_S1);
+   ah-ah_intrstate[3] = OS_REG_READ(ah, AR_ISR_S2);
+   ah-ah_intrstate[4] = OS_REG_READ(ah, AR_ISR_S3);
+   ah-ah_intrstate[5] = OS_REG_READ(ah, AR_ISR_S4);
+   ah-ah_intrstate[6] = OS_REG_READ(ah, AR_ISR_S5);
+
+   /* XXX double reading? */
+   ah-ah_syncstate = OS_REG_READ(ah, AR_HOSTIF_REG(ah, 
AR_INTR_SYNC_CAUSE));
+#endif
+
 sync_cause =
 OS_REG_READ(ah, AR_HOSTIF_REG(ah, AR_INTR_SYNC_CAUSE)) 
 (sync_en_def | AR_INTR_SYNC_MASK_GPIO);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269147 - head/sys/dev/etherswitch/arswitch

2014-07-26 Thread Adrian Chadd
Author: adrian
Date: Sat Jul 26 21:33:17 2014
New Revision: 269147
URL: http://svnweb.freebsd.org/changeset/base/269147

Log:
  Add another revision of the AR8327.

Modified:
  head/sys/dev/etherswitch/arswitch/arswitch.c

Modified: head/sys/dev/etherswitch/arswitch/arswitch.c
==
--- head/sys/dev/etherswitch/arswitch/arswitch.cSat Jul 26 21:32:03 
2014(r269146)
+++ head/sys/dev/etherswitch/arswitch/arswitch.cSat Jul 26 21:33:17 
2014(r269147)
@@ -135,6 +135,7 @@ arswitch_probe(device_t dev)
sc-sc_switchtype = AR8X16_SWITCH_AR8316;
break;
case 0x1202:
+   case 0x1204:
chipname = AR8327;
sc-sc_switchtype = AR8X16_SWITCH_AR8327;
sc-mii_lo_first = 1;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r269127 - head/sys/dev/usb/wlan

2014-07-26 Thread Adrian Chadd
On 26 July 2014 12:13, Hans Petter Selasky h...@selasky.org wrote:
 On 07/26/14 20:36, Adrian Chadd wrote:

 Hi,

 We should likely review how the PLCP bits are being used and why it's
 getting a rate of 0 in the first place.

 So, why's it getting a rate of 0 passed into the transmit path?



 Hi Adrian,

 Here is the backtrace of the panic:

 Fatal trap 18: integer divide fault while in kernel mode
 cpuid = 2; apic id = 02
 instruction pointer = 0x20:0x807826cf
 stack pointer   = 0x28:0xff8000305090
 frame pointer   = 0x28:0xff80003050a0
 code segment= base 0x0, limit 0xf, type 0x1b
 = DPL 0, pres 1, long 1, def32 0, gran 1
 processor eflags= interrupt enabled, resume, IOPL = 0
 current process = 15 (usbus0)
 trap number = 18
 panic: integer divide fault
 cpuid = 2
 KDB: stack backtrace:
 #0 0x809257e6 at kdb_backtrace+0x66
 #1 0x808eb3ae at panic+0x1ce
 #2 0x80cd2c30 at trap_fatal+0x290
 #3 0x80cd3480 at trap+0x250
 #4 0x80cbc783 at calltrap+0x8
 #5 0x80783d90 at ural_start+0x1d0
 #6 0x809aa2ea at if_transmit+0xea
 #7 0x809ef7b2 at ieee80211_start+0x542
 #8 0x809aa2ea at if_transmit+0xea
 #9 0x809ae8b3 at ether_output_frame+0x33
 #10 0x809aee30 at ether_output+0x530
 #11 0x80a186b4 at ip_output+0xd74
 #12 0x80a87d2a at tcp_output+0xfea
 #13 0x80a8 at tcp_do_segment+0xc02
 #14 0x80a85219 at tcp_input+0xa29
 #15 0x80a155fa at ip_input+0xaa
 #16 0x809b7808 at netisr_dispatch_src+0x218
 #17 0x809ae3fd at ether_demux+0x14d

Hm, so at some point that rate was not assigned to something. Can you
trace the ural_start path to see where it's supposed to be calculating
the rate?


-a
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r269148 - head/sys/mips/atheros

2014-07-26 Thread Adrian Chadd
Author: adrian
Date: Sun Jul 27 05:44:42 2014
New Revision: 269148
URL: http://svnweb.freebsd.org/changeset/base/269148

Log:
  Commit some sins in the name of oh god oh god I don't really want to
  be able to claim I know how the UART code works.
  
  * Just return 115200 as the current baud rate. I should cache it in the
device struct and return that but I'm lazy right now.
  * don't error out on other ioctl settings for now, just silently ignore them.
  * remove some code that was copied from the 8250 driver that isn't needed
any longer.
  
  Tested:
  
  * AR9331, Carambola-2 board.

Modified:
  head/sys/mips/atheros/uart_dev_ar933x.c

Modified: head/sys/mips/atheros/uart_dev_ar933x.c
==
--- head/sys/mips/atheros/uart_dev_ar933x.c Sat Jul 26 21:33:17 2014
(r269147)
+++ head/sys/mips/atheros/uart_dev_ar933x.c Sun Jul 27 05:44:42 2014
(r269148)
@@ -428,8 +428,6 @@ ar933x_bus_getsig(struct uart_softc *sc)
 
/*
 * For now, let's just return that DSR/DCD/CTS is asserted.
-*
-* XXX TODO: actually verify whether this is correct!
 */
SIGCHG(1, sig, SER_DSR, SER_DDSR);
SIGCHG(1, sig, SER_CTS, SER_DCTS);
@@ -441,80 +439,31 @@ ar933x_bus_getsig(struct uart_softc *sc)
return (sig);
 }
 
+/*
+ * XXX TODO: actually implement the rest of this!
+ */
 static int
 ar933x_bus_ioctl(struct uart_softc *sc, int request, intptr_t data)
 {
-#if 0
-   struct uart_bas *bas;
-   int baudrate, divisor, error;
-   uint8_t efr, lcr;
+   int error = 0;
 
-   bas = sc-sc_bas;
-   error = 0;
-   uart_lock(sc-sc_hwmtx);
+   /* XXX lock */
switch (request) {
case UART_IOCTL_BREAK:
-   lcr = uart_getreg(bas, REG_LCR);
-   if (data)
-   lcr |= LCR_SBREAK;
-   else
-   lcr = ~LCR_SBREAK;
-   uart_setreg(bas, REG_LCR, lcr);
-   uart_barrier(bas);
-   break;
case UART_IOCTL_IFLOW:
-   lcr = uart_getreg(bas, REG_LCR);
-   uart_barrier(bas);
-   uart_setreg(bas, REG_LCR, 0xbf);
-   uart_barrier(bas);
-   efr = uart_getreg(bas, REG_EFR);
-   if (data)
-   efr |= EFR_RTS;
-   else
-   efr = ~EFR_RTS;
-   uart_setreg(bas, REG_EFR, efr);
-   uart_barrier(bas);
-   uart_setreg(bas, REG_LCR, lcr);
-   uart_barrier(bas);
-   break;
case UART_IOCTL_OFLOW:
-   lcr = uart_getreg(bas, REG_LCR);
-   uart_barrier(bas);
-   uart_setreg(bas, REG_LCR, 0xbf);
-   uart_barrier(bas);
-   efr = uart_getreg(bas, REG_EFR);
-   if (data)
-   efr |= EFR_CTS;
-   else
-   efr = ~EFR_CTS;
-   uart_setreg(bas, REG_EFR, efr);
-   uart_barrier(bas);
-   uart_setreg(bas, REG_LCR, lcr);
-   uart_barrier(bas);
break;
case UART_IOCTL_BAUD:
-   lcr = uart_getreg(bas, REG_LCR);
-   uart_setreg(bas, REG_LCR, lcr | LCR_DLAB);
-   uart_barrier(bas);
-   divisor = uart_getreg(bas, REG_DLL) |
-   (uart_getreg(bas, REG_DLH)  8);
-   uart_barrier(bas);
-   uart_setreg(bas, REG_LCR, lcr);
-   uart_barrier(bas);
-   baudrate = (divisor  0) ? bas-rclk / divisor / 16 : 0;
-   if (baudrate  0)
-   *(int*)data = baudrate;
-   else
-   error = ENXIO;
+   *(int*)data = 115200;
break;
default:
error = EINVAL;
break;
}
-   uart_unlock(sc-sc_hwmtx);
+
+   /* XXX unlock */
+
return (error);
-#endif
-   return (ENXIO);
 }
 
 /*
@@ -581,6 +530,8 @@ ar933x_bus_ipend(struct uart_softc *sc)
 
/*
 * Only signal TX idle if we're not busy transmitting.
+*
+* XXX I never get _out_ of txbusy? Debug that!
 */
if (sc-sc_txbusy) {
if (isr  AR933X_UART_INT_TX_EMPTY) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org