svn commit: r189919 - head/sys/kern
Author: kib Date: Tue Mar 17 09:50:40 2009 New Revision: 189919 URL: http://svn.freebsd.org/changeset/base/189919 Log: Use the properly sized types for ELF object header and program headers. This fixes osrel fetching from the FreeBSD branding note for the 64bit platforms. Reported by: swell.k gmail com Reviewed by: dchagin Tested by:dchagin, swell.k gmail com Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c == --- head/sys/kern/imgact_elf.c Tue Mar 17 06:54:41 2009(r189918) +++ head/sys/kern/imgact_elf.c Tue Mar 17 09:50:40 2009(r189919) @@ -1330,14 +1330,14 @@ __elfN(check_note)(struct image_params * int32_t *osrel) { const Elf_Note *note, *note_end; - const Elf32_Phdr *phdr, *pnote; - const Elf32_Ehdr *hdr; + const Elf_Phdr *phdr, *pnote; + const Elf_Ehdr *hdr; const char *note_name; int i; pnote = NULL; - hdr = (const Elf32_Ehdr *)imgp->image_header; - phdr = (const Elf32_Phdr *)(imgp->image_header + hdr->e_phoff); + hdr = (const Elf_Ehdr *)imgp->image_header; + phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff); for (i = 0; i < hdr->e_phnum; i++) { if (phdr[i].p_type == PT_NOTE) { ___ 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: r189920 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netinet
Author: rwatson Date: Tue Mar 17 10:15:49 2009 New Revision: 189920 URL: http://svn.freebsd.org/changeset/base/189920 Log: Merge r188992 from head to stable/7: In tcp_usr_shutdown() and tcp_usr_send(), I missed converting NULL checks for the tcpcb, previously used to detect complete disconnection, with INP_DROPPED checks. Correct that, preventing shutdown() from improperly generating a TCP segment with destination IP and port of 0.0.0.0:0. PR: kern/132050 Reported by: david gueluy Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netinet/tcp_usrreq.c Modified: stable/7/sys/netinet/tcp_usrreq.c == --- stable/7/sys/netinet/tcp_usrreq.c Tue Mar 17 09:50:40 2009 (r189919) +++ stable/7/sys/netinet/tcp_usrreq.c Tue Mar 17 10:15:49 2009 (r189920) @@ -712,7 +712,8 @@ tcp_usr_shutdown(struct socket *so) TCPDEBUG1(); socantsendmore(so); tcp_usrclosed(tp); - error = tcp_output_disconnect(tp); + if (!(inp->inp_vflag & INP_DROPPED)) + error = tcp_output_disconnect(tp); out: TCPDEBUG2(PRU_SHUTDOWN); @@ -844,7 +845,7 @@ tcp_usr_send(struct socket *so, int flag INP_INFO_WUNLOCK(&tcbinfo); headlocked = 0; } - if (tp != NULL) { + if (!(inp->inp_vflag & INP_DROPPED)) { if (flags & PRUS_MORETOCOME) tp->t_flags |= TF_MORETOCOME; error = tcp_output_send(tp); ___ 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: r189921 - vendor/tzdata/dist
Author: edwin Date: Tue Mar 17 10:47:26 2009 New Revision: 189921 URL: http://svn.freebsd.org/changeset/base/189921 Log: Vendor import of tzdata2009c - Cuba has DST again. Modified: vendor/tzdata/dist/northamerica Modified: vendor/tzdata/dist/northamerica == --- vendor/tzdata/dist/northamerica Tue Mar 17 10:15:49 2009 (r189920) +++ vendor/tzdata/dist/northamerica Tue Mar 17 10:47:26 2009 (r189921) @@ -1,4 +1,4 @@ -# @(#)northamerica 8.26 +# @(#)northamerica 8.27 # # also includes Central America and the Caribbean @@ -2258,6 +2258,25 @@ Zone America/Costa_Rica -5:36:20 - LMT 1 # From Arthur David Olson (2008-03-12): # Assume Sun>=15 (third Sunday) going forward. +# From Alexander Krivenyshev (2009-03-04) +# According to the Radio Reloj - Cuba will start Daylight Saving Time on +# midnight between Saturday, March 07, 2009 and Sunday, March 08, 2009- +# not on midnight March 14 / March 15 as previously thought. +# +# http://www.worldtimezone.com/dst_news/dst_news_cuba05.html";> +# http://www.worldtimezone.com/dst_news/dst_news_cuba05.html +# (in Spanish) +# + +# From Arthur David Olson (2009-03-09) +# I listened over the Internet to +# http://media.enet.cu/readioreloj";> +# http://media.enet.cu/readioreloj +# +# this morning; when it was 10:05 a. m. here in Bethesda, Maryland the +# the time was announced as "diez cinco"--the same time as here, indicating +# that has indeed switched to DST. Assume second Sunday from 2009 forward. + # Rule NAMEFROMTO TYPEIN ON AT SAVELETTER/S Rule Cuba1928only- Jun 10 0:001:00D Rule Cuba1928only- Oct 10 0:000 S @@ -2290,7 +2309,8 @@ Rule Cuba19982003- Oct lastSun 0:00s Rule Cuba20002004- Apr Sun>=1 0:00s 1:00D Rule Cuba2006max - Oct lastSun 0:00s 0 S Rule Cuba2007only- Mar Sun>=8 0:00s 1:00D -Rule Cuba2008max - Mar Sun>=15 0:00s 1:00D +Rule Cuba2008only- Mar Sun>=15 0:00s 1:00D +Rule Cuba2009max - Mar Sun>=8 0:00s 1:00D # Zone NAMEGMTOFF RULES FORMAT [UNTIL] Zone America/Havana -5:29:28 - LMT 1890 ___ 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: r189922 - vendor/tzdata/tzdata2009c
Author: edwin Date: Tue Mar 17 10:48:13 2009 New Revision: 189922 URL: http://svn.freebsd.org/changeset/base/189922 Log: Tag of tzdata2009c Added: vendor/tzdata/tzdata2009c/ - copied from r189921, vendor/tzdata/dist/ ___ 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: r189923 - head/share/zoneinfo
Author: edwin Date: Tue Mar 17 10:51:31 2009 New Revision: 189923 URL: http://svn.freebsd.org/changeset/base/189923 Log: MFV of tzdata2009c - Cuba has DST again. MFC after:1 week Modified: head/share/zoneinfo/ (props changed) head/share/zoneinfo/northamerica Modified: head/share/zoneinfo/northamerica == --- head/share/zoneinfo/northamericaTue Mar 17 10:48:13 2009 (r189922) +++ head/share/zoneinfo/northamericaTue Mar 17 10:51:31 2009 (r189923) @@ -1,4 +1,4 @@ -# @(#)northamerica 8.26 +# @(#)northamerica 8.27 # # also includes Central America and the Caribbean @@ -2258,6 +2258,25 @@ Zone America/Costa_Rica -5:36:20 - LMT 1 # From Arthur David Olson (2008-03-12): # Assume Sun>=15 (third Sunday) going forward. +# From Alexander Krivenyshev (2009-03-04) +# According to the Radio Reloj - Cuba will start Daylight Saving Time on +# midnight between Saturday, March 07, 2009 and Sunday, March 08, 2009- +# not on midnight March 14 / March 15 as previously thought. +# +# http://www.worldtimezone.com/dst_news/dst_news_cuba05.html";> +# http://www.worldtimezone.com/dst_news/dst_news_cuba05.html +# (in Spanish) +# + +# From Arthur David Olson (2009-03-09) +# I listened over the Internet to +# http://media.enet.cu/readioreloj";> +# http://media.enet.cu/readioreloj +# +# this morning; when it was 10:05 a. m. here in Bethesda, Maryland the +# the time was announced as "diez cinco"--the same time as here, indicating +# that has indeed switched to DST. Assume second Sunday from 2009 forward. + # Rule NAMEFROMTO TYPEIN ON AT SAVELETTER/S Rule Cuba1928only- Jun 10 0:001:00D Rule Cuba1928only- Oct 10 0:000 S @@ -2290,7 +2309,8 @@ Rule Cuba19982003- Oct lastSun 0:00s Rule Cuba20002004- Apr Sun>=1 0:00s 1:00D Rule Cuba2006max - Oct lastSun 0:00s 0 S Rule Cuba2007only- Mar Sun>=8 0:00s 1:00D -Rule Cuba2008max - Mar Sun>=15 0:00s 1:00D +Rule Cuba2008only- Mar Sun>=15 0:00s 1:00D +Rule Cuba2009max - Mar Sun>=8 0:00s 1:00D # Zone NAMEGMTOFF RULES FORMAT [UNTIL] Zone America/Havana -5:29:28 - LMT 1890 ___ 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: r189765 - in head: . lib/libc lib/libc/nls
Quoting Ulrich Spörlein (from Mon, 16 Mar 2009 19:35:34 +0100): On Fri, 13.03.2009 at 14:22:16 -0400, David Schultz wrote: On Fri, Mar 13, 2009, Sean C. Farley wrote: > Now, you only need to revive the BSD-licensed libiconv[1]. :) [...] > 1. http://people.freebsd.org/~bland/iconv-2.1.tar.gz I asked a few weeks ago on standards@ why we weren't using Citrus iconv, which is what NetBSD uses, and seems to be in a somewhat better state than this. It also provides various wide character conversion routines that overlap with what tjr@ has already done in FreeBSD, so we'd have to sort that out. And we'd have to sort out a gazillion ports that want -liconv. I, for one, would love to see some iconv overlo^Wsupport in base. That way, I could teach calendar(1) to translate stuff to LC_CTYPE, right now the German calendar file is saved in Latin1 whereas I'm using UTF-8 terminals :/ Anorther approach would be to make calendar DTRT with UTF-8... one step into this direction (german UTF-8 catalogs) is at http://svnweb.freebsd.org/viewvc/base/user/netchild/calendar-utf8/ Bye, Alexander. -- Law of Probable Dispersal: Whatever it is that hits the fan will not be evenly distributed. http://www.Leidinger.netAlexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 ___ 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: r189925 - head/sys/sys
Author: kib Date: Tue Mar 17 12:47:40 2009 New Revision: 189925 URL: http://svn.freebsd.org/changeset/base/189925 Log: Add some definitions for the DT_FLAGS_1 tag flags. Reviewed by: kan Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h == --- head/sys/sys/elf_common.h Tue Mar 17 11:28:56 2009(r189924) +++ head/sys/sys/elf_common.h Tue Mar 17 12:47:40 2009(r189925) @@ -466,6 +466,11 @@ typedef struct { executable contains code using a static thread-local storage scheme. */ +/* Values for DT_FLAGS_1 */ +#defineDF_1_BIND_NOW 0x0001 /* Same as DF_BIND_NOW */ +#defineDF_1_GLOBAL 0x0002 /* Set the RTLD_GLOBAL for object */ +#defineDF_1_ORIGIN 0x0080 /* Process $ORIGIN */ + /* Values for n_type. Used in core files. */ #defineNT_PRSTATUS 1 /* Process status. */ #defineNT_FPREGSET 2 /* Floating point registers. */ ___ 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: r189926 - in head/sys: amd64/include arm/include i386/include ia64/include mips/include powerpc/include sparc64/include sun4v/include
Author: kib Date: Tue Mar 17 12:50:16 2009 New Revision: 189926 URL: http://svn.freebsd.org/changeset/base/189926 Log: Add AT_EXECPATH ELF auxinfo entry type. The value's a_ptr is a pointer to the full path of the image that is being executed. Increase AT_COUNT. Remove no longer true comment about types used in Linux ELF binaries, listed types contain FreeBSD-specific entries. Reviewed by: kan Modified: head/sys/amd64/include/elf.h head/sys/arm/include/elf.h head/sys/i386/include/elf.h head/sys/ia64/include/elf.h head/sys/mips/include/elf.h head/sys/powerpc/include/elf.h head/sys/sparc64/include/elf.h head/sys/sun4v/include/elf.h Modified: head/sys/amd64/include/elf.h == --- head/sys/amd64/include/elf.hTue Mar 17 12:47:40 2009 (r189925) +++ head/sys/amd64/include/elf.hTue Mar 17 12:50:16 2009 (r189926) @@ -81,16 +81,14 @@ __ElfType(Auxinfo); #defineAT_BASE 7 /* Interpreter's base address. */ #defineAT_FLAGS8 /* Flags (unused for i386). */ #defineAT_ENTRY9 /* Where interpreter should transfer control. */ -/* - * The following non-standard values are used in Linux ELF binaries. - */ #defineAT_NOTELF 10 /* Program is not ELF ?? */ #defineAT_UID 11 /* Real uid. */ #defineAT_EUID 12 /* Effective uid. */ #defineAT_GID 13 /* Real gid. */ #defineAT_EGID 14 /* Effective gid. */ +#defineAT_EXECPATH 15 /* Path to the executable. */ -#defineAT_COUNT15 /* Count of defined aux entry types. */ +#defineAT_COUNT16 /* Count of defined aux entry types. */ /* * Relocation types. Modified: head/sys/arm/include/elf.h == --- head/sys/arm/include/elf.h Tue Mar 17 12:47:40 2009(r189925) +++ head/sys/arm/include/elf.h Tue Mar 17 12:50:16 2009(r189926) @@ -75,8 +75,9 @@ __ElfType(Auxinfo); #define AT_EUID 12 /* Effective uid. */ #define AT_GID 13 /* Real gid. */ #define AT_EGID 14 /* Effective gid. */ +#defineAT_EXECPATH 15 /* Path to the executable. */ -#define AT_COUNT15 /* Count of defined aux entry types. */ +#define AT_COUNT16 /* Count of defined aux entry types. */ #defineR_ARM_COUNT 33 /* Count of defined relocation types. */ Modified: head/sys/i386/include/elf.h == --- head/sys/i386/include/elf.h Tue Mar 17 12:47:40 2009(r189925) +++ head/sys/i386/include/elf.h Tue Mar 17 12:50:16 2009(r189926) @@ -84,16 +84,14 @@ __ElfType(Auxinfo); #defineAT_BASE 7 /* Interpreter's base address. */ #defineAT_FLAGS8 /* Flags (unused for i386). */ #defineAT_ENTRY9 /* Where interpreter should transfer control. */ -/* - * The following non-standard values are used in Linux ELF binaries. - */ #defineAT_NOTELF 10 /* Program is not ELF ?? */ #defineAT_UID 11 /* Real uid. */ #defineAT_EUID 12 /* Effective uid. */ #defineAT_GID 13 /* Real gid. */ #defineAT_EGID 14 /* Effective gid. */ +#defineAT_EXECPATH 15 /* Path to the executable. */ -#defineAT_COUNT15 /* Count of defined aux entry types. */ +#defineAT_COUNT16 /* Count of defined aux entry types. */ /* * Relocation types. Modified: head/sys/ia64/include/elf.h == --- head/sys/ia64/include/elf.h Tue Mar 17 12:47:40 2009(r189925) +++ head/sys/ia64/include/elf.h Tue Mar 17 12:50:16 2009(r189926) @@ -82,16 +82,14 @@ __ElfType(Auxinfo); #defineAT_BASE 7 /* Interpreter's base address. */ #defineAT_FLAGS8 /* Flags (unused for i386). */ #defineAT_ENTRY9 /* Where interpreter should transfer control. */ -/* - * The following non-standard values are used in Linux ELF binaries. - */ #defineAT_NOTELF 10 /* Program is not ELF ?? */ #defineAT_UID 11 /* Real uid. */ #defineAT_EUID 12 /* Effective uid. */ #defineAT_GID 13 /* Real gid. */ #defineAT_EGID 14 /* Effective gid. */ +#defineAT_EXECPATH 15 /* Path to the executable. */ -#defineAT_COUNT15 /* Count of defined aux entry types. */ +#defineAT_COUNT16 /* Count of defined aux entry types. */ /* * Value
svn commit: r189927 - in head/sys: compat/ia32 kern sys
Author: kib Date: Tue Mar 17 12:53:28 2009 New Revision: 189927 URL: http://svn.freebsd.org/changeset/base/189927 Log: Supply AT_EXECPATH auxinfo entry to the interpreter, both for native and compat32 binaries. Tested by:pho Reviewed by: kan Modified: head/sys/compat/ia32/ia32_sysvec.c head/sys/kern/imgact_elf.c head/sys/kern/kern_exec.c head/sys/sys/imgact.h Modified: head/sys/compat/ia32/ia32_sysvec.c == --- head/sys/compat/ia32/ia32_sysvec.c Tue Mar 17 12:50:16 2009 (r189926) +++ head/sys/compat/ia32/ia32_sysvec.c Tue Mar 17 12:53:28 2009 (r189927) @@ -189,15 +189,21 @@ ia32_copyout_strings(struct image_params char *stringp, *destp; u_int32_t *stack_base; struct freebsd32_ps_strings *arginfo; + size_t execpath_len; int szsigcode; /* * Calculate string base and vector table pointers. * Also deal with signal trampoline code for this exec type. */ + if (imgp->execpath != NULL && imgp->auxargs != NULL) + execpath_len = strlen(imgp->execpath) + 1; + else + execpath_len = 0; arginfo = (struct freebsd32_ps_strings *)FREEBSD32_PS_STRINGS; szsigcode = *(imgp->proc->p_sysent->sv_szsigcode); destp = (caddr_t)arginfo - szsigcode - SPARE_USRSPACE - + roundup(execpath_len, sizeof(char *)) - roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); /* @@ -208,6 +214,15 @@ ia32_copyout_strings(struct image_params ((caddr_t)arginfo - szsigcode), szsigcode); /* +* Copy the image path for the rtld. +*/ + if (execpath_len != 0) { + imgp->execpathp = (uintptr_t)arginfo - szsigcode - execpath_len; + copyout(imgp->execpath, (void *)imgp->execpathp, + execpath_len); + } + + /* * If we have a valid auxargs ptr, prepare some room * on the stack. */ @@ -223,9 +238,9 @@ ia32_copyout_strings(struct image_params * the arg and env vector sets,and imgp->auxarg_size is room * for argument of Runtime loader. */ - vectp = (u_int32_t *) (destp - (imgp->args->argc + imgp->args->envc + 2 + - imgp->auxarg_size) * sizeof(u_int32_t)); - + vectp = (u_int32_t *) (destp - (imgp->args->argc + + imgp->args->envc + 2 + imgp->auxarg_size + execpath_len) * + sizeof(u_int32_t)); } else /* * The '+ 2' is for the null pointers at the end of each of Modified: head/sys/kern/imgact_elf.c == --- head/sys/kern/imgact_elf.c Tue Mar 17 12:50:16 2009(r189926) +++ head/sys/kern/imgact_elf.c Tue Mar 17 12:53:28 2009(r189927) @@ -885,6 +885,8 @@ __elfN(freebsd_fixup)(register_t **stack AUXARGS_ENTRY(pos, AT_FLAGS, args->flags); AUXARGS_ENTRY(pos, AT_ENTRY, args->entry); AUXARGS_ENTRY(pos, AT_BASE, args->base); + if (imgp->execpathp != 0) + AUXARGS_ENTRY(pos, AT_EXECPATH, imgp->execpathp); AUXARGS_ENTRY(pos, AT_NULL, 0); free(imgp->auxargs, M_TEMP); Modified: head/sys/kern/kern_exec.c == --- head/sys/kern/kern_exec.c Tue Mar 17 12:50:16 2009(r189926) +++ head/sys/kern/kern_exec.c Tue Mar 17 12:53:28 2009(r189927) @@ -379,6 +379,8 @@ do_execve(td, args, mac_p) imgp->ps_strings = 0; imgp->auxarg_size = 0; imgp->args = args; + imgp->execpath = imgp->freepath = NULL; + imgp->execpathp = 0; #ifdef MAC error = mac_execve_enter(imgp, mac_p); @@ -519,6 +521,15 @@ interpret: * of the sv_copyout_strings/sv_fixup operations require the vnode. */ VOP_UNLOCK(imgp->vp, 0); + + /* +* Do the best to calculate the full path to the image file. +*/ + if (imgp->auxargs != NULL && + ((args->fname != NULL && args->fname[0] == '/') || +vn_fullpath(td, imgp->vp, &imgp->execpath, &imgp->freepath) != 0)) + imgp->execpath = args->fname; + /* * Copy out strings (args and env) and initialize stack base */ @@ -859,6 +870,8 @@ exec_fail_dealloc: if (imgp->object != NULL) vm_object_deallocate(imgp->object); + free(imgp->freepath, M_TEMP); + if (error == 0) { /* * Stop the process here if its stop event mask has @@ -1164,18 +1177,24 @@ exec_copyout_strings(imgp) register_t *stack_base; struct ps_strings *arginfo; struct proc *p; + size_t execpath_len; in
svn commit: r189928 - head/sys/dev/firewire
Author: sbruno Date: Tue Mar 17 13:07:11 2009 New Revision: 189928 URL: http://svn.freebsd.org/changeset/base/189928 Log: Reviewed by: scott (sco...@freebsd.org) Obtained from:Hideotshi Shimokawa This update is based on comments from Hidetoshi. Changeset 183550 removed the call to crom_load() in fw_busreset(). Restore that call such that the Configuration ROM is valid. Stash and update fwdev settings in fw_explore_node() so that negotiation works again. Modified: head/sys/dev/firewire/firewire.c Modified: head/sys/dev/firewire/firewire.c == --- head/sys/dev/firewire/firewire.cTue Mar 17 12:53:28 2009 (r189927) +++ head/sys/dev/firewire/firewire.cTue Mar 17 13:07:11 2009 (r189928) @@ -685,7 +685,8 @@ fw_init_crom(struct firewire_comm *fc) src->businfo.cyc_clk_acc = 100; src->businfo.max_rec = fc->maxrec; src->businfo.max_rom = MAXROM_4; - src->businfo.generation = 0; +#define FW_GENERATION_CHANGEABLE 2 + src->businfo.generation = FW_GENERATION_CHANGEABLE; src->businfo.link_spd = fc->speed; src->businfo.eui64.hi = fc->eui.hi; @@ -734,6 +735,7 @@ fw_busreset(struct firewire_comm *fc, ui struct firewire_dev_comm *fdc; struct crom_src *src; device_t *devlistp; + uint32_t *newrom; int i, devcnt; FW_GLOCK_ASSERT(fc); @@ -759,18 +761,31 @@ fw_busreset(struct firewire_comm *fc, ui } src = &fc->crom_src_buf->src; - /* -* If the old config rom needs to be overwritten, -* bump the businfo.generation indicator to -* indicate that we need to be reprobed -*/ - if (bcmp(src, fc->config_rom, CROMSIZE) != 0) { - /* generation is a 2 bit field */ - /* valid values are only from 0 - 3 */ - src->businfo.generation = 1; - bcopy(src, (void *)fc->config_rom, CROMSIZE); - } else - src->businfo.generation = 0; +/* + * If the old config rom needs to be overwritten, + * bump the businfo.generation indicator to + * indicate that we need to be reprobed + * See 1394a-2000 8.3.2.5.4 for more details. + * generation starts at 2 and rolls over at 0xF + * back to 2. + * + * A generation of 0 indicates a device + * that is not 1394a-2000 compliant. + * A generation of 1 indicates a device that + * does not change it's Bus Info Block or + * Configuration ROM. + */ +#define FW_MAX_GENERATION 0xF + newrom = malloc(CROMSIZE, M_FW, M_NOWAIT | M_ZERO); + src = &fc->crom_src_buf->src; + crom_load(src, newrom, CROMSIZE); + if (bcmp(newrom, fc->config_rom, CROMSIZE) != 0) { + if ( src->businfo.generation++ > FW_MAX_GENERATION ) + src->businfo.generation = FW_GENERATION_CHANGEABLE; + bcopy(newrom, (void *)fc->config_rom, CROMSIZE); + } + free(newrom, M_FW); + } /* Call once after reboot */ @@ -1590,6 +1605,10 @@ fw_explore_node(struct fw_device *dfwdev } fwdev->fc = fc; fwdev->eui = binfo->eui64; + fwdev->dst = dfwdev->dst; + fwdev->maxrec = dfwdev->maxrec; + fwdev->status = dfwdev->status; + /* * Pre-1394a-2000 didn't have link_spd in * the Bus Info block, so try and use the @@ -1599,7 +1618,7 @@ fw_explore_node(struct fw_device *dfwdev * ignore the speed map alltogether. SWB */ if ( binfo->link_spd == FWSPD_S100 /* 0 */) { - device_printf(fc->bdev, "%s" + device_printf(fc->bdev, "%s: " "Pre 1394a-2000 detected\n", __func__); fwdev->speed = fc->speed_map->speed[fc->nodeid][node]; @@ -1609,21 +1628,19 @@ fw_explore_node(struct fw_device *dfwdev * Test this speed with a read to the CSRROM. * If it fails, slow down the speed and retry. */ - while (fwdev->speed > 0) { + while (fwdev->speed > FWSPD_S100 /* 0 */) { err = fw_explore_read_quads(fwdev, CSRROMOFF, &speed_test, 1); - if (err) + if (err) { + device_printf(fc->bdev, "%s: fwdev->speed(%s)" + " decremented due to negotiation\n", + __func__, + linkspeed[fwdev->speed]); fwdev->speed--; - else +
svn commit: r189929 - stable/7/sys/conf
Author: kensmith Date: Tue Mar 17 14:17:59 2009 New Revision: 189929 URL: http://svn.freebsd.org/changeset/base/189929 Log: We're a little less than a week from code freeze for the 7.2-REL release cycle. Give people a heads-up that there might be higher than usual developer activity during this period by starting to call it 7.2-PRERELEASE now. Modified: stable/7/sys/conf/newvers.sh Modified: stable/7/sys/conf/newvers.sh == --- stable/7/sys/conf/newvers.shTue Mar 17 13:07:11 2009 (r189928) +++ stable/7/sys/conf/newvers.shTue Mar 17 14:17:59 2009 (r189929) @@ -31,8 +31,8 @@ # $FreeBSD$ TYPE="FreeBSD" -REVISION="7.1" -BRANCH="STABLE" +REVISION="7.2" +BRANCH="PRERELEASE" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi ___ 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: r189930 - stable/7/share/termcap
Author: rafan Date: Tue Mar 17 14:29:25 2009 New Revision: 189930 URL: http://svn.freebsd.org/changeset/base/189930 Log: MFC r189216 (ahead original schedule due to the upcoming 7.2-RELEASE) - Remove kH (kp_kll) from screen. It has the identical key sequence as @7 (kp_end). As ncurses has the limitation that it returns the first matched key symbol, you can not use END in ncurses based program under screen (like ports/misc/mc). We did similar changes to xterm entry last year for exactly the same reason. PR: 132199 Submitted by: Timur I. Bakeyev Modified: stable/7/share/termcap/ (props changed) stable/7/share/termcap/termcap.src Modified: stable/7/share/termcap/termcap.src == --- stable/7/share/termcap/termcap.src Tue Mar 17 14:17:59 2009 (r189929) +++ stable/7/share/termcap/termcap.src Tue Mar 17 14:29:25 2009 (r189930) @@ -2771,7 +2771,7 @@ SC|screen|VT 100/ANSI X3.64 virtual term :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\ :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\ :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:F1=\E[23~:F2=\E[24~:\ - :kh=\E[1~:kI=\E[2~:kD=\E[3~:kH=\E[4~:@7=\E[4~:kP=\E[5~:\ + :kh=\E[1~:kI=\E[2~:kD=\E[3~:@7=\E[4~:kP=\E[5~:\ :kN=\E[6~:eA=\E(B\E)0:as=^N:ae=^O:ti=\E[?1049h:te=\E[?1049l:\ :vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l:\ :Co#8:pa#64:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:AX:\ ___ 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: r189931 - head/sys/netinet
Author: bms Date: Tue Mar 17 14:41:54 2009 New Revision: 189931 URL: http://svn.freebsd.org/changeset/base/189931 Log: Deal with the case where ifma_protospec may be NULL, during any IPv4 multicast operations which reference it. There is a potential race because ifma_protospec is set to NULL when we discover the underlying ifnet has gone away. This write is not covered by the IF_ADDR_LOCK, and it's difficult to widen its scope without making it a recursive lock. It isn't clear why this manifests more quickly with 802.11 interfaces, but does not seem to manifest at all with wired interfaces. With this change, the 802.11 related panics reported by sam@ and cokane@ should go away. It is not the right fix, that requires more thought before 8.0. Idea from:sam Tested by:cokane Modified: head/sys/netinet/igmp.c head/sys/netinet/in.c head/sys/netinet/in_mcast.c Modified: head/sys/netinet/igmp.c == --- head/sys/netinet/igmp.c Tue Mar 17 14:29:25 2009(r189930) +++ head/sys/netinet/igmp.c Tue Mar 17 14:41:54 2009(r189931) @@ -183,6 +183,11 @@ static int vnet_igmp_idetach(const void * VIMAGE: Each in_multi corresponds to an ifp, and each ifp corresponds * to a vnet in ifp->if_vnet. * + * SMPng: XXX We may potentially race operations on ifma_protospec. + * The problem is that we currently lack a clean way of taking the + * IF_ADDR_LOCK() between the ifnet and in layers w/o recursing, + * as anything which modifies ifma needs to be covered by that lock. + * So check for ifma_protospec being NULL before proceeding. */ struct mtx igmp_mtx; int mpsafe_igmp = 0; @@ -601,6 +606,7 @@ out: * is detached, but also before the link layer does its cleanup. * * SMPNG: igmp_ifdetach() needs to take IF_ADDR_LOCK(). + * XXX This is also bitten by unlocked ifma_protospec access. * * VIMAGE: curvnet should have been set by caller, but let's not assume * that for now. @@ -623,8 +629,13 @@ igmp_ifdetach(struct ifnet *ifp) if (igi->igi_version == IGMP_VERSION_3) { IF_ADDR_LOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_INET) + if (ifma->ifma_addr->sa_family != AF_INET || + ifma->ifma_protospec == NULL) continue; +#if 0 + KASSERT(ifma->ifma_protospec != NULL, + ("%s: ifma_protospec is NULL", __func__)); +#endif inm = (struct in_multi *)ifma->ifma_protospec; if (inm->inm_state == IGMP_LEAVING_MEMBER) { SLIST_INSERT_HEAD(&igi->igi_relinmhead, @@ -783,7 +794,8 @@ igmp_input_v1_query(struct ifnet *ifp, c */ IF_ADDR_LOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_INET) + if (ifma->ifma_addr->sa_family != AF_INET || + ifma->ifma_protospec == NULL) continue; inm = (struct in_multi *)ifma->ifma_protospec; if (inm->inm_timer != 0) @@ -880,7 +892,8 @@ igmp_input_v2_query(struct ifnet *ifp, c IF_ADDR_LOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_INET) + if (ifma->ifma_addr->sa_family != AF_INET || + ifma->ifma_protospec == NULL) continue; inm = (struct in_multi *)ifma->ifma_protospec; igmp_v2_update_group(inm, timer); @@ -1701,7 +1714,8 @@ igmp_fasttimo_vnet(void) IF_ADDR_LOCK(ifp); TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, tifma) { - if (ifma->ifma_addr->sa_family != AF_INET) + if (ifma->ifma_addr->sa_family != AF_INET || + ifma->ifma_protospec == NULL) continue; inm = (struct in_multi *)ifma->ifma_protospec; switch (igi->igi_version) { @@ -3311,7 +3325,8 @@ igmp_v3_dispatch_general_query(struct ig IF_ADDR_LOCK(ifp); TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, tifma) { - if (ifma->ifma_addr->sa_family != AF_INET) + if (ifma->ifma_addr->sa_family != AF_INET || + ifma->ifma_protospec == NULL) continue; inm = (struct in_multi *)ifma->ifma_protospec; Modified: head/sys/netinet/in.c ===
svn commit: r189932 - in head: share/misc usr.bin/calendar/calendars
Author: fabient Date: Tue Mar 17 14:53:42 2009 New Revision: 189932 URL: http://svn.freebsd.org/changeset/base/189932 Log: Add information about me as a new committer to the src tree Approved by: jkoshy (mentor) Modified: head/share/misc/committers-src.dot head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/share/misc/committers-src.dot == --- head/share/misc/committers-src.dot Tue Mar 17 14:41:54 2009 (r189931) +++ head/share/misc/committers-src.dot Tue Mar 17 14:53:42 2009 (r189932) @@ -88,6 +88,7 @@ eik [label="Oliver eikemeier\n...@freebs emaste [label="Ed maste\nema...@freebsd.org\n2005/10/04"] emax [label="Maksim yevmenkin\ne...@freebsd.org\n2003/10/12"] eri [label="Ermal luci\n...@freebsd.org\n2008/06/11"] +fabient [label="Fabien thomas\nfabi...@freebsd.org\n2009/03/16"] fanf [label="Tony finch\nf...@freebsd.org\n2002/05/05"] fjoe [label="Max khon\nf...@freebsd.org\n2001/08/06"] flz [label="Florent thoumie\n...@freebsd.org\n2006/03/30"] @@ -314,6 +315,7 @@ jkh -> wes jkh -> yar jkoshy -> kaiw +jkoshy -> fabient jlemon -> bmilekic jlemon -> brooks Modified: head/usr.bin/calendar/calendars/calendar.freebsd == --- head/usr.bin/calendar/calendars/calendar.freebsdTue Mar 17 14:41:54 2009(r189931) +++ head/usr.bin/calendar/calendars/calendar.freebsdTue Mar 17 14:53:42 2009(r189932) @@ -28,6 +28,7 @@ 01/22 Johann Visagie born in Cape Town, South Africa, 1970 01/23 Hideyuki KURASHINA born in Niigata, Japan, 1982 01/24 Matteo Riondato born in Padova, Italy, 1986 +01/24 Fabien Thomas born in Avignon, France, 1971 01/25 Bernd Walter born in Moers, Nordrhein-Westfalen, Germany, 1974 01/26 Andrew Gallatin born in Buffalo, New York, United States, 1970 01/27 Nick Sayer born in San Diego, California, United States, 1968 ___ 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: r189933 - head/sys/kern
Author: attilio Date: Tue Mar 17 16:30:49 2009 New Revision: 189933 URL: http://svn.freebsd.org/changeset/base/189933 Log: Fix an old-standing bug that crept in along the several revisions: B_DELWRI cleanup and vnode disassociation should happen just before to assign the buffer to a queue. Reported by: miwi, Volker , Ben Kaduk , Christopher Mallon Tested by:lulf, miwi Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c == --- head/sys/kern/vfs_bio.c Tue Mar 17 14:53:42 2009(r189932) +++ head/sys/kern/vfs_bio.c Tue Mar 17 16:30:49 2009(r189933) @@ -1369,9 +1369,23 @@ brelse(struct buf *bp) if (bp->b_qindex != QUEUE_NONE) panic("brelse: free buffer onto another queue???"); + /* +* If the buffer has junk contents signal it and eventually +* clean up B_DELWRI and diassociate the vnode so that gbincore() +* doesn't find it. +*/ + if (bp->b_bufsize == 0 || (bp->b_ioflags & BIO_ERROR) != 0 || + (bp->b_flags & (B_INVAL | B_NOCACHE | B_RELBUF)) != 0) + bp->b_flags |= B_INVAL; + if (bp->b_flags & B_INVAL) { + if (bp->b_flags & B_DELWRI) + bundirty(bp); + if (bp->b_vp) + brelvp(bp); + } + /* buffers with no memory */ if (bp->b_bufsize == 0) { - bp->b_flags |= B_INVAL; bp->b_xflags &= ~(BX_BKGRDWRITE | BX_ALTDATA); if (bp->b_vflags & BV_BKGRDINPROG) panic("losing buffer 1"); @@ -1384,7 +1398,6 @@ brelse(struct buf *bp) /* buffers with junk contents */ } else if (bp->b_flags & (B_INVAL | B_NOCACHE | B_RELBUF) || (bp->b_ioflags & BIO_ERROR)) { - bp->b_flags |= B_INVAL; bp->b_xflags &= ~(BX_BKGRDWRITE | BX_ALTDATA); if (bp->b_vflags & BV_BKGRDINPROG) panic("losing buffer 2"); @@ -1407,19 +1420,6 @@ brelse(struct buf *bp) mtx_unlock(&bqlock); /* -* If B_INVAL and B_DELWRI is set, clear B_DELWRI. We have already -* placed the buffer on the correct queue. We must also disassociate -* the device and vnode for a B_INVAL buffer so gbincore() doesn't -* find it. -*/ - if (bp->b_flags & B_INVAL) { - if (bp->b_flags & B_DELWRI) - bundirty(bp); - if (bp->b_vp) - brelvp(bp); - } - - /* * Fixup numfreebuffers count. The bp is on an appropriate queue * unless locked. We then bump numfreebuffers if it is not B_DELWRI. * We've already handled the B_INVAL case ( B_DELWRI will be clear ___ 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: r189934 - head/usr.bin/ministat
Author: dwmalone Date: Tue Mar 17 19:37:47 2009 New Revision: 189934 URL: http://svn.freebsd.org/changeset/base/189934 Log: Fix some warns - mainly signedness and unused variables. Modified: head/usr.bin/ministat/ministat.c Modified: head/usr.bin/ministat/ministat.c == --- head/usr.bin/ministat/ministat.cTue Mar 17 16:30:49 2009 (r189933) +++ head/usr.bin/ministat/ministat.cTue Mar 17 19:37:47 2009 (r189934) @@ -136,7 +136,7 @@ struct dataset { double *points; unsigned lpoints; double sy, syy; - int n; + unsigned n; }; static struct dataset * @@ -191,8 +191,6 @@ Avg(struct dataset *ds) static double Median(struct dataset *ds) { - int even, i; - struct point *p1, *p2; return (ds->points[ds->n / 2]); } @@ -317,8 +315,8 @@ static void PlotSet(struct dataset *ds, int val) { struct plot *pl; - struct point *pp; - int i, j, m, x, n; + int i, j, m, x; + unsigned n; int bar; pl = &plot; ___ 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: r189935 - in stable/7/sys: . contrib/pf dev/ata dev/ath/ath_hal dev/cxgb geom geom/part modules/geom/geom_part modules/geom/geom_part/geom_part_ebr sys
Author: marcel Date: Tue Mar 17 19:38:40 2009 New Revision: 189935 URL: http://svn.freebsd.org/changeset/base/189935 Log: Sync gpart with the trunk. This includes: o APM scheme supports Tivo Series 1 partitions (read only). o Bootcode support added to BSD scheme. o New EBR scheme to support Extended Boot Records (logical partitions). o PC98 scheme fixes (credits to nyan@) o VTOC8 scheme fixes (credits to marius@) Added: stable/7/sys/geom/part/g_part_ebr.c - copied, changed from r188354, head/sys/geom/part/g_part_ebr.c stable/7/sys/modules/geom/geom_part/geom_part_ebr/ - copied from r188354, head/sys/modules/geom/geom_part/geom_part_ebr/ Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ata/atapi-cd.c stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/geom/geom.h stable/7/sys/geom/geom_dev.c stable/7/sys/geom/geom_subr.c stable/7/sys/geom/part/g_part.c stable/7/sys/geom/part/g_part.h stable/7/sys/geom/part/g_part_apm.c stable/7/sys/geom/part/g_part_bsd.c stable/7/sys/geom/part/g_part_gpt.c stable/7/sys/geom/part/g_part_if.m stable/7/sys/geom/part/g_part_mbr.c stable/7/sys/geom/part/g_part_pc98.c stable/7/sys/geom/part/g_part_vtoc8.c stable/7/sys/modules/geom/geom_part/Makefile stable/7/sys/sys/disk.h stable/7/sys/sys/diskpc98.h Modified: stable/7/sys/dev/ata/atapi-cd.c == --- stable/7/sys/dev/ata/atapi-cd.c Tue Mar 17 19:37:47 2009 (r189934) +++ stable/7/sys/dev/ata/atapi-cd.c Tue Mar 17 19:38:40 2009 (r189935) @@ -218,7 +218,10 @@ acd_geom_ioctl(struct g_provider *pp, u_ case CDIOCRESET: acd_test_ready(dev); break; - + + case DIOCGPROVIDERALIAS: + break; + default: acd_read_toc(dev); acd_prevent_allow(dev, 1); Modified: stable/7/sys/geom/geom.h == --- stable/7/sys/geom/geom.hTue Mar 17 19:37:47 2009(r189934) +++ stable/7/sys/geom/geom.hTue Mar 17 19:38:40 2009(r189935) @@ -227,10 +227,11 @@ void g_error_provider(struct g_provider struct g_provider *g_provider_by_name(char const *arg); int g_getattr__(const char *attr, struct g_consumer *cp, void *var, int len); #define g_getattr(a, c, v) g_getattr__((a), (c), (v), sizeof *(v)) -int g_handleattr(struct bio *bp, const char *attribute, void *val, int len); +int g_handleattr(struct bio *bp, const char *attribute, const void *val, +int len); int g_handleattr_int(struct bio *bp, const char *attribute, int val); int g_handleattr_off_t(struct bio *bp, const char *attribute, off_t val); -int g_handleattr_str(struct bio *bp, const char *attribute, char *str); +int g_handleattr_str(struct bio *bp, const char *attribute, const char *str); struct g_consumer * g_new_consumer(struct g_geom *gp); struct g_geom * g_new_geomf(struct g_class *mp, const char *fmt, ...); struct g_provider * g_new_providerf(struct g_geom *gp, const char *fmt, ...); Modified: stable/7/sys/geom/geom_dev.c == --- stable/7/sys/geom/geom_dev.cTue Mar 17 19:37:47 2009 (r189934) +++ stable/7/sys/geom/geom_dev.cTue Mar 17 19:38:40 2009 (r189935) @@ -124,6 +124,7 @@ g_dev_taste(struct g_class *mp, struct g { struct g_geom *gp; struct g_consumer *cp; + char *alias; int error; struct cdev *dev; u_int unit; @@ -147,6 +148,17 @@ g_dev_taste(struct g_class *mp, struct g gp->softc = dev; dev->si_drv1 = gp; dev->si_drv2 = cp; + + g_topology_unlock(); + + alias = g_malloc(MAXPATHLEN, M_WAITOK | M_ZERO); + error = (pp->geom->ioctl == NULL) ? ENODEV : + pp->geom->ioctl(pp, DIOCGPROVIDERALIAS, alias, 0, curthread); + if (!error && alias[0] != '\0') + make_dev_alias(dev, "%s", alias); + g_free(alias); + + g_topology_lock(); return (gp); } Modified: stable/7/sys/geom/geom_subr.c == --- stable/7/sys/geom/geom_subr.c Tue Mar 17 19:37:47 2009 (r189934) +++ stable/7/sys/geom/geom_subr.c Tue Mar 17 19:38:40 2009 (r189935) @@ -856,14 +856,14 @@ g_handleattr_off_t(struct bio *bp, const } int -g_handleattr_str(struct bio *bp, const char *attribute, char *str) +g_handleattr_str(struct bio *bp, const char *attribute, const char *str) { return (g_handleattr(bp, attribute, str, 0)); } int -g_handleattr(struct bio *bp, const char *attribute, void *val, int len) +g_handleattr(struct bio *bp, const char *attribute, const void *val, int len) { int error = 0; @@ -880,12 +880,13 @@
svn commit: r189936 - head/release/picobsd/tinyware/simple_httpd
Author: dwmalone Date: Tue Mar 17 19:51:04 2009 New Revision: 189936 URL: http://svn.freebsd.org/changeset/base/189936 Log: Warns fixes: use putenv rather than setenv to avoid constness problems, when we want to print an off_t cast to intmax_t and use %jd. Up WARNS to 6. Modified: head/release/picobsd/tinyware/simple_httpd/Makefile head/release/picobsd/tinyware/simple_httpd/simple_httpd.c Modified: head/release/picobsd/tinyware/simple_httpd/Makefile == --- head/release/picobsd/tinyware/simple_httpd/Makefile Tue Mar 17 19:38:40 2009(r189935) +++ head/release/picobsd/tinyware/simple_httpd/Makefile Tue Mar 17 19:51:04 2009(r189936) @@ -3,5 +3,6 @@ PROG=simple_httpd SRCS= simple_httpd.c NO_MAN= +WARNS?=6 .include Modified: head/release/picobsd/tinyware/simple_httpd/simple_httpd.c == --- head/release/picobsd/tinyware/simple_httpd/simple_httpd.c Tue Mar 17 19:38:40 2009(r189935) +++ head/release/picobsd/tinyware/simple_httpd/simple_httpd.c Tue Mar 17 19:51:04 2009(r189936) @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -278,7 +279,7 @@ http_request(void) /*printf("HTTP/1.0 200 OK\nContent-type: text/html\n\n\n");*/ printf("HTTP/1.0 200 OK\r\n"); /* Plug in environment variable, others in log_line */ - putenv("SERVER_SOFTWARE=FreeBSD/PicoBSD"); + setenv("SERVER_SOFTWARE", "FreeBSD/PicoBSD", 1); execlp (filename,filename,par,(char *)0); } @@ -331,7 +332,7 @@ http_request(void) http_output(httpd_server_ident); http_date(); - sprintf(buff, "Content-length: %lld\r\n", file_status.st_size); + sprintf(buff, "Content-length: %jd\r\n", (intmax_t)file_status.st_size); write(con_sock, buff, strlen(buff)); strcpy(buff, "Content-type: "); ___ 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: r189938 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb netinet
Author: bz Date: Tue Mar 17 20:59:45 2009 New Revision: 189938 URL: http://svn.freebsd.org/changeset/base/189938 Log: MFC r183001: Implement IPv6 support for TCP MD5 Signature Option (RFC 2385) the same way it has been implemented for IPv4. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/netinet/tcp_output.c stable/7/sys/netinet/tcp_subr.c stable/7/sys/netinet/tcp_syncache.c Modified: stable/7/sys/netinet/tcp_output.c == --- stable/7/sys/netinet/tcp_output.c Tue Mar 17 19:57:11 2009 (r189937) +++ stable/7/sys/netinet/tcp_output.c Tue Mar 17 20:59:45 2009 (r189938) @@ -681,11 +681,7 @@ send: } #ifdef TCP_SIGNATURE /* TCP-MD5 (RFC2385). */ -#ifdef INET6 - if (!isipv6 && (tp->t_flags & TF_SIGNATURE)) -#else if (tp->t_flags & TF_SIGNATURE) -#endif /* INET6 */ to.to_flags |= TOF_SIGNATURE; #endif /* TCP_SIGNATURE */ @@ -954,12 +950,9 @@ send: tp->snd_up = tp->snd_una; /* drag it along */ #ifdef TCP_SIGNATURE -#ifdef INET6 - if (!isipv6) -#endif if (tp->t_flags & TF_SIGNATURE) { int sigoff = to.to_signature - opt; - tcp_signature_compute(m, sizeof(struct ip), len, optlen, + tcp_signature_compute(m, 0, len, optlen, (u_char *)(th + 1) + sigoff, IPSEC_DIR_OUTBOUND); } #endif Modified: stable/7/sys/netinet/tcp_subr.c == --- stable/7/sys/netinet/tcp_subr.c Tue Mar 17 19:57:11 2009 (r189937) +++ stable/7/sys/netinet/tcp_subr.c Tue Mar 17 20:59:45 2009 (r189938) @@ -102,6 +102,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include +#include #endif /*IPSEC*/ #include @@ -1852,11 +1853,11 @@ tcp_signature_apply(void *fstate, void * } /* - * Compute TCP-MD5 hash of a TCPv4 segment. (RFC2385) + * Compute TCP-MD5 hash of a TCP segment. (RFC2385) * * Parameters: * m pointer to head of mbuf chain - * off0offset to TCP header within the mbuf chain + * _unused * len length of TCP segment data, excluding options * optlen length of TCP segment options * buf pointer to storage for computed MD5 digest @@ -1866,9 +1867,6 @@ tcp_signature_apply(void *fstate, void * * When called from tcp_input(), we can be sure that th_sum has been * zeroed out and verified already. * - * This function is for IPv4 use only. Calling this function with an - * IPv6 packet in the mbuf chain will yield undefined results. - * * Return 0 if successful, otherwise return -1. * * XXX The key is retrieved from the system's PF_KEY SADB, by keying a @@ -1878,7 +1876,7 @@ tcp_signature_apply(void *fstate, void * * specify per-application flows but it is unstable. */ int -tcp_signature_compute(struct mbuf *m, int off0, int len, int optlen, +tcp_signature_compute(struct mbuf *m, int _unused, int len, int optlen, u_char *buf, u_int direction) { union sockaddr_union dst; @@ -1889,34 +1887,62 @@ tcp_signature_compute(struct mbuf *m, in struct ipovly *ipovly; struct secasvar *sav; struct tcphdr *th; +#ifdef INET6 + struct ip6_hdr *ip6; + struct in6_addr in6; + char ip6buf[INET6_ADDRSTRLEN]; + uint32_t plen; + uint16_t nhdr; +#endif u_short savecsum; KASSERT(m != NULL, ("NULL mbuf chain")); KASSERT(buf != NULL, ("NULL signature pointer")); /* Extract the destination from the IP header in the mbuf. */ - ip = mtod(m, struct ip *); bzero(&dst, sizeof(union sockaddr_union)); - dst.sa.sa_len = sizeof(struct sockaddr_in); - dst.sa.sa_family = AF_INET; - dst.sin.sin_addr = (direction == IPSEC_DIR_INBOUND) ? - ip->ip_src : ip->ip_dst; + ip = mtod(m, struct ip *); +#ifdef INET6 + ip6 = NULL; /* Make the compiler happy. */ +#endif + switch (ip->ip_v) { + case IPVERSION: + dst.sa.sa_len = sizeof(struct sockaddr_in); + dst.sa.sa_family = AF_INET; + dst.sin.sin_addr = (direction == IPSEC_DIR_INBOUND) ? + ip->ip_src : ip->ip_dst; + break; +#ifdef INET6 + case (IPV6_VERSION >> 4): + ip6 = mtod(m, struct ip6_hdr *); + dst.sa.sa_len = sizeof(struct sockaddr_in6); + dst.sa.sa_family = AF_INET6; + dst.sin6.sin6_addr = (direction == IPSEC_DIR_INBOUND) ? + ip6->ip6_src : ip6->ip6_dst; + break; +#endif + default: + return (EINVAL); + /* NOTREACHED */ + bre
svn commit: r189939 - head/lib/libusb
Author: delphij Date: Tue Mar 17 21:20:39 2009 New Revision: 189939 URL: http://svn.freebsd.org/changeset/base/189939 Log: Add prototypes for libusb20_be_[gs]et_template. Modified: head/lib/libusb/libusb20.h Modified: head/lib/libusb/libusb20.h == --- head/lib/libusb/libusb20.h Tue Mar 17 20:59:45 2009(r189938) +++ head/lib/libusb/libusb20.h Tue Mar 17 21:20:39 2009(r189939) @@ -274,6 +274,8 @@ int libusb20_be_get_dev_quirk(struct lib intlibusb20_be_get_quirk_name(struct libusb20_backend *pbe, uint16_t index, struct libusb20_quirk *pq); intlibusb20_be_add_dev_quirk(struct libusb20_backend *pbe, struct libusb20_quirk *pq); intlibusb20_be_remove_dev_quirk(struct libusb20_backend *pbe, struct libusb20_quirk *pq); +intlibusb20_be_get_template(struct libusb20_backend *pbe, int *ptemp); +intlibusb20_be_set_template(struct libusb20_backend *pbe, int temp); /* USB backend operations */ ___ 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: r189940 - head/usr.sbin/usbconfig
Author: delphij Date: Tue Mar 17 21:21:33 2009 New Revision: 189940 URL: http://svn.freebsd.org/changeset/base/189940 Log: Remove unused local. usbconfig(8) can now compile under WARNS=6. Modified: head/usr.sbin/usbconfig/usbconfig.c Modified: head/usr.sbin/usbconfig/usbconfig.c == --- head/usr.sbin/usbconfig/usbconfig.c Tue Mar 17 21:20:39 2009 (r189939) +++ head/usr.sbin/usbconfig/usbconfig.c Tue Mar 17 21:21:33 2009 (r189940) @@ -501,7 +501,6 @@ main(int argc, char **argv) { struct libusb20_backend *pbe; struct options *opt = &options; - char *cp; int n; int t; ___ 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: r189941 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/re
Author: yongari Date: Wed Mar 18 01:57:26 2009 New Revision: 189941 URL: http://svn.freebsd.org/changeset/base/189941 Log: MFC r187481: - Do not read and write RX configuration register multiple times. - Always program RX configuration register from scratch instead of doing read/modify/write. - Rename re_setmulti() to re_set_rxmode() to be reflect reality. - Simplify hash filter logic a little while I am here. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/re/if_re.c Modified: stable/7/sys/dev/re/if_re.c == --- stable/7/sys/dev/re/if_re.c Tue Mar 17 21:21:33 2009(r189940) +++ stable/7/sys/dev/re/if_re.c Wed Mar 18 01:57:26 2009(r189941) @@ -266,7 +266,7 @@ static int re_miibus_readreg(device_t, static int re_miibus_writereg (device_t, int, int, int); static void re_miibus_statchg (device_t); -static void re_setmulti(struct rl_softc *); +static void re_set_rxmode (struct rl_softc *); static void re_reset (struct rl_softc *); static void re_setwol (struct rl_softc *); static void re_clrwol (struct rl_softc *); @@ -607,26 +607,23 @@ re_miibus_statchg(device_t dev) } /* - * Program the 64-bit multicast hash filter. + * Set the RX configuration and 64-bit multicast hash filter. */ static void -re_setmulti(struct rl_softc *sc) +re_set_rxmode(struct rl_softc *sc) { struct ifnet*ifp; - int h = 0; - u_int32_t hashes[2] = { 0, 0 }; struct ifmultiaddr *ifma; - u_int32_t rxfilt; - int mcnt = 0; + uint32_thashes[2] = { 0, 0 }; + uint32_th, rxfilt; RL_LOCK_ASSERT(sc); ifp = sc->rl_ifp; + rxfilt = RL_RXCFG_CONFIG | RL_RXCFG_RX_INDIV | RL_RXCFG_RX_BROAD; - rxfilt = CSR_READ_4(sc, RL_RXCFG); - rxfilt &= ~(RL_RXCFG_RX_ALLPHYS | RL_RXCFG_RX_MULTI); - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { + if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { if (ifp->if_flags & IFF_PROMISC) rxfilt |= RL_RXCFG_RX_ALLPHYS; /* @@ -635,17 +632,10 @@ re_setmulti(struct rl_softc *sc) * promiscuous mode. */ rxfilt |= RL_RXCFG_RX_MULTI; - CSR_WRITE_4(sc, RL_RXCFG, rxfilt); - CSR_WRITE_4(sc, RL_MAR0, 0x); - CSR_WRITE_4(sc, RL_MAR4, 0x); - return; + hashes[0] = hashes[1] = 0x; + goto done; } - /* first, zot all the existing hash bits */ - CSR_WRITE_4(sc, RL_MAR0, 0); - CSR_WRITE_4(sc, RL_MAR4, 0); - - /* now program new ones */ IF_ADDR_LOCK(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -656,31 +646,29 @@ re_setmulti(struct rl_softc *sc) hashes[0] |= (1 << h); else hashes[1] |= (1 << (h - 32)); - mcnt++; } IF_ADDR_UNLOCK(ifp); - if (mcnt) + if (hashes[0] != 0 || hashes[1] != 0) { + /* +* For some unfathomable reason, RealTek decided to +* reverse the order of the multicast hash registers +* in the PCI Express parts. This means we have to +* write the hash pattern in reverse order for those +* devices. +*/ + if ((sc->rl_flags & RL_FLAG_INVMAR) != 0) { + h = bswap32(hashes[0]); + hashes[0] = bswap32(hashes[1]); + hashes[1] = h; + } rxfilt |= RL_RXCFG_RX_MULTI; - else - rxfilt &= ~RL_RXCFG_RX_MULTI; + } +done: + CSR_WRITE_4(sc, RL_MAR0, hashes[0]); + CSR_WRITE_4(sc, RL_MAR4, hashes[1]); CSR_WRITE_4(sc, RL_RXCFG, rxfilt); - - /* -* For some unfathomable reason, RealTek decided to reverse -* the order of the multicast hash registers in the PCI Express -* parts. This means we have to write the hash pattern in reverse -* order for those devices. -*/ - - if ((sc->rl_flags & RL_FLAG_INVMAR) != 0) { - CSR_WRITE_4(sc, RL_MAR0, bswap32(hashes[1])); - CSR_WRITE_4(sc, RL_MAR4, bswap32(hashes[0])); - } else { - CSR_WRITE_4(sc, RL_MAR0, hashes[0]); - CSR_WRITE_4(sc, RL_MAR4, hashes[1]); - } } static void @@ -2498,7 +2486,6 @@ re_init_locked(struct rl
svn commit: r189942 - head/sys/compat/ndis
Author: weongyo Date: Wed Mar 18 01:57:54 2009 New Revision: 189942 URL: http://svn.freebsd.org/changeset/base/189942 Log: If the caller sets irp_usriostat or irp_usrevent it try to process it whatever the IRP flag is because some drivers (eg. RTL8187L NDIS driver) call IoCompleteRequest() without setting flags. It will prevent waiting a event forever at attach. Modified: head/sys/compat/ndis/subr_ntoskrnl.c Modified: head/sys/compat/ndis/subr_ntoskrnl.c == --- head/sys/compat/ndis/subr_ntoskrnl.cWed Mar 18 01:57:26 2009 (r189941) +++ head/sys/compat/ndis/subr_ntoskrnl.cWed Mar 18 01:57:54 2009 (r189942) @@ -1197,6 +1197,11 @@ IofCompleteRequest(irp *ip, uint8_t prio sl++; } while (ip->irp_currentstackloc <= (ip->irp_stackcnt + 1)); + if (ip->irp_usriostat != NULL) + *ip->irp_usriostat = ip->irp_iostat; + if (ip->irp_usrevent != NULL) + KeSetEvent(ip->irp_usrevent, prioboost, FALSE); + /* Handle any associated IRPs. */ if (ip->irp_flags & IRP_ASSOCIATED_IRP) { @@ -1220,16 +1225,10 @@ IofCompleteRequest(irp *ip, uint8_t prio /* With any luck, these conditions will never arise. */ - if (ip->irp_flags & (IRP_PAGING_IO|IRP_CLOSE_OPERATION)) { - if (ip->irp_usriostat != NULL) - *ip->irp_usriostat = ip->irp_iostat; - if (ip->irp_usrevent != NULL) - KeSetEvent(ip->irp_usrevent, prioboost, FALSE); - if (ip->irp_flags & IRP_PAGING_IO) { - if (ip->irp_mdl != NULL) - IoFreeMdl(ip->irp_mdl); - IoFreeIrp(ip); - } + if (ip->irp_flags & IRP_PAGING_IO) { + if (ip->irp_mdl != NULL) + IoFreeMdl(ip->irp_mdl); + IoFreeIrp(ip); } 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"
svn commit: r189943 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/re pci
Author: yongari Date: Wed Mar 18 02:00:23 2009 New Revision: 189943 URL: http://svn.freebsd.org/changeset/base/189943 Log: MFC r187482: Retire RL_FLAG_INVMAR bit to match its comment and reality. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/re/if_re.c stable/7/sys/pci/if_rlreg.h Modified: stable/7/sys/dev/re/if_re.c == --- stable/7/sys/dev/re/if_re.c Wed Mar 18 01:57:54 2009(r189942) +++ stable/7/sys/dev/re/if_re.c Wed Mar 18 02:00:23 2009(r189943) @@ -657,7 +657,7 @@ re_set_rxmode(struct rl_softc *sc) * write the hash pattern in reverse order for those * devices. */ - if ((sc->rl_flags & RL_FLAG_INVMAR) != 0) { + if ((sc->rl_flags & RL_FLAG_PCIE) != 0) { h = bswap32(hashes[0]); hashes[0] = bswap32(hashes[1]); hashes[1] = h; @@ -1234,22 +1234,21 @@ re_attach(device_t dev) break; case RL_HWREV_8100E: case RL_HWREV_8101E: - sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_INVMAR | - RL_FLAG_PHYWAKE | RL_FLAG_FASTETHER; + sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_PHYWAKE | + RL_FLAG_FASTETHER; break; case RL_HWREV_8102E: case RL_HWREV_8102EL: - sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_INVMAR | - RL_FLAG_PHYWAKE | RL_FLAG_PAR | RL_FLAG_DESCV2 | - RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP; + sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_PHYWAKE | + RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | + RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP; break; case RL_HWREV_8168_SPIN1: case RL_HWREV_8168_SPIN2: sc->rl_flags |= RL_FLAG_WOLRXENB; /* FALLTHROUGH */ case RL_HWREV_8168_SPIN3: - sc->rl_flags |= RL_FLAG_INVMAR | RL_FLAG_PHYWAKE | - RL_FLAG_MACSTAT; + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_MACSTAT; break; case RL_HWREV_8168C_SPIN2: sc->rl_flags |= RL_FLAG_MACSLEEP; @@ -1260,9 +1259,8 @@ re_attach(device_t dev) /* FALLTHROUGH */ case RL_HWREV_8168CP: case RL_HWREV_8168D: - sc->rl_flags |= RL_FLAG_INVMAR | RL_FLAG_PHYWAKE | - RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | - RL_FLAG_CMDSTOP; + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PAR | + RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | RL_FLAG_CMDSTOP; /* * These controllers support jumbo frame but it seems * that enabling it requires touching additional magic Modified: stable/7/sys/pci/if_rlreg.h == --- stable/7/sys/pci/if_rlreg.h Wed Mar 18 01:57:54 2009(r189942) +++ stable/7/sys/pci/if_rlreg.h Wed Mar 18 02:00:23 2009(r189943) @@ -852,7 +852,6 @@ struct rl_softc { int rl_txstart; uint32_trl_flags; #defineRL_FLAG_MSI 0x0001 -#defineRL_FLAG_INVMAR 0x0004 #defineRL_FLAG_PHYWAKE 0x0008 #defineRL_FLAG_NOJUMBO 0x0010 #defineRL_FLAG_PAR 0x0020 ___ 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: r189944 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/re pci
Author: yongari Date: Wed Mar 18 02:03:16 2009 New Revision: 189944 URL: http://svn.freebsd.org/changeset/base/189944 Log: MFC r187483: - Add support for 8110SCe part. Some magic registers were taken from Linux driver. - Swap hardware revisions for 8110S and 8169S as Linux driver claims. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/re/if_re.c stable/7/sys/pci/if_rlreg.h Modified: stable/7/sys/dev/re/if_re.c == --- stable/7/sys/dev/re/if_re.c Wed Mar 18 02:00:23 2009(r189943) +++ stable/7/sys/dev/re/if_re.c Wed Mar 18 02:03:16 2009(r189944) @@ -199,9 +199,10 @@ static struct rl_hwrev re_hwrevs[] = { { RL_HWREV_8169, RL_8169, "8169"}, { RL_HWREV_8169S, RL_8169, "8169S"}, { RL_HWREV_8110S, RL_8169, "8110S"}, - { RL_HWREV_8169_8110SB, RL_8169, "8169SB"}, - { RL_HWREV_8169_8110SC, RL_8169, "8169SC"}, - { RL_HWREV_8169_8110SBL, RL_8169, "8169SBL"}, + { RL_HWREV_8169_8110SB, RL_8169, "8169SB/8110SB"}, + { RL_HWREV_8169_8110SC, RL_8169, "8169SC/8110SC"}, + { RL_HWREV_8169_8110SBL, RL_8169, "8169SBL/8110SBL"}, + { RL_HWREV_8169_8110SCE, RL_8169, "8169SC/8110SC"}, { RL_HWREV_8100, RL_8139, "8100"}, { RL_HWREV_8101, RL_8139, "8101"}, { RL_HWREV_8100E, RL_8169, "8100E"}, @@ -688,12 +689,10 @@ re_reset(struct rl_softc *sc) if (i == RL_TIMEOUT) device_printf(sc->rl_dev, "reset never completed!\n"); - if ((sc->rl_flags & RL_FLAG_PHY8169) != 0) + if ((sc->rl_flags & RL_FLAG_MACRESET) != 0) CSR_WRITE_1(sc, 0x82, 1); - if ((sc->rl_flags & RL_FLAG_PHY8110S) != 0) { - CSR_WRITE_1(sc, 0x82, 1); - re_gmii_writereg(sc->rl_dev, 1, 0x0B, 0); - } + if (sc->rl_hwrev == RL_HWREV_8169S) + re_gmii_writereg(sc->rl_dev, 1, 0x0b, 0); } #ifdef RE_DIAG @@ -1209,12 +1208,22 @@ re_attach(device_t dev) hw_rev = re_hwrevs; hwrev = CSR_READ_4(sc, RL_TXCFG); - device_printf(dev, "Chip rev. 0x%08x\n", hwrev & 0x7c80); + switch (hwrev & 0x7000) { + case 0x: + case 0x1000: + device_printf(dev, "Chip rev. 0x%08x\n", hwrev & 0xfc80); + hwrev &= (RL_TXCFG_HWREV | 0x8000); + break; + default: + device_printf(dev, "Chip rev. 0x%08x\n", hwrev & 0x7c80); + hwrev &= RL_TXCFG_HWREV; + break; + } device_printf(dev, "MAC rev. 0x%08x\n", hwrev & 0x0070); - hwrev &= RL_TXCFG_HWREV; while (hw_rev->rl_desc != NULL) { if (hw_rev->rl_rev == hwrev) { sc->rl_type = hw_rev->rl_type; + sc->rl_hwrev = hw_rev->rl_rev; break; } hw_rev++; @@ -1229,9 +1238,6 @@ re_attach(device_t dev) case RL_HWREV_8139CPLUS: sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_FASTETHER; break; - case RL_HWREV_8110S: - sc->rl_flags |= RL_FLAG_PHY8110S; - break; case RL_HWREV_8100E: case RL_HWREV_8101E: sc->rl_flags |= RL_FLAG_NOJUMBO | RL_FLAG_PHYWAKE | @@ -1273,14 +1279,16 @@ re_attach(device_t dev) */ sc->rl_flags |= RL_FLAG_NOJUMBO; break; - case RL_HWREV_8169: - case RL_HWREV_8169S: - sc->rl_flags |= RL_FLAG_PHY8169; - break; case RL_HWREV_8169_8110SB: - case RL_HWREV_8169_8110SC: case RL_HWREV_8169_8110SBL: - sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHY8169; + case RL_HWREV_8169_8110SC: + case RL_HWREV_8169_8110SCE: + sc->rl_flags |= RL_FLAG_PHYWAKE; + /* FALLTHROUGH */ + case RL_HWREV_8169: + case RL_HWREV_8169S: + case RL_HWREV_8110S: + sc->rl_flags |= RL_FLAG_MACRESET; break; default: break; @@ -2484,6 +2492,7 @@ re_init_locked(struct rl_softc *sc) { struct ifnet*ifp = sc->rl_ifp; struct mii_data *mii; + uint32_treg; uint16_tcfg; union { uint32_t align_dummy; @@ -2519,6 +2528,17 @@ re_init_locked(struct rl_softc *sc) } else cfg |= RL_CPLUSCMD_RXENB | RL_CPLUSCMD_TXENB; CSR_WRITE_2(sc, RL_CPLUS_CMD, cfg); + if (sc->rl_hwrev == RL_HWREV_8169_8110SC || + sc->rl_hwrev == RL_HWREV_8169_8110SCE) { + reg = 0x000fff00; + if ((CSR_READ_1(sc, RL_CFG2) & RL_CFG2_PCI66MHZ) != 0) + reg |= 0x00
svn commit: r189945 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/re
Author: yongari Date: Wed Mar 18 02:07:07 2009 New Revision: 189945 URL: http://svn.freebsd.org/changeset/base/189945 Log: MFC r188381: Reclaim transmitted frames in re_tick(). This is for PCIe controllers that lose Tx completion interrupts under certain conditions. With this change it's safe to use MSI on PCIe controllers so enable MSI on these controllers. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/re/if_re.c Modified: stable/7/sys/dev/re/if_re.c == --- stable/7/sys/dev/re/if_re.c Wed Mar 18 02:03:16 2009(r189944) +++ stable/7/sys/dev/re/if_re.c Wed Mar 18 02:07:07 2009(r189945) @@ -156,7 +156,7 @@ MODULE_DEPEND(re, miibus, 1, 1, 1); #include "miibus_if.h" /* Tunables. */ -static int msi_disable = 1; +static int msi_disable = 0; TUNABLE_INT("hw.re.msi_disable", &msi_disable); #define RE_CSUM_FEATURES(CSUM_IP | CSUM_TCP | CSUM_UDP) @@ -2064,6 +2064,13 @@ re_tick(void *xsc) mii_tick(mii); if ((sc->rl_flags & RL_FLAG_LINK) == 0) re_miibus_statchg(sc->rl_dev); + /* +* Reclaim transmitted frames here. Technically it is not +* necessary to do here but it ensures periodic reclamation +* regardless of Tx completion interrupt which seems to be +* lost on PCIe based controllers under certain situations. +*/ + re_txeof(sc); re_watchdog(sc); callout_reset(&sc->rl_stat_callout, hz, re_tick, sc); } ___ 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: r189946 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/re pci
Author: yongari Date: Wed Mar 18 02:10:01 2009 New Revision: 189946 URL: http://svn.freebsd.org/changeset/base/189946 Log: MFC r188474: Allocating 2 MSI messages do not seem to work on certain controllers so use just 1 MSI message. This fixes regression introduced in r188381. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/re/if_re.c stable/7/sys/pci/if_rlreg.h Modified: stable/7/sys/dev/re/if_re.c == --- stable/7/sys/dev/re/if_re.c Wed Mar 18 02:07:07 2009(r189945) +++ stable/7/sys/dev/re/if_re.c Wed Mar 18 02:10:01 2009(r189946) @@ -1149,7 +1149,8 @@ re_attach(device_t dev) if (bootverbose) device_printf(dev, "MSI count : %d\n", msic); } - if (msic == RL_MSI_MESSAGES && msi_disable == 0) { + if (msic > 0 && msi_disable == 0) { + msic = 1; if (pci_alloc_msi(dev, &msic) == 0) { if (msic == RL_MSI_MESSAGES) { device_printf(dev, "Using %d MSI messages\n", Modified: stable/7/sys/pci/if_rlreg.h == --- stable/7/sys/pci/if_rlreg.h Wed Mar 18 02:07:07 2009(r189945) +++ stable/7/sys/pci/if_rlreg.h Wed Mar 18 02:10:01 2009(r189946) @@ -758,7 +758,7 @@ struct rl_stats { #define RE_RX_DESC_BUFLEN MCLBYTES #endif -#defineRL_MSI_MESSAGES 2 +#defineRL_MSI_MESSAGES 1 #define RL_ADDR_LO(y) ((uint64_t) (y) & 0x) #define RL_ADDR_HI(y) ((uint64_t) (y) >> 32) ___ 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: r189947 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/re
Author: yongari Date: Wed Mar 18 02:12:33 2009 New Revision: 189947 URL: http://svn.freebsd.org/changeset/base/189947 Log: MFC r189555: Add a new tunable hw.re.prefer_iomap which disables memory register mapping. The tunable is OFF for all controllers except RTL8169SC family. RTL8169SC seems to require more magic to use memory register mapping. r187483 added a fix for RTL8169SCe controller but it does not looke like fix other variants of RTL8169SC. Tested by: Gavin Stone-Tolcher g.stone-tolcher <> its dot uq dot edu dot au Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/re/if_re.c Modified: stable/7/sys/dev/re/if_re.c == --- stable/7/sys/dev/re/if_re.c Wed Mar 18 02:10:01 2009(r189946) +++ stable/7/sys/dev/re/if_re.c Wed Mar 18 02:12:33 2009(r189947) @@ -158,6 +158,8 @@ MODULE_DEPEND(re, miibus, 1, 1, 1); /* Tunables. */ static int msi_disable = 0; TUNABLE_INT("hw.re.msi_disable", &msi_disable); +static int prefer_iomap = 0; +TUNABLE_INT("hw.re.prefer_iomap", &prefer_iomap); #define RE_CSUM_FEATURES(CSUM_IP | CSUM_TCP | CSUM_UDP) @@ -1118,25 +1120,35 @@ re_attach(device_t dev) pci_enable_busmaster(dev); devid = pci_get_device(dev); - /* Prefer memory space register mapping over IO space. */ - sc->rl_res_id = PCIR_BAR(1); - sc->rl_res_type = SYS_RES_MEMORY; - /* RTL8168/8101E seems to use different BARs. */ - if (devid == RT_DEVICEID_8168 || devid == RT_DEVICEID_8101E) - sc->rl_res_id = PCIR_BAR(2); + /* +* Prefer memory space register mapping over IO space. +* Because RTL8169SC does not seem to work when memory mapping +* is used always activate io mapping. +*/ + if (devid == RT_DEVICEID_8169SC) + prefer_iomap = 1; + if (prefer_iomap == 0) { + sc->rl_res_id = PCIR_BAR(1); + sc->rl_res_type = SYS_RES_MEMORY; + /* RTL8168/8101E seems to use different BARs. */ + if (devid == RT_DEVICEID_8168 || devid == RT_DEVICEID_8101E) + sc->rl_res_id = PCIR_BAR(2); + } else { + sc->rl_res_id = PCIR_BAR(0); + sc->rl_res_type = SYS_RES_IOPORT; + } sc->rl_res = bus_alloc_resource_any(dev, sc->rl_res_type, &sc->rl_res_id, RF_ACTIVE); - - if (sc->rl_res == NULL) { + if (sc->rl_res == NULL && prefer_iomap == 0) { sc->rl_res_id = PCIR_BAR(0); sc->rl_res_type = SYS_RES_IOPORT; sc->rl_res = bus_alloc_resource_any(dev, sc->rl_res_type, &sc->rl_res_id, RF_ACTIVE); - if (sc->rl_res == NULL) { - device_printf(dev, "couldn't map ports/memory\n"); - error = ENXIO; - goto fail; - } + } + if (sc->rl_res == NULL) { + device_printf(dev, "couldn't map ports/memory\n"); + error = ENXIO; + goto fail; } sc->rl_btag = rman_get_bustag(sc->rl_res); ___ 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: r189948 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/nfe
Author: yongari Date: Wed Mar 18 02:23:01 2009 New Revision: 189948 URL: http://svn.freebsd.org/changeset/base/189948 Log: MFC r183561, 186346: r183561: Add hardware MAC statistics support. Register information was obtained from Linux forcedeth driver. While I'm here move creating a sysctl node for process_limit to function nfe_sysctl_node(). Tested by: "Arno J. Klaassen" < arno heho dot snv dot jussieu dot fr > r186346: Fix a typo. Submitted by: clemens fischer via Shigeaki Tagashira Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/nfe/if_nfe.c stable/7/sys/dev/nfe/if_nfereg.h stable/7/sys/dev/nfe/if_nfevar.h Modified: stable/7/sys/dev/nfe/if_nfe.c == --- stable/7/sys/dev/nfe/if_nfe.c Wed Mar 18 02:12:33 2009 (r189947) +++ stable/7/sys/dev/nfe/if_nfe.c Wed Mar 18 02:23:01 2009 (r189948) @@ -122,6 +122,9 @@ static void nfe_dma_map_segs(void *, bus static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); static int sysctl_hw_nfe_proc_limit(SYSCTL_HANDLER_ARGS); +static void nfe_sysctl_node(struct nfe_softc *); +static void nfe_stats_clear(struct nfe_softc *); +static void nfe_stats_update(struct nfe_softc *); #ifdef NFE_DEBUG static int nfedebug = 0; @@ -454,18 +457,19 @@ nfe_attach(device_t dev) break; case PCI_PRODUCT_NVIDIA_MCP51_LAN1: case PCI_PRODUCT_NVIDIA_MCP51_LAN2: - sc->nfe_flags |= NFE_40BIT_ADDR | NFE_PWR_MGMT; + sc->nfe_flags |= NFE_40BIT_ADDR | NFE_PWR_MGMT | NFE_MIB_V1; break; case PCI_PRODUCT_NVIDIA_CK804_LAN1: case PCI_PRODUCT_NVIDIA_CK804_LAN2: case PCI_PRODUCT_NVIDIA_MCP04_LAN1: case PCI_PRODUCT_NVIDIA_MCP04_LAN2: - sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM; + sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM | + NFE_MIB_V1; break; case PCI_PRODUCT_NVIDIA_MCP55_LAN1: case PCI_PRODUCT_NVIDIA_MCP55_LAN2: sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM | - NFE_HW_VLAN | NFE_PWR_MGMT | NFE_TX_FLOW_CTRL; + NFE_HW_VLAN | NFE_PWR_MGMT | NFE_TX_FLOW_CTRL | NFE_MIB_V2; break; case PCI_PRODUCT_NVIDIA_MCP61_LAN1: @@ -481,7 +485,7 @@ nfe_attach(device_t dev) case PCI_PRODUCT_NVIDIA_MCP73_LAN3: case PCI_PRODUCT_NVIDIA_MCP73_LAN4: sc->nfe_flags |= NFE_40BIT_ADDR | NFE_PWR_MGMT | - NFE_CORRECT_MACADDR | NFE_TX_FLOW_CTRL; + NFE_CORRECT_MACADDR | NFE_TX_FLOW_CTRL | NFE_MIB_V2; break; case PCI_PRODUCT_NVIDIA_MCP77_LAN1: case PCI_PRODUCT_NVIDIA_MCP77_LAN2: @@ -489,7 +493,7 @@ nfe_attach(device_t dev) case PCI_PRODUCT_NVIDIA_MCP77_LAN4: /* XXX flow control */ sc->nfe_flags |= NFE_40BIT_ADDR | NFE_HW_CSUM | NFE_PWR_MGMT | - NFE_CORRECT_MACADDR; + NFE_CORRECT_MACADDR | NFE_MIB_V3; break; case PCI_PRODUCT_NVIDIA_MCP79_LAN1: case PCI_PRODUCT_NVIDIA_MCP79_LAN2: @@ -497,14 +501,15 @@ nfe_attach(device_t dev) case PCI_PRODUCT_NVIDIA_MCP79_LAN4: /* XXX flow control */ sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM | - NFE_PWR_MGMT | NFE_CORRECT_MACADDR; + NFE_PWR_MGMT | NFE_CORRECT_MACADDR | NFE_MIB_V3; break; case PCI_PRODUCT_NVIDIA_MCP65_LAN1: case PCI_PRODUCT_NVIDIA_MCP65_LAN2: case PCI_PRODUCT_NVIDIA_MCP65_LAN3: case PCI_PRODUCT_NVIDIA_MCP65_LAN4: sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | - NFE_PWR_MGMT | NFE_CORRECT_MACADDR | NFE_TX_FLOW_CTRL; + NFE_PWR_MGMT | NFE_CORRECT_MACADDR | NFE_TX_FLOW_CTRL | + NFE_MIB_V2; break; } @@ -551,24 +556,8 @@ nfe_attach(device_t dev) goto fail; nfe_alloc_jrx_ring(sc, &sc->jrxq); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "process_limit", CTLTYPE_INT | CTLFLAG_RW, - &sc->nfe_process_limit, 0, sysctl_hw_nfe_proc_limit, "I", - "max number of Rx events to process"); - - sc->nfe_process_limit = NFE_PROC_DEFAULT; - error = resource_int_value(device_get_name(dev), device_get_unit(dev), - "process_limit", &sc->nfe_process_limit); - if (error == 0) { - if (sc->nfe_process_limit < NFE_PROC_MIN || - sc->nfe_process_limit > NFE_PR
svn commit: r189949 - stable/7/share/man/man4
Author: yongari Date: Wed Mar 18 02:26:46 2009 New Revision: 189949 URL: http://svn.freebsd.org/changeset/base/189949 Log: MFC r188382: Document loader tunable hw.re.msi_disable. Bump .Dd Modified: stable/7/share/man/man4/ (props changed) stable/7/share/man/man4/igb.4 (props changed) stable/7/share/man/man4/re.4 Modified: stable/7/share/man/man4/re.4 == --- stable/7/share/man/man4/re.4Wed Mar 18 02:23:01 2009 (r189948) +++ stable/7/share/man/man4/re.4Wed Mar 18 02:26:46 2009 (r189949) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 14, 2006 +.Dd February 9, 2009 .Dt RE 4 .Os .Sh NAME @@ -169,6 +169,16 @@ USRobotics USR997902 Gigabit Ethernet (8 .It Xterasys XN-152 10/100/1000 NIC (8169) .El +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width "xx" +.It Va hw.re.msi_disable +This tunable disables MSI support on the Ethernet hardware. +The default value is 0. +.El .Sh DIAGNOSTICS .Bl -diag .It "re%d: couldn't map memory" ___ 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: r189950 - in head/sys: compat/ndis dev/if_ndis
Author: weongyo Date: Wed Mar 18 02:38:35 2009 New Revision: 189950 URL: http://svn.freebsd.org/changeset/base/189950 Log: Some NDIS USB drivers try to call URB funcs like URB_FUNCTION_VENDOR_xxx or URB_FUNCTION_CLASS_xxx with HAL preemption lock that means it's non-sleepable during USB requests though usb2_do_request() requires a sleep so it needs to send queries to the default pipe without those interfaces to avoid sleep. Modified: head/sys/compat/ndis/subr_usbd.c head/sys/dev/if_ndis/if_ndis_usb.c head/sys/dev/if_ndis/if_ndisvar.h Modified: head/sys/compat/ndis/subr_usbd.c == --- head/sys/compat/ndis/subr_usbd.cWed Mar 18 02:26:46 2009 (r189949) +++ head/sys/compat/ndis/subr_usbd.cWed Mar 18 02:38:35 2009 (r189950) @@ -77,6 +77,38 @@ __FBSDID("$FreeBSD$"); static driver_object usbd_driver; static usb2_callback_t usbd_non_isoc_callback; +static usb2_callback_t usbd_ctrl_callback; + +#defineUSBD_CTRL_READ_PIPE 0 +#defineUSBD_CTRL_WRITE_PIPE1 +#defineUSBD_CTRL_MAX_PIPE 2 +#defineUSBD_CTRL_READ_BUFFER_SP256 +#defineUSBD_CTRL_READ_BUFFER_SIZE \ + (sizeof(struct usb2_device_request) + USBD_CTRL_READ_BUFFER_SP) +#defineUSBD_CTRL_WRITE_BUFFER_SIZE \ + (sizeof(struct usb2_device_request)) +static struct usb2_config usbd_default_epconfig[USBD_CTRL_MAX_PIPE] = { + [USBD_CTRL_READ_PIPE] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* control pipe */ + .direction =UE_DIR_ANY, + .if_index = 0, + .mh.bufsize = USBD_CTRL_READ_BUFFER_SIZE, + .mh.flags = { .short_xfer_ok = 1, }, + .mh.callback = &usbd_ctrl_callback, + .mh.timeout = 5000, /* 5 seconds */ + }, + [USBD_CTRL_WRITE_PIPE] = { + .type = UE_CONTROL, + .endpoint = 0x00, /* control pipe */ + .direction =UE_DIR_ANY, + .if_index = 0, + .mh.bufsize = USBD_CTRL_WRITE_BUFFER_SIZE, + .mh.flags = { .proxy_buffer = 1, }, + .mh.callback = &usbd_ctrl_callback, + .mh.timeout = 5000, /* 5 seconds */ + } +}; static int32_t usbd_func_bulkintr(irp *); static int32_t usbd_func_vendorclass(irp *); @@ -84,6 +116,9 @@ static int32_tusbd_func_selconf(irp * static int32_t usbd_func_abort_pipe(irp *); static usb2_error_t usbd_setup_endpoint(irp *, uint8_t, struct usb2_endpoint_descriptor *); +static usb2_error_t usbd_setup_endpoint_default(irp *, uint8_t); +static usb2_error_t usbd_setup_endpoint_one(irp *, uint8_t, + struct ndisusb_ep *, struct usb2_config *); static int32_t usbd_func_getdesc(irp *); static union usbd_urb *usbd_geturb(irp *); static struct ndisusb_ep*usbd_get_ndisep(irp *, usb_endpoint_descriptor_t *); @@ -558,6 +593,57 @@ usbd_func_selconf(ip) } static usb2_error_t +usbd_setup_endpoint_one(ip, ifidx, ne, epconf) + irp *ip; + uint8_t ifidx; + struct ndisusb_ep *ne; + struct usb2_config *epconf; +{ + device_t dev = IRP_NDIS_DEV(ip); + struct ndis_softc *sc = device_get_softc(dev); + struct usb2_xfer *xfer; + usb2_error_t status; + + InitializeListHead(&ne->ne_active); + InitializeListHead(&ne->ne_pending); + KeInitializeSpinLock(&ne->ne_lock); + + status = usb2_transfer_setup(sc->ndisusb_dev, &ifidx, ne->ne_xfer, + epconf, 1, sc, &sc->ndisusb_mtx); + if (status != USB_ERR_NORMAL_COMPLETION) { + device_printf(dev, "couldn't setup xfer: %s\n", + usb2_errstr(status)); + return (status); + } + xfer = ne->ne_xfer[0]; + xfer->priv_fifo = ne; + + return (status); +} + +static usb2_error_t +usbd_setup_endpoint_default(ip, ifidx) + irp *ip; + uint8_t ifidx; +{ + device_t dev = IRP_NDIS_DEV(ip); + struct ndis_softc *sc = device_get_softc(dev); + usb2_error_t status; + + if (ifidx > 0) + device_printf(dev, "warning: ifidx > 0 isn't supported.\n"); + + status = usbd_setup_endpoint_one(ip, ifidx, &sc->ndisusb_dread_ep, + &usbd_default_epconfig[USBD_CTRL_READ_PIPE]); + if (status != USB_ERR_NORMAL_COMPLETION) + return (status); + + status = usbd_setup_endpoint_one(ip, ifidx, &sc->ndisusb_dwrite_ep, + &usbd_default_epconfig[USBD_CTRL_WRITE_PIPE]); + return (status); +} + +static usb2_error_t usbd_setup_endpoint(ip, ifi
svn commit: r189951 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/mii
Author: yongari Date: Wed Mar 18 03:29:05 2009 New Revision: 189951 URL: http://svn.freebsd.org/changeset/base/189951 Log: MFC r189564: Report current link state while auto-negotiation is in progress. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/mii/ip1000phy.c Modified: stable/7/sys/dev/mii/ip1000phy.c == --- stable/7/sys/dev/mii/ip1000phy.cWed Mar 18 02:38:35 2009 (r189950) +++ stable/7/sys/dev/mii/ip1000phy.cWed Mar 18 03:29:05 2009 (r189951) @@ -296,7 +296,7 @@ done: * Only retry autonegotiation every mii_anegticks seconds. */ if (sc->mii_ticks <= sc->mii_anegticks) - return (0); + break; sc->mii_ticks = 0; ip1000phy_mii_phy_auto(sc); ___ 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: r189952 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/mii
Author: yongari Date: Wed Mar 18 03:31:19 2009 New Revision: 189952 URL: http://svn.freebsd.org/changeset/base/189952 Log: MFC r189565: For unknown speed, explicitly set IFM_NONE. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/mii/ip1000phy.c Modified: stable/7/sys/dev/mii/ip1000phy.c == --- stable/7/sys/dev/mii/ip1000phy.cWed Mar 18 03:29:05 2009 (r189951) +++ stable/7/sys/dev/mii/ip1000phy.cWed Mar 18 03:31:19 2009 (r189952) @@ -353,6 +353,9 @@ ip1000phy_status(struct mii_softc *sc) case IP1000PHY_LSR_SPEED_1000: mii->mii_media_active |= IFM_1000_T; break; + default: + mii->mii_media_active |= IFM_NONE; + return; } if ((stat & IP1000PHY_LSR_FULL_DUPLEX) != 0) mii->mii_media_active |= IFM_FDX; @@ -373,6 +376,9 @@ ip1000phy_status(struct mii_softc *sc) case PC_LinkSpeed_1000: mii->mii_media_active |= IFM_1000_T; break; + default: + mii->mii_media_active |= IFM_NONE; + return; } if ((stat & PC_PhyDuplexStatus) != 0) mii->mii_media_active |= IFM_FDX; ___ 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: r189953 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/mii
Author: yongari Date: Wed Mar 18 03:33:45 2009 New Revision: 189953 URL: http://svn.freebsd.org/changeset/base/189953 Log: MFC r189566: Use mii_phy_add_media() and remove setting each media type. While I'm here, don't set mii_anegticks as it's set by mii_phy_add_media(). Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/mii/ip1000phy.c Modified: stable/7/sys/dev/mii/ip1000phy.c == --- stable/7/sys/dev/mii/ip1000phy.cWed Mar 18 03:31:19 2009 (r189952) +++ stable/7/sys/dev/mii/ip1000phy.cWed Mar 18 03:33:45 2009 (r189953) @@ -118,7 +118,6 @@ ip1000phy_attach(device_t dev) sc->mii_phy = ma->mii_phyno; sc->mii_service = ip1000phy_service; sc->mii_pdata = mii; - sc->mii_anegticks = MII_ANEGTICKS_GIGE; sc->mii_flags |= MIIF_NOISOLATE; mii->mii_instance++; @@ -126,37 +125,14 @@ ip1000phy_attach(device_t dev) isc->model = MII_MODEL(ma->mii_id2); isc->revision = MII_REV(ma->mii_id2); + sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; + if (sc->mii_capabilities & BMSR_EXTSTAT) + sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); device_printf(dev, " "); -#defineADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) - - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_NONE, 0, sc->mii_inst), - BMCR_ISO); - - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, 0, sc->mii_inst), - IP1000PHY_BMCR_10); - printf("10baseT, "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, IFM_FDX, sc->mii_inst), - IP1000PHY_BMCR_10 | IP1000PHY_BMCR_FDX); - printf("10baseT-FDX, "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, 0, sc->mii_inst), - IP1000PHY_BMCR_100); - printf("100baseTX, "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_FDX, sc->mii_inst), - IP1000PHY_BMCR_100 | IP1000PHY_BMCR_FDX); - printf("100baseTX-FDX, "); - /* 1000baseT half-duplex, really supported? */ - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, 0, sc->mii_inst), - IP1000PHY_BMCR_1000); - printf("1000baseTX, "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, IFM_FDX, sc->mii_inst), - IP1000PHY_BMCR_1000 | IP1000PHY_BMCR_FDX); - printf("1000baseTX-FDX, "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, sc->mii_inst), 0); - printf("auto\n"); -#undef ADD - ip1000phy_reset(sc); + mii_phy_add_media(sc); + printf("\n"); MIIBUS_MEDIAINIT(sc->mii_dev); 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: r189954 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/mii
Author: yongari Date: Wed Mar 18 03:36:08 2009 New Revision: 189954 URL: http://svn.freebsd.org/changeset/base/189954 Log: MFC r189567: For IP1001 PHYs, read auto-negotiation advertisement register to get default next page configuration. While I'm here explicitly set IP1000PHY_ANAR_CSMA bit. This bit is read-only and always set by hardware so setting it has no effect but it would clear the intention. With this change controllers that couldn't establish 1000baseT link should work. PR: kern/130846 Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/dev/mii/ip1000phy.c stable/7/sys/dev/mii/ip1000phyreg.h Modified: stable/7/sys/dev/mii/ip1000phy.c == --- stable/7/sys/dev/mii/ip1000phy.cWed Mar 18 03:33:45 2009 (r189953) +++ stable/7/sys/dev/mii/ip1000phy.cWed Mar 18 03:36:08 2009 (r189954) @@ -391,18 +391,24 @@ ip1000phy_status(struct mii_softc *sc) } static int -ip1000phy_mii_phy_auto(struct mii_softc *mii) +ip1000phy_mii_phy_auto(struct mii_softc *sc) { + struct ip1000phy_softc *isc; uint32_t reg; - PHY_WRITE(mii, IP1000PHY_MII_ANAR, - IP1000PHY_ANAR_10T | IP1000PHY_ANAR_10T_FDX | + isc = (struct ip1000phy_softc *)sc; + reg = 0; + if (isc->model == MII_MODEL_ICPLUS_IP1001) + reg = PHY_READ(sc, IP1000PHY_MII_ANAR); + reg |= IP1000PHY_ANAR_10T | IP1000PHY_ANAR_10T_FDX | IP1000PHY_ANAR_100TX | IP1000PHY_ANAR_100TX_FDX | - IP1000PHY_ANAR_PAUSE | IP1000PHY_ANAR_APAUSE); + IP1000PHY_ANAR_PAUSE | IP1000PHY_ANAR_APAUSE; + PHY_WRITE(sc, IP1000PHY_MII_ANAR, reg | IP1000PHY_ANAR_CSMA); + reg = IP1000PHY_1000CR_1000T | IP1000PHY_1000CR_1000T_FDX; reg |= IP1000PHY_1000CR_MASTER; - PHY_WRITE(mii, IP1000PHY_MII_1000CR, reg); - PHY_WRITE(mii, IP1000PHY_MII_BMCR, (IP1000PHY_BMCR_FDX | + PHY_WRITE(sc, IP1000PHY_MII_1000CR, reg); + PHY_WRITE(sc, IP1000PHY_MII_BMCR, (IP1000PHY_BMCR_FDX | IP1000PHY_BMCR_AUTOEN | IP1000PHY_BMCR_STARTNEG)); return (EJUSTRETURN); Modified: stable/7/sys/dev/mii/ip1000phyreg.h == --- stable/7/sys/dev/mii/ip1000phyreg.h Wed Mar 18 03:33:45 2009 (r189953) +++ stable/7/sys/dev/mii/ip1000phyreg.h Wed Mar 18 03:36:08 2009 (r189954) @@ -61,6 +61,7 @@ /* Autonegotiation advertisement register */ #defineIP1000PHY_MII_ANAR 0x04 +#defineIP1000PHY_ANAR_CSMA 0x0001 #defineIP1000PHY_ANAR_10T 0x0020 #defineIP1000PHY_ANAR_10T_FDX 0x0040 #defineIP1000PHY_ANAR_100TX0x0080 ___ 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: r189955 - head/usr.sbin/sysinstall
Author: ganbold (doc committer) Date: Wed Mar 18 03:56:26 2009 New Revision: 189955 URL: http://svn.freebsd.org/changeset/base/189955 Log: Clear confirm password field first when adding new user. PR: i386/132580 Reported by: ilgiz Approved by:kensmith Modified: head/usr.sbin/sysinstall/user.c Modified: head/usr.sbin/sysinstall/user.c == --- head/usr.sbin/sysinstall/user.c Wed Mar 18 03:36:08 2009 (r189954) +++ head/usr.sbin/sysinstall/user.c Wed Mar 18 03:56:26 2009 (r189955) @@ -698,6 +698,7 @@ userAddUser(dialogMenuItem *self) CLEAR(ugroup); CLEAR(gecos); CLEAR(passwd); +CLEAR(confpasswd); CLEAR(umemb); CLEAR(homedir); CLEAR(shell); ___ 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"