svn commit: r186124 - in head: lib/libfetch usr.bin/fetch
Author: murray Date: Mon Dec 15 08:27:44 2008 New Revision: 186124 URL: http://svn.freebsd.org/changeset/base/186124 Log: Add support for HTTP 1.1 If-Modified-Since behavior. fetch(1) accepts a new argument -i file that if specified will cause the file to be downloaded only if it is more recent than the mtime of file. libfetch(3) accepts the mtime in the url structure and a flag to indicate when this behavior is desired. PR: bin/87841 Submitted by: Jukka A. Ukkonen j...@iki.fi (partially) Reviewed by: des, ru MFC after:3 weeks Modified: head/lib/libfetch/fetch.3 head/lib/libfetch/fetch.h head/lib/libfetch/http.c head/usr.bin/fetch/fetch.1 head/usr.bin/fetch/fetch.c Modified: head/lib/libfetch/fetch.3 == --- head/lib/libfetch/fetch.3 Mon Dec 15 08:11:45 2008(r186123) +++ head/lib/libfetch/fetch.3 Mon Dec 15 08:27:44 2008(r186124) @@ -25,7 +25,7 @@ .\ .\ $FreeBSD$ .\ -.Dd December 18, 2007 +.Dd December 14, 2008 .Dt FETCH 3 .Os .Sh NAME @@ -165,9 +165,16 @@ struct url { char *doc; off_t offset; size_t length; +time_t ims_time; }; .Ed .Pp +The +.Va ims_time +field stores the time value for +.Li If-Modified-Since +HTTP requests. +.Pp The pointer returned by .Fn fetchMakeURL or @@ -353,6 +360,22 @@ and .Fn fetchPutHTTP will use a direct connection even if a proxy server is defined. .Pp +If the +.Ql i +(if-modified-since) flag is specified, and +the +.Va ims_time +field is set in +.Vt struct url , +then +.Fn fetchXGetHTTP +and +.Fn fetchGetHTTP +will send a conditional +.Li If-Modified-Since +HTTP header to only fetch the content if it is newer than +.Va ims_time . +.Pp Since there seems to be no good way of implementing the HTTP PUT method in a manner consistent with the rest of the .Nm fetch Modified: head/lib/libfetch/fetch.h == --- head/lib/libfetch/fetch.h Mon Dec 15 08:11:45 2008(r186123) +++ head/lib/libfetch/fetch.h Mon Dec 15 08:27:44 2008(r186124) @@ -46,6 +46,7 @@ struct url { char*doc; off_toffset; size_t length; + time_t ims_time; }; struct url_stat { Modified: head/lib/libfetch/http.c == --- head/lib/libfetch/http.cMon Dec 15 08:11:45 2008(r186123) +++ head/lib/libfetch/http.cMon Dec 15 08:27:44 2008(r186124) @@ -63,6 +63,7 @@ __FBSDID($FreeBSD$); #include sys/param.h #include sys/socket.h +#include sys/time.h #include ctype.h #include err.h @@ -92,6 +93,7 @@ __FBSDID($FreeBSD$); #define HTTP_MOVED_PERM301 #define HTTP_MOVED_TEMP302 #define HTTP_SEE_OTHER 303 +#define HTTP_NOT_MODIFIED 304 #define HTTP_TEMP_REDIRECT 307 #define HTTP_NEED_AUTH 401 #define HTTP_NEED_PROXY_AUTH 407 @@ -797,20 +799,23 @@ FILE * http_request(struct url *URL, const char *op, struct url_stat *us, struct url *purl, const char *flags) { + char timebuf[80]; + char hbuf[MAXHOSTNAMELEN + 7], *host; conn_t *conn; struct url *url, *new; - int chunked, direct, need_auth, noredirect, verbose; + int chunked, direct, ims, need_auth, noredirect, verbose; int e, i, n, val; off_t offset, clength, length, size; time_t mtime; const char *p; FILE *f; hdr_t h; - char hbuf[MAXHOSTNAMELEN + 7], *host; + struct tm *timestruct; direct = CHECK_FLAG('d'); noredirect = CHECK_FLAG('A'); verbose = CHECK_FLAG('v'); + ims = CHECK_FLAG('i'); if (direct purl) { fetchFreeURL(purl); @@ -879,6 +884,14 @@ http_request(struct url *URL, const char op, url-doc); } + if (ims url-ims_time) { + timestruct = gmtime((time_t *)url-ims_time); + (void)strftime(timebuf, 80, %a, %d %b %Y %T GMT, + timestruct); + if (verbose) + fetch_info(If-Modified-Since: %s, timebuf); + http_cmd(conn, If-Modified-Since: %s, timebuf); + } /* virtual host */ http_cmd(conn, Host: %s, host); @@ -940,6 +953,7 @@ http_request(struct url *URL, const char switch (http_get_reply(conn)) { case HTTP_OK: case HTTP_PARTIAL: + case HTTP_NOT_MODIFIED: /* fine */ break; case HTTP_MOVED_PERM: @@ -1074,7 +1088,10 @@ http_request(struct url *URL, const char } /* we have a hit or an
svn commit: r186127 - head/sys/dev/hwpmc
Author: jkoshy Date: Mon Dec 15 14:41:55 2008 New Revision: 186127 URL: http://svn.freebsd.org/changeset/base/186127 Log: - Disambiguate a few panic messages. - Style fixes: wrap long lines, parenthesize return values. Modified: head/sys/dev/hwpmc/hwpmc_logging.c Modified: head/sys/dev/hwpmc/hwpmc_logging.c == --- head/sys/dev/hwpmc/hwpmc_logging.c Mon Dec 15 14:07:07 2008 (r186126) +++ head/sys/dev/hwpmc/hwpmc_logging.c Mon Dec 15 14:41:55 2008 (r186127) @@ -199,7 +199,7 @@ pmclog_get_buffer(struct pmc_owner *po) mtx_assert(po-po_mtx, MA_OWNED); KASSERT(po-po_curbuf == NULL, - ([pmc,%d] po=%p current buffer still valid, __LINE__, po)); + ([pmclog,%d] po=%p current buffer still valid, __LINE__, po)); mtx_lock_spin(pmc_bufferlist_mtx); if ((plb = TAILQ_FIRST(pmc_bufferlist)) != NULL) @@ -212,7 +212,7 @@ pmclog_get_buffer(struct pmc_owner *po) if (plb) KASSERT(plb-plb_ptr == plb-plb_base plb-plb_base plb-plb_fence, - ([pmc,%d] po=%p buffer invariants: ptr=%p + ([pmclog,%d] po=%p buffer invariants: ptr=%p base=%p fence=%p, __LINE__, po, plb-plb_ptr, plb-plb_base, plb-plb_fence)); #endif @@ -224,7 +224,7 @@ pmclog_get_buffer(struct pmc_owner *po) if (plb == NULL) atomic_add_int(pmc_stats.pm_buffer_requests_failed, 1); - return plb ? 0 : ENOMEM; + return (plb ? 0 : ENOMEM); } /* @@ -256,7 +256,7 @@ pmclog_loop(void *arg) PMCDBG(LOG,INI,1, po=%p kt=%p, po, po-po_kthread); KASSERT(po-po_kthread == curthread-td_proc, - ([pmc,%d] proc mismatch po=%p po/kt=%p curproc=%p, __LINE__, + ([pmclog,%d] proc mismatch po=%p po/kt=%p curproc=%p, __LINE__, po, po-po_kthread, curthread-td_proc)); lb = NULL; @@ -381,10 +381,10 @@ static void pmclog_release(struct pmc_owner *po) { KASSERT(po-po_curbuf-plb_ptr = po-po_curbuf-plb_base, - ([pmc,%d] buffer invariants po=%p ptr=%p base=%p, __LINE__, + ([pmclog,%d] buffer invariants po=%p ptr=%p base=%p, __LINE__, po, po-po_curbuf-plb_ptr, po-po_curbuf-plb_base)); KASSERT(po-po_curbuf-plb_ptr = po-po_curbuf-plb_fence, - ([pmc,%d] buffer invariants po=%p ptr=%p fenc=%p, __LINE__, + ([pmclog,%d] buffer invariants po=%p ptr=%p fenc=%p, __LINE__, po, po-po_curbuf-plb_ptr, po-po_curbuf-plb_fence)); /* schedule an I/O if we've filled a buffer */ @@ -423,15 +423,15 @@ pmclog_reserve(struct pmc_owner *po, int if (po-po_curbuf == NULL) if (pmclog_get_buffer(po) != 0) { mtx_unlock_spin(po-po_mtx); - return NULL; + return (NULL); } KASSERT(po-po_curbuf != NULL, - ([pmc,%d] po=%p no current buffer, __LINE__, po)); + ([pmclog,%d] po=%p no current buffer, __LINE__, po)); KASSERT(po-po_curbuf-plb_ptr = po-po_curbuf-plb_base po-po_curbuf-plb_ptr = po-po_curbuf-plb_fence, - ([pmc,%d] po=%p buffer invariants: ptr=%p base=%p fence=%p, + ([pmclog,%d] po=%p buffer invariants: ptr=%p base=%p fence=%p, __LINE__, po, po-po_curbuf-plb_ptr, po-po_curbuf-plb_base, po-po_curbuf-plb_fence)); @@ -439,7 +439,7 @@ pmclog_reserve(struct pmc_owner *po, int newptr = oldptr + length; KASSERT(oldptr != (uintptr_t) NULL, - ([pmc,%d] po=%p Null log buffer pointer, __LINE__, po)); + ([pmclog,%d] po=%p Null log buffer pointer, __LINE__, po)); /* * If we have space in the current buffer, return a pointer to @@ -458,18 +458,18 @@ pmclog_reserve(struct pmc_owner *po, int if (pmclog_get_buffer(po) != 0) { mtx_unlock_spin(po-po_mtx); - return NULL; + return (NULL); } KASSERT(po-po_curbuf != NULL, - ([pmc,%d] po=%p no current buffer, __LINE__, po)); + ([pmclog,%d] po=%p no current buffer, __LINE__, po)); KASSERT(po-po_curbuf-plb_ptr != NULL, - ([pmc,%d] null return from pmc_get_log_buffer, __LINE__)); + ([pmclog,%d] null return from pmc_get_log_buffer, __LINE__)); KASSERT(po-po_curbuf-plb_ptr == po-po_curbuf-plb_base po-po_curbuf-plb_ptr = po-po_curbuf-plb_fence, - ([pmc,%d] po=%p buffer invariants: ptr=%p base=%p fence=%p, + ([pmclog,%d] po=%p buffer invariants: ptr=%p base=%p fence=%p, __LINE__, po, po-po_curbuf-plb_ptr, po-po_curbuf-plb_base, po-po_curbuf-plb_fence)); @@ -481,7 +481,7 @@ pmclog_reserve(struct pmc_owner *po, int getnanotime(ts); /* fill in the
svn commit: r186128 - in head/sys: conf dev/ofw powerpc/include powerpc/ofw powerpc/powermac sparc64/ebus sparc64/include sparc64/isa sparc64/pci sparc64/sbus sparc64/sparc64 sun4v/include
Author: nwhitehorn Date: Mon Dec 15 15:31:10 2008 New Revision: 186128 URL: http://svn.freebsd.org/changeset/base/186128 Log: Adapt parts of the sparc64 Open Firmware bus enumeration code (in particular, the code for parsing interrupt maps) to PowerPC and reflect their new MI status by moving them to the shared dev/ofw directory. This commit also modifies the OFW PCI enumeration procedure on PowerPC to allow the bus to find non-firmware-enumerated devices that Apple likes to add, and adds some useful Open Firmware properties (compat and name) to the pnpinfo string of children on OFW SBus, EBus, PCI, and MacIO links. Because of the change to PCI enumeration on PowerPC, X has started working again on PPC machines with Grackle hostbridges. Reviewed by: marius Obtained from:sparc64 Deleted: head/sys/sparc64/include/ofw_bus.h head/sys/sparc64/sparc64/ofw_bus.c head/sys/sun4v/include/ofw_bus.h Modified: head/sys/conf/files.sparc64 head/sys/conf/files.sun4v head/sys/dev/ofw/ofw_bus_subr.c head/sys/dev/ofw/ofw_bus_subr.h head/sys/dev/ofw/openfirm.h head/sys/powerpc/include/param.h head/sys/powerpc/ofw/ofw_pcib_pci.c head/sys/powerpc/ofw/ofw_pcibus.c head/sys/powerpc/powermac/grackle.c head/sys/powerpc/powermac/gracklevar.h head/sys/powerpc/powermac/macio.c head/sys/powerpc/powermac/uninorth.c head/sys/powerpc/powermac/uninorthvar.h head/sys/sparc64/ebus/ebus.c head/sys/sparc64/isa/ofw_isa.c head/sys/sparc64/pci/apb.c head/sys/sparc64/pci/ofw_pci.h head/sys/sparc64/pci/ofw_pcib.c head/sys/sparc64/pci/ofw_pcib_subr.c head/sys/sparc64/pci/ofw_pcibus.c head/sys/sparc64/pci/psycho.c head/sys/sparc64/pci/schizo.c head/sys/sparc64/sbus/sbus.c head/sys/sparc64/sparc64/ofw_machdep.c Modified: head/sys/conf/files.sparc64 == --- head/sys/conf/files.sparc64 Mon Dec 15 14:41:55 2008(r186127) +++ head/sys/conf/files.sparc64 Mon Dec 15 15:31:10 2008(r186128) @@ -111,7 +111,6 @@ sparc64/sparc64/mp_exception.S optional sparc64/sparc64/mp_locore.Soptionalsmp sparc64/sparc64/mp_machdep.c optionalsmp sparc64/sparc64/nexus.cstandard -sparc64/sparc64/ofw_bus.c standard sparc64/sparc64/ofw_machdep.c standard sparc64/sparc64/pmap.c standard sparc64/sparc64/prof_machdep.c optionalprofiling-routine Modified: head/sys/conf/files.sun4v == --- head/sys/conf/files.sun4v Mon Dec 15 14:41:55 2008(r186127) +++ head/sys/conf/files.sun4v Mon Dec 15 15:31:10 2008(r186128) @@ -65,7 +65,6 @@ sun4v/sun4v/mp_locore.S optionalsmp sun4v/sun4v/mp_machdep.c optionalsmp sun4v/sun4v/nexus.cstandard sun4v/cddl/t1_copy.S standard -sparc64/sparc64/ofw_bus.c standard sparc64/sparc64/ofw_machdep.c standard sun4v/sun4v/pmap.c standard sparc64/sparc64/prof_machdep.c optionalprofiling-routine Modified: head/sys/dev/ofw/ofw_bus_subr.c == --- head/sys/dev/ofw/ofw_bus_subr.c Mon Dec 15 14:41:55 2008 (r186127) +++ head/sys/dev/ofw/ofw_bus_subr.c Mon Dec 15 15:31:10 2008 (r186128) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2001 - 2003 by Thomas Moestl t...@freebsd.org. * Copyright (c) 2005 Marius Strobl mar...@freebsd.org * All rights reserved. * @@ -33,7 +34,9 @@ __FBSDID($FreeBSD$); #include sys/systm.h #include sys/bus.h #include sys/errno.h +#include sys/libkern.h +#include dev/ofw/ofw_bus.h #include dev/ofw/ofw_bus_subr.h #include dev/ofw/openfirm.h @@ -71,6 +74,22 @@ ofw_bus_gen_destroy_devinfo(struct ofw_b free(obd-obd_type, M_OFWPROP); } +int +ofw_bus_gen_child_pnpinfo_str(device_t cbdev, device_t child, char *buf, +size_t buflen) +{ + if (ofw_bus_get_name(child) != NULL) { + strlcat(buf, name=, buflen); + strlcat(buf, ofw_bus_get_name(child), buflen); + } + + if (ofw_bus_get_compat(child) != NULL) { + strlcat(buf, compat=, buflen); + strlcat(buf, ofw_bus_get_compat(child), buflen); + } + + return (0); +}; const char * ofw_bus_gen_get_compat(device_t bus, device_t dev) @@ -126,3 +145,135 @@ ofw_bus_gen_get_type(device_t bus, devic return (NULL); return (obd-obd_type); } + +static int +ofw_bus_searchprop(phandle_t node, char *propname, void *buf, int buflen) +{ + int rv; + + for (; node != 0; node = OF_parent(node)) { + if ((rv = OF_getprop(node, propname, buf, buflen)) != -1) + return (rv); + } + return (-1); +} + +void +ofw_bus_setup_iinfo(phandle_t node, struct ofw_bus_iinfo *ii, int intrsz) +{ + pcell_t
svn commit: r186131 - head/usr.sbin/sysinstall
Author: kensmith Date: Mon Dec 15 15:46:56 2008 New Revision: 186131 URL: http://svn.freebsd.org/changeset/base/186131 Log: Don't tell the user to remove the media until its actually possible for them to remove the media. CDs need to be unmounted before they can be removed. Modified: head/usr.sbin/sysinstall/main.c head/usr.sbin/sysinstall/system.c Modified: head/usr.sbin/sysinstall/main.c == --- head/usr.sbin/sysinstall/main.c Mon Dec 15 15:42:24 2008 (r186130) +++ head/usr.sbin/sysinstall/main.c Mon Dec 15 15:46:56 2008 (r186131) @@ -201,8 +201,7 @@ main(int argc, char **argv) #if defined(__sparc64__) || !msgNoYes(Are you sure you wish to exit? The system will halt.) #else - || !msgNoYes(Are you sure you wish to exit? The system will reboot\n -(be sure to remove any floppies/CDs/DVDs from the drives).) + || !msgNoYes(Are you sure you wish to exit? The system will reboot.) #endif ) break; Modified: head/usr.sbin/sysinstall/system.c == --- head/usr.sbin/sysinstall/system.c Mon Dec 15 15:42:24 2008 (r186130) +++ head/usr.sbin/sysinstall/system.c Mon Dec 15 15:46:56 2008 (r186131) @@ -235,8 +235,13 @@ void systemShutdown(int status) { /* If some media is open, close it down */ -if (status =0) - mediaClose(); +if (status =0) { + if (mediaDevice != NULL mediaDevice-type == DEVICE_TYPE_CDROM) { + mediaClose(); + msgConfirm(Be sure to remove the media from the drive.); + } else + mediaClose(); +} /* write out any changes to rc.conf .. */ configRC_conf(); ___ 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: r186131 - head/usr.sbin/sysinstall
On Mon, 2008-12-15 at 15:46 +, Ken Smith wrote: Author: kensmith Date: Mon Dec 15 15:46:56 2008 New Revision: 186131 URL: http://svn.freebsd.org/changeset/base/186131 Log: Don't tell the user to remove the media until its actually possible for them to remove the media. CDs need to be unmounted before they can be removed. I could have sworn I saw a PR complaining about this a couple months ago (the PR itself was much older) because that's what reminded me this was a problem. I stopped expecting to be able to remove the media before the reboot started a long time ago... Anyway, I can't seem to find the PR now. If it does exist and if anyone somehow manages to trip across it could you assign it to me so I can close it please? -- Ken Smith - From there to here, from here to | kensm...@cse.buffalo.edu there, funny things are everywhere. | - Theodore Geisel | ___ 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: r185941 - head/sys/dev/usb
Why not add those devices to u3g while at it? Nick Author: thompsa Date: Thu Dec 11 21:08:14 2008 New Revision: 185941 URL: http://svn.freebsd.org/changeset/base/185941 Log: Add entries for some Option, Sierra and Stelera 3G cards. Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs = = --- head/sys/dev/usb/usbdevs Thu Dec 11 18:32:05 2008 (r185940) +++ head/sys/dev/usb/usbdevs Thu Dec 11 21:08:14 2008(r185941) @@ -620,6 +620,7 @@ vendor AMIT 0x18c5 AMIT vendor QCOM 0x18e8 Qcom vendor LINKSYS3 0x1915 Linksys vendor QUALCOMMINC 0x19d2 Qualcomm, Incorporated +vendor STELERA 0x1a8d Stelera Wireless vendor DLINK 0x2001 D-Link vendor PLANEX2 0x2019 Planex Communications vendor ERICSSON 0x2282 Ericsson @@ -1876,6 +1877,7 @@ product OPTION VODAFONEMC3G 0x5000 Vodaf product OPTION GT3G 0x6000 GlobeTrotter 3G datacard product OPTION GT3GQUAD 0x6300 GlobeTrotter 3G QUAD datacard product OPTION GT3GPLUS 0x6600 GlobeTrotter 3G+ datacard +product OPTION GTICON322 0xd033 GlobeTrotter Icon322 storage product OPTION GTMAX36 0x6701 GlobeTrotter Max 3.6 Modem product OPTION GTMAXHSUPA0x7001 GlobeTrotter HSUPA @@ -2125,12 +2127,14 @@ product SIERRA AIRCARD595 0x0019 Sierra product SIERRA AC595U0x0120 Sierra Wireless AirCard 595U product SIERRA AC597E0x0021 Sierra Wireless AirCard 597E product SIERRA C597 0x0023 Sierra Wireless Compass 597 +product SIERRA AC875 0x6820 Sierra Wireless AirCard 875 product SIERRA AC880 0x6850 Sierra Wireless AirCard 880 product SIERRA AC881 0x6851 Sierra Wireless AirCard 881 product SIERRA AC880E0x6852 Sierra Wireless AirCard 880E product SIERRA AC881E0x6853 Sierra Wireless AirCard 881E product SIERRA AC880U0x6855 Sierra Wireless AirCard 880U product SIERRA AC881U0x6856 Sierra Wireless AirCard 881U +product SIERRA AC885U0x6880 Sierra Wireless AirCard 885U product SIERRA EM56250x0017 EM5625 product SIERRA MC57200x0218 MC5720 Wireless Modem product SIERRA MC5720_2 0x0018 MC5720 @@ -2253,6 +2257,10 @@ product SPARKLAN RT25730x0004 RT2573 /* Sphairon Access Systems GmbH products */ product SPHAIRON UB801R 0x0110 UB801R +/* Stelera Wireless products */ +product STELERA ZEROCD 0x1000 Zerocd Installer +product STELERA C105 0x1002 Stelera/Bandrish C105 USB + /* STMicroelectronics products */ product STMICRO BIOCPU 0x2016 Biometric Coprocessor product STMICRO COMMUNICATOR 0x7554 USB Communicator ___ 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-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: r186132 - head/sys/dev/mfi
Author: ambrisko Date: Mon Dec 15 17:11:40 2008 New Revision: 186132 URL: http://svn.freebsd.org/changeset/base/186132 Log: Change Dell's gen2 catch-all from Dell PERC H700/H800 to Dell PERC Gen2 and bump the driver version from 2 to 3 and fix the related style problem. Suggested by: LSI Modified: head/sys/dev/mfi/mfi.c head/sys/dev/mfi/mfi_pci.c Modified: head/sys/dev/mfi/mfi.c == --- head/sys/dev/mfi/mfi.c Mon Dec 15 15:46:56 2008(r186131) +++ head/sys/dev/mfi/mfi.c Mon Dec 15 17:11:40 2008(r186132) @@ -296,7 +296,8 @@ mfi_attach(struct mfi_softc *sc) uint32_t status; int error, commsz, framessz, sensesz; int frames, unit, max_fw_sge; -device_printf(sc-mfi_dev, Megaraid SAS driver Ver 2.00 \n); + + device_printf(sc-mfi_dev, Megaraid SAS driver Ver 3.00 \n); mtx_init(sc-mfi_io_lock, MFI I/O lock, NULL, MTX_DEF); sx_init(sc-mfi_config_lock, MFI config); Modified: head/sys/dev/mfi/mfi_pci.c == --- head/sys/dev/mfi/mfi_pci.c Mon Dec 15 15:46:56 2008(r186131) +++ head/sys/dev/mfi/mfi_pci.c Mon Dec 15 17:11:40 2008(r186132) @@ -123,7 +123,7 @@ struct mfi_ident { {0x1000, 0x0079, 0x1028, 0x1f18, MFI_FLAGS_GEN2, Dell PERC H700 Modular}, {0x1000, 0x0079, 0x1028, 0x1f19, MFI_FLAGS_GEN2, Dell PERC H700}, {0x1000, 0x0079, 0x1028, 0x1f1b, MFI_FLAGS_GEN2, Dell PERC H800}, - {0x1000, 0x0079, 0x1028, 0x, MFI_FLAGS_GEN2, Dell PERC H700/H800}, + {0x1000, 0x0079, 0x1028, 0x, MFI_FLAGS_GEN2, Dell PERC Gen2}, {0x1000, 0x0079, 0x, 0x, MFI_FLAGS_GEN2, LSI MegaSAS Gen2}, {0x1000, 0x007c, 0x, 0x, MFI_FLAGS_1078, LSI MegaSAS 1078}, {0x1000, 0x0411, 0x, 0x, MFI_FLAGS_1064R, LSI MegaSAS 1064R}, /* Brocton IOP */ ___ 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: r186133 - head/sys/dev/ofw
Author: nwhitehorn Date: Mon Dec 15 18:20:59 2008 New Revision: 186133 URL: http://svn.freebsd.org/changeset/base/186133 Log: Unbreak ofwdump build by moving the pcell_t definition to after the kernel types headers, and inside the _KERNEL ifdef. Pointy hat to: me Modified: head/sys/dev/ofw/openfirm.h Modified: head/sys/dev/ofw/openfirm.h == --- head/sys/dev/ofw/openfirm.h Mon Dec 15 17:11:40 2008(r186132) +++ head/sys/dev/ofw/openfirm.h Mon Dec 15 18:20:59 2008(r186133) @@ -69,12 +69,6 @@ typedef unsigned long cell_t; typedefunsigned intihandle_t; typedef unsigned int phandle_t; -/* - * Other than in Open Firmware calls, the size of a bus cell seems to be - * always the same. - */ -typedef u_int32_t pcell_t; - #ifdef _KERNEL #include sys/cdefs.h #include sys/types.h @@ -83,6 +77,12 @@ typedef u_int32_t pcell_t; MALLOC_DECLARE(M_OFWPROP); /* + * Other than in Open Firmware calls, the size of a bus cell seems to be + * always the same. + */ +typedef u_int32_t pcell_t; + +/* * Stuff that is used by the Open Firmware code. */ void set_openfirm_callback(int (*)(void *)); ___ 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: r186134 - in stable/7/sys: . dev/bge
Author: marius Date: Mon Dec 15 20:32:16 2008 New Revision: 186134 URL: http://svn.freebsd.org/changeset/base/186134 Log: - Limit BCM5701 B5 to 32-bit mode as a workaround for a bug which causes data corruption in combination with certain bridges. Information about this problem was kindly provided by davidch. [1] - As BGE_FLAG_PCIX is meant to indicate that the controller is in PCI-X mode, revert to the pre __FreeBSD_version 602101 method of reading the bus mode register rather than checking the mere existence of a PCI-X capability, which is also there when the NIC f.e. is put into a 32-bit slot causing it not to be in PCI-X mode. Setting BGE_FLAG_PCIX inappropriately could cause the NIC to be tuned incorrectly. PR: 128833 [1] Reviewed by: jhb Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/dev/bge/if_bge.c Modified: stable/7/sys/dev/bge/if_bge.c == --- stable/7/sys/dev/bge/if_bge.c Mon Dec 15 18:20:59 2008 (r186133) +++ stable/7/sys/dev/bge/if_bge.c Mon Dec 15 20:32:16 2008 (r186134) @@ -1370,6 +1370,16 @@ bge_chipinit(struct bge_softc *sc) BGE_MODECTL_TX_NO_PHDR_CSUM); /* +* BCM5701 B5 have a bug causing data corruption when using +* 64-bit DMA reads, which can be terminated early and then +* completed later as 32-bit accesses, in combination with +* certain bridges. +*/ + if (sc-bge_asicrev == BGE_ASICREV_BCM5701 + sc-bge_chipid == BGE_CHIPID_BCM5701_B5) + BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_FORCE_PCI32); + + /* * Tell the firmware the driver is running */ if (sc-bge_asf_mode ASF_STACKUP) @@ -2465,26 +2475,21 @@ bge_attach(device_t dev) */ if (reg != 0) sc-bge_flags |= BGE_FLAG_PCIE; - } else if (pci_find_extcap(dev, PCIY_PCIX, reg) == 0) { - if (reg != 0) - sc-bge_flags |= BGE_FLAG_PCIX; - } - #else if (BGE_IS_5705_PLUS(sc)) { reg = pci_read_config(dev, BGE_PCIE_CAPID_REG, 4); if ((reg 0xFF) == BGE_PCIE_CAPID) sc-bge_flags |= BGE_FLAG_PCIE; +#endif } else { /* * Check if the device is in PCI-X Mode. * (This bit is not valid on PCI Express controllers.) */ - if ((pci_read_config(sc-bge_dev, BGE_PCI_PCISTATE, 4) + if ((pci_read_config(dev, BGE_PCI_PCISTATE, 4) BGE_PCISTATE_PCI_BUSMODE) == 0) sc-bge_flags |= BGE_FLAG_PCIX; } -#endif #if __FreeBSD_version 602105 { ___ 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: r186136 - in stable/6/sys: . dev/bge
Author: marius Date: Mon Dec 15 20:40:06 2008 New Revision: 186136 URL: http://svn.freebsd.org/changeset/base/186136 Log: - Limit BCM5701 B5 to 32-bit mode as a workaround for a bug which causes data corruption in combination with certain bridges. Information about this problem was kindly provided by davidch. [1] - As BGE_FLAG_PCIX is meant to indicate that the controller is in PCI-X mode, revert to the pre __FreeBSD_version 602101 method of reading the bus mode register rather than checking the mere existence of a PCI-X capability, which is also there when the NIC f.e. is put into a 32-bit slot causing it not to be in PCI-X mode. Setting BGE_FLAG_PCIX inappropriately could cause the NIC to be tuned incorrectly. PR: 128833 [1] Reviewed by: jhb Modified: stable/6/sys/ (props changed) stable/6/sys/dev/bge/if_bge.c Modified: stable/6/sys/dev/bge/if_bge.c == --- stable/6/sys/dev/bge/if_bge.c Mon Dec 15 20:36:32 2008 (r186135) +++ stable/6/sys/dev/bge/if_bge.c Mon Dec 15 20:40:06 2008 (r186136) @@ -1353,6 +1353,16 @@ bge_chipinit(struct bge_softc *sc) BGE_MODECTL_TX_NO_PHDR_CSUM); /* +* BCM5701 B5 have a bug causing data corruption when using +* 64-bit DMA reads, which can be terminated early and then +* completed later as 32-bit accesses, in combination with +* certain bridges. +*/ + if (sc-bge_asicrev == BGE_ASICREV_BCM5701 + sc-bge_chipid == BGE_CHIPID_BCM5701_B5) + BGE_SETBIT(sc, BGE_MODE_CTL, BGE_MODECTL_FORCE_PCI32); + + /* * Tell the firmware the driver is running */ if (sc-bge_asf_mode ASF_STACKUP) @@ -2448,26 +2458,21 @@ bge_attach(device_t dev) */ if (reg != 0) sc-bge_flags |= BGE_FLAG_PCIE; - } else if (pci_find_extcap(dev, PCIY_PCIX, reg) == 0) { - if (reg != 0) - sc-bge_flags |= BGE_FLAG_PCIX; - } - #else if (BGE_IS_5705_PLUS(sc)) { reg = pci_read_config(dev, BGE_PCIE_CAPID_REG, 4); if ((reg 0xFF) == BGE_PCIE_CAPID) sc-bge_flags |= BGE_FLAG_PCIE; +#endif } else { /* * Check if the device is in PCI-X Mode. * (This bit is not valid on PCI Express controllers.) */ - if ((pci_read_config(sc-bge_dev, BGE_PCI_PCISTATE, 4) + if ((pci_read_config(dev, BGE_PCI_PCISTATE, 4) BGE_PCISTATE_PCI_BUSMODE) == 0) sc-bge_flags |= BGE_FLAG_PCIX; } -#endif #if __FreeBSD_version 602105 { ___ 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: r186137 - in stable/7/sys: . contrib/pf dev/cxgb dev/dc
Author: marius Date: Mon Dec 15 21:36:14 2008 New Revision: 186137 URL: http://svn.freebsd.org/changeset/base/186137 Log: MFC: 185750 - According to the corresponding Linux, NetBSD and OpenSolaris drivers, there should be a 1us delay after every write when bit-banging the MII. Also insert barriers in order to ensure the intended ordering. These changes hopefully will solve the bus wedging occasionally experienced with DM9102A since r182461. - Deobfuscate dc_mii_readreg() a bit. Approved by: re (kib) Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/dc/if_dc.c stable/7/sys/dev/dc/if_dcreg.h Modified: stable/7/sys/dev/dc/if_dc.c == --- stable/7/sys/dev/dc/if_dc.c Mon Dec 15 20:40:06 2008(r186136) +++ stable/7/sys/dev/dc/if_dc.c Mon Dec 15 21:36:14 2008(r186137) @@ -607,15 +607,22 @@ dc_read_eeprom(struct dc_softc *sc, cadd static void dc_mii_writebit(struct dc_softc *sc, int bit) { + uint32_t reg; - if (bit) - CSR_WRITE_4(sc, DC_SIO, - DC_SIO_ROMCTL_WRITE | DC_SIO_MII_DATAOUT); - else - CSR_WRITE_4(sc, DC_SIO, DC_SIO_ROMCTL_WRITE); - - DC_SETBIT(sc, DC_SIO, DC_SIO_MII_CLK); - DC_CLRBIT(sc, DC_SIO, DC_SIO_MII_CLK); + reg = DC_SIO_ROMCTL_WRITE | (bit != 0 ? DC_SIO_MII_DATAOUT : 0); + CSR_WRITE_4(sc, DC_SIO, reg); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); + + CSR_WRITE_4(sc, DC_SIO, reg | DC_SIO_MII_CLK); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); + CSR_WRITE_4(sc, DC_SIO, reg); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); } /* @@ -624,11 +631,22 @@ dc_mii_writebit(struct dc_softc *sc, int static int dc_mii_readbit(struct dc_softc *sc) { + uint32_t reg; - CSR_WRITE_4(sc, DC_SIO, DC_SIO_ROMCTL_READ | DC_SIO_MII_DIR); - CSR_READ_4(sc, DC_SIO); - DC_SETBIT(sc, DC_SIO, DC_SIO_MII_CLK); - DC_CLRBIT(sc, DC_SIO, DC_SIO_MII_CLK); + reg = DC_SIO_ROMCTL_READ | DC_SIO_MII_DIR; + CSR_WRITE_4(sc, DC_SIO, reg); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); + (void)CSR_READ_4(sc, DC_SIO); + CSR_WRITE_4(sc, DC_SIO, reg | DC_SIO_MII_CLK); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); + CSR_WRITE_4(sc, DC_SIO, reg); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); if (CSR_READ_4(sc, DC_SIO) DC_SIO_MII_DATAIN) return (1); @@ -644,6 +662,9 @@ dc_mii_sync(struct dc_softc *sc) int i; CSR_WRITE_4(sc, DC_SIO, DC_SIO_ROMCTL_WRITE); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); for (i = 0; i 32; i++) dc_mii_writebit(sc, 1); @@ -667,15 +688,13 @@ dc_mii_send(struct dc_softc *sc, u_int32 static int dc_mii_readreg(struct dc_softc *sc, struct dc_mii_frame *frame) { - int i, ack; + int i; /* * Set up frame for RX. */ frame-mii_stdelim = DC_MII_STARTDELIM; frame-mii_opcode = DC_MII_READOP; - frame-mii_turnaround = 0; - frame-mii_data = 0; /* * Sync the PHYs. @@ -690,38 +709,28 @@ dc_mii_readreg(struct dc_softc *sc, stru dc_mii_send(sc, frame-mii_phyaddr, 5); dc_mii_send(sc, frame-mii_regaddr, 5); -#ifdef notdef - /* Idle bit */ - dc_mii_writebit(sc, 1); - dc_mii_writebit(sc, 0); -#endif - - /* Check for ack. */ - ack = dc_mii_readbit(sc); - /* -* Now try reading data bits. If the ack failed, we still +* Now try reading data bits. If the turnaround failed, we still * need to clock through 16 cycles to keep the PHY(s) in sync. */ - if (ack) { + frame-mii_turnaround = dc_mii_readbit(sc); + if (frame-mii_turnaround != 0) { for (i = 0; i 16; i++) dc_mii_readbit(sc); goto fail; } - for (i = 0x8000; i; i = 1) { - if (!ack) { - if (dc_mii_readbit(sc)) - frame-mii_data |= i; - } + if (dc_mii_readbit(sc)) + frame-mii_data |= i; } fail: + /* Clock the idle bits. */ dc_mii_writebit(sc, 0); dc_mii_writebit(sc, 0); - if (ack) + if (frame-mii_turnaround != 0) return
svn commit: r186138 - in releng/7.1/sys: . contrib/pf dev/cxgb dev/dc
Author: marius Date: Mon Dec 15 21:37:40 2008 New Revision: 186138 URL: http://svn.freebsd.org/changeset/base/186138 Log: MFC: 185750 - According to the corresponding Linux, NetBSD and OpenSolaris drivers, there should be a 1us delay after every write when bit-banging the MII. Also insert barriers in order to ensure the intended ordering. These changes hopefully will solve the bus wedging occasionally experienced with DM9102A since r182461. - Deobfuscate dc_mii_readreg() a bit. Approved by: re (kib) Modified: releng/7.1/sys/ (props changed) releng/7.1/sys/contrib/pf/ (props changed) releng/7.1/sys/dev/cxgb/ (props changed) releng/7.1/sys/dev/dc/if_dc.c releng/7.1/sys/dev/dc/if_dcreg.h Modified: releng/7.1/sys/dev/dc/if_dc.c == --- releng/7.1/sys/dev/dc/if_dc.c Mon Dec 15 21:36:14 2008 (r186137) +++ releng/7.1/sys/dev/dc/if_dc.c Mon Dec 15 21:37:40 2008 (r186138) @@ -607,15 +607,22 @@ dc_read_eeprom(struct dc_softc *sc, cadd static void dc_mii_writebit(struct dc_softc *sc, int bit) { + uint32_t reg; - if (bit) - CSR_WRITE_4(sc, DC_SIO, - DC_SIO_ROMCTL_WRITE | DC_SIO_MII_DATAOUT); - else - CSR_WRITE_4(sc, DC_SIO, DC_SIO_ROMCTL_WRITE); - - DC_SETBIT(sc, DC_SIO, DC_SIO_MII_CLK); - DC_CLRBIT(sc, DC_SIO, DC_SIO_MII_CLK); + reg = DC_SIO_ROMCTL_WRITE | (bit != 0 ? DC_SIO_MII_DATAOUT : 0); + CSR_WRITE_4(sc, DC_SIO, reg); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); + + CSR_WRITE_4(sc, DC_SIO, reg | DC_SIO_MII_CLK); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); + CSR_WRITE_4(sc, DC_SIO, reg); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); } /* @@ -624,11 +631,22 @@ dc_mii_writebit(struct dc_softc *sc, int static int dc_mii_readbit(struct dc_softc *sc) { + uint32_t reg; - CSR_WRITE_4(sc, DC_SIO, DC_SIO_ROMCTL_READ | DC_SIO_MII_DIR); - CSR_READ_4(sc, DC_SIO); - DC_SETBIT(sc, DC_SIO, DC_SIO_MII_CLK); - DC_CLRBIT(sc, DC_SIO, DC_SIO_MII_CLK); + reg = DC_SIO_ROMCTL_READ | DC_SIO_MII_DIR; + CSR_WRITE_4(sc, DC_SIO, reg); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); + (void)CSR_READ_4(sc, DC_SIO); + CSR_WRITE_4(sc, DC_SIO, reg | DC_SIO_MII_CLK); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); + CSR_WRITE_4(sc, DC_SIO, reg); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); if (CSR_READ_4(sc, DC_SIO) DC_SIO_MII_DATAIN) return (1); @@ -644,6 +662,9 @@ dc_mii_sync(struct dc_softc *sc) int i; CSR_WRITE_4(sc, DC_SIO, DC_SIO_ROMCTL_WRITE); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); for (i = 0; i 32; i++) dc_mii_writebit(sc, 1); @@ -667,15 +688,13 @@ dc_mii_send(struct dc_softc *sc, u_int32 static int dc_mii_readreg(struct dc_softc *sc, struct dc_mii_frame *frame) { - int i, ack; + int i; /* * Set up frame for RX. */ frame-mii_stdelim = DC_MII_STARTDELIM; frame-mii_opcode = DC_MII_READOP; - frame-mii_turnaround = 0; - frame-mii_data = 0; /* * Sync the PHYs. @@ -690,38 +709,28 @@ dc_mii_readreg(struct dc_softc *sc, stru dc_mii_send(sc, frame-mii_phyaddr, 5); dc_mii_send(sc, frame-mii_regaddr, 5); -#ifdef notdef - /* Idle bit */ - dc_mii_writebit(sc, 1); - dc_mii_writebit(sc, 0); -#endif - - /* Check for ack. */ - ack = dc_mii_readbit(sc); - /* -* Now try reading data bits. If the ack failed, we still +* Now try reading data bits. If the turnaround failed, we still * need to clock through 16 cycles to keep the PHY(s) in sync. */ - if (ack) { + frame-mii_turnaround = dc_mii_readbit(sc); + if (frame-mii_turnaround != 0) { for (i = 0; i 16; i++) dc_mii_readbit(sc); goto fail; } - for (i = 0x8000; i; i = 1) { - if (!ack) { - if (dc_mii_readbit(sc)) - frame-mii_data |= i; - } + if (dc_mii_readbit(sc)) + frame-mii_data |= i; } fail: + /* Clock the idle bits. */ dc_mii_writebit(sc, 0); dc_mii_writebit(sc, 0); - if (ack) + if (frame-mii_turnaround
svn commit: r186139 - in stable/6/sys: . pci
Author: marius Date: Mon Dec 15 21:39:31 2008 New Revision: 186139 URL: http://svn.freebsd.org/changeset/base/186139 Log: - According to the corresponding Linux, NetBSD and OpenSolaris drivers, there should be a 1us delay after every write when bit-banging the MII. Also insert barriers in order to ensure the intended ordering. These changes hopefully will solve the bus wedging occasionally experienced with DM9102A since r182461. - Deobfuscate dc_mii_readreg() a bit. Modified: stable/6/sys/ (props changed) stable/6/sys/pci/if_dc.c stable/6/sys/pci/if_dcreg.h Modified: stable/6/sys/pci/if_dc.c == --- stable/6/sys/pci/if_dc.cMon Dec 15 21:37:40 2008(r186138) +++ stable/6/sys/pci/if_dc.cMon Dec 15 21:39:31 2008(r186139) @@ -616,15 +616,22 @@ dc_read_eeprom(struct dc_softc *sc, cadd static void dc_mii_writebit(struct dc_softc *sc, int bit) { + uint32_t reg; - if (bit) - CSR_WRITE_4(sc, DC_SIO, - DC_SIO_ROMCTL_WRITE | DC_SIO_MII_DATAOUT); - else - CSR_WRITE_4(sc, DC_SIO, DC_SIO_ROMCTL_WRITE); - - DC_SETBIT(sc, DC_SIO, DC_SIO_MII_CLK); - DC_CLRBIT(sc, DC_SIO, DC_SIO_MII_CLK); + reg = DC_SIO_ROMCTL_WRITE | (bit != 0 ? DC_SIO_MII_DATAOUT : 0); + CSR_WRITE_4(sc, DC_SIO, reg); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); + + CSR_WRITE_4(sc, DC_SIO, reg | DC_SIO_MII_CLK); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); + CSR_WRITE_4(sc, DC_SIO, reg); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); } /* @@ -633,11 +640,22 @@ dc_mii_writebit(struct dc_softc *sc, int static int dc_mii_readbit(struct dc_softc *sc) { + uint32_t reg; - CSR_WRITE_4(sc, DC_SIO, DC_SIO_ROMCTL_READ | DC_SIO_MII_DIR); - CSR_READ_4(sc, DC_SIO); - DC_SETBIT(sc, DC_SIO, DC_SIO_MII_CLK); - DC_CLRBIT(sc, DC_SIO, DC_SIO_MII_CLK); + reg = DC_SIO_ROMCTL_READ | DC_SIO_MII_DIR; + CSR_WRITE_4(sc, DC_SIO, reg); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); + (void)CSR_READ_4(sc, DC_SIO); + CSR_WRITE_4(sc, DC_SIO, reg | DC_SIO_MII_CLK); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); + CSR_WRITE_4(sc, DC_SIO, reg); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); if (CSR_READ_4(sc, DC_SIO) DC_SIO_MII_DATAIN) return (1); @@ -653,6 +671,9 @@ dc_mii_sync(struct dc_softc *sc) int i; CSR_WRITE_4(sc, DC_SIO, DC_SIO_ROMCTL_WRITE); + CSR_BARRIER_4(sc, DC_SIO, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + DELAY(1); for (i = 0; i 32; i++) dc_mii_writebit(sc, 1); @@ -676,15 +697,13 @@ dc_mii_send(struct dc_softc *sc, u_int32 static int dc_mii_readreg(struct dc_softc *sc, struct dc_mii_frame *frame) { - int i, ack; + int i; /* * Set up frame for RX. */ frame-mii_stdelim = DC_MII_STARTDELIM; frame-mii_opcode = DC_MII_READOP; - frame-mii_turnaround = 0; - frame-mii_data = 0; /* * Sync the PHYs. @@ -699,38 +718,28 @@ dc_mii_readreg(struct dc_softc *sc, stru dc_mii_send(sc, frame-mii_phyaddr, 5); dc_mii_send(sc, frame-mii_regaddr, 5); -#ifdef notdef - /* Idle bit */ - dc_mii_writebit(sc, 1); - dc_mii_writebit(sc, 0); -#endif - - /* Check for ack. */ - ack = dc_mii_readbit(sc); - /* -* Now try reading data bits. If the ack failed, we still +* Now try reading data bits. If the turnaround failed, we still * need to clock through 16 cycles to keep the PHY(s) in sync. */ - if (ack) { + frame-mii_turnaround = dc_mii_readbit(sc); + if (frame-mii_turnaround != 0) { for (i = 0; i 16; i++) dc_mii_readbit(sc); goto fail; } - for (i = 0x8000; i; i = 1) { - if (!ack) { - if (dc_mii_readbit(sc)) - frame-mii_data |= i; - } + if (dc_mii_readbit(sc)) + frame-mii_data |= i; } fail: + /* Clock the idle bits. */ dc_mii_writebit(sc, 0); dc_mii_writebit(sc, 0); - if (ack) + if (frame-mii_turnaround != 0) return (1); return (0); } @@ -745,7 +754,6 @@ dc_mii_writereg(struct dc_softc *sc, str /* * Set up frame for TX. */
svn commit: r186140 - head/sys/dev/isp
Author: marius Date: Mon Dec 15 21:42:38 2008 New Revision: 186140 URL: http://svn.freebsd.org/changeset/base/186140 Log: Don't try reading the SXP_PINS_DIFF on the 10160 and 12160 SCSI controllers. Reading this register, for which there are indications that it doesn't really exist, returns 0 on at least some 12160 and doing so on Sun Fire V880 causes a data access error exception. Reported and tested by: Beat Gaetzi Approved by: mjacob Obtained from:OpenBSD (modulo setting isp_lvdmode) Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c == --- head/sys/dev/isp/isp.c Mon Dec 15 21:39:31 2008(r186139) +++ head/sys/dev/isp/isp.c Mon Dec 15 21:42:38 2008(r186140) @@ -335,6 +335,23 @@ isp_reset(ispsoftc_t *isp) /* * XXX: Should probably do some bus sensing. */ + } else if (IS_ULTRA3(isp)) { + sdparam *sdp = isp-isp_param; + + isp-isp_clock = 100; + + if (IS_10160(isp)) + btype = 10160; + else if (IS_12160(isp)) + btype = 12160; + else + btype = UNKLVD; + sdp-isp_lvdmode = 1; + + if (IS_DUALBUS(isp)) { + sdp++; + sdp-isp_lvdmode = 1; + } } else if (IS_ULTRA2(isp)) { static const char m[] = bus %d is in %s Mode; uint16_t l; @@ -346,10 +363,6 @@ isp_reset(ispsoftc_t *isp) btype = 1280; else if (IS_1080(isp)) btype = 1080; - else if (IS_10160(isp)) - btype = 10160; - else if (IS_12160(isp)) - btype = 12160; else btype = UNKLVD; ___ 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: r186141 - in head/sys: netinet netinet6 netipsec
Author: bz Date: Mon Dec 15 21:50:54 2008 New Revision: 186141 URL: http://svn.freebsd.org/changeset/base/186141 Log: Another step assimilating IPv[46] PCB code - directly use the inpcb names rather than the following IPv6 compat macros: in6pcb,in6p_sp, in6p_ip6_nxt,in6p_flowinfo,in6p_vflag, in6p_flags,in6p_socket,in6p_lport,in6p_fport,in6p_ppcb and sotoin6pcb(). Apart from removing duplicate code in netipsec, this is a pure whitespace, not a functional change. Discussed with: rwatson Reviewed by: rwatson (version before review requested changes) MFC after:4 weeks (set the timer and see then) Modified: head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_usrreq.c head/sys/netinet6/icmp6.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/in6_src.c head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_output.c head/sys/netinet6/raw_ip6.c head/sys/netinet6/udp6_usrreq.c head/sys/netipsec/ipsec.c head/sys/netipsec/key.c Modified: head/sys/netinet/tcp_subr.c == --- head/sys/netinet/tcp_subr.c Mon Dec 15 21:42:38 2008(r186140) +++ head/sys/netinet/tcp_subr.c Mon Dec 15 21:50:54 2008(r186141) @@ -434,7 +434,7 @@ tcpip_fillheaders(struct inpcb *inp, voi ip6 = (struct ip6_hdr *)ip_ptr; ip6-ip6_flow = (ip6-ip6_flow ~IPV6_FLOWINFO_MASK) | - (inp-in6p_flowinfo IPV6_FLOWINFO_MASK); + (inp-inp_flow IPV6_FLOWINFO_MASK); ip6-ip6_vfc = (ip6-ip6_vfc ~IPV6_VERSION_MASK) | (IPV6_VERSION IPV6_VERSION_MASK); ip6-ip6_nxt = IPPROTO_TCP; Modified: head/sys/netinet/tcp_syncache.c == --- head/sys/netinet/tcp_syncache.c Mon Dec 15 21:42:38 2008 (r186140) +++ head/sys/netinet/tcp_syncache.c Mon Dec 15 21:50:54 2008 (r186141) @@ -708,8 +708,8 @@ syncache_socket(struct syncache *sc, str goto abort; } /* Override flowlabel from in6_pcbconnect. */ - inp-in6p_flowinfo = ~IPV6_FLOWLABEL_MASK; - inp-in6p_flowinfo |= sc-sc_flowlabel; + inp-inp_flow = ~IPV6_FLOWLABEL_MASK; + inp-inp_flow |= sc-sc_flowlabel; } else #endif { @@ -994,7 +994,7 @@ _syncache_add(struct in_conninfo *inc, s #ifdef INET6 if (inc-inc_isipv6 - (inp-in6p_flags IN6P_AUTOFLOWLABEL)) + (inp-inp_flags IN6P_AUTOFLOWLABEL)) autoflowlabel = 1; #endif ip_ttl = inp-inp_ip_ttl; @@ -1654,7 +1654,7 @@ syncookie_lookup(struct in_conninfo *inc #ifdef INET6 if (inc-inc_isipv6) { - if (sotoinpcb(so)-in6p_flags IN6P_AUTOFLOWLABEL) + if (sotoinpcb(so)-inp_flags IN6P_AUTOFLOWLABEL) sc-sc_flowlabel = md5_buffer[1] IPV6_FLOWLABEL_MASK; } else #endif Modified: head/sys/netinet/tcp_usrreq.c == --- head/sys/netinet/tcp_usrreq.c Mon Dec 15 21:42:38 2008 (r186140) +++ head/sys/netinet/tcp_usrreq.c Mon Dec 15 21:50:54 2008 (r186141) @@ -1167,9 +1167,9 @@ tcp6_connect(struct tcpcb *tp, struct so inp-in6p_faddr = sin6-sin6_addr; inp-inp_fport = sin6-sin6_port; /* update flowinfo - draft-itojun-ipv6-flowlabel-api-00 */ - inp-in6p_flowinfo = ~IPV6_FLOWLABEL_MASK; - if (inp-in6p_flags IN6P_AUTOFLOWLABEL) - inp-in6p_flowinfo |= + inp-inp_flow = ~IPV6_FLOWLABEL_MASK; + if (inp-inp_flags IN6P_AUTOFLOWLABEL) + inp-inp_flow |= (htonl(ip6_randomflowlabel()) IPV6_FLOWLABEL_MASK); in_pcbrehash(inp); Modified: head/sys/netinet6/icmp6.c == --- head/sys/netinet6/icmp6.c Mon Dec 15 21:42:38 2008(r186140) +++ head/sys/netinet6/icmp6.c Mon Dec 15 21:50:54 2008(r186141) @@ -1899,8 +1899,8 @@ icmp6_rip6_input(struct mbuf **mp, int o INIT_VNET_INET6(curvnet); struct mbuf *m = *mp; struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); - struct in6pcb *in6p; - struct in6pcb *last = NULL; + struct inpcb *in6p; + struct inpcb *last = NULL; struct sockaddr_in6 fromsa; struct icmp6_hdr *icmp6; struct mbuf *opts = NULL; @@ -1933,7 +1933,7 @@ icmp6_rip6_input(struct mbuf **mp, int o LIST_FOREACH(in6p, V_ripcb, inp_list) { if ((in6p-inp_vflag INP_IPV6) == 0) continue; - if (in6p-in6p_ip6_nxt != IPPROTO_ICMPV6) + if (in6p-inp_ip_p != IPPROTO_ICMPV6) continue; if
Re: svn commit: r186141 - in head/sys: netinet netinet6 netipsec
On Mon, 15 Dec 2008, Bjoern A. Zeeb wrote: Hi, Author: bz Date: Mon Dec 15 21:50:54 2008 New Revision: 186141 URL: http://svn.freebsd.org/changeset/base/186141 Log: Another step assimilating IPv[46] PCB code - directly use the inpcb names rather than the following IPv6 compat macros: in6pcb,in6p_sp, in6p_ip6_nxt,in6p_flowinfo,in6p_vflag, in6p_flags,in6p_socket,in6p_lport,in6p_fport,in6p_ppcb and sotoin6pcb(). This is going to be the first in a series of smaller commits over the next days. Once we are (I am) through with the (whitespace) assimilation we might be more agressive on code and some inpcb fields, either removing or possibly renaming them. Note: the macros are going to stay for compat and 3rd party reasons, etc. (at least for another while). Note: SCTP was deliberately ignored and left out from the changes. /bz -- Bjoern A. Zeeb The greatest risk is not taking one. ___ 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: r186143 - head/sys/net80211
Author: sam Date: Mon Dec 15 22:31:54 2008 New Revision: 186143 URL: http://svn.freebsd.org/changeset/base/186143 Log: remove extraneous ';' Modified: head/sys/net80211/ieee80211_crypto.h Modified: head/sys/net80211/ieee80211_crypto.h == --- head/sys/net80211/ieee80211_crypto.hMon Dec 15 21:54:23 2008 (r186142) +++ head/sys/net80211/ieee80211_crypto.hMon Dec 15 22:31:54 2008 (r186143) @@ -218,7 +218,7 @@ static __inline void ieee80211_crypto_resetkey(struct ieee80211vap *vap, struct ieee80211_key *k, ieee80211_keyix ix) { - k-wk_cipher = ieee80211_cipher_none;; + k-wk_cipher = ieee80211_cipher_none; k-wk_private = k-wk_cipher-ic_attach(vap, k); k-wk_keyix = k-wk_rxkeyix = ix; k-wk_flags = IEEE80211_KEY_XMIT | IEEE80211_KEY_RECV; ___ 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: r186144 - head/sys/net80211
Author: sam Date: Mon Dec 15 22:50:50 2008 New Revision: 186144 URL: http://svn.freebsd.org/changeset/base/186144 Log: Fix ucastkey teardown for drivers that plumb clear keys or similar (e.g. ath): we must check the key index and not whether the key points at a cipher other than undef. This looks like it's been broken for a while. Might be worth adding an explicit clear cipher at some point though this would require changes to the usage of IEEE80211_KEY_UNDEFINED. PR: 125906 Modified: head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_node.c == --- head/sys/net80211/ieee80211_node.c Mon Dec 15 22:31:54 2008 (r186143) +++ head/sys/net80211/ieee80211_node.c Mon Dec 15 22:50:50 2008 (r186144) @@ -1643,7 +1643,7 @@ ieee80211_node_delucastkey(struct ieee80 IEEE80211_NODE_LOCK(nt); nikey = NULL; status = 1; /* NB: success */ - if (!IEEE80211_KEY_UNDEFINED(ni-ni_ucastkey)) { + if (ni-ni_ucastkey.wk_keyix != IEEE80211_KEYIX_NONE) { keyix = ni-ni_ucastkey.wk_rxkeyix; status = ieee80211_crypto_delkey(ni-ni_vap, ni-ni_ucastkey); if (nt-nt_keyixmap != NULL keyix nt-nt_keyixmax) { ___ 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: r186145 - head/sys/dev/sound/pci/hda
Author: mav Date: Mon Dec 15 23:49:09 2008 New Revision: 186145 URL: http://svn.freebsd.org/changeset/base/186145 Log: Add VIA VT1708B codec IDs. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c == --- head/sys/dev/sound/pci/hda/hdac.c Mon Dec 15 22:50:50 2008 (r186144) +++ head/sys/dev/sound/pci/hda/hdac.c Mon Dec 15 23:49:09 2008 (r186145) @@ -669,6 +669,14 @@ static const struct { #define HDA_CODEC_VT1709_5 HDA_CODEC_CONSTRUCT(VIA, 0xe715) #define HDA_CODEC_VT1709_6 HDA_CODEC_CONSTRUCT(VIA, 0xe716) #define HDA_CODEC_VT1709_7 HDA_CODEC_CONSTRUCT(VIA, 0xe717) +#define HDA_CODEC_VT1708B_0HDA_CODEC_CONSTRUCT(VIA, 0xe720) +#define HDA_CODEC_VT1708B_1HDA_CODEC_CONSTRUCT(VIA, 0xe721) +#define HDA_CODEC_VT1708B_2HDA_CODEC_CONSTRUCT(VIA, 0xe722) +#define HDA_CODEC_VT1708B_3HDA_CODEC_CONSTRUCT(VIA, 0xe723) +#define HDA_CODEC_VT1708B_4HDA_CODEC_CONSTRUCT(VIA, 0xe724) +#define HDA_CODEC_VT1708B_5HDA_CODEC_CONSTRUCT(VIA, 0xe725) +#define HDA_CODEC_VT1708B_6HDA_CODEC_CONSTRUCT(VIA, 0xe726) +#define HDA_CODEC_VT1708B_7HDA_CODEC_CONSTRUCT(VIA, 0xe727) #define HDA_CODEC_VT HDA_CODEC_CONSTRUCT(VIA, 0x) /* ATI */ @@ -774,6 +782,14 @@ static const struct { { HDA_CODEC_VT1709_5, VIA VT1709_5 }, { HDA_CODEC_VT1709_6, VIA VT1709_6 }, { HDA_CODEC_VT1709_7, VIA VT1709_7 }, + { HDA_CODEC_VT1708B_0, VIA VT1708B_0 }, + { HDA_CODEC_VT1708B_1, VIA VT1708B_1 }, + { HDA_CODEC_VT1708B_2, VIA VT1708B_2 }, + { HDA_CODEC_VT1708B_3, VIA VT1708B_3 }, + { HDA_CODEC_VT1708B_4, VIA VT1708B_4 }, + { HDA_CODEC_VT1708B_5, VIA VT1708B_5 }, + { HDA_CODEC_VT1708B_6, VIA VT1708B_6 }, + { HDA_CODEC_VT1708B_7, VIA VT1708B_7 }, /* Unknown codec */ { HDA_CODEC_ALC, Realtek (Unknown) }, { HDA_CODEC_AD,Analog Devices (Unknown) }, ___ 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: r186146 - head/sys/dev/sound/pci/hda
Author: mav Date: Tue Dec 16 00:08:51 2008 New Revision: 186146 URL: http://svn.freebsd.org/changeset/base/186146 Log: Add some HDMI codec IDs. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c == --- head/sys/dev/sound/pci/hda/hdac.c Mon Dec 15 23:49:09 2008 (r186145) +++ head/sys/dev/sound/pci/hda/hdac.c Tue Dec 16 00:08:51 2008 (r186146) @@ -635,6 +635,7 @@ static const struct { /* Silicon Image */ #define SII_VENDORID 0x1095 +#define HDA_CODEC_SII1392 HDA_CODEC_CONSTRUCT(SII, 0x1392) #define HDA_CODEC_SII HDA_CODEC_CONSTRUCT(SII, 0x) /* Lucent/Agere */ @@ -680,6 +681,10 @@ static const struct { #define HDA_CODEC_VT HDA_CODEC_CONSTRUCT(VIA, 0x) /* ATI */ +#define HDA_CODEC_ATIRS600_1 HDA_CODEC_CONSTRUCT(ATI, 0x793c) +#define HDA_CODEC_ATIRS600_2 HDA_CODEC_CONSTRUCT(ATI, 0x7919) +#define HDA_CODEC_ATIRS690 HDA_CODEC_CONSTRUCT(ATI, 0x791a) +#define HDA_CODEC_ATIR6XX HDA_CODEC_CONSTRUCT(ATI, 0xaa01) #define HDA_CODEC_ATI HDA_CODEC_CONSTRUCT(ATI, 0x) /* NVIDIA */ @@ -790,6 +795,11 @@ static const struct { { HDA_CODEC_VT1708B_5, VIA VT1708B_5 }, { HDA_CODEC_VT1708B_6, VIA VT1708B_6 }, { HDA_CODEC_VT1708B_7, VIA VT1708B_7 }, + { HDA_CODEC_ATIRS600_1,ATI RS600 HDMI }, + { HDA_CODEC_ATIRS600_2,ATI RS600 HDMI }, + { HDA_CODEC_ATIRS690, ATI RS690/780 HDMI }, + { HDA_CODEC_ATIR6XX, ATI R6xx HDMI }, + { HDA_CODEC_SII1392, Silicon Image SiI1392 HDMI }, /* Unknown codec */ { HDA_CODEC_ALC, Realtek (Unknown) }, { HDA_CODEC_AD,Analog Devices (Unknown) }, ___ 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: r186147 - head/sys/netinet6
Author: kmacy Date: Tue Dec 16 00:16:51 2008 New Revision: 186147 URL: http://svn.freebsd.org/changeset/base/186147 Log: fix two use after frees in nd6_cache_lladdr caused by last minute unlock shuffling Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c == --- head/sys/netinet6/nd6.c Tue Dec 16 00:08:51 2008(r186146) +++ head/sys/netinet6/nd6.c Tue Dec 16 00:16:51 2008(r186147) @@ -1405,6 +1405,7 @@ nd6_cache_lladdr(struct ifnet *ifp, stru int llchange; int flags = 0; int newstate = 0; + uint16_t router; struct sockaddr_in6 sin6; struct mbuf *chain = NULL; @@ -1599,11 +1600,14 @@ nd6_cache_lladdr(struct ifnet *ifp, stru } if (ln) { + int static_route = (ln-la_flags LLE_STATIC); + router = ln-ln_router; + if (flags ND6_EXCLUSIVE) LLE_WUNLOCK(ln); else LLE_RUNLOCK(ln); - if (ln-la_flags LLE_STATIC) + if (static_route) ln = NULL; } if (chain) @@ -1624,7 +1628,7 @@ nd6_cache_lladdr(struct ifnet *ifp, stru * for those are not autoconfigured hosts, we explicitly avoid such * cases for safety. */ - if (do_update ln-ln_router !V_ip6_forwarding V_ip6_accept_rtadv) { + if (do_update router !V_ip6_forwarding V_ip6_accept_rtadv) { /* * guaranteed recursion */ ___ 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: r186148 - head/sys/netinet6
Author: kmacy Date: Tue Dec 16 00:18:04 2008 New Revision: 186148 URL: http://svn.freebsd.org/changeset/base/186148 Log: unlock looked up llentrys in defrouter_select Modified: head/sys/netinet6/nd6_rtr.c Modified: head/sys/netinet6/nd6_rtr.c == --- head/sys/netinet6/nd6_rtr.c Tue Dec 16 00:16:51 2008(r186147) +++ head/sys/netinet6/nd6_rtr.c Tue Dec 16 00:18:04 2008(r186148) @@ -653,6 +653,8 @@ defrouter_select(void) selected_dr = dr; } IF_AFDATA_UNLOCK(dr-ifp); + if (ln != NULL) + LLE_RUNLOCK(ln); if (dr-installed installed_dr == NULL) installed_dr = dr; @@ -683,6 +685,8 @@ defrouter_select(void) selected_dr = installed_dr; } IF_AFDATA_UNLOCK(installed_dr-ifp); + if (ln != NULL) + LLE_RUNLOCK(ln); } /* ___ 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: r186149 - head/sys/net
Author: kmacy Date: Tue Dec 16 00:20:15 2008 New Revision: 186149 URL: http://svn.freebsd.org/changeset/base/186149 Log: add macro for destroying an llentry's rwlock Modified: head/sys/net/if_llatbl.h Modified: head/sys/net/if_llatbl.h == --- head/sys/net/if_llatbl.hTue Dec 16 00:18:04 2008(r186148) +++ head/sys/net/if_llatbl.hTue Dec 16 00:20:15 2008(r186149) @@ -81,6 +81,7 @@ struct llentry { #defineLLE_DOWNGRADE(lle) rw_downgrade((lle)-lle_lock) #defineLLE_TRY_UPGRADE(lle)rw_try_upgrade((lle)-lle_lock) #defineLLE_LOCK_INIT(lle) rw_init_flags((lle)-lle_lock, lle, RW_DUPOK) +#defineLLE_LOCK_DESTROY(lle) rw_destroy((lle)-lle_lock) #defineLLE_WLOCK_ASSERT(lle) rw_assert((lle)-lle_lock, RA_WLOCKED) #define LLE_IS_VALID(lle) (((lle) != NULL) ((lle) != (void *)-1)) @@ -119,7 +120,7 @@ struct llentry { LLE_WUNLOCK(lle); \ } \ /* guard against invalid refs */\ - lle = 0;\ + lle = NULL; \ } while (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: r186150 - in head/sys: netinet netinet6
Author: kmacy Date: Tue Dec 16 00:20:49 2008 New Revision: 186150 URL: http://svn.freebsd.org/changeset/base/186150 Log: unlock and destroy an llentry's lock before freeing Found by: sam Modified: head/sys/netinet/in.c head/sys/netinet6/in6.c Modified: head/sys/netinet/in.c == --- head/sys/netinet/in.c Tue Dec 16 00:20:15 2008(r186149) +++ head/sys/netinet/in.c Tue Dec 16 00:20:49 2008(r186150) @@ -1060,6 +1060,8 @@ in_lltable_new(const struct sockaddr *l3 static void in_lltable_free(struct lltable *llt, struct llentry *lle) { + LLE_WUNLOCK(lle); + LLE_LOCK_DESTROY(lle); free(lle, M_LLTABLE); } Modified: head/sys/netinet6/in6.c == --- head/sys/netinet6/in6.c Tue Dec 16 00:20:15 2008(r186149) +++ head/sys/netinet6/in6.c Tue Dec 16 00:20:49 2008(r186150) @@ -2115,6 +2115,8 @@ in6_lltable_new(const struct sockaddr *l static void in6_lltable_free(struct lltable *llt, struct llentry *lle) { + LLE_WUNLOCK(lle); + LLE_LOCK_DESTROY(lle); free(lle, M_LLTABLE); } ___ 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: r186151 - head/sys/net80211
Author: sam Date: Tue Dec 16 01:17:36 2008 New Revision: 186151 URL: http://svn.freebsd.org/changeset/base/186151 Log: fix comment Submitted by: Daan Vreeken Modified: head/sys/net80211/ieee80211_hostap.c Modified: head/sys/net80211/ieee80211_hostap.c == --- head/sys/net80211/ieee80211_hostap.cTue Dec 16 00:20:49 2008 (r186150) +++ head/sys/net80211/ieee80211_hostap.cTue Dec 16 01:17:36 2008 (r186151) @@ -929,7 +929,7 @@ hostap_auth_open(struct ieee80211_node * */ ni-ni_flags |= IEEE80211_NODE_AREF; /* -* Mark the node as requiring a valid associatio id +* Mark the node as requiring a valid association id * before outbound traffic is permitted. */ ni-ni_flags |= IEEE80211_NODE_ASSOCID; ___ 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: r186152 - head/usr.sbin/sysinstall
Author: kensmith Date: Tue Dec 16 01:18:10 2008 New Revision: 186152 URL: http://svn.freebsd.org/changeset/base/186152 Log: Stop treating Xorg as a distribution in the mainline portion of sysinstall and leave it to be handled in the packages section (or post-install completely) along with all the other packages. Modified: head/usr.sbin/sysinstall/dispatch.c head/usr.sbin/sysinstall/dist.c head/usr.sbin/sysinstall/dist.h head/usr.sbin/sysinstall/menus.c head/usr.sbin/sysinstall/sysinstall.8 head/usr.sbin/sysinstall/sysinstall.h head/usr.sbin/sysinstall/system.c Modified: head/usr.sbin/sysinstall/dispatch.c == --- head/usr.sbin/sysinstall/dispatch.c Tue Dec 16 01:17:36 2008 (r186151) +++ head/usr.sbin/sysinstall/dispatch.c Tue Dec 16 01:18:10 2008 (r186152) @@ -70,10 +70,8 @@ static struct _word { { distSetCustom, distSetCustom }, { distUnsetCustom, distUnsetCustom }, { distSetDeveloper, distSetDeveloper}, -{ distSetXDeveloper, distSetXDeveloper }, { distSetKernDeveloper, distSetKernDeveloper}, { distSetUser, distSetUser }, -{ distSetXUser, distSetXUser}, { distSetMinimum,distSetMinimum }, { distSetEverything, distSetEverything }, { distSetSrc,distSetSrc }, Modified: head/usr.sbin/sysinstall/dist.c == --- head/usr.sbin/sysinstall/dist.c Tue Dec 16 01:17:36 2008 (r186151) +++ head/usr.sbin/sysinstall/dist.c Tue Dec 16 01:18:10 2008 (r186152) @@ -45,7 +45,6 @@ unsigned int Dists; unsigned int SrcDists; -unsigned int XOrgDists; unsigned int KernelDists; enum _disttype { DT_TARBALL, DT_SUBDIST, DT_PACKAGE }; @@ -63,7 +62,6 @@ typedef struct _dist { static Distribution KernelDistTable[]; static Distribution SrcDistTable[]; -static Distribution XOrgDistTable[]; #defineDTE_TARBALL(name, mask, flag, directory) \ { name, mask, DIST_ ## flag, DT_TARBALL, { directory } } @@ -92,7 +90,6 @@ static Distribution DistTable[] = { DTE_SUBDIST(src, Dists, SRC, SrcDistTable), DTE_TARBALL(ports,Dists, PORTS,/usr), DTE_TARBALL(local,Dists, LOCAL,/), -DTE_PACKAGE(X.Org,Dists, XORG, xorg), DTE_END, }; @@ -138,15 +135,11 @@ distVerifyFlags(void) { if (SrcDists) Dists |= DIST_SRC; -if (XOrgDists) - Dists |= DIST_XORG; if (KernelDists) Dists |= DIST_KERNEL; -if (isDebug()) { +if (isDebug()) msgDebug(Dist Masks: Dists: %0x, Srcs: %0x Kernels: %0x\n, Dists, SrcDists, KernelDists); - msgDebug(XServer: %0x\n, XOrgDists); -} } int @@ -154,7 +147,6 @@ distReset(dialogMenuItem *self) { Dists = 0; SrcDists = 0; -XOrgDists = 0; KernelDists = 0; return DITEM_SUCCESS | DITEM_REDRAW; } @@ -172,9 +164,6 @@ distConfig(dialogMenuItem *self) if ((cp = variable_get(VAR_DIST_SRC)) != NULL) SrcDists = atoi(cp); -if ((cp = variable_get(VAR_DIST_X11)) != NULL) - XOrgDists = atoi(cp); - if ((cp = variable_get(VAR_DIST_KERNEL)) != NULL) KernelDists = atoi(cp); @@ -182,14 +171,6 @@ distConfig(dialogMenuItem *self) return DITEM_SUCCESS | DITEM_REDRAW; } -static int -distSetX(void) -{ -Dists |= DIST_XORG; -XOrgDists = DIST_XORG_ALL; -return DITEM_SUCCESS; -} - int selectKernel(void) { @@ -216,17 +197,6 @@ distSetDeveloper(dialogMenuItem *self) } int -distSetXDeveloper(dialogMenuItem *self) -{ -int i; - -i = distSetDeveloper(self); -i |= distSetX(); -distVerifyFlags(); -return i; -} - -int distSetKernDeveloper(dialogMenuItem *self) { int i; @@ -241,17 +211,6 @@ distSetKernDeveloper(dialogMenuItem *sel } int -distSetXKernDeveloper(dialogMenuItem *self) -{ -int i; - -i = distSetKernDeveloper(self); -i |= distSetX(); -distVerifyFlags(); -return i; -} - -int distSetUser(dialogMenuItem *self) { int i; @@ -265,17 +224,6 @@ distSetUser(dialogMenuItem *self) } int -distSetXUser(dialogMenuItem *self) -{ -int i; - -i = distSetUser(self); -i |= distSetX(); -distVerifyFlags(); -return i; -} - -int distSetMinimum(dialogMenuItem *self) { distReset(NULL); @@ -292,7 +240,6 @@ distSetEverything(dialogMenuItem *self) Dists = DIST_ALL; SrcDists = DIST_SRC_ALL; -XOrgDists = DIST_XORG_ALL; KernelDists = DIST_KERNEL_ALL; i = distMaybeSetPorts(self); distVerifyFlags(); Modified: head/usr.sbin/sysinstall/dist.h == --- head/usr.sbin/sysinstall/dist.h Tue Dec 16 01:17:36 2008
svn commit: r186153 - head/sys/netinet6
Author: qingli Date: Tue Dec 16 01:21:19 2008 New Revision: 186153 URL: http://svn.freebsd.org/changeset/base/186153 Log: Initialize the variable router, and apply static_route flag across the entire nd6_cache_lladdr() function. Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c == --- head/sys/netinet6/nd6.c Tue Dec 16 01:18:10 2008(r186152) +++ head/sys/netinet6/nd6.c Tue Dec 16 01:21:19 2008(r186153) @@ -1405,9 +1405,10 @@ nd6_cache_lladdr(struct ifnet *ifp, stru int llchange; int flags = 0; int newstate = 0; - uint16_t router; + uint16_t router = 0; struct sockaddr_in6 sin6; struct mbuf *chain = NULL; + int static_route = 0; IF_AFDATA_UNLOCK_ASSERT(ifp); @@ -1441,8 +1442,10 @@ nd6_cache_lladdr(struct ifnet *ifp, stru is_newentry = 1; } else { /* do nothing if static ndp is set */ - if (ln-la_flags LLE_STATIC) + if (ln-la_flags LLE_STATIC) { + static_route = 1; goto done; + } is_newentry = 0; } if (ln == NULL) @@ -1600,7 +1603,7 @@ nd6_cache_lladdr(struct ifnet *ifp, stru } if (ln) { - int static_route = (ln-la_flags LLE_STATIC); + static_route = (ln-la_flags LLE_STATIC); router = ln-ln_router; if (flags ND6_EXCLUSIVE) @@ -1642,7 +1645,7 @@ done: LLE_WUNLOCK(ln); else LLE_RUNLOCK(ln); - if (ln-la_flags LLE_STATIC) + if (static_route) ln = NULL; } return (ln); ___ 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: r186154 - head/sys/kern
Author: mav Date: Tue Dec 16 01:24:05 2008 New Revision: 186154 URL: http://svn.freebsd.org/changeset/base/186154 Log: If possible, try to obtain max_mhz on cpufreq attach instead of first request. On HyperThreading CPUs logical cores have same frequency, so setting it on any core will change the other's one. In most cases first request to the second core will be the set request, done after setting frequency of the first core. In such case second CPU will obtain throttled frequency of the first core as it's max_mhz making cpufreq broken due to different frequency sets. Modified: head/sys/kern/kern_cpu.c Modified: head/sys/kern/kern_cpu.c == --- head/sys/kern/kern_cpu.cTue Dec 16 01:21:19 2008(r186153) +++ head/sys/kern/kern_cpu.cTue Dec 16 01:24:05 2008(r186154) @@ -144,7 +144,9 @@ static int cpufreq_attach(device_t dev) { struct cpufreq_softc *sc; + struct pcpu *pc; device_t parent; + uint64_t rate; int numdevs; CF_DEBUG(initializing %s\n, device_get_nameunit(dev)); @@ -156,7 +158,12 @@ cpufreq_attach(device_t dev) CF_MTX_INIT(sc-lock); sc-curr_level.total_set.freq = CPUFREQ_VAL_UNKNOWN; SLIST_INIT(sc-saved_freq); - sc-max_mhz = CPUFREQ_VAL_UNKNOWN; + /* Try to get current CPU freq to use it as maximum later if needed */ + pc = cpu_get_pcpu(dev); + if (cpu_est_clockrate(pc-pc_cpuid, rate) == 0) + sc-max_mhz = rate / 100; + else + sc-max_mhz = CPUFREQ_VAL_UNKNOWN; /* * Only initialize one set of sysctls for all CPUs. In the future, ___ 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: r186156 - head/sys/netinet6
Author: kmacy Date: Tue Dec 16 02:05:11 2008 New Revision: 186156 URL: http://svn.freebsd.org/changeset/base/186156 Log: need to check that lle is not null before unlock if the break condition is not met also fix the break condition to explicitly check against NULL Modified: head/sys/netinet6/nd6_rtr.c Modified: head/sys/netinet6/nd6_rtr.c == --- head/sys/netinet6/nd6_rtr.c Tue Dec 16 01:58:30 2008(r186155) +++ head/sys/netinet6/nd6_rtr.c Tue Dec 16 02:05:11 2008(r186156) @@ -1333,13 +1333,14 @@ find_pfxlist_reachable_router(struct nd_ for (pfxrtr = LIST_FIRST(pr-ndpr_advrtrs); pfxrtr; pfxrtr = LIST_NEXT(pfxrtr, pfr_entry)) { IF_AFDATA_LOCK(pfxrtr-router-ifp); - if ((ln = nd6_lookup(pfxrtr-router-rtaddr, 0, - pfxrtr-router-ifp)) + if (((ln = nd6_lookup(pfxrtr-router-rtaddr, 0, + pfxrtr-router-ifp)) != NULL) ND6_IS_LLINFO_PROBREACH(ln)) { LLE_RUNLOCK(ln); break; /* found */ } - LLE_RUNLOCK(ln); + if (ln != NULL) + LLE_RUNLOCK(ln); IF_AFDATA_UNLOCK(pfxrtr-router-ifp); } return (pfxrtr); ___ 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: r186157 - head/sys/netinet6
Author: kmacy Date: Tue Dec 16 02:06:26 2008 New Revision: 186157 URL: http://svn.freebsd.org/changeset/base/186157 Log: make sure redirect doesn't return without dropping the lock Modified: head/sys/netinet6/icmp6.c Modified: head/sys/netinet6/icmp6.c == --- head/sys/netinet6/icmp6.c Tue Dec 16 02:05:11 2008(r186156) +++ head/sys/netinet6/icmp6.c Tue Dec 16 02:06:26 2008(r186157) @@ -2453,6 +2453,7 @@ icmp6_redirect_output(struct mbuf *m0, s struct mbuf *m = NULL; /* newly allocated one */ struct ip6_hdr *ip6;/* m as struct ip6_hdr */ struct nd_redirect *nd_rd; + struct llentry *ln = NULL; size_t maxlen; u_char *p; struct ifnet *outif = NULL; @@ -2575,20 +2576,19 @@ icmp6_redirect_output(struct mbuf *m0, s { /* target lladdr option */ int len; - struct llentry *ln; struct nd_opt_hdr *nd_opt; char *lladdr; IF_AFDATA_LOCK(ifp); ln = nd6_lookup(router_ll6, 0, ifp); IF_AFDATA_UNLOCK(ifp); - if (!ln) + if (ln == NULL) goto nolladdropt; len = sizeof(*nd_opt) + ifp-if_addrlen; len = (len + 7) ~7; /* round by 8 */ /* safety check */ - if (len + (p - (u_char *)ip6) maxlen) + if (len + (p - (u_char *)ip6) maxlen) goto nolladdropt; if (ln-la_flags LLE_VALID) { @@ -2599,10 +2599,11 @@ icmp6_redirect_output(struct mbuf *m0, s bcopy(ln-ll_addr, lladdr, ifp-if_addrlen); p += len; } - LLE_RUNLOCK(ln); } -nolladdropt:; - +nolladdropt: + if (ln != NULL) + LLE_RUNLOCK(ln); + m-m_pkthdr.len = m-m_len = p - (u_char *)ip6; /* just to be safe */ ___ 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: r186131 - head/usr.sbin/sysinstall
On Mon, Dec 15, 2008 at 1:50 PM, Ken Smith kensm...@cse.buffalo.edu wrote: On Mon, 2008-12-15 at 15:46 +, Ken Smith wrote: Author: kensmith Date: Mon Dec 15 15:46:56 2008 New Revision: 186131 URL: http://svn.freebsd.org/changeset/base/186131 Log: Don't tell the user to remove the media until its actually possible for them to remove the media. CDs need to be unmounted before they can be removed. I could have sworn I saw a PR complaining about this a couple months ago (the PR itself was much older) because that's what reminded me this was a problem. I stopped expecting to be able to remove the media before the reboot started a long time ago... Anyway, I can't seem to find the PR now. If it does exist and if anyone somehow manages to trip across it could you assign it to me so I can close it please? Isn't it bin/122522? It is already assigned to you. :-) -- cd /usr/ports/sysutils/life make clean ___ 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: r186158 - head/sys/netinet6
Author: kmacy Date: Tue Dec 16 02:30:42 2008 New Revision: 186158 URL: http://svn.freebsd.org/changeset/base/186158 Log: check return from lla_lookup against NULL not zero Modified: head/sys/netinet6/in6.c head/sys/netinet6/in6_src.c Modified: head/sys/netinet6/in6.c == --- head/sys/netinet6/in6.c Tue Dec 16 02:06:26 2008(r186157) +++ head/sys/netinet6/in6.c Tue Dec 16 02:30:42 2008(r186158) @@ -1593,7 +1593,7 @@ in6_ifinit(struct ifnet *ifp, struct in6 ln = lla_lookup(LLTABLE6(ifp), (LLE_CREATE | LLE_IFADDR | LLE_EXCLUSIVE), (struct sockaddr *)ia-ia_addr); IF_AFDATA_UNLOCK(ifp); - if (ln) { + if (ln != NULL) { ln-la_expire = 0; /* for IPv6 this means permanent */ ln-ln_state = ND6_LLINFO_REACHABLE; LLE_WUNLOCK(ln); Modified: head/sys/netinet6/in6_src.c == --- head/sys/netinet6/in6_src.c Tue Dec 16 02:06:26 2008(r186157) +++ head/sys/netinet6/in6_src.c Tue Dec 16 02:30:42 2008(r186158) @@ -574,7 +574,7 @@ selectroute(struct sockaddr_in6 *dstsock IF_AFDATA_LOCK(ifp); la = lla_lookup(LLTABLE6(ifp), 0, (struct sockaddr *)sin6_next-sin6_addr); IF_AFDATA_UNLOCK(ifp); - if (la) + if (la != NULL) LLE_RUNLOCK(la); else { error = EHOSTUNREACH; ___ 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: r186159 - head/sys/netinet6
Author: kmacy Date: Tue Dec 16 02:33:53 2008 New Revision: 186159 URL: http://svn.freebsd.org/changeset/base/186159 Log: advance tail pointer in nd6_output_lle and check lla_output return against NULL Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c == --- head/sys/netinet6/nd6.c Tue Dec 16 02:30:42 2008(r186158) +++ head/sys/netinet6/nd6.c Tue Dec 16 02:33:53 2008(r186159) @@ -1407,7 +1407,7 @@ nd6_cache_lladdr(struct ifnet *ifp, stru int newstate = 0; uint16_t router = 0; struct sockaddr_in6 sin6; - struct mbuf *chain = NULL; + struct mbuf *tail = NULL, *chain = NULL; int static_route = 0; IF_AFDATA_UNLOCK_ASSERT(ifp); @@ -1526,7 +1526,9 @@ nd6_cache_lladdr(struct ifnet *ifp, stru * just set the 2nd argument as the * 1st one. */ - nd6_output_lle(ifp, ifp, m_hold, L3_ADDR_SIN6(ln), NULL, ln, chain); + nd6_output_lle(ifp, ifp, m_hold, L3_ADDR_SIN6(ln), NULL, ln, tail); + if ((tail != NULL) chain == (NULL)) + chain = tail; } if (chain) memcpy(sin6, L3_ADDR_SIN6(ln), sizeof(sin6)); @@ -1889,8 +1891,10 @@ nd6_output_lle(struct ifnet *ifp, struct if (lle != NULL) { if (*tail == NULL) *tail = m; - else + else { (*tail)-m_nextpkt = m; + *tail = m; + } return (error); } if ((ifp-if_flags IFF_LOOPBACK) != 0) { @@ -2037,7 +2041,7 @@ nd6_storelladdr(struct ifnet *ifp, struc ln = lla_lookup(LLTABLE6(ifp), 0, dst); IF_AFDATA_UNLOCK(ifp); if ((ln == NULL) || !(ln-la_flags LLE_VALID)) { - if (ln) + if (ln != NULL) LLE_RUNLOCK(ln); /* this could happen, if we could not allocate memory */ m_freem(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: r186160 - head/sys/netinet6
Author: kmacy Date: Tue Dec 16 02:47:22 2008 New Revision: 186160 URL: http://svn.freebsd.org/changeset/base/186160 Log: explicitly check return of lla_lookup against NULL Modified: head/sys/netinet6/nd6.c head/sys/netinet6/nd6_nbr.c Modified: head/sys/netinet6/nd6.c == --- head/sys/netinet6/nd6.c Tue Dec 16 02:33:53 2008(r186159) +++ head/sys/netinet6/nd6.c Tue Dec 16 02:47:22 2008(r186160) @@ -1433,14 +1433,14 @@ nd6_cache_lladdr(struct ifnet *ifp, stru flags |= lladdr ? ND6_EXCLUSIVE : 0; IF_AFDATA_LOCK(ifp); ln = nd6_lookup(from, flags, ifp); - if (ln) - IF_AFDATA_UNLOCK(ifp); + if (ln == NULL) { flags |= LLE_EXCLUSIVE; ln = nd6_lookup(from, flags |ND6_CREATE, ifp); IF_AFDATA_UNLOCK(ifp); is_newentry = 1; } else { + IF_AFDATA_UNLOCK(ifp); /* do nothing if static ndp is set */ if (ln-la_flags LLE_STATIC) { static_route = 1; @@ -1604,7 +1604,7 @@ nd6_cache_lladdr(struct ifnet *ifp, stru break; } - if (ln) { + if (ln != NULL) { static_route = (ln-la_flags LLE_STATIC); router = ln-ln_router; @@ -1878,7 +1878,7 @@ nd6_output_lle(struct ifnet *ifp, struct * ln is valid and the caller did not pass in * an llentry */ - if (ln (lle == NULL)) { + if ((ln != NULL) (lle == NULL)) { if (flags LLE_EXCLUSIVE) LLE_WUNLOCK(ln); else @@ -1909,7 +1909,7 @@ nd6_output_lle(struct ifnet *ifp, struct * ln is valid and the caller did not pass in * an llentry */ - if (ln (lle == NULL)) { + if ((ln != NULL) (lle == NULL)) { if (flags LLE_EXCLUSIVE) LLE_WUNLOCK(ln); else Modified: head/sys/netinet6/nd6_nbr.c == --- head/sys/netinet6/nd6_nbr.c Tue Dec 16 02:33:53 2008(r186159) +++ head/sys/netinet6/nd6_nbr.c Tue Dec 16 02:47:22 2008(r186160) @@ -474,7 +474,7 @@ nd6_ns_output(struct ifnet *ifp, const s struct ip6_hdr *hip6; /* hold ip6 */ struct in6_addr *hsrc = NULL; - if (ln ln-la_hold) { + if ((ln != NULL) ln-la_hold) { /* * assuming every packet in la_hold has the same IP * header @@ -878,7 +878,7 @@ nd6_na_input(struct mbuf *m, int off, in } } freeit: - if (ln) { + if (ln != NULL) { if (chain) memcpy(sin6, L3_ADDR_SIN6(ln), sizeof(sin6)); LLE_WUNLOCK(ln); @@ -890,7 +890,7 @@ nd6_na_input(struct mbuf *m, int off, in return; bad: - if (ln) + if (ln != NULL) LLE_WUNLOCK(ln); V_icmp6stat.icp6s_badna++; ___ 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: r186161 - head/sys/netinet
Author: kmacy Date: Tue Dec 16 02:48:12 2008 New Revision: 186161 URL: http://svn.freebsd.org/changeset/base/186161 Log: don't unlock lle if it is NULL Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c == --- head/sys/netinet/if_ether.c Tue Dec 16 02:47:22 2008(r186160) +++ head/sys/netinet/if_ether.c Tue Dec 16 02:48:12 2008(r186161) @@ -777,7 +777,8 @@ arp_ifinit(struct ifnet *ifp, struct ifa if (lle == NULL) log(LOG_INFO, arp_ifinit: cannot create arp entry for interface address\n); - LLE_RUNLOCK(lle); + else + LLE_RUNLOCK(lle); ifa-ifa_rtrequest = NULL; } ___ 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: r186162 - head/sys/netinet6
Author: kmacy Date: Tue Dec 16 03:05:18 2008 New Revision: 186162 URL: http://svn.freebsd.org/changeset/base/186162 Log: simplify locking in find_pfxlist_reachable_router Modified: head/sys/netinet6/nd6_rtr.c Modified: head/sys/netinet6/nd6_rtr.c == --- head/sys/netinet6/nd6_rtr.c Tue Dec 16 02:48:12 2008(r186161) +++ head/sys/netinet6/nd6_rtr.c Tue Dec 16 03:05:18 2008(r186162) @@ -1329,19 +1329,20 @@ find_pfxlist_reachable_router(struct nd_ { struct nd_pfxrouter *pfxrtr; struct llentry *ln; + int canreach; for (pfxrtr = LIST_FIRST(pr-ndpr_advrtrs); pfxrtr; pfxrtr = LIST_NEXT(pfxrtr, pfr_entry)) { IF_AFDATA_LOCK(pfxrtr-router-ifp); - if (((ln = nd6_lookup(pfxrtr-router-rtaddr, 0, - pfxrtr-router-ifp)) != NULL) - ND6_IS_LLINFO_PROBREACH(ln)) { - LLE_RUNLOCK(ln); - break; /* found */ - } - if (ln != NULL) - LLE_RUNLOCK(ln); + ln = nd6_lookup(pfxrtr-router-rtaddr, 0, pfxrtr-router-ifp); IF_AFDATA_UNLOCK(pfxrtr-router-ifp); + canreach = 0; + if (ln != NULL) { + canreach = ND6_IS_LLINFO_PROBREACH(ln); + LLE_RUNLOCK(ln); + } + if (canreach) + break; } return (pfxrtr); } ___ 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: r186163 - head/sys/netinet6
Author: kmacy Date: Tue Dec 16 03:12:44 2008 New Revision: 186163 URL: http://svn.freebsd.org/changeset/base/186163 Log: convert more pointer validation checks to checking against NULL Modified: head/sys/netinet6/icmp6.c head/sys/netinet6/nd6.c head/sys/netinet6/raw_ip6.c Modified: head/sys/netinet6/icmp6.c == --- head/sys/netinet6/icmp6.c Tue Dec 16 03:05:18 2008(r186162) +++ head/sys/netinet6/icmp6.c Tue Dec 16 03:12:44 2008(r186163) @@ -1947,7 +1947,7 @@ icmp6_rip6_input(struct mbuf **mp, int o INP_RUNLOCK(in6p); continue; } - if (last) { + if (last != NULL) { struct mbuf *n = NULL; /* @@ -2008,7 +2008,7 @@ icmp6_rip6_input(struct mbuf **mp, int o last = in6p; } INP_INFO_RUNLOCK(V_ripcbinfo); - if (last) { + if (last != NULL) { if (last-inp_flags IN6P_CONTROLOPTS) ip6_savecontrol(last, m, opts); /* strip intermediate headers */ Modified: head/sys/netinet6/nd6.c == --- head/sys/netinet6/nd6.c Tue Dec 16 03:05:18 2008(r186162) +++ head/sys/netinet6/nd6.c Tue Dec 16 03:12:44 2008(r186163) @@ -1642,7 +1642,7 @@ nd6_cache_lladdr(struct ifnet *ifp, stru return (ln); done: - if (ln) { + if (ln != NULL) { if (flags ND6_EXCLUSIVE) LLE_WUNLOCK(ln); else @@ -1716,7 +1716,7 @@ nd6_output_lle(struct ifnet *ifp, struct int flags = 0; #ifdef INVARIANTS - if (lle) { + if (lle != NULL) { LLE_WLOCK_ASSERT(lle); Modified: head/sys/netinet6/raw_ip6.c == --- head/sys/netinet6/raw_ip6.c Tue Dec 16 03:05:18 2008(r186162) +++ head/sys/netinet6/raw_ip6.c Tue Dec 16 03:12:44 2008(r186163) @@ -193,7 +193,7 @@ rip6_input(struct mbuf **mp, int *offp, continue; } } - if (last) { + if (last != NULL) { struct mbuf *n = m_copy(m, 0, (int)M_COPYALL); #ifdef IPSEC @@ -240,7 +240,7 @@ rip6_input(struct mbuf **mp, int *offp, INP_RUNLOCK(last); } else #endif /* IPSEC */ - if (last) { + if (last != NULL) { if (last-inp_flags IN6P_CONTROLOPTS || last-inp_socket-so_options SO_TIMESTAMP) ip6_savecontrol(last, m, opts); ___ 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: r186165 - head/sys/nfsserver
Author: kensmith Date: Tue Dec 16 04:34:09 2008 New Revision: 186165 URL: http://svn.freebsd.org/changeset/base/186165 Log: Handle VFS_VGET() failing with an error other than EOPNOTSUPP in addition to failing with that error. PR: 125149 Submitted by: Jaakko Heinonen (jh at saunalahti dot fi) Reviewed by: mohans, kan MFC after:3 days Modified: head/sys/nfsserver/nfs_serv.c Modified: head/sys/nfsserver/nfs_serv.c == --- head/sys/nfsserver/nfs_serv.c Tue Dec 16 03:18:59 2008 (r186164) +++ head/sys/nfsserver/nfs_serv.c Tue Dec 16 04:34:09 2008 (r186165) @@ -3615,9 +3615,12 @@ again: * Probe one of the directory entries to see if the filesystem * supports VGET. */ - if (VFS_VGET(vp-v_mount, dp-d_fileno, LK_EXCLUSIVE, nvp) == - EOPNOTSUPP) { - error = NFSERR_NOTSUPP; + error = VFS_VGET(vp-v_mount, dp-d_fileno, LK_EXCLUSIVE, nvp); + if (error) { + if (error == EOPNOTSUPP) + error = NFSERR_NOTSUPP; + else + error = NFSERR_SERVERFAULT; vrele(vp); vp = NULL; free((caddr_t)cookies, M_TEMP); ___ 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: r186166 - head/sys/net
Author: kmacy Date: Tue Dec 16 04:40:43 2008 New Revision: 186166 URL: http://svn.freebsd.org/changeset/base/186166 Log: assert that the radix node head is locked when manipulating the tree Modified: head/sys/net/radix.c Modified: head/sys/net/radix.c == --- head/sys/net/radix.cTue Dec 16 04:34:09 2008(r186165) +++ head/sys/net/radix.cTue Dec 16 04:40:43 2008(r186166) @@ -274,6 +274,7 @@ rn_match(v_arg, head) int off = t-rn_offset, vlen = LEN(cp), matched_off; register int test, b, rn_bit; + RADIX_NODE_HEAD_LOCK_ASSERT(head); /* * Open code rn_search(v, top) to avoid overhead of extra * subroutine call. @@ -618,6 +619,8 @@ rn_addroute(v_arg, n_arg, head, treenode caddr_t mmask; struct radix_mask *m, **mp; + + RADIX_NODE_HEAD_WLOCK_ASSERT(head); /* * In dealing with non-contiguous masks, there may be * many different routes which have the same mask. @@ -788,6 +791,7 @@ rn_delete(v_arg, netmask_arg, head) caddr_t v, netmask; int b, head_off, vlen; + RADIX_NODE_HEAD_WLOCK_ASSERT(head); v = v_arg; netmask = netmask_arg; x = head-rnh_treetop; @@ -981,6 +985,7 @@ rn_walktree_from(h, a, m, f, w) int stopping = 0; int lastb; + RADIX_NODE_HEAD_LOCK_ASSERT(h); /* * rn_search_m is sort-of-open-coded here. We cannot use the * function because we need to keep track of the last node seen. @@ -1087,6 +1092,8 @@ rn_walktree(h, f, w) * while applying the function f to it, so we need to calculate * the successor node in advance. */ + + RADIX_NODE_HEAD_LOCK_ASSERT(h); /* First time through node, go left */ while (rn-rn_bit = 0) rn = rn-rn_left; ___ 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: r186167 - head/sys/net
Author: kmacy Date: Tue Dec 16 04:41:39 2008 New Revision: 186167 URL: http://svn.freebsd.org/changeset/base/186167 Log: style and spelling fix Modified: head/sys/net/if_llatbl.c head/sys/net/route.c Modified: head/sys/net/if_llatbl.c == --- head/sys/net/if_llatbl.cTue Dec 16 04:40:43 2008(r186166) +++ head/sys/net/if_llatbl.cTue Dec 16 04:41:39 2008(r186167) @@ -287,7 +287,7 @@ lla_rt_output(struct rt_msghdr *rtm, str laflags = lle-la_flags; LLE_WUNLOCK(lle); #ifdef INET - /* gratuious ARP */ + /* gratuitous ARP */ if ((laflags LLE_PUB) dst-sa_family == AF_INET) { arprequest(ifp, ((struct sockaddr_in *)dst)-sin_addr, Modified: head/sys/net/route.c == --- head/sys/net/route.cTue Dec 16 04:40:43 2008(r186166) +++ head/sys/net/route.cTue Dec 16 04:41:39 2008(r186167) @@ -303,7 +303,7 @@ rtalloc1_fib(struct sockaddr *dst, int r goto done; } else if (needlock) - RADIX_NODE_HEAD_RUNLOCK(rnh); + RADIX_NODE_HEAD_RUNLOCK(rnh); /* * Either we hit the root or couldn't find any match, ___ 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: r186168 - head/sys/dev/bce
Author: delphij Date: Tue Dec 16 04:59:04 2008 New Revision: 186168 URL: http://svn.freebsd.org/changeset/base/186168 Log: Test whether sc-tx_mbuf_map[i], not whether sc-tx_mbuf_map is NULL before doing bus_dmamap_sync() since it operates on the former, not the latter. Reviewed by: davidch Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c == --- head/sys/dev/bce/if_bce.c Tue Dec 16 04:41:39 2008(r186167) +++ head/sys/dev/bce/if_bce.c Tue Dec 16 04:59:04 2008(r186168) @@ -5114,7 +5114,7 @@ bce_free_tx_chain(struct bce_softc *sc) /* Unmap, unload, and free any mbufs still in the TX mbuf chain. */ for (i = 0; i TOTAL_TX_BD; i++) { if (sc-tx_mbuf_ptr[i] != NULL) { - if (sc-tx_mbuf_map != NULL) + if (sc-tx_mbuf_map[i] != NULL) bus_dmamap_sync(sc-tx_mbuf_tag, sc-tx_mbuf_map[i], BUS_DMASYNC_POSTWRITE); m_freem(sc-tx_mbuf_ptr[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
svn commit: r186169 - head/sys/dev/bce
Author: delphij Date: Tue Dec 16 05:03:22 2008 New Revision: 186169 URL: http://svn.freebsd.org/changeset/base/186169 Log: Don't count InFramesL2FilterDiscards into Ierr. This value does not represent a real packet error but simply indicate that an unexpected unicast or multicast error was received by the NIC, which was not counted in the past as well. Reported by: many (on -stable@) Reviewed by: davidch MFC after:3 days Modified: head/sys/dev/bce/if_bce.c Modified: head/sys/dev/bce/if_bce.c == --- head/sys/dev/bce/if_bce.c Tue Dec 16 04:59:04 2008(r186168) +++ head/sys/dev/bce/if_bce.c Tue Dec 16 05:03:22 2008(r186169) @@ -7408,7 +7408,6 @@ bce_stats_update(struct bce_softc *sc) (u_long) sc-stat_IfInMBUFDiscards + (u_long) sc-stat_Dot3StatsAlignmentErrors + (u_long) sc-stat_Dot3StatsFCSErrors + - (u_long) sc-stat_IfInFramesL2FilterDiscards + (u_long) sc-stat_IfInRuleCheckerDiscards + (u_long) sc-stat_IfInFTQDiscards + (u_long) sc-com_no_buffers; ___ 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: r186170 - head/sys/netinet6
Author: kmacy Date: Tue Dec 16 06:01:08 2008 New Revision: 186170 URL: http://svn.freebsd.org/changeset/base/186170 Log: check pointers against NULL Modified: head/sys/netinet6/raw_ip6.c Modified: head/sys/netinet6/raw_ip6.c == --- head/sys/netinet6/raw_ip6.c Tue Dec 16 05:03:22 2008(r186169) +++ head/sys/netinet6/raw_ip6.c Tue Dec 16 06:01:08 2008(r186170) @@ -232,7 +232,7 @@ rip6_input(struct mbuf **mp, int *offp, /* * Check AH/ESP integrity. */ - if (last ipsec6_in_reject(m, last)) { + if ((last != NULL) ipsec6_in_reject(m, last)) { m_freem(m); V_ipsec6stat.in_polvio++; V_ip6stat.ip6s_delivered--; @@ -357,7 +357,7 @@ rip6_output(m, va_alist) INP_WLOCK(in6p); dst = dstsock-sin6_addr; - if (control) { + if (control != NULL) { if ((error = ip6_setpktopts(control, opt, in6p-in6p_outputopts, so-so_cred, so-so_proto-pr_protocol)) != 0) { @@ -491,7 +491,7 @@ rip6_output(m, va_alist) m_freem(m); freectl: - if (control) { + if (control != NULL) { ip6_clearpktopts(opt, -1); m_freem(control); } ___ 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