svn commit: r204246 - head/sys/dev/isp

2010-02-23 Thread Matt Jacob
Author: mjacob
Date: Tue Feb 23 14:35:44 2010
New Revision: 204246
URL: http://svn.freebsd.org/changeset/base/204246

Log:
  xpt_rescan only honors a wildcard in the target field. Revert the previous
  change and have isp_make_here scan the whole bus which will then scan all
  luns.
  
  I think xpt_rescan needs to be fixed, but that's a separable issue.
  
  Suggested by: Alexander

Modified:
  head/sys/dev/isp/isp_freebsd.c

Modified: head/sys/dev/isp/isp_freebsd.c
==
--- head/sys/dev/isp/isp_freebsd.c  Tue Feb 23 09:58:12 2010
(r204245)
+++ head/sys/dev/isp/isp_freebsd.c  Tue Feb 23 14:35:44 2010
(r204246)
@@ -3892,7 +3892,12 @@ isp_make_here(ispsoftc_t *isp, int chan,
isp_prt(isp, ISP_LOGWARN, "Chan %d unable to alloc CCB for 
rescan", chan);
return;
}
-   if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, 
cam_sim_path(fc->sim), tgt, 0) != CAM_REQ_CMP) {
+   /*
+* xpt_rescan only honors wildcard in the target field. 
+* Scan the whole bus instead of target, which will then
+* force a scan of all luns.
+*/
+   if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, 
cam_sim_path(fc->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
isp_prt(isp, ISP_LOGWARN, "unable to create path for rescan");
xpt_free_ccb(ccb);
return;
___
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: r204103 - in head/usr.bin: . seq

2010-02-23 Thread Valentin Nechayev
 Sun, Feb 21, 2010 at 15:55:08, yanefbsd wrote about "Re: svn commit: r204103 - 
in head/usr.bin: . seq": 

> >>  Add seq(1), a small utility to generate sequence number.
> > Why do we need this when we have jot(1)?
> Agreed. FreeBSD isn't Linux (seq is a non-standard GNU tool).
> -Garrett

jot is non-standard in the same way. OTOH defining intervals in seq is much
easier to understand.


-netch-
___
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: r204247 - head/share/man/man4/man4.powerpc

2010-02-23 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Tue Feb 23 14:56:49 2010
New Revision: 204247
URL: http://svn.freebsd.org/changeset/base/204247

Log:
  Fix two bugs in this manpage: 'System' is not abbreviated with 'P',
  and a non-useful version of smu(4) was in 8.0, so modify the history
  to reflect that.
  
  Submitted by: gavin

Modified:
  head/share/man/man4/man4.powerpc/smu.4

Modified: head/share/man/man4/man4.powerpc/smu.4
==
--- head/share/man/man4/man4.powerpc/smu.4  Tue Feb 23 14:35:44 2010
(r204246)
+++ head/share/man/man4/man4.powerpc/smu.4  Tue Feb 23 14:56:49 2010
(r204247)
@@ -41,7 +41,7 @@ kernel configuration file:
 .Sh DESCRIPTION
 The
 .Nm
-driver provides support for the System Management Unit (PMU) found in many
+driver provides support for the System Management Unit (SMU) found in many
 Apple G5 systems.
 This includes most Power Macintosh G5 and all iMac G5 systems.
 .Pp
@@ -112,7 +112,7 @@ annunciator interface at
 The
 .Nm
 device driver appeared in
-.Fx 9.0 .
+.Fx 8.0 .
 .Sh AUTHORS
 .An -nosplit
 The
___
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: r204248 - head/sys/dev/syscons/snake

2010-02-23 Thread Ivan Voras
Author: ivoras
Date: Tue Feb 23 15:12:41 2010
New Revision: 204248
URL: http://svn.freebsd.org/changeset/base/204248

Log:
  Upgrade the "snake" syscons screensaver to the new, multimedia version!
  Now, with color! And system load averages!
  
  Amused by it: gnn

Modified:
  head/sys/dev/syscons/snake/snake_saver.c

Modified: head/sys/dev/syscons/snake/snake_saver.c
==
--- head/sys/dev/syscons/snake/snake_saver.cTue Feb 23 14:56:49 2010
(r204247)
+++ head/sys/dev/syscons/snake/snake_saver.cTue Feb 23 15:12:41 2010
(r204248)
@@ -36,6 +36,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 
@@ -48,11 +50,22 @@ static int  *messagep;
 static int messagelen;
 static int blanked;
 
+#define MSGBUF_LEN 70
+
+static int nofancy = 0;
+TUNABLE_INT("hw.syscons.saver_snake_nofancy", &nofancy);
+
+#define FANCY_SNAKE(!nofancy)
+#define LOAD_HIGH(ld)  (((ld * 100 + FSCALE / 2) >> FSHIFT) / 100)
+#define LOAD_LOW(ld)   (((ld * 100 + FSCALE / 2) >> FSHIFT) % 100)
+
+static inline void update_msg(void);
+
 static int
 snake_saver(video_adapter_t *adp, int blank)
 {
static int  dirx, diry;
-   int f;
+   int f, color, load;
sc_softc_t  *sc;
scr_stat*scp;
 
@@ -99,22 +112,52 @@ snake_saver(video_adapter_t *adp, int bl
(random() % 20) == 0)
diry = -diry;
savs[0] += dirx + diry;
+   if (FANCY_SNAKE) {
+   update_msg();
+   load = LOAD_HIGH(averunnable.ldavg[0]) * 100;
+   if (load == 0)
+   color = FG_LIGHTGREY | BG_BLACK;
+   else if (load / mp_ncpus <= 50)
+   color = FG_LIGHTGREEN | BG_BLACK;
+   else if (load / mp_ncpus <= 75)
+   color = FG_YELLOW | BG_BLACK;
+   else if (load / mp_ncpus <= 99)
+   color = FG_LIGHTRED | BG_BLACK;
+   else
+   color = FG_RED | FG_BLINK | BG_BLACK;
+   } else
+   color = FG_LIGHTGREY | BG_BLACK;
+
for (f=messagelen-1; f>=0; f--)
sc_vtb_putc(&scp->scr, savs[f], sc->scr_map[save[f]],
-   (FG_LIGHTGREY | BG_BLACK) << 8);
+   color << 8);
} else
blanked = 0;
 
return 0;
 }
 
+static inline void
+update_msg(void)
+{
+   if (!FANCY_SNAKE) {
+   messagelen = sprintf(message, "%s %s", ostype, osrelease);
+   return;
+   }
+   messagelen = snprintf(message, MSGBUF_LEN,
+   "%s %s (%d.%02d %d.%02d, %d.%02d)",
+   ostype, osrelease,
+   LOAD_HIGH(averunnable.ldavg[0]), LOAD_LOW(averunnable.ldavg[0]),
+   LOAD_HIGH(averunnable.ldavg[1]), LOAD_LOW(averunnable.ldavg[1]),
+   LOAD_HIGH(averunnable.ldavg[2]), LOAD_LOW(averunnable.ldavg[2]));
+}
+
 static int
 snake_init(video_adapter_t *adp)
 {
-   messagelen = strlen(ostype) + 1 + strlen(osrelease);
-   message = malloc(messagelen + 1, M_DEVBUF, M_WAITOK);
-   sprintf(message, "%s %s", ostype, osrelease);
-   messagep = malloc(messagelen * sizeof *messagep, M_DEVBUF, M_WAITOK);
+   message = malloc(MSGBUF_LEN, M_DEVBUF, M_WAITOK);
+   messagep = malloc(MSGBUF_LEN * sizeof *messagep, M_DEVBUF, M_WAITOK);
+   update_msg();
return 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: r204249 - head/sys/dev/syscons/snake

2010-02-23 Thread Ivan Voras
Author: ivoras
Date: Tue Feb 23 15:27:07 2010
New Revision: 204249
URL: http://svn.freebsd.org/changeset/base/204249

Log:
  The New and Improved snake_server - Service Pack 1: now even more
  sensitive to load average variations!

Modified:
  head/sys/dev/syscons/snake/snake_saver.c

Modified: head/sys/dev/syscons/snake/snake_saver.c
==
--- head/sys/dev/syscons/snake/snake_saver.cTue Feb 23 15:12:41 2010
(r204248)
+++ head/sys/dev/syscons/snake/snake_saver.cTue Feb 23 15:27:07 2010
(r204249)
@@ -114,7 +114,7 @@ snake_saver(video_adapter_t *adp, int bl
savs[0] += dirx + diry;
if (FANCY_SNAKE) {
update_msg();
-   load = LOAD_HIGH(averunnable.ldavg[0]) * 100;
+   load = ((averunnable.ldavg[0] * 100 + FSCALE / 2) >> 
FSHIFT);
if (load == 0)
color = FG_LIGHTGREY | BG_BLACK;
else if (load / mp_ncpus <= 50)
___
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: r204250 - head/sys/dev/ata

2010-02-23 Thread Alexander Motin
Author: mav
Date: Tue Feb 23 16:39:53 2010
New Revision: 204250
URL: http://svn.freebsd.org/changeset/base/204250

Log:
  Fix recursive lock attempt on hot-plug event in non-ATA_CAM mode.

Modified:
  head/sys/dev/ata/ata-all.c

Modified: head/sys/dev/ata/ata-all.c
==
--- head/sys/dev/ata/ata-all.c  Tue Feb 23 15:27:07 2010(r204249)
+++ head/sys/dev/ata/ata-all.c  Tue Feb 23 16:39:53 2010(r204250)
@@ -289,15 +289,13 @@ static void
 ata_conn_event(void *context, int dummy)
 {
device_t dev = (device_t)context;
-   struct ata_channel *ch = device_get_softc(dev);
 #ifdef ATA_CAM
+   struct ata_channel *ch = device_get_softc(dev);
union ccb *ccb;
-#endif
 
mtx_lock(&ch->state_mtx);
ata_reinit(dev);
mtx_unlock(&ch->state_mtx);
-#ifdef ATA_CAM
if ((ccb = xpt_alloc_ccb()) == NULL)
return;
if (xpt_create_path(&ccb->ccb_h.path, NULL,
@@ -307,6 +305,8 @@ ata_conn_event(void *context, int dummy)
return;
}
xpt_rescan(ccb);
+#else
+   ata_reinit(dev);
 #endif
 }
 
___
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: r204251 - stable/8/sys/cddl/boot/zfs

2010-02-23 Thread Pawel Jakub Dawidek
Author: pjd
Date: Tue Feb 23 16:46:34 2010
New Revision: 204251
URL: http://svn.freebsd.org/changeset/base/204251

Log:
  MFC r201684.
  
  Teach the (gpt)zfsboot and zfsloader raidz code to use its buffers
  more efficiently.
  
  Before this patch, in the worst case memory use would increase
  exponentially on the number of drives in the raidz vdev.
  
  Submitted by: Matt Reimer 
  Sponsored by: VPOP Technologies, Inc.
  Silence from: dfr

Modified:
  stable/8/sys/cddl/boot/zfs/zfssubr.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/   (props changed)

Modified: stable/8/sys/cddl/boot/zfs/zfssubr.c
==
--- stable/8/sys/cddl/boot/zfs/zfssubr.cTue Feb 23 16:39:53 2010
(r204250)
+++ stable/8/sys/cddl/boot/zfs/zfssubr.cTue Feb 23 16:46:34 2010
(r204251)
@@ -454,7 +454,7 @@ vdev_raidz_reconstruct_q(raidz_col_t *co
 
 static void
 vdev_raidz_reconstruct_pq(raidz_col_t *cols, int nparity, int acols,
-int x, int y)
+int x, int y, void *temp_p, void *temp_q)
 {
uint8_t *p, *q, *pxy, *qxy, *xd, *yd, tmp, a, b, aexp, bexp;
void *pdata, *qdata;
@@ -478,10 +478,8 @@ vdev_raidz_reconstruct_pq(raidz_col_t *c
xsize = cols[x].rc_size;
ysize = cols[y].rc_size;
 
-   cols[VDEV_RAIDZ_P].rc_data =
-   zfs_alloc_temp(cols[VDEV_RAIDZ_P].rc_size);
-   cols[VDEV_RAIDZ_Q].rc_data =
-   zfs_alloc_temp(cols[VDEV_RAIDZ_Q].rc_size);
+   cols[VDEV_RAIDZ_P].rc_data = temp_p;
+   cols[VDEV_RAIDZ_Q].rc_data = temp_q;
cols[x].rc_size = 0;
cols[y].rc_size = 0;
 
@@ -551,9 +549,12 @@ vdev_raidz_read(vdev_t *vdev, const blkp
uint64_t f = b % dcols;
uint64_t o = (b / dcols) << unit_shift;
uint64_t q, r, coff;
-   int c, c1, bc, col, acols, devidx, asize, n;
+   int c, c1, bc, col, acols, devidx, asize, n, max_rc_size;
static raidz_col_t cols[16];
raidz_col_t *rc, *rc1;
+   void *orig, *orig1, *temp_p, *temp_q;
+
+   orig = orig1 = temp_p = temp_q = NULL;
 
q = s / (dcols - nparity);
r = s - q * (dcols - nparity);
@@ -561,6 +562,7 @@ vdev_raidz_read(vdev_t *vdev, const blkp
 
acols = (q == 0 ? bc : dcols);
asize = 0;
+   max_rc_size = 0;

for (c = 0; c < acols; c++) {
col = f + c;
@@ -577,6 +579,8 @@ vdev_raidz_read(vdev_t *vdev, const blkp
cols[c].rc_tried = 0;
cols[c].rc_skipped = 0;
asize += cols[c].rc_size;
+   if (cols[c].rc_size > max_rc_size)
+   max_rc_size = cols[c].rc_size;
}
 
asize = roundup(asize, (nparity + 1) << unit_shift);
@@ -777,8 +781,13 @@ reconstruct:
//ASSERT(c != acols);
//ASSERT(!rc->rc_skipped || rc->rc_error == ENXIO || 
rc->rc_error == ESTALE);
 
+   if (temp_p == NULL)
+   temp_p = zfs_alloc_temp(max_rc_size);
+   if (temp_q == NULL)
+   temp_q = zfs_alloc_temp(max_rc_size);
+
vdev_raidz_reconstruct_pq(cols, nparity, acols,
-   c1, c);
+   c1, c, temp_p, temp_q);
 
if (zio_checksum_error(bp, buf) == 0)
return (0);
@@ -845,18 +854,12 @@ reconstruct:
return (EIO);
}
 
-   asize = 0;
-   for (c = 0; c < acols; c++) {
-   rc = &cols[c];
-   if (rc->rc_size > asize)
-   asize = rc->rc_size;
-   }
if (cols[VDEV_RAIDZ_P].rc_error == 0) {
/*
 * Attempt to reconstruct the data from parity P.
 */
-   void *orig;
-   orig = zfs_alloc_temp(asize);
+   if (orig == NULL)
+   orig = zfs_alloc_temp(max_rc_size);
for (c = nparity; c < acols; c++) {
rc = &cols[c];
 
@@ -874,8 +877,8 @@ reconstruct:
/*
 * Attempt to reconstruct the data from parity Q.
 */
-   void *orig;
-   orig = zfs_alloc_temp(asize);
+   if (orig == NULL)
+   orig = zfs_alloc_temp(max_rc_size);
for (c = nparity; c < acols; c++) {
rc = &cols[c];
 
@@ -895,9 +898,14 @@ reconstruct:
/*
 * Attempt to reconstruct the data from both P and Q.
 */
-   void *orig, *orig1;
-   

svn commit: r204252 - in stable/7/sys: cam dev/isp

2010-02-23 Thread Matt Jacob
Author: mjacob
Date: Tue Feb 23 18:37:21 2010
New Revision: 204252
URL: http://svn.freebsd.org/changeset/base/204252

Log:
  MFC 196008 196162 197214 197372 197373
  MFC 198822 200089 201325 201408 202418
  MFC 203444 203463 203478 204050
  
  Move back into RELENG_7 the current state of isp.

Deleted:
  stable/7/sys/dev/isp/isp_tpublic.h
Modified:
  stable/7/sys/cam/cam_ccb.h
  stable/7/sys/cam/cam_xpt.c
  stable/7/sys/dev/isp/isp.c
  stable/7/sys/dev/isp/isp_freebsd.c
  stable/7/sys/dev/isp/isp_freebsd.h
  stable/7/sys/dev/isp/isp_ioctl.h
  stable/7/sys/dev/isp/isp_library.c
  stable/7/sys/dev/isp/isp_library.h
  stable/7/sys/dev/isp/isp_pci.c
  stable/7/sys/dev/isp/isp_sbus.c
  stable/7/sys/dev/isp/isp_stds.h
  stable/7/sys/dev/isp/isp_target.c
  stable/7/sys/dev/isp/isp_target.h
  stable/7/sys/dev/isp/ispmbox.h
  stable/7/sys/dev/isp/ispreg.h
  stable/7/sys/dev/isp/ispvar.h
Directory Properties:
  stable/7/sbin/geom/   (props changed)
  stable/7/sbin/geom/class/label/   (props changed)
  stable/7/sbin/geom/class/part/   (props changed)
  stable/7/sbin/geom/class/stripe/   (props changed)
  stable/7/sbin/geom/misc/   (props changed)
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/cam/cam_ccb.h
==
--- stable/7/sys/cam/cam_ccb.h  Tue Feb 23 16:46:34 2010(r204251)
+++ stable/7/sys/cam/cam_ccb.h  Tue Feb 23 18:37:21 2010(r204252)
@@ -170,6 +170,15 @@ typedef enum {
 * volume size.
 */
 
+   XPT_GET_SIM_KNOB= 0x18,
+   /*
+* Get SIM specific knob values.
+*/
+
+   XPT_SET_SIM_KNOB= 0x19,
+   /*
+* Set SIM specific knob values.
+*/
 /* HBA engine commands 0x20->0x2F */
XPT_ENG_INQ = 0x20 | XPT_FC_XPT_ONLY,
/* HBA engine feature inquiry */
@@ -186,8 +195,12 @@ typedef enum {
XPT_CONT_TARGET_IO  = 0x33 | XPT_FC_DEV_QUEUED,
/* Continue Host Target I/O Connection */
XPT_IMMED_NOTIFY= 0x34 | XPT_FC_QUEUED | XPT_FC_USER_CCB,
-   /* Notify Host Target driver of event */
+   /* Notify Host Target driver of event 
(obsolete) */
XPT_NOTIFY_ACK  = 0x35,
+   /* Acknowledgement of event (obsolete) */
+   XPT_IMMEDIATE_NOTIFY= 0x36 | XPT_FC_QUEUED | XPT_FC_USER_CCB,
+   /* Notify Host Target driver of event */
+   XPT_NOTIFY_ACKNOWLEDGE  = 0x37 | XPT_FC_QUEUED | XPT_FC_USER_CCB,
/* Acknowledgement of event */
 
 /* Vendor Unique codes: 0x80->0x8F */
@@ -521,12 +534,14 @@ typedef enum {
 struct ccb_pathinq_settings_spi {
u_int8_t ppr_options;
 };
+
 struct ccb_pathinq_settings_fc {
u_int64_t wwnn; /* world wide node name */
u_int64_t wwpn; /* world wide port name */
u_int32_t port; /* 24 bit port id, if known */
u_int32_t bitrate;  /* Mbps */
 };
+
 struct ccb_pathinq_settings_sas {
u_int32_t bitrate;  /* Mbps */
 };
@@ -645,6 +660,7 @@ struct ccb_relsim {
  * Definitions for the asynchronous callback CCB fields.
  */
 typedef enum {
+   AC_CONTRACT = 0x1000,/* A contractual callback */
AC_GETDEV_CHANGED   = 0x800,/* Getdev info might have changed */
AC_INQ_CHANGED  = 0x400,/* Inquiry info might have changed */
AC_TRANSFER_NEG = 0x200,/* New transfer settings in effect */
@@ -661,6 +677,26 @@ typedef enum {
 typedef void ac_callback_t (void *softc, u_int32_t code,
struct cam_path *path, void *args);
 
+/*
+ * Generic Asynchronous callbacks.
+ *
+ * Generic arguments passed bac which are then interpreted between a per-system
+ * contract number.
+ */
+#defineAC_CONTRACT_DATA_MAX (128 - sizeof (u_int64_t))
+struct ac_contract {
+   u_int64_t   contract_number;
+   u_int8_tcontract_data[AC_CONTRACT_DATA_MAX];
+};
+
+#defineAC_CONTRACT_DEV_CHG 1
+struct ac_device_changed {
+   u_int64_t   wwpn;
+   u_int32_t   port;
+   target_id_t target;
+   u_int8_tarrived;
+};
+
 /* Set Asynchronous Callback CCB */
 struct ccb_setasync {
struct ccb_hdr   ccb_h;
@@ -782,6 +818,50 @@ struct ccb_calc_geometry {
 };
 
 /*
+ * Set or get SIM (and transport) specific knobs
+ */
+
+#defineKNOB_VALID_ADDRESS  0x1
+#defineKNOB_VALID_ROLE 0x2
+
+
+#defineKNOB_ROLE_NONE

svn commit: r204253 - head/sys/cam

2010-02-23 Thread Alexander Motin
Author: mav
Date: Tue Feb 23 18:42:07 2010
New Revision: 204253
URL: http://svn.freebsd.org/changeset/base/204253

Log:
  Make xpt_rescan() more correct, as it was before r197208: do not use
  XPT_SCAN_LUN for wildcard LUN, fall back to XPT_SCAN_BUS.

Modified:
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/cam_xpt.c
==
--- head/sys/cam/cam_xpt.c  Tue Feb 23 18:37:21 2010(r204252)
+++ head/sys/cam/cam_xpt.c  Tue Feb 23 18:42:07 2010(r204253)
@@ -866,7 +866,8 @@ xpt_rescan(union ccb *ccb)
struct ccb_hdr *hdr;
 
/* Prepare request */
-   if(ccb->ccb_h.path->target->target_id == CAM_TARGET_WILDCARD)
+   if (ccb->ccb_h.path->target->target_id == CAM_TARGET_WILDCARD ||
+   ccb->ccb_h.path->device->lun_id == CAM_LUN_WILDCARD)
ccb->ccb_h.func_code = XPT_SCAN_BUS;
else
ccb->ccb_h.func_code = XPT_SCAN_LUN;
___
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: r204254 - stable/7/share/man/man4

2010-02-23 Thread Gavin Atkinson
Author: gavin
Date: Tue Feb 23 19:34:22 2010
New Revision: 204254
URL: http://svn.freebsd.org/changeset/base/204254

Log:
  Merge r203620,203621 from head:
  
Document support for the D-Link DFE520-TX card (supported with the vr(4)
driver)
  
  PR:   kern/135989
  Submitted by: "Rashid N. Achilov"  citycat4 ngs.ru

Modified:
  stable/7/share/man/man4/vr.4
Directory Properties:
  stable/7/share/man/man4/   (props changed)

Modified: stable/7/share/man/man4/vr.4
==
--- stable/7/share/man/man4/vr.4Tue Feb 23 18:42:07 2010
(r204253)
+++ stable/7/share/man/man4/vr.4Tue Feb 23 19:34:22 2010
(r204254)
@@ -30,7 +30,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 11, 2008
+.Dd February 7, 2010
 .Dt VR 4
 .Os
 .Sh NAME
@@ -130,6 +130,8 @@ Fast Ethernet adapters including:
 .It
 AOpen/Acer ALN-320
 .It
+D-Link DFE520-TX
+.It
 D-Link DFE530-TX
 .It
 Hawking Technologies PN102TX
___
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: r204255 - stable/7/lib/libc/gen

2010-02-23 Thread Gavin Atkinson
Author: gavin
Date: Tue Feb 23 19:37:00 2010
New Revision: 204255
URL: http://svn.freebsd.org/changeset/base/204255

Log:
  Merge r203393,r203395 from head:
  
The multiplicand a = 0x5deece66d = 25214903917, not 0xfdeece66d.
This bug in the man page has gone unnoticed for over 15 years!
  
  PR:   docs/143461
  Submitted by: Jeremy Huddleston  jeremyhu apple.com

Modified:
  stable/7/lib/libc/gen/rand48.3
Directory Properties:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/stdtime/   (props changed)

Modified: stable/7/lib/libc/gen/rand48.3
==
--- stable/7/lib/libc/gen/rand48.3  Tue Feb 23 19:34:22 2010
(r204254)
+++ stable/7/lib/libc/gen/rand48.3  Tue Feb 23 19:37:00 2010
(r204255)
@@ -12,7 +12,7 @@
 .\" @(#)rand48.3 V1.0 MB 8 Oct 1993
 .\" $FreeBSD$
 .\"
-.Dd October 8, 1993
+.Dd February 2, 2010
 .Dt RAND48 3
 .Os
 .Sh NAME
@@ -57,7 +57,7 @@ The
 particular formula employed is
 r(n+1) = (a * r(n) + c) mod m
 where the default values are
-for the multiplicand a = 0xfdeece66d = 25214903917 and
+for the multiplicand a = 0x5deece66d = 25214903917 and
 the addend c = 0xb = 11.
 The modulo is always fixed at m = 2 ** 48.
 r(n) is called the seed of the random number generator.
___
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: r204256 - head/sys/dev/bwn

2010-02-23 Thread Weongyo Jeong
Author: weongyo
Date: Tue Feb 23 19:44:51 2010
New Revision: 204256
URL: http://svn.freebsd.org/changeset/base/204256

Log:
  fixes a compile error; invalid type argument of '->'.

Modified:
  head/sys/dev/bwn/if_bwn.c

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Tue Feb 23 19:37:00 2010(r204255)
+++ head/sys/dev/bwn/if_bwn.c   Tue Feb 23 19:44:51 2010(r204256)
@@ -5969,7 +5969,7 @@ bwn_lo_write(struct bwn_mac *mac, struct
 {
uint16_t value;
 
-   KASSERT(mac->mac_phy->type == BWN_PHYTYPE_G,
+   KASSERT(mac->mac_phy.type == BWN_PHYTYPE_G,
("%s:%d: fail", __func__, __LINE__));
 
value = (uint8_t) (ctl->q);
___
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: r204257 - head/sys/dev/bwn

2010-02-23 Thread Weongyo Jeong
Author: weongyo
Date: Tue Feb 23 19:55:54 2010
New Revision: 204257
URL: http://svn.freebsd.org/changeset/base/204257

Log:
  o adds sysctl variables to show device statistics.
  o records RTS success/fail statistics.
  
  Pointed by:   imp

Modified:
  head/sys/dev/bwn/if_bwn.c
  head/sys/dev/bwn/if_bwnvar.h

Modified: head/sys/dev/bwn/if_bwn.c
==
--- head/sys/dev/bwn/if_bwn.c   Tue Feb 23 19:44:51 2010(r204256)
+++ head/sys/dev/bwn/if_bwn.c   Tue Feb 23 19:55:54 2010(r204257)
@@ -536,6 +536,7 @@ static void bwn_phy_lp_gaintbl_write_r2(
struct bwn_txgain_entry);
 static voidbwn_phy_lp_gaintbl_write_r01(struct bwn_mac *, int,
struct bwn_txgain_entry);
+static voidbwn_sysctl_node(struct bwn_softc *);
 
 static struct resource_spec bwn_res_spec_legacy[] = {
{ SYS_RES_IRQ,  0,  RF_ACTIVE | RF_SHAREABLE },
@@ -1066,9 +1067,6 @@ bwn_attach_post(struct bwn_softc *sc)
struct ifnet *ifp = sc->sc_ifp;
struct siba_dev_softc *sd = sc->sc_sd;
struct siba_sprom *sprom = &sd->sd_bus->siba_sprom;
-#ifdef BWN_DEBUG
-   device_t dev = sc->sc_dev;
-#endif
 
ic = ifp->if_l2com;
ic->ic_ifp = ifp;
@@ -1117,11 +1115,7 @@ bwn_attach_post(struct bwn_softc *sc)
&sc->sc_rx_th.wr_ihdr, sizeof(sc->sc_rx_th),
BWN_RX_RADIOTAP_PRESENT);
 
-#ifdef BWN_DEBUG
-   SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
-   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
-   "debug", CTLFLAG_RW, &sc->sc_debug, 0, "Debug flags");
-#endif
+   bwn_sysctl_node(sc);
 
if (bootverbose)
ieee80211_announce(ic);
@@ -9077,6 +9071,7 @@ bwn_handle_txeof(struct bwn_mac *mac, co
struct bwn_pio_txqueue *tq;
struct bwn_pio_txpkt *tp = NULL;
struct bwn_softc *sc = mac->mac_sc;
+   struct bwn_stats *stats = &mac->mac_stats;
struct ieee80211_node *ni;
int slot;
 
@@ -9088,9 +9083,9 @@ bwn_handle_txeof(struct bwn_mac *mac, co
device_printf(sc->sc_dev, "TODO: STATUS AMPDU\n");
if (status->rtscnt) {
if (status->rtscnt == 0xf)
-   device_printf(sc->sc_dev, "TODO: RTS fail\n");
+   stats->rtsfail++;
else
-   device_printf(sc->sc_dev, "TODO: RTS ok\n");
+   stats->rts++;
}
 
if (mac->mac_flags & BWN_MAC_FLAG_DMA) {
@@ -14286,6 +14281,36 @@ bwn_phy_lp_gaintbl_write_r01(struct bwn_
 }
 
 static void
+bwn_sysctl_node(struct bwn_softc *sc)
+{
+   device_t dev = sc->sc_dev;
+   struct bwn_mac *mac;
+   struct bwn_stats *stats;
+
+   /* XXX assume that count of MAC is only 1. */
+
+   if ((mac = sc->sc_curmac) == NULL)
+   return;
+   stats = &mac->mac_stats;
+
+   SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+   "linknoise", CTLFLAG_RW, &stats->rts, 0, "Noise level");
+   SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+   "rts", CTLFLAG_RW, &stats->rts, 0, "RTS");
+   SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+   "rtsfail", CTLFLAG_RW, &stats->rtsfail, 0, "RTS failed to send");
+
+#ifdef BWN_DEBUG
+   SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev),
+   SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+   "debug", CTLFLAG_RW, &sc->sc_debug, 0, "Debug flags");
+#endif
+}
+
+static void
 bwn_identify(driver_t *driver, device_t parent)
 {
 

Modified: head/sys/dev/bwn/if_bwnvar.h
==
--- head/sys/dev/bwn/if_bwnvar.hTue Feb 23 19:44:51 2010
(r204256)
+++ head/sys/dev/bwn/if_bwnvar.hTue Feb 23 19:55:54 2010
(r204257)
@@ -515,6 +515,8 @@ struct bwn_tx_radiotap_header {
 };
 
 struct bwn_stats {
+   int32_t rtsfail;
+   int32_t rts;
int32_t link_noise;
 };
 
___
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: r204258 - stable/7/share/man/man9

2010-02-23 Thread Gavin Atkinson
Author: gavin
Date: Tue Feb 23 20:28:15 2010
New Revision: 204258
URL: http://svn.freebsd.org/changeset/base/204258

Log:
  Merge r203636 from head:
  
Correct arguments to free_unr(), "item" was missing.

Modified:
  stable/7/share/man/man9/alloc_unr.9
Directory Properties:
  stable/7/share/man/man9/   (props changed)

Modified: stable/7/share/man/man9/alloc_unr.9
==
--- stable/7/share/man/man9/alloc_unr.9 Tue Feb 23 19:55:54 2010
(r204257)
+++ stable/7/share/man/man9/alloc_unr.9 Tue Feb 23 20:28:15 2010
(r204258)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 23, 2005
+.Dd February 7, 2010
 .Dt ALLOC_UNR 9
 .Os
 .Sh NAME
@@ -81,7 +81,7 @@ is returned.
 Same as
 .Fn alloc_unr
 except that mutex is assumed to be already locked and thus is not used.
-.It Fn free_unr uh
+.It Fn free_unr uh item
 Free a previously allocated unit number.
 This function may require allocating memory, and thus it can sleep.
 There is no pre-locked variant.
___
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: r204260 - stable/7/games/fortune/datfiles

2010-02-23 Thread Gavin Atkinson
Author: gavin
Date: Tue Feb 23 21:15:05 2010
New Revision: 204260
URL: http://svn.freebsd.org/changeset/base/204260

Log:
  Merge r202115 from head:
  
Our standard "xterm" termcap entry supports colour, so this tip is 
redundant.
As it happens, "xterm-color" has just been an alias for "xterm" since
src/share/termcap/termcap.src 1.131 in September 2002.
  
  PR:   docs/132959

Modified:
  stable/7/games/fortune/datfiles/freebsd-tips   (contents, props changed)
Directory Properties:
  stable/7/games/fortune/   (props changed)
  stable/7/games/fortune/datfiles/   (props changed)
  stable/7/games/fortune/fortune/   (props changed)

Modified: stable/7/games/fortune/datfiles/freebsd-tips
==
--- stable/7/games/fortune/datfiles/freebsd-tipsTue Feb 23 21:13:48 
2010(r204259)
+++ stable/7/games/fortune/datfiles/freebsd-tipsTue Feb 23 21:15:05 
2010(r204260)
@@ -50,18 +50,6 @@ If you are in the C shell and have just 
 be able to run it unless you first type "rehash".
-- Dru 
 %
-If you are running xterm, the default TERM variable will be 'xterm'.  If you
-set this environment variable to 'xterm-color' instead, a lot of programs will
-use colors.  You can do this by
-
-   TERM=xterm-color; export TERM
-
-in Bourne-derived shells, and
-
-   setenv TERM xterm-color
-
-in csh-derived shells.
-%
 If you do not want to get beeps in X11 (X Windows), you can turn them off with
 
xset b off
___
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: r204264 - head/sys/dev/aac

2010-02-23 Thread Ed Maste
Author: emaste
Date: Tue Feb 23 21:41:13 2010
New Revision: 204264
URL: http://svn.freebsd.org/changeset/base/204264

Log:
  Minor diff reduction with Adaptec's driver: in aac_release_command() set
  cm_queue to AAC_ADAP_NORM_CMD_QUEUE by default.  In every place it was set,
  it was set to AAC_ADAP_NORM_CMD_QUEUE anyhow.

Modified:
  head/sys/dev/aac/aac.c
  head/sys/dev/aac/aac_cam.c

Modified: head/sys/dev/aac/aac.c
==
--- head/sys/dev/aac/aac.c  Tue Feb 23 21:39:11 2010(r204263)
+++ head/sys/dev/aac/aac.c  Tue Feb 23 21:41:13 2010(r204264)
@@ -1195,7 +1195,6 @@ aac_bio_command(struct aac_softc *sc, st
cm->cm_complete = aac_bio_complete;
cm->cm_private = bp;
cm->cm_timestamp = time_uptime;
-   cm->cm_queue = AAC_ADAP_NORM_CMD_QUEUE;
 
/* build the FIB */
fib = cm->cm_fib;
@@ -1350,7 +1349,6 @@ aac_wait_command(struct aac_command *cm)
fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
 
/* Put the command on the ready queue and get things going */
-   cm->cm_queue = AAC_ADAP_NORM_CMD_QUEUE;
aac_enqueue_ready(cm);
aac_startio(sc);
error = msleep(cm, &sc->aac_io_lock, PRIBIO, "aacwait", 0);
@@ -1400,6 +1398,7 @@ aac_release_command(struct aac_command *
cm->cm_flags = 0;
cm->cm_complete = NULL;
cm->cm_private = NULL;
+   cm->cm_queue = AAC_ADAP_NORM_CMD_QUEUE;
cm->cm_fib->Header.XferState = AAC_FIBSTATE_EMPTY;
cm->cm_fib->Header.StructType = AAC_FIBTYPE_TFIB;
cm->cm_fib->Header.Flags = 0;

Modified: head/sys/dev/aac/aac_cam.c
==
--- head/sys/dev/aac/aac_cam.c  Tue Feb 23 21:39:11 2010(r204263)
+++ head/sys/dev/aac/aac_cam.c  Tue Feb 23 21:41:13 2010(r204264)
@@ -453,7 +453,6 @@ aac_cam_action(struct cam_sim *sim, unio
cm->cm_complete = aac_cam_complete;
cm->cm_private = ccb;
cm->cm_timestamp = time_uptime;
-   cm->cm_queue = AAC_ADAP_NORM_CMD_QUEUE;
 
fib->Header.XferState =
AAC_FIBSTATE_HOSTOWNED  |
___
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: r204265 - in head/sys: dev/fb dev/syscons sys

2010-02-23 Thread Jung-uk Kim
Author: jkim
Date: Tue Feb 23 21:51:14 2010
New Revision: 204265
URL: http://svn.freebsd.org/changeset/base/204265

Log:
  Yet another attempt to make palette loading more safer:
  
  - Add a separate palette data for 8-bit DAC mode when SC_PIXEL_MODE is set
  and fill it up with default gray-scale palette data for text.  Now we don't
  have to set `hint.sc.0.vesa_mode' to get the default palette data.
  - Add a new adapter flag, V_ADP_DAC8 to track whether the controller is
  using 8-bit palette format and load correct palette when switching modes.
  - Set 8-bit DAC mode only for non-VGA compatible graphics mode.

Modified:
  head/sys/dev/fb/vesa.c
  head/sys/dev/syscons/scvidctl.c
  head/sys/dev/syscons/syscons.c
  head/sys/dev/syscons/syscons.h
  head/sys/sys/fbio.h

Modified: head/sys/dev/fb/vesa.c
==
--- head/sys/dev/fb/vesa.c  Tue Feb 23 21:41:13 2010(r204264)
+++ head/sys/dev/fb/vesa.c  Tue Feb 23 21:51:14 2010(r204265)
@@ -165,7 +165,9 @@ static int int10_set_mode(int mode);
 static int vesa_bios_post(void);
 static int vesa_bios_get_mode(int mode, struct vesa_mode *vmode);
 static int vesa_bios_set_mode(int mode);
+#if 0
 static int vesa_bios_get_dac(void);
+#endif
 static int vesa_bios_set_dac(int bits);
 static int vesa_bios_save_palette(int start, int colors, u_char *palette,
  int bits);
@@ -318,6 +320,7 @@ vesa_bios_set_mode(int mode)
return (regs.R_AX != 0x004f);
 }
 
+#if 0
 static int
 vesa_bios_get_dac(void)
 {
@@ -334,6 +337,7 @@ vesa_bios_get_dac(void)
 
return (regs.R_BH);
 }
+#endif
 
 static int
 vesa_bios_set_dac(int bits)
@@ -1198,6 +1202,10 @@ vesa_set_mode(video_adapter_t *adp, int 
if (VESA_MODE(adp->va_mode)) {
if (!VESA_MODE(mode) &&
(*prevvidsw->get_info)(adp, mode, &info) == 0) {
+   if ((adp->va_flags & V_ADP_DAC8) != 0) {
+   vesa_bios_set_dac(6);
+   adp->va_flags &= ~V_ADP_DAC8;
+   }
int10_set_mode(adp->va_initial_bios_mode);
if (adp->va_info.vi_flags & V_INFO_LINEAR)
pmap_unmapdev(adp->va_buffer,
@@ -1228,8 +1236,14 @@ vesa_set_mode(video_adapter_t *adp, int 
if (vesa_bios_set_mode(mode | ((info.vi_flags & V_INFO_LINEAR) ? 0x4000 
: 0)))
return (1);
 
-   if ((vesa_adp_info->v_flags & V_DAC8) != 0)
-   vesa_bios_set_dac(8);
+   /* Palette format is reset by the above VBE function call. */
+   adp->va_flags &= ~V_ADP_DAC8;
+
+   if ((vesa_adp_info->v_flags & V_DAC8) != 0 &&
+   (info.vi_flags & V_INFO_GRAPHICS) != 0 &&
+   (info.vi_flags & V_INFO_NONVGA) != 0 &&
+   vesa_bios_set_dac(8) > 6)
+   adp->va_flags |= V_ADP_DAC8;
 
if (adp->va_info.vi_flags & V_INFO_LINEAR)
pmap_unmapdev(adp->va_buffer, adp->va_buffer_size);
@@ -1308,10 +1322,10 @@ vesa_save_palette(video_adapter_t *adp, 
 {
int bits;
 
-   if (adp == vesa_adp && VESA_MODE(adp->va_mode)) {
-   bits = vesa_bios_get_dac();
-   if ((adp->va_info.vi_flags & V_INFO_NONVGA) != 0 || bits > 6)
-   return (vesa_bios_save_palette(0, 256, palette, bits));
+   if (adp == vesa_adp && VESA_MODE(adp->va_mode) &&
+   (adp->va_info.vi_flags & V_INFO_NONVGA) != 0) {
+   bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6;
+   return (vesa_bios_save_palette(0, 256, palette, bits));
}
 
return ((*prevvidsw->save_palette)(adp, palette));
@@ -1322,10 +1336,10 @@ vesa_load_palette(video_adapter_t *adp, 
 {
int bits;
 
-   if (adp == vesa_adp && VESA_MODE(adp->va_mode)) {
-   bits = vesa_bios_get_dac();
-   if ((adp->va_info.vi_flags & V_INFO_NONVGA) != 0 || bits > 6)
-   return (vesa_bios_load_palette(0, 256, palette, bits));
+   if (adp == vesa_adp && VESA_MODE(adp->va_mode) &&
+   (adp->va_info.vi_flags & V_INFO_NONVGA) != 0) {
+   bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6;
+   return (vesa_bios_load_palette(0, 256, palette, bits));
}
 
return ((*prevvidsw->load_palette)(adp, palette));
@@ -1530,10 +1544,10 @@ get_palette(video_adapter_t *adp, int ba
return (1);
if (!VESA_MODE(adp->va_mode))
return (1);
-   bits = vesa_bios_get_dac();
-   if ((adp->va_info.vi_flags & V_INFO_NONVGA) == 0 && bits <= 6)
+   if ((adp->va_info.vi_flags & V_INFO_NONVGA) == 0)
return (1);
 
+   bits = (adp->va_flags & V_ADP_DAC8) != 0 ? 8 : 6;
r = malloc(count * 3, M_DEVBUF, M_WAITOK);
g = r + count;
b = g + count;
@@ -1568,10 +1582,10 @@ set_palette(video_adapter_t *adp, 

svn commit: r204266 - stable/7/sys/pci

2010-02-23 Thread Gavin Atkinson
Author: gavin
Date: Tue Feb 23 22:09:42 2010
New Revision: 204266
URL: http://svn.freebsd.org/changeset/base/204266

Log:
  Merge r202931 from head:
Add support for four more nfsmb controllers, shipping on at least the
ASUS Atom ION boards.
  
  PR:   kern/142571
  Submitted by: oliver

Modified:
  stable/7/sys/pci/nfsmb.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/pci/nfsmb.c
==
--- stable/7/sys/pci/nfsmb.cTue Feb 23 21:51:14 2010(r204265)
+++ stable/7/sys/pci/nfsmb.cTue Feb 23 22:09:42 2010(r204266)
@@ -65,6 +65,10 @@ static int nfsmb_debug = 0;
 #defineNFSMB_DEVICEID_NF4_55_SMB   0x0368
 #defineNFSMB_DEVICEID_NF4_61_SMB   0x03eb
 #defineNFSMB_DEVICEID_NF4_65_SMB   0x0446
+#defineNFSMB_DEVICEID_NF4_67_SMB   0x0542
+#defineNFSMB_DEVICEID_NF4_73_SMB   0x07d8
+#defineNFSMB_DEVICEID_NF4_78S_SMB  0x0752
+#defineNFSMB_DEVICEID_NF4_79_SMB   0x0aa2
 
 /* PCI Configuration space registers */
 #defineNF2PCI_SMBASE_1 PCIR_BAR(4)
@@ -160,6 +164,10 @@ nfsmb_probe(device_t dev)
case NFSMB_DEVICEID_NF4_55_SMB:
case NFSMB_DEVICEID_NF4_61_SMB:
case NFSMB_DEVICEID_NF4_65_SMB:
+   case NFSMB_DEVICEID_NF4_67_SMB:
+   case NFSMB_DEVICEID_NF4_73_SMB:
+   case NFSMB_DEVICEID_NF4_78S_SMB:
+   case NFSMB_DEVICEID_NF4_79_SMB:
device_set_desc(dev, "nForce2/3/4 MCP SMBus 
Controller");
return (BUS_PROBE_DEFAULT);
}
@@ -251,6 +259,10 @@ nfsmb_attach(device_t dev)
case NFSMB_DEVICEID_NF4_55_SMB:
case NFSMB_DEVICEID_NF4_61_SMB:
case NFSMB_DEVICEID_NF4_65_SMB:
+   case NFSMB_DEVICEID_NF4_67_SMB:
+   case NFSMB_DEVICEID_NF4_73_SMB:
+   case NFSMB_DEVICEID_NF4_78S_SMB:
+   case NFSMB_DEVICEID_NF4_79_SMB:
/* Trying to add secondary device as slave */
nfsmb_sc->subdev = device_add_child(dev, "nfsmb", -1);
if (!nfsmb_sc->subdev) {
___
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: r204267 - head/usr.sbin/cxgbtool

2010-02-23 Thread Navdeep Parhar
Author: np
Date: Tue Feb 23 23:01:41 2010
New Revision: 204267
URL: http://svn.freebsd.org/changeset/base/204267

Log:
  Allow cxgbtool to build with WARNS=6
  
  MFC after:1 week

Modified:
  head/usr.sbin/cxgbtool/cxgbtool.c
  head/usr.sbin/cxgbtool/reg_defs.c
  head/usr.sbin/cxgbtool/reg_defs_t3.c
  head/usr.sbin/cxgbtool/reg_defs_t3b.c
  head/usr.sbin/cxgbtool/reg_defs_t3c.c

Modified: head/usr.sbin/cxgbtool/cxgbtool.c
==
--- head/usr.sbin/cxgbtool/cxgbtool.c   Tue Feb 23 22:09:42 2010
(r204266)
+++ head/usr.sbin/cxgbtool/cxgbtool.c   Tue Feb 23 23:01:41 2010
(r204267)
@@ -85,7 +85,8 @@ struct reg_info { 
 
 static const char *progname;
 
-static void __attribute__((noreturn)) usage(FILE *fp)
+static void
+usage(FILE *fp)
 {
fprintf(fp, "Usage: %s  [operation]\n", progname);
fprintf(fp,
@@ -136,7 +137,8 @@ doit(const char *iff_name, unsigned long
return ioctl(fd, cmd, data) < 0 ? -1 : 0;
 }
 
-static int get_int_arg(const char *s, uint32_t *valp)
+static int
+get_int_arg(const char *s, uint32_t *valp)
 {
char *p;
 
@@ -172,11 +174,12 @@ write_reg(const char *iff_name, uint32_t
err(1, "register write");
 }
 
-static int register_io(int argc, char *argv[], int start_arg,
+static int
+register_io(int argc, char *argv[], int start_arg,
   const char *iff_name)
 {
char *p;
-   uint32_t addr, val = 0, write = 0;
+   uint32_t addr, val = 0, w = 0;
 
if (argc != start_arg + 1) return -1;
 
@@ -184,14 +187,14 @@ static int register_io(int argc, char *a
if (p == argv[start_arg]) return -1;
if (*p == '=' && p[1]) {
val = strtoul(p + 1, &p, 0);
-   write = 1;
+   w = 1;
}
if (*p) {
warnx("bad parameter \"%s\"", argv[start_arg]);
return -1;
}
 
-   if (write)
+   if (w)
write_reg(iff_name, addr, val);
else {
val = read_reg(iff_name, addr);
@@ -200,9 +203,9 @@ static int register_io(int argc, char *a
return 0;
 }
 
-static int mdio_io(int argc, char *argv[], int start_arg, const char 
*iff_name) 
+static int
+mdio_io(int argc, char *argv[], int start_arg, const char *iff_name) 
 { 
-struct ifreq ifr; 
 struct ch_mii_data p;
 unsigned int cmd, phy_addr, reg, mmd, val; 
  
@@ -230,12 +233,14 @@ static int mdio_io(int argc, char *argv[
 return 0; 
 } 
 
-static inline uint32_t xtract(uint32_t val, int shift, int len)
+static inline
+uint32_t xtract(uint32_t val, int shift, int len)
 {
return (val >> shift) & ((1 << len) - 1);
 }
 
-static int dump_block_regs(const struct reg_info *reg_array, uint32_t *regs)
+static int
+dump_block_regs(const struct reg_info *reg_array, uint32_t *regs)
 {
uint32_t reg_val = 0; // silence compiler warning
 
@@ -254,7 +259,8 @@ static int dump_block_regs(const struct 
return 1;
 }
 
-static int dump_regs_t2(int argc, char *argv[], int start_arg, uint32_t *regs)
+static int
+dump_regs_t2(int argc, char *argv[], int start_arg, uint32_t *regs)
 {
int match = 0;
char *block_name = NULL;
@@ -292,8 +298,8 @@ static int dump_regs_t2(int argc, char *
 }
 
 #if defined(CONFIG_T3_REGS)
-static int dump_regs_t3(int argc, char *argv[], int start_arg, uint32_t *regs,
-   int is_pcie)
+static int
+dump_regs_t3(int argc, char *argv[], int start_arg, uint32_t *regs, int 
is_pcie)
 {
int match = 0;
char *block_name = NULL;
@@ -353,8 +359,9 @@ static int dump_regs_t3(int argc, char *
return 0;
 }
 
-static int dump_regs_t3b(int argc, char *argv[], int start_arg, uint32_t *regs,
-int is_pcie)
+static int
+dump_regs_t3b(int argc, char *argv[], int start_arg, uint32_t *regs,
+int is_pcie)
 {
int match = 0;
char *block_name = NULL;
@@ -414,8 +421,9 @@ static int dump_regs_t3b(int argc, char 
return 0;
 }
 
-static int dump_regs_t3c(int argc, char *argv[], int start_arg, uint32_t *regs,
-int is_pcie)
+static int
+dump_regs_t3c(int argc, char *argv[], int start_arg, uint32_t *regs,
+int is_pcie)
 {
int match = 0;
char *block_name = NULL;
@@ -479,7 +487,7 @@ static int dump_regs_t3c(int argc, char 
 static int
 dump_regs(int argc, char *argv[], int start_arg, const char *iff_name)
 {
-   int i, vers, revision, is_pcie;
+   int vers, revision, is_pcie;
struct ch_ifconf_regs regs;
 
regs.len = REGDUMP_SIZE;
@@ -514,7 +522,8 @@ dump_regs(int argc, char *argv[], int st
return 0;
 }
 
-static int t3_meminfo(const uint32_t *regs)
+static int
+t3_meminfo(const uint32_t *regs)
 {
enum {
SG_EGR_CNTX_BADDR   = 0x58,
@@ -592,11 +601,16 @@ static int t3_meminfo(const uint32_t *re
return 0;
 }
 
-stati

svn commit: r204268 - in head/sys/powerpc: aim include

2010-02-23 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Wed Feb 24 00:54:37 2010
New Revision: 204268
URL: http://svn.freebsd.org/changeset/base/204268

Log:
  Close a race involving the OEA64 scratchpage. When the scratch page's
  physical address is changed, there is a brief window during which its PTE
  is invalid. Since moea64_set_scratchpage_pa() does not and cannot hold
  the page table lock, it was possible for another CPU to insert a new PTE
  into the scratch page's PTEG slot during this interval, corrupting both
  mappings.
  
  Solve this by creating a new flag, LPTE_LOCKED, such that
  moea64_pte_insert will avoid claiming locked PTEG slots even if they
  are invalid. This change also incorporates some additional paranoia
  added to solve things I thought might be this bug.
  
  Reported by:  linimon

Modified:
  head/sys/powerpc/aim/mmu_oea64.c
  head/sys/powerpc/include/pte.h

Modified: head/sys/powerpc/aim/mmu_oea64.c
==
--- head/sys/powerpc/aim/mmu_oea64.cTue Feb 23 23:01:41 2010
(r204267)
+++ head/sys/powerpc/aim/mmu_oea64.cWed Feb 24 00:54:37 2010
(r204268)
@@ -227,6 +227,7 @@ TLBIE(pmap_t pmap, vm_offset_t va) {
 #defineVSID_MAKE(sr, hash) ((sr) | (((hash) & 0xf) << 4))
 #defineVSID_TO_SR(vsid)((vsid) & 0xf)
 #defineVSID_TO_HASH(vsid)  (((vsid) >> 4) & 0xf)
+#defineVSID_HASH_MASK  0x007fULL
 
 #definePVO_PTEGIDX_MASK0x007UL /* which PTEG slot */
 #definePVO_PTEGIDX_VALID   0x008UL /* slot is valid */
@@ -458,9 +459,9 @@ MMU_DEF(oea64_bridge_mmu);
 static __inline u_int
 va_to_pteg(uint64_t vsid, vm_offset_t addr)
 {
-   u_int hash;
+   uint64_t hash;
 
-   hash = vsid ^ (((uint64_t)addr & ADDR_PIDX) >>
+   hash = (vsid & VSID_HASH_MASK) ^ (((uint64_t)addr & ADDR_PIDX) >>
ADDR_PIDX_SHFT);
return (hash & moea64_pteg_mask);
 }
@@ -979,6 +980,7 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o
moea64_scratchpage_va[i],&j);
moea64_scratchpage_pte[i] = moea64_pvo_to_pte(
moea64_scratchpage_pvo[i],j);
+   moea64_scratchpage_pte[i]->pte_hi |= LPTE_LOCKED;
UNLOCK_TABLE();
}
 
@@ -1090,8 +1092,10 @@ moea64_zero_page(mmu_t mmu, vm_page_t m)
 
 static __inline
 void moea64_set_scratchpage_pa(int which, vm_offset_t pa) {
+   mtx_assert(&moea64_scratchpage_mtx, MA_OWNED);
+
moea64_scratchpage_pvo[which]->pvo_pte.lpte.pte_lo &= 
-   (~LPTE_WIMG & ~LPTE_RPGN);
+   ~(LPTE_WIMG | LPTE_RPGN);
moea64_scratchpage_pvo[which]->pvo_pte.lpte.pte_lo |= 
moea64_calc_wimg(pa) | (uint64_t)pa;
 
@@ -2151,18 +2155,16 @@ moea64_pvo_remove(struct pvo_entry *pvo,
 static __inline int
 moea64_pvo_pte_index(const struct pvo_entry *pvo, int ptegidx)
 {
-   int pteidx;
 
/*
 * We can find the actual pte entry without searching by grabbing
-* the PTEG index from 3 unused bits in pte_lo[11:9] and by
+* the PTEG index from 3 unused bits in pvo_vaddr and by
 * noticing the HID bit.
 */
-   pteidx = ptegidx * 8 + PVO_PTEGIDX_GET(pvo);
if (pvo->pvo_pte.lpte.pte_hi & LPTE_HID)
-   pteidx ^= moea64_pteg_mask * 8;
+   ptegidx ^= moea64_pteg_mask;
 
-   return (pteidx);
+   return ((ptegidx << 3) | PVO_PTEGIDX_GET(pvo));
 }
 
 static struct pvo_entry *
@@ -2259,7 +2261,8 @@ moea64_pte_insert(u_int ptegidx, struct 
 * First try primary hash.
 */
for (pt = moea64_pteg_table[ptegidx].pt, i = 0; i < 8; i++, pt++) {
-   if ((pt->pte_hi & LPTE_VALID) == 0) {
+   if ((pt->pte_hi & LPTE_VALID) == 0 &&
+   (pt->pte_hi & LPTE_LOCKED) == 0) {
pvo_pt->pte_hi &= ~LPTE_HID;
moea64_pte_set(pt, pvo_pt);
return (i);
@@ -2272,7 +2275,8 @@ moea64_pte_insert(u_int ptegidx, struct 
ptegidx ^= moea64_pteg_mask;
 
for (pt = moea64_pteg_table[ptegidx].pt, i = 0; i < 8; i++, pt++) {
-   if ((pt->pte_hi & LPTE_VALID) == 0) {
+   if ((pt->pte_hi & LPTE_VALID) == 0 &&
+   (pt->pte_hi & LPTE_LOCKED) == 0) {
pvo_pt->pte_hi |= LPTE_HID;
moea64_pte_set(pt, pvo_pt);
return (i);

Modified: head/sys/powerpc/include/pte.h
==
--- head/sys/powerpc/include/pte.h  Tue Feb 23 23:01:41 2010
(r204267)
+++ head/sys/powerpc/include/pte.h  Wed Feb 24 00:54:37 2010
(r204268)
@@ -95,6 +95,7 @@ struct lpteg {
 /* High quadword: */
 #define LPTE_VSID_SHIFT12
 #define LPTE_API   0x0F80ULL
+#define LPTE_LOCKED0x0008

svn commit: r204269 - head/sys/powerpc/aim

2010-02-23 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Wed Feb 24 00:55:55 2010
New Revision: 204269
URL: http://svn.freebsd.org/changeset/base/204269

Log:
  Use dcbz instead of word stores for page zeroing, providing a factor of
  3-4 speedup.

Modified:
  head/sys/powerpc/aim/mmu_oea64.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==
--- head/sys/powerpc/aim/mmu_oea64.cWed Feb 24 00:54:37 2010
(r204268)
+++ head/sys/powerpc/aim/mmu_oea64.cWed Feb 24 00:55:55 2010
(r204269)
@@ -1075,15 +1075,6 @@ moea64_change_wiring(mmu_t mmu, pmap_t p
 }
 
 /*
- * Zero a page of physical memory by temporarily mapping it into the tlb.
- */
-void
-moea64_zero_page(mmu_t mmu, vm_page_t m)
-{
-   moea64_zero_page_area(mmu,m,0,PAGE_SIZE);
-}
-
-/*
  * This goes through and sets the physical address of our
  * special scratch PTE to the PA we want to zero or copy. Because
  * of locking issues (this can get called in pvo_enter() by
@@ -1147,6 +1138,27 @@ moea64_zero_page_area(mmu_t mmu, vm_page
mtx_unlock(&moea64_scratchpage_mtx);
 }
 
+/*
+ * Zero a page of physical memory by temporarily mapping it
+ */
+void
+moea64_zero_page(mmu_t mmu, vm_page_t m)
+{
+   vm_offset_t pa = VM_PAGE_TO_PHYS(m);
+   vm_offset_t off;
+
+   if (!moea64_initialized)
+   panic("moea64_zero_page: can't zero pa %#x", pa);
+
+   mtx_lock(&moea64_scratchpage_mtx);
+
+   moea64_set_scratchpage_pa(0,pa);
+   for (off = 0; off < PAGE_SIZE; off += cacheline_size)
+   __asm __volatile("dcbz 0,%0" ::
+   "r"(moea64_scratchpage_va[0] + off));
+   mtx_unlock(&moea64_scratchpage_mtx);
+}
+
 void
 moea64_zero_page_idle(mmu_t mmu, vm_page_t m)
 {
___
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: r204270 - in head: share/man/man4/man4.powerpc sys/powerpc/powermac

2010-02-23 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Wed Feb 24 01:27:36 2010
New Revision: 204270
URL: http://svn.freebsd.org/changeset/base/204270

Log:
  Add the ability to set SMU-based machines to restart automatically after
  power loss.

Modified:
  head/share/man/man4/man4.powerpc/smu.4
  head/sys/powerpc/powermac/smu.c

Modified: head/share/man/man4/man4.powerpc/smu.4
==
--- head/share/man/man4/man4.powerpc/smu.4  Wed Feb 24 00:55:55 2010
(r204269)
+++ head/share/man/man4/man4.powerpc/smu.4  Wed Feb 24 01:27:36 2010
(r204270)
@@ -75,6 +75,9 @@ The following sysctls can be used to con
 power management behavior and to examine current system power and
 thermal conditions.
 .Bl -tag -width indent
+.It Va dev.smu.%d.server_mode
+Restart after power failure behavior (1 causes system to reboot after power
+cut, 0 causes system to remain off).
 .It Va dev.smu.%d.target_temp
 Target system temperature, in degrees Celsius. The
 .Nm

Modified: head/sys/powerpc/powermac/smu.c
==
--- head/sys/powerpc/powermac/smu.c Wed Feb 24 00:55:55 2010
(r204269)
+++ head/sys/powerpc/powermac/smu.c Wed Feb 24 01:27:36 2010
(r204270)
@@ -137,6 +137,7 @@ static void smu_attach_fans(device_t dev
 static voidsmu_attach_sensors(device_t dev, phandle_t sensroot);
 static voidsmu_fanmgt_callout(void *xdev);
 static voidsmu_set_sleepled(void *xdev, int onoff);
+static int smu_server_mode(SYSCTL_HANDLER_ARGS);
 
 /* where to find the doorbell GPIO */
 
@@ -174,6 +175,16 @@ MALLOC_DEFINE(M_SMU, "smu", "SMU Sensor 
 #define  SMU_MISC_GET_DATA 0x02
 #define  SMU_MISC_LED_CTRL 0x04
 #define SMU_POWER  0xaa
+#define SMU_POWER_EVENTS   0x8f
+#define  SMU_PWR_GET_POWERUP   0x00
+#define  SMU_PWR_SET_POWERUP   0x01
+#define  SMU_PWR_CLR_POWERUP   0x02
+
+/* Power event types */
+#define SMU_WAKEUP_KEYPRESS0x01
+#define SMU_WAKEUP_AC_INSERT   0x02
+#define SMU_WAKEUP_AC_CHANGE   0x04
+#define SMU_WAKEUP_RING0x10
 
 /* Data blocks */
 #define SMU_CPUTEMP_CAL0x18
@@ -301,6 +312,15 @@ smu_attach(device_t dev)
 */
sc->sc_leddev = led_create(smu_set_sleepled, dev, "sleepled");
 
+   /*
+* Reset on power loss behavior
+*/
+
+   SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
+SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO,
+   "server_mode", CTLTYPE_INT | CTLFLAG_RW, dev, 0,
+   smu_server_mode, "I", "Enable reboot after power failure");
+
return (0);
 }
 
@@ -877,3 +897,41 @@ smu_set_sleepled(void *xdev, int onoff)
smu_run_cmd(smu, &cmd);
 }
 
+static int
+smu_server_mode(SYSCTL_HANDLER_ARGS)
+{
+   struct smu_cmd cmd;
+   u_int server_mode;
+   device_t smu = arg1;
+   int error;
+   
+   cmd.cmd = SMU_POWER_EVENTS;
+   cmd.len = 1;
+   cmd.data[0] = SMU_PWR_GET_POWERUP;
+
+   error = smu_run_cmd(smu, &cmd);
+
+   if (error)
+   return (error);
+
+   server_mode = (cmd.data[1] & SMU_WAKEUP_AC_INSERT) ? 1 : 0;
+
+   error = sysctl_handle_int(oidp, &server_mode, 0, req);
+
+   if (error || !req->newptr)
+   return (error);
+
+   if (server_mode == 1)
+   cmd.data[0] = SMU_PWR_SET_POWERUP;
+   else if (server_mode == 0)
+   cmd.data[0] = SMU_PWR_CLR_POWERUP;
+   else
+   return (EINVAL);
+
+   cmd.len = 3;
+   cmd.data[1] = 0;
+   cmd.data[2] = SMU_WAKEUP_AC_INSERT;
+
+   return (smu_run_cmd(smu, &cmd));
+}
+
___
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: r204271 - head/sys/dev/cxgb

2010-02-23 Thread Navdeep Parhar
Author: np
Date: Wed Feb 24 01:44:39 2010
New Revision: 204271
URL: http://svn.freebsd.org/changeset/base/204271

Log:
  Accessing an mbuf after it has been handed off to the hardware is a bad
  race as it could already have been tx'd and freed by that time.  Place
  the bpf tap just _before_ writing the gen bit.
  
  This fixes a panic when running tcpdump on a cxgb interface.

Modified:
  head/sys/dev/cxgb/cxgb_sge.c

Modified: head/sys/dev/cxgb/cxgb_sge.c
==
--- head/sys/dev/cxgb/cxgb_sge.cWed Feb 24 01:27:36 2010
(r204270)
+++ head/sys/dev/cxgb/cxgb_sge.cWed Feb 24 01:44:39 2010
(r204271)
@@ -1477,6 +1477,7 @@ t3_encap(struct sge_qset *qs, struct mbu
V_WR_GEN(txqs.gen)) | htonl(V_WR_TID(txq->token));
set_wr_hdr(wrp, wr_hi, wr_lo);
wmb();
+   ETHER_BPF_MTAP(pi->ifp, m0);
wr_gen2(txd, txqs.gen);
check_ring_tx_db(sc, txq);
return (0); 
@@ -1549,8 +1550,10 @@ t3_encap(struct sge_qset *qs, struct mbu
V_WR_GEN(txqs.gen) | V_WR_TID(txq->token));
set_wr_hdr(&hdr->wr, wr_hi, wr_lo);
wmb();
+   ETHER_BPF_MTAP(pi->ifp, m0);
wr_gen2(txd, txqs.gen);
check_ring_tx_db(sc, txq);
+   m_freem(m0);
return (0);
}
flits = 3;  
@@ -1578,8 +1581,10 @@ t3_encap(struct sge_qset *qs, struct mbu
V_WR_GEN(txqs.gen) | V_WR_TID(txq->token));
set_wr_hdr(&cpl->wr, wr_hi, wr_lo);
wmb();
+   ETHER_BPF_MTAP(pi->ifp, m0);
wr_gen2(txd, txqs.gen);
check_ring_tx_db(sc, txq);
+   m_freem(m0);
return (0);
}
flits = 2;
@@ -1590,12 +1595,14 @@ t3_encap(struct sge_qset *qs, struct mbu
 
sgl_flits = sgl_len(nsegs);
 
+   ETHER_BPF_MTAP(pi->ifp, m0);
+
KASSERT(ndesc <= 4, ("ndesc too large %d", ndesc));
wr_hi = htonl(V_WR_OP(FW_WROPCODE_TUNNEL_TX_PKT) | txqs.compl);
wr_lo = htonl(V_WR_TID(txq->token));
write_wr_hdr_sgl(ndesc, txd, &txqs, txq, sgl, flits,
sgl_flits, wr_hi, wr_lo);
-   check_ring_tx_db(pi->adapter, txq);
+   check_ring_tx_db(sc, txq);
 
return (0);
 }
@@ -1674,16 +1681,6 @@ cxgb_start_locked(struct sge_qset *qs)
 */
if (t3_encap(qs, &m_head) || m_head == NULL)
break;
-   
-   /* Send a copy of the frame to the BPF listener */
-   ETHER_BPF_MTAP(ifp, m_head);
-
-   /*
-* We sent via PIO, no longer need a copy
-*/
-   if (m_head->m_nextpkt == NULL &&
-   m_head->m_pkthdr.len <= PIO_LEN)
-   m_freem(m_head);
 
m_head = NULL;
}
@@ -1726,17 +1723,6 @@ cxgb_transmit_locked(struct ifnet *ifp, 
 */
txq->txq_direct_packets++;
txq->txq_direct_bytes += m->m_pkthdr.len;
-   /*
-   ** Send a copy of the frame to the BPF
-   ** listener and set the watchdog on.
-   */
-   ETHER_BPF_MTAP(ifp, m);
-   /*
-* We sent via PIO, no longer need a copy
-*/
-   if (m->m_pkthdr.len <= PIO_LEN)
-   m_freem(m);
-
}
} else if ((error = drbr_enqueue(ifp, br, m)) != 0)
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"


Re: svn commit: r200743 - in head/usr.sbin: . service

2010-02-23 Thread Cyrille Lefevre


Cyrille Lefevre a écrit :

Doug Barton a écrit :

I agree to making the change you suggested, but I would like to
quibble over the format. Isn't the attached patch equivalent, and
simpler? What is the value of setting HOME and PATH in the environment
if we're just going to use 'env -i HOME PATH' anyway?


how about to replace $* by "$@" in service.sh and to quote $dir/$script 
as well ?


before :
exec env -i HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin $dir/$script $*

after :
exec env -i HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin "$dir/$script" "$@"


forgive me for the noise, don't see the message from "Jilles Tjoelker"...

Regards,

Cyrille Lefevre
--
mailto:cyrille.lefevre-li...@laposte.net


___
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: r200743 - in head/usr.sbin: . service

2010-02-23 Thread Cyrille Lefevre


Doug Barton a écrit :

I agree to making the change you suggested, but I would like to
quibble over the format. Isn't the attached patch equivalent, and
simpler? What is the value of setting HOME and PATH in the environment
if we're just going to use 'env -i HOME PATH' anyway?


how about to replace $* by "$@" in service.sh and to quote $dir/$script 
as well ?


before :
exec env -i HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin $dir/$script $*

after :
exec env -i HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin "$dir/$script" "$@"

Regards,

Cyrille Lefevre
--
mailto:cyrille.lefevre-li...@laposte.net


___
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"