Re: svn commit: r205024 - head/sys/net

2010-03-11 Thread Qing Li
>
> Is there any way we can pick up via an assertion that an interface driver has 
> failed to implement this functionality? This has never been a historic 
> requirement, so I suspect there are a lot of drivers floating around that 
> fail to meet the requirement. Also, is this for IFT_ETHER only, or also other 
> link types?
>

Not sure if I get the assertion suggestion. How would an assertion help here ?

-- Qing
___
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: r205074 - head/sys/dev/ata

2010-03-11 Thread Alexander Motin
Author: mav
Date: Fri Mar 12 07:49:10 2010
New Revision: 205074
URL: http://svn.freebsd.org/changeset/base/205074

Log:
  Mask disk_idx to avoid panic because of extra bits set.
  
  PR:   kern/102211
  Submitted by: yoichi

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

Modified: head/sys/dev/ata/ata-raid.c
==
--- head/sys/dev/ata/ata-raid.c Fri Mar 12 07:26:37 2010(r205073)
+++ head/sys/dev/ata/ata-raid.c Fri Mar 12 07:49:10 2010(r205074)
@@ -2544,22 +2544,24 @@ ata_raid_intel_read_meta(device_t dev, s
 
/* clear out any old info */
for (disk = 0; disk < raid->total_disks; disk++) {
+   u_int disk_idx = map->disk_idx[disk] & 0x;
+
raid->disks[disk].dev = NULL;
-   bcopy(meta->disk[map->disk_idx[disk]].serial,
+   bcopy(meta->disk[disk_idx].serial,
  raid->disks[disk].serial,
  sizeof(raid->disks[disk].serial));
raid->disks[disk].sectors =
-   meta->disk[map->disk_idx[disk]].sectors;
+   meta->disk[disk_idx].sectors;
raid->disks[disk].flags = 0;
-   if (meta->disk[map->disk_idx[disk]].flags & INTEL_F_ONLINE)
+   if (meta->disk[disk_idx].flags & INTEL_F_ONLINE)
raid->disks[disk].flags |= AR_DF_ONLINE;
-   if (meta->disk[map->disk_idx[disk]].flags & INTEL_F_ASSIGNED)
+   if (meta->disk[disk_idx].flags & INTEL_F_ASSIGNED)
raid->disks[disk].flags |= AR_DF_ASSIGNED;
-   if (meta->disk[map->disk_idx[disk]].flags & INTEL_F_SPARE) {
+   if (meta->disk[disk_idx].flags & INTEL_F_SPARE) {
raid->disks[disk].flags &= ~(AR_DF_ONLINE | AR_DF_ASSIGNED);
raid->disks[disk].flags |= AR_DF_SPARE;
}
-   if (meta->disk[map->disk_idx[disk]].flags & INTEL_F_DOWN)
+   if (meta->disk[disk_idx].flags & INTEL_F_DOWN)
raid->disks[disk].flags &= ~AR_DF_ONLINE;
}
}
___
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: r205024 - head/sys/net

2010-03-11 Thread Robert N. M. Watson

On Mar 12, 2010, at 12:18 AM, Qing Li wrote:

>  You definitely have a very good point here.  I was a bit surprised
>  during debugging that the link state is not consistently initialized
>  and by far not enforced across all of the drivers. Admittedly I checked
>  the most commonly deployed devices and they are in good state.
> 
>  I certainly appreciate your patience on this one and will try to get
>  it resolved quickly.

One of the reasons drivers don't do this consistently his that historically, 
hardware has not consistently supported link state detection. This now does 
seem to be a standard feature, but I think it would be useful to continue to 
support some notion of a driver not supporting it, hence my thoughts on a link 
state capability: only test link state if the driver can implement it. 
Otherwise, you end up with a link state undefined state, which likely comes to 
much the same thing, and is presumably what in practice you get today on 
drivers that don't set it.

Robert___
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: r205024 - head/sys/net

2010-03-11 Thread Robert N. M. Watson

On Mar 11, 2010, at 11:30 PM, Qing Li wrote:

>  What you raised is definitely a possibility and these fixes take the
>  similar approach. I am going to try and go through each of these
>  drivers in /sys/dev/ and converting them, very soon.

Is there any way we can pick up via an assertion that an interface driver has 
failed to implement this functionality? This has never been a historic 
requirement, so I suspect there are a lot of drivers floating around that fail 
to meet the requirement. Also, is this for IFT_ETHER only, or also other link 
types?

Robert___
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: r205024 - head/sys/net

2010-03-11 Thread Qing Li
That's a good idea. I will take your approach.

-- Qing


On Thu, Mar 11, 2010 at 11:15 PM, Julian Elischer  wrote:
> Juli Mallett wrote:
>>
>> On Thu, Mar 11, 2010 at 15:39, Qing Li  wrote:
>>>
>>> I guess it's a good time to clean things up. The if_link_state code has
>>> been
>>> around for quite some time, either it be fully utilized or not be there
>>> at all.
>>> The inconsistency is the root cause.
>>
>> Sure.  There is an increasing amount of stuff that network drivers are
>> expected to do, but they work without doing them.  It's easy to think
>> you have a functioning network driver and that you can get by without
>> adding support for media changes and link status reporting, etc.
>>
>>> I will try going through these tonight and hopefully the fix all take a
>>> common approach.
>
> probably should add a flag that means "we have media state"
> and if it is not set, assume it is always on.
>
>>
>> If you can think of a way to add some invariants (warn the first time
>> a driver receives a packet without having ever set the link state,
>> make sure the media status callback sets the valid flag in the
>> request, etc) that would probably be very helpful for people who are
>> writing network drivers.  If I hadn't been following the threads about
>> your changes, I would have had to spend much longer fixing the Octeon
>> port's Ethernet driver, wondering why suddenly it broke and
>> instrumenting the routing code.  A printf would go a long way.
>>
>> Juli.
>
>
___
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: r205073 - head/share/misc

2010-03-11 Thread Brooks Davis
Author: brooks
Date: Fri Mar 12 07:26:37 2010
New Revision: 205073
URL: http://svn.freebsd.org/changeset/base/205073

Log:
  Regen:
  
  * Hart:   rev 671 of pcidevs.txt; 22-01-2008 (D-M-Y).
  * Boemler:vendors.txt (2010-03126)
  
  PR:   kern/133733
  MFC after:1 week

Modified:
  head/share/misc/pci_vendors

Modified: head/share/misc/pci_vendors
==
--- head/share/misc/pci_vendors Fri Mar 12 07:08:20 2010(r205072)
+++ head/share/misc/pci_vendors Fri Mar 12 07:26:37 2010(r205073)
@@ -18,7 +18,7 @@
4001WinTV PVR-250 (v1)
4009WinTV PVR-250
4801WinTV PVR-250 MCE
-   6800Hauppage Nova -TD-500 DVB-T Tuner Device
+   6800Hauppage Nova -TD-500 DVB-T Tuner Device ( 
PCIVEN_1131&DEV_7130&SUBSYS_4051&REV_014&3B)
 0071   Nebula Electronics Ltd
 0100   Ncipher Corp Ltd
 0123   General Dynamics
@@ -44,6 +44,10 @@
8519OV519 series
 05E3   CyberDoor
0701CBD516
+064E   SUYIN Corporation
+   A101Acer Crystal Eye Webcam (suYin)
+   A103WebCam (SuYin)
+   D101Web Cam (SuYin)
 066F   Sigmatel Inc
3410SMTP3410
3500SMTP3500
@@ -54,6 +58,8 @@
1704ISDN Adapter (PCI Bus, D, C)
 067B   Prolific Technology Inc
2303PL-2303 USB-to-Serial Converter
+   2305USB-to-Printer Bridge Controller (PL-2305)
+   2393prolific (prolific)
3507PL-3507 Hi-Speed USB & IEEE 1394 Combo to IDE Bridge Controller
 069D   Hughes Network Systems (HNS)
 0700   Stream Machine
@@ -70,7 +76,7 @@
 09C1   Arris
0704CM 200E Cable Modem
 0A5C   Broadcom Corporation
-   0201Broadcom USB iLine10(tm) Network Adapter
+   0201Broadcom USB iLine10(tm) Network Adapter (Broadcom NetXtreme 
BCM5782 Gigabie Ethernet Contro)
2000Broadcom Bluetooth Firmware Upgrade Device
2009Broadcom Bluetooth Controller
200ABroadcom Bluetooth Controller
@@ -84,17 +90,17 @@
2038Broadcom Blutonium Device Firmware Downloader (BCM2038)
2039BROADCOM Bluetooth Device
2045Broadcom Bluetooth Controller
-   2046Broadcom USB Bluetooth Device
+   2046Broadcom USB Bluetooth Device ( 5738z)
2047Broadcom USB Bluetooth Device
205EBroadcom Bluetooth Firmware Upgrade Device
-   2100Broadcom Bluetooth 2.0+eDR USB dongle
-   2101Broadcom Bluetooth 2.0+EDR USB dongle
-   2102ANYCOM Blue USB-200/250
+   2100Broadcom Bluetooth 2.0+eDR USB dongle (BT 50)
+   2101Broadcom Bluetooth 2.0+EDR USB dongle ( 5&11BBCF3F&0&2)
+   2102ANYCOM Blue USB-200/250 ( USBVID_04B4&PID_21025&38CD4C16&0&6)
2110Broadcom Bluetooth Controller
2111ANYCOM Blue USB-UHE 200/250
2120Broadcom 2045 Bluetooth 2.0 USB-UHE Device with trace filter ( 
2045)
2121Broadcom 2045 Bluetooth 2.0 USB Device with trace filter
-   2122Broadcom Bluetooth 2.0+EDR USB dongle
+   2122Broadcom Bluetooth 2.0+EDR USB dongle ( BCM92045B3)
21242045B3ROM Bluetooth Dongle
2130Broadcom 2045 Bluetooth 2.0 USB-UHE Device with trace filter
2131Broadcom 2045 Bluetooth 2.0 USB Device with trace filter
@@ -104,7 +110,7 @@
21432046 Flash non UHE Class 1
21442046 Flash non UHE module Class 2
2145Broadcom BCM9204MD LENO Module
-   2146Broadcom 2046 Bluetooth 2.1 USB UHE Dongle
+   2146Broadcom 2045 Bluetooth 2.1 USB UHE Dongle
2147Broadcom 2046 Bluetooth 2.1 USB Dongle
2148Broadcom 2046 Bluetooth 2.1 USB UHE Dongle
2149Broadcom 2046 Bluetooth 2.1 USB Dongle
@@ -122,8 +128,9 @@
2155Broadcom Bluetooth USB Dongle
2157BCM2046 B1 USB 500
2158Broadcom 2046 Bluetooth 2.1 Device
-   4502USB Human Interface Device
-   4503USB Human Interface Device
+   4500Broadcom 2046 Bluetooth 2.1 USB Dongle (BCM2046B1)
+   4502Broadcom 2046 Bluetooth 2.1 USB Dongle (BCM2046B1)
+   4503Broadcom 2046 Bluetooth 2.1 USB Dongle ( BCM2046B1)
5800Unified Security Hub
6300Pirelli ISB Remote NDIS Device
 0A89   BREA Technologies Inc
@@ -144,17 +151,22 @@
0A06RCB672FXX 672-channel modular analog telphony card
 0B49   ASCII Corporation
064FTrance Vibrator
+0C45   Microdia Ltd.
+   602DUSB Webcam (7&2BE7B8E3&0&4)
+   6130USB CAMERA (5&3512B308&0&1)
 0E11   Compaq Computer Corp (Now owned by Hewlett-Packard)
0001PCI to EISA Bridge
-   0002PCI to ISA Bridge
+   0002PCI to ISA Bridge (ISA Bridge)
000FStorageWorks Library Adapter (HVD) (CPQB1A9)
0012686P7 (686P7)
-   0046Smart Array 64xx/6i Controller
+   0046Smart Array 6400 Controller (N/A)
   

Re: svn commit: r205024 - head/sys/net

2010-03-11 Thread Julian Elischer

Juli Mallett wrote:

On Thu, Mar 11, 2010 at 15:39, Qing Li  wrote:

I guess it's a good time to clean things up. The if_link_state code has been
around for quite some time, either it be fully utilized or not be there at all.
The inconsistency is the root cause.


Sure.  There is an increasing amount of stuff that network drivers are
expected to do, but they work without doing them.  It's easy to think
you have a functioning network driver and that you can get by without
adding support for media changes and link status reporting, etc.


I will try going through these tonight and hopefully the fix all take a
common approach.


probably should add a flag that means "we have media state"
and if it is not set, assume it is always on.



If you can think of a way to add some invariants (warn the first time
a driver receives a packet without having ever set the link state,
make sure the media status callback sets the valid flag in the
request, etc) that would probably be very helpful for people who are
writing network drivers.  If I hadn't been following the threads about
your changes, I would have had to spend much longer fixing the Octeon
port's Ethernet driver, wondering why suddenly it broke and
instrumenting the routing code.  A printf would go a long way.

Juli.


___
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: r205072 - in head/sys/mips: include mips

2010-03-11 Thread Neel Natu
Author: neel
Date: Fri Mar 12 07:08:20 2010
New Revision: 205072
URL: http://svn.freebsd.org/changeset/base/205072

Log:
  - Enable kernel stack guard page.
  
  - Unmap the unused kernel stack page that we cannot use because it is
not aligned on a (PAGE_SIZE * 2) boundary.

Modified:
  head/sys/mips/include/param.h
  head/sys/mips/mips/vm_machdep.c

Modified: head/sys/mips/include/param.h
==
--- head/sys/mips/include/param.h   Fri Mar 12 06:57:53 2010
(r205071)
+++ head/sys/mips/include/param.h   Fri Mar 12 07:08:20 2010
(r205072)
@@ -128,14 +128,13 @@
 #defineMAXDUMPPGS  1   /* xxx: why is this only one? */
 
 /*
- * NOTE: In FreeBSD, Uarea's don't have a fixed address.
- *  Therefore, any code imported from OpenBSD which depends on
- *  UADDR, UVPN and KERNELSTACK requires porting.
- * XXX: 3 stack pages?  Not 4 which would be more efficient from a tlb
- * XXX: point of view.
+ * The kernel stack needs to be aligned on a (PAGE_SIZE * 2) boundary.
+ *
+ * Although we allocate 3 pages for the kernel stack we end up using
+ * only the 2 pages that are aligned on a (PAGE_SIZE * 2) boundary.
  */
 #defineKSTACK_PAGES3   /* kernel stack*/
-#defineKSTACK_GUARD_PAGES  0   /* pages of kstack guard; 0 
disables */
+#defineKSTACK_GUARD_PAGES  1   /* pages of kstack guard; 0 
disables */
 
 #defineUPAGES  2
 

Modified: head/sys/mips/mips/vm_machdep.c
==
--- head/sys/mips/mips/vm_machdep.c Fri Mar 12 06:57:53 2010
(r205071)
+++ head/sys/mips/mips/vm_machdep.c Fri Mar 12 07:08:20 2010
(r205072)
@@ -214,6 +214,16 @@ cpu_thread_swapin(struct thread *td)
 {
pt_entry_t *pte;
int i;
+   vm_offset_t unused_kstack_page;
+
+   /*
+* Unmap the unused kstack page.
+*/
+   unused_kstack_page = td->td_kstack;
+   if (td->td_md.md_realstack == td->td_kstack)
+   unused_kstack_page += (KSTACK_PAGES - 1) * PAGE_SIZE;
+
+   pmap_kremove(unused_kstack_page);
 
/*
 * The kstack may be at a different physical address now.
@@ -239,13 +249,19 @@ cpu_thread_swapout(struct thread *td)
 void
 cpu_thread_alloc(struct thread *td)
 {
+   vm_offset_t unused_kstack_page;
pt_entry_t *pte;
int i;
 
-   if(td->td_kstack & (1 << PAGE_SHIFT))
+   if (td->td_kstack & (1 << PAGE_SHIFT)) {
td->td_md.md_realstack = td->td_kstack + PAGE_SIZE;
-   else
+   unused_kstack_page = td->td_kstack;
+   } else {
td->td_md.md_realstack = td->td_kstack;
+   unused_kstack_page = td->td_kstack +
+   (KSTACK_PAGES - 1) * PAGE_SIZE;
+   }
+   pmap_kremove(unused_kstack_page);
 
td->td_pcb = (struct pcb *)(td->td_md.md_realstack +
(td->td_kstack_pages - 1) * PAGE_SIZE) - 1;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r205071 - head/usr.bin/ncal

2010-03-11 Thread Edwin Groothuis
Author: edwin
Date: Fri Mar 12 06:57:53 2010
New Revision: 205071
URL: http://svn.freebsd.org/changeset/base/205071

Log:
  - With the introduction of -A, -B and -3, not all combinations of
arguments makes sense anymore. For example, what would a combination
of -3 (show three months) and -y (show the whole year) do?
We will abort on these cases.
  - Move the debug option -d to -H (from highlight), while -d is now
used for setting the day of "today" so that -y and friends can
be tested.

Modified:
  head/usr.bin/ncal/ncal.1
  head/usr.bin/ncal/ncal.c

Modified: head/usr.bin/ncal/ncal.1
==
--- head/usr.bin/ncal/ncal.1Fri Mar 12 06:56:51 2010(r205070)
+++ head/usr.bin/ncal/ncal.1Fri Mar 12 06:57:53 2010(r205071)
@@ -117,12 +117,6 @@ Britain and her colonies switched to the
 Print the number of the week below each week column.
 .It Fl y
 Display a calendar for the specified year.
-.It Fl b
-Switch to backwards compatibility mode (for debugging).
-.It Fl d Ar -mm-dd
-Use
-.Ar -mm-dd
-as the current date (for debugging of highlighting).
 .It Fl 3
 Display the previous, current and next month surrounding today.
 .It Fl A Ar number
@@ -133,6 +127,16 @@ of months after the current month.
 Display the
 .Ar number
 of months before the current month.
+.It Fl b
+Switch to backwards compatibility mode (for debugging).
+.It Fl d Ar -mm
+Use
+.Ar -mm
+as the current date (for debugging of date selection).
+.It Fl H Ar -mm-dd
+Use
+.Ar -mm-dd
+as the current date (for debugging of highlighting).
 .El
 .Pp
 A single parameter specifies the year (1\(en) to be displayed;
@@ -148,6 +152,14 @@ year default to those of the current sys
 will display a calendar for the month of August in the current
 year).
 .Pp
+Not all options can be used together. For example
+.Dq Li -3 -A 2 -B 3 -y -m 7
+would mean:
+show me the three months around the seventh month, three before
+that, two after that and the whole year.
+.Nm ncal
+will warn about these combinations.
+.Pp
 A year starts on January 1.
 .Sh SEE ALSO
 .Xr calendar 3 ,

Modified: head/usr.bin/ncal/ncal.c
==
--- head/usr.bin/ncal/ncal.cFri Mar 12 06:56:51 2010(r205070)
+++ head/usr.bin/ncal/ncal.cFri Mar 12 06:57:53 2010(r205071)
@@ -163,25 +163,25 @@ int   flag_nohighlight;   /* user doesn't wa
 int flag_weeks;/* user wants number of week */
 int nswitch;   /* user defined switch date */
 intnswitchb;   /* switch date for backward compatibility */
-inttoday;
+inthighlightdate;
 
 char   *center(char *s, char *t, int w);
 wchar_t *wcenter(wchar_t *s, wchar_t *t, int w);
+intfirstday(int y, int m);
+void   highlight(char *dst, char *src, int len, int *extraletters);
 void   mkmonthr(int year, int month, int jd_flag, struct monthlines * monthl);
 void   mkmonthb(int year, int month, int jd_flag, struct monthlines * monthl);
 void   mkweekdays(struct weekdays * wds);
+void   monthranger(int year, int m, int jd_flag, int before, int after);
+void   monthrangeb(int year, int m, int jd_flag, int before, int after);
 intparsemonth(const char *s, int *m, int *y);
 void   printcc(void);
 void   printeaster(int year, int julian, int orthodox);
-intfirstday(int y, int m);
 date   *sdater(int ndays, struct date * d);
 date   *sdateb(int ndays, struct date * d);
 intsndaysr(struct date * d);
 intsndaysb(struct date * d);
 static voidusage(void);
-void   monthranger(int year, int jd_flag, int m, int before, int after);
-void   monthrangeb(int year, int jd_flag, int m, int before, int after);
-void   highlight(char *dst, char *src, int len, int *extraletters);
 
 int
 main(int argc, char *argv[])
@@ -194,15 +194,21 @@ main(int argc, char *argv[])
int m = 0;  /* month */
int y = 0;  /* year */
int flag_backward = 0;  /* user called cal--backward compat. */
-   int flag_hole_year = 0; /* user wants the whole year */
+   int flag_wholeyear = 0; /* user wants the whole year */
int flag_julian_cal = 0;/* user wants Julian Calendar */
-   int flag_julian_day = 0;/* user wants the Julian day
-* numbers */
-   int flag_orthodox = 0;  /* use wants Orthodox easter */
-   int flag_easter = 0;/* use wants easter date */
+   int flag_julian_day = 0;/* user wants the Julian day numbers */
+   int flag_orthodox = 0;  /* user wants Orthodox easter */
+   int flag_easter = 0;/* user wants easter date */
+   int flag_3months = 0;   /* user wants 3 month display (-3) */
+   int flag_after = 0; /* user wants to see months after */

svn commit: r205070 - stable/8/lib/libc/stdio

2010-03-11 Thread Jaakko Heinonen
Author: jh
Date: Fri Mar 12 06:56:51 2010
New Revision: 205070
URL: http://svn.freebsd.org/changeset/base/205070

Log:
  MFC r204447:
  
  In _gettemp(), check that the length of the path doesn't exceed
  MAXPATHLEN. Otherwise the path name (or part of it) may not fit to
  carrybuf causing a buffer overflow.
  
  PR:   bin/140228

Modified:
  stable/8/lib/libc/stdio/mktemp.c
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)

Modified: stable/8/lib/libc/stdio/mktemp.c
==
--- stable/8/lib/libc/stdio/mktemp.cFri Mar 12 06:31:19 2010
(r205069)
+++ stable/8/lib/libc/stdio/mktemp.cFri Mar 12 06:56:51 2010
(r205070)
@@ -116,6 +116,10 @@ _gettemp(path, doopen, domkdir, slen)
 
for (trv = path; *trv != '\0'; ++trv)
;
+   if (trv - path >= MAXPATHLEN) {
+   errno = ENAMETOOLONG;
+   return (0);
+   }
trv -= slen;
suffp = trv;
--trv;
___
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: r205069 - head/sys/net

2010-03-11 Thread Kip Macy
Author: kmacy
Date: Fri Mar 12 06:31:19 2010
New Revision: 205069
URL: http://svn.freebsd.org/changeset/base/205069

Log:
  fix stats reporting sysctl

Modified:
  head/sys/net/flowtable.c

Modified: head/sys/net/flowtable.c
==
--- head/sys/net/flowtable.cFri Mar 12 05:16:24 2010(r205068)
+++ head/sys/net/flowtable.cFri Mar 12 06:31:19 2010(r205069)
@@ -1,6 +1,6 @@
 /**
 
-Copyright (c) 2008-2010, BitGravity Inc.
+Copyright (c) 2008-2009, BitGravity Inc.
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -298,14 +298,11 @@ SYSCTL_VNET_PROC(_net_inet_flowtable, OI
 
 
 
-#define FS_PRINT(sb, field)sbuf_printf((sb), "\t%s=%jd", #field, 
fs->ft_##field)
+#define FS_PRINT(sb, field)sbuf_printf((sb), "\t%s: %jd\n", #field, 
fs->ft_##field)
 
 static void
-fs_print(struct flowtable_stats *fs)
+fs_print(struct sbuf *sb, struct flowtable_stats *fs)
 {
-   struct sbuf *sb;
-
-   sb = sbuf_new(NULL, NULL, 32*1024, SBUF_FIXEDLEN);
 
FS_PRINT(sb, collisions);
FS_PRINT(sb, allocated);
@@ -315,12 +312,10 @@ fs_print(struct flowtable_stats *fs)
FS_PRINT(sb, frees);
FS_PRINT(sb, hits);
FS_PRINT(sb, lookups);
-   sbuf_finish(sb);
-   
 }
 
 static void
-flowtable_show_stats(struct flowtable *ft)
+flowtable_show_stats(struct sbuf *sb, struct flowtable *ft)
 {
int i;
struct flowtable_stats fs, *pfs;
@@ -344,27 +339,32 @@ flowtable_show_stats(struct flowtable *f
} else {
pfs = &ft->ft_stats[0];
}
-
-   fs_print(pfs);
+   fs_print(sb, pfs);
 }
 
 static int
 sysctl_flowtable_stats(SYSCTL_HANDLER_ARGS)
 {
struct flowtable *ft;
+   struct sbuf *sb;
+   int error;
+
+   sb = sbuf_new(NULL, NULL, 64*1024, SBUF_FIXEDLEN);
 
ft = V_flow_list_head;
while (ft != NULL) {
-   printf("name: %s\n", ft->ft_name);
-   flowtable_show_stats(ft);
+   sbuf_printf(sb, "\ntable name: %s\n", ft->ft_name);
+   flowtable_show_stats(sb, ft);
ft = ft->ft_next;
}
+   sbuf_finish(sb);
+   error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1);
+   sbuf_delete(sb);
 
-   return (0);
+   return (error);
 }
-SYSCTL_VNET_PROC(_net_inet_flowtable, OID_AUTO, stats,
-CTLTYPE_INT|CTLFLAG_RW, 0, 0, sysctl_flowtable_stats, "IU",
-"flowtable statistics");
+SYSCTL_VNET_PROC(_net_inet_flowtable, OID_AUTO, stats, 
CTLTYPE_STRING|CTLFLAG_RD,
+NULL, 0, sysctl_flowtable_stats, "A", "flowtable statistics");
 
 
 #ifndef RADIX_MPATH
___
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: r205068 - stable/8/usr.bin/perror

2010-03-11 Thread Joerg Wunsch
Author: joerg
Date: Fri Mar 12 05:16:24 2010
New Revision: 205068
URL: http://svn.freebsd.org/changeset/base/205068

Log:
  (r205011) The "number" argument is everything but optional.

Modified:
  stable/8/usr.bin/perror/perror.1
Directory Properties:
  stable/8/usr.bin/perror/   (props changed)

Modified: stable/8/usr.bin/perror/perror.1
==
--- stable/8/usr.bin/perror/perror.1Fri Mar 12 05:08:05 2010
(r205067)
+++ stable/8/usr.bin/perror/perror.1Fri Mar 12 05:16:24 2010
(r205068)
@@ -34,7 +34,7 @@
 .Nd "print an error number as a string"
 .Sh SYNOPSIS
 .Nm
-.Op Ar number
+.Ar number
 .Sh DESCRIPTION
 The
 .Nm
___
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: r205066 - in head/sys: net netinet

2010-03-11 Thread Kip Macy
Author: kmacy
Date: Fri Mar 12 05:03:26 2010
New Revision: 205066
URL: http://svn.freebsd.org/changeset/base/205066

Log:
  - restructure flowtable to support ipv6
  - add a name argument to flowtable_alloc for printing with ddb commands
  - extend ddb commands to print destination address or 4-tuples
  - don't parse ports in ulp header if FL_HASH_ALL is not passed
  - add kern_flowtable_insert to enable more generic use of flowtable
(e.g. system calls for adding entries)
  - don't hash loopback addresses
  - cleanup whitespace
  - keep statistics per-cpu for per-cpu flowtables to avoid cache line 
contention
  - add sysctls to accumulate stats and report aggregate
  
  MFC after:7 days

Modified:
  head/sys/net/flowtable.c
  head/sys/net/flowtable.h
  head/sys/net/if_llatbl.c
  head/sys/net/if_llatbl.h
  head/sys/netinet/ip_input.c
  head/sys/netinet/ip_output.c

Modified: head/sys/net/flowtable.c
==
--- head/sys/net/flowtable.cFri Mar 12 04:44:20 2010(r205065)
+++ head/sys/net/flowtable.cFri Mar 12 05:03:26 2010(r205066)
@@ -1,6 +1,6 @@
 /**
 
-Copyright (c) 2008-2009, BitGravity Inc.
+Copyright (c) 2008-2010, BitGravity Inc.
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
@@ -30,6 +30,8 @@ POSSIBILITY OF SUCH DAMAGE.
 #include "opt_route.h"
 #include "opt_mpath.h"
 #include "opt_ddb.h"
+#include "opt_inet.h"
+#include "opt_inet6.h"
 
 #include 
 __FBSDID("$FreeBSD$");
@@ -45,6 +47,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -63,6 +66,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef INET6
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -140,31 +146,39 @@ union flentryp {
struct flentry  **pcpu[MAXCPU];
 };
 
+struct flowtable_stats {
+   uint64_tft_collisions;
+   uint64_tft_allocated;
+   uint64_tft_misses;
+   uint64_tft_max_depth;
+   uint64_tft_free_checks;
+   uint64_tft_frees;
+   uint64_tft_hits;
+   uint64_tft_lookups;
+} __aligned(128);
+
 struct flowtable {
+   struct  flowtable_stats ft_stats[MAXCPU];
int ft_size;
int ft_lock_count;
uint32_tft_flags;
-   uint32_tft_collisions;
-   uint32_tft_allocated;
-   uint32_tft_misses;
-   uint64_tft_hits;
 
uint32_tft_udp_idle;
uint32_tft_fin_wait_idle;
uint32_tft_syn_idle;
uint32_tft_tcp_idle;
 
+   char*ft_name;
fl_lock_t   *ft_lock;
fl_lock_t   *ft_unlock;
fl_rtalloc_t*ft_rtalloc;
struct mtx  *ft_locks;
 
-   
union flentryp  ft_table;
bitstr_t*ft_masks[MAXCPU];
bitstr_t*ft_tmpmask;
struct flowtable *ft_next;
-};
+} __aligned(128);
 
 static struct proc *flowcleanerproc;
 static VNET_DEFINE(struct flowtable *, flow_list_head);
@@ -181,12 +195,24 @@ static struct cv  flowclean_cv;
 static struct mtx  flowclean_lock;
 static uint32_tflowclean_cycles;
 
+#ifdef FLOWTABLE_DEBUG
+#define FLDPRINTF(ft, flags, fmt, ...) \
+do {   \
+   if ((ft)->ft_flags & (flags))   \
+   printf((fmt), __VA_ARGS__); \
+} while (0);   \
+
+#else
+#define FLDPRINTF(ft, flags, fmt, ...)
+
+#endif
+
+
 /*
  * TODO:
  * - Make flowtable stats per-cpu, aggregated at sysctl call time,
  *   to avoid extra cache evictions caused by incrementing a shared
  *   counter
- * - add IPv6 support to flow lookup
  * - add sysctls to resize && flush flow tables 
  * - Add per flowtable sysctls for statistics and configuring timeouts
  * - add saturation counter to rtentry to support per-packet load-balancing
@@ -200,13 +226,6 @@ static uint32_tflowclean_cycles;
  */
 VNET_DEFINE(int, flowtable_enable) = 1;
 static VNET_DEFINE(int, flowtable_debug);
-static VNET_DEFINE(int, flowtable_hits);
-static VNET_DEFINE(int, flowtable_lookups);
-static VNET_DEFINE(int, flowtable_misses);
-static VNET_DEFINE(int, flowtable_frees);
-static VNET_DEFINE(int, flowtable_free_checks);
-static VNET_DEFINE(int, flowtable_max_depth);
-static VNET_DEFINE(int, flowtable_collisions);
 static VNET_DEFINE(int, flowtable_syn_expire) = SYN_IDLE;
 static VNET_DEFINE(int, flowtable_udp_expire) = UDP_IDLE;
 static VNET_DEFINE(int, flowtable_fin_wait_expire) = FIN_WAIT_IDLE;
@@ -216,13 +235,6 @@ static VNET_DEFINE(int, flowtable_ready)
 
 #defineV_flowtable_enable  VNET(flowtable_enable)
 #defineV_flowtable_debug   VNET(flowtable_debug

Re: svn commit: r205024 - head/sys/net

2010-03-11 Thread John Hay
On Thu, Mar 11, 2010 at 03:35:13PM -0800, Juli Mallett wrote:
> On Thu, Mar 11, 2010 at 15:30, Qing Li  wrote:
> >>
> >> A couple of questions:
> >>
> >> (1) It used to be the case that quite a few interface drivers and types
> >> didn't have a notion of "link up" -- especially older ethernet devices. ?Do
> >> those all have the same problem? ?It was probably a design oversight that
> >>?devices don't declare an explicit capability for "can report link state".
> >>
> >
> > ?What you raised is definitely a possibility and these fixes take the
> > ?similar approach. I am going to try and go through each of these
> > ?drivers in /sys/dev/ and converting them, very soon.
> 
> Go through drivers in the embedded port directories, too.  The Octeon
> port's Ethernet driver was broken by this, and it looks like the
> Atheros if_arge is probably broken, too.  I would even suggest going
> back to the old behavior briefly while the port maintainers are given
> an opportunity to update their drivers.  Actually, it looks like only
> MIPS has Ethernet drivers outside of dev/ at a quick glance, but I'd
> be surprised if there weren't other broken examples.

There is also if_npe in the arm/xscale/ixp425 directory and probably
others in the rest of the arm directories.

John
-- 
John Hay -- j...@meraka.csir.co.za / j...@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: r205064 - in head/sys/mips: include mips

2010-03-11 Thread Neel Natu
Author: neel
Date: Fri Mar 12 03:49:17 2010
New Revision: 205064
URL: http://svn.freebsd.org/changeset/base/205064

Log:
  Make the ddb command "show tlb" SMP friendly.
  
  It now accepts an argument to dump out the tlb of a particular cpu.

Modified:
  head/sys/mips/include/cpuregs.h
  head/sys/mips/include/pmap.h
  head/sys/mips/mips/mp_machdep.c
  head/sys/mips/mips/pmap.c

Modified: head/sys/mips/include/cpuregs.h
==
--- head/sys/mips/include/cpuregs.h Fri Mar 12 03:08:47 2010
(r205063)
+++ head/sys/mips/include/cpuregs.h Fri Mar 12 03:49:17 2010
(r205064)
@@ -577,6 +577,8 @@
 
 #define MIPS_CONFIG1_TLBSZ_MASK0x7E00  /* bits 30..25 
# tlb entries minus one */
 #define MIPS_CONFIG1_TLBSZ_SHIFT   25
+#defineMIPS_MAX_TLB_ENTRIES64
+
 #define MIPS_CONFIG1_IS_MASK   0x01C0  /* bits 24..22 icache 
sets per way */
 #define MIPS_CONFIG1_IS_SHIFT  22
 #define MIPS_CONFIG1_IL_MASK   0x0038  /* bits 21..19 icache 
line size */

Modified: head/sys/mips/include/pmap.h
==
--- head/sys/mips/include/pmap.hFri Mar 12 03:08:47 2010
(r205063)
+++ head/sys/mips/include/pmap.hFri Mar 12 03:49:17 2010
(r205064)
@@ -219,6 +219,11 @@ pmap_map_fpage(vm_paddr_t pa, struct fpa
 boolean_t check_unmaped);
 void pmap_unmap_fpage(vm_paddr_t pa, struct fpage *fp);
 
+/*
+ * Function to save TLB contents so that they may be inspected in the debugger.
+ */
+extern void pmap_save_tlb(void);
+
 #endif /* _KERNEL */
 
 #endif /* !LOCORE */

Modified: head/sys/mips/mips/mp_machdep.c
==
--- head/sys/mips/mips/mp_machdep.c Fri Mar 12 03:08:47 2010
(r205063)
+++ head/sys/mips/mips/mp_machdep.c Fri Mar 12 03:49:17 2010
(r205064)
@@ -128,6 +128,7 @@ mips_ipi_handler(void *arg)
CTR0(KTR_SMP, "IPI_STOP or IPI_STOP_HARD");
 
savectx(&stoppcbs[cpu]);
+   pmap_save_tlb();
 
/* Indicate we are stopped */
atomic_set_int(&stopped_cpus, cpumask);

Modified: head/sys/mips/mips/pmap.c
==
--- head/sys/mips/mips/pmap.c   Fri Mar 12 03:08:47 2010(r205063)
+++ head/sys/mips/mips/pmap.c   Fri Mar 12 03:49:17 2010(r205064)
@@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -149,6 +150,8 @@ unsigned pmap_max_asid; /* max ASID sup
 
 vm_offset_t kernel_vm_end;
 
+static struct tlb tlbstash[MAXCPU][MIPS_MAX_TLB_ENTRIES];
+
 static void pmap_asid_alloc(pmap_t pmap);
 
 /*
@@ -3284,17 +3287,6 @@ db_dump_tlb(int first, int last)
}
 }
 
-#ifdef DDB
-#include 
-#include 
-
-DB_SHOW_COMMAND(tlb, ddb_dump_tlb)
-{
-   db_dump_tlb(0, num_tlbentries - 1);
-}
-
-#endif
-
 /*
  * Routine:pmap_kextract
  * Function:
@@ -3377,3 +3369,61 @@ pmap_flush_pvcache(vm_page_t m)
}
}
 }
+
+void
+pmap_save_tlb(void)
+{
+   int tlbno, cpu;
+
+   cpu = PCPU_GET(cpuid);
+
+   for (tlbno = 0; tlbno < num_tlbentries; ++tlbno)
+   MachTLBRead(tlbno, &tlbstash[cpu][tlbno]);
+}
+
+#ifdef DDB
+#include 
+
+DB_SHOW_COMMAND(tlb, ddb_dump_tlb)
+{
+   int cpu, tlbno;
+   struct tlb *tlb;
+
+   if (have_addr)
+   cpu = ((addr >> 4) % 16) * 10 + (addr % 16);
+   else
+   cpu = PCPU_GET(cpuid);
+
+   if (cpu < 0 || cpu >= mp_ncpus) {
+   db_printf("Invalid CPU %d\n", cpu);
+   return;
+   } else
+   db_printf("CPU %d:\n", cpu);
+
+   if (cpu == PCPU_GET(cpuid))
+   pmap_save_tlb();
+
+   for (tlbno = 0; tlbno < num_tlbentries; ++tlbno) {
+   tlb = &tlbstash[cpu][tlbno];
+   if (tlb->tlb_lo0 & PTE_V || tlb->tlb_lo1 & PTE_V) {
+   printf("TLB %2d vad 0x%0lx ",
+   tlbno, (long)(tlb->tlb_hi & 0xff00));
+   } else {
+   printf("TLB*%2d vad 0x%0lx ",
+   tlbno, (long)(tlb->tlb_hi & 0xff00));
+   }
+   printf("0=0x%0lx ", pfn_to_vad((long)tlb->tlb_lo0));
+   printf("%c", tlb->tlb_lo0 & PTE_V ? 'V' : '-');
+   printf("%c", tlb->tlb_lo0 & PTE_M ? 'M' : '-');
+   printf("%c", tlb->tlb_lo0 & PTE_G ? 'G' : '-');
+   printf(" atr %x ", (tlb->tlb_lo0 >> 3) & 7);
+   printf("1=0x%0lx ", pfn_to_vad((long)tlb->tlb_lo1));
+   printf("%c", tlb->tlb_lo1 & PTE_V ? 'V' : '-');
+   printf(

svn commit: r205063 - in head/sys: amd64/amd64 i386/i386

2010-03-11 Thread John Baldwin
Author: jhb
Date: Fri Mar 12 03:08:47 2010
New Revision: 205063
URL: http://svn.freebsd.org/changeset/base/205063

Log:
  Fix the previous attempt to fix kernel builds of HEAD on 7.x.  Use the
  __gnu_inline__ attribute for PMAP_INLINE when using the 7.x compiler to
  match what 7.x uses for PMAP_INLINE.

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/i386/i386/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==
--- head/sys/amd64/amd64/pmap.c Fri Mar 12 02:56:49 2010(r205062)
+++ head/sys/amd64/amd64/pmap.c Fri Mar 12 03:08:47 2010(r205063)
@@ -152,7 +152,7 @@ __FBSDID("$FreeBSD$");
 
 #if !defined(DIAGNOSTIC)
 #ifdef __GNUC_GNU_INLINE__
-#define PMAP_INLINEinline
+#define PMAP_INLINE__attribute__((__gnu_inline__)) inline
 #else
 #define PMAP_INLINEextern inline
 #endif

Modified: head/sys/i386/i386/pmap.c
==
--- head/sys/i386/i386/pmap.c   Fri Mar 12 02:56:49 2010(r205062)
+++ head/sys/i386/i386/pmap.c   Fri Mar 12 03:08:47 2010(r205063)
@@ -163,7 +163,7 @@ __FBSDID("$FreeBSD$");
 
 #if !defined(DIAGNOSTIC)
 #ifdef __GNUC_GNU_INLINE__
-#define PMAP_INLINEinline
+#define PMAP_INLINE__attribute__((__gnu_inline__)) inline
 #else
 #define PMAP_INLINEextern inline
 #endif
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r205061 - head/sys/mips/cavium/dev/rgmii

2010-03-11 Thread Juli Mallett
Author: jmallett
Date: Fri Mar 12 02:56:45 2010
New Revision: 205061
URL: http://svn.freebsd.org/changeset/base/205061

Log:
  o) Send packets being queued for transmission up to BPF if there's a listener.
  o) Properly configure the CAM to handle IFF_PROMISC and note where 
IFF_ALLMULTI
 handling would go if we didn't already force the NIC to receive all
 multicast traffic.
  
  Reviewed by:  imp
  Sponsored by: Packet Forensics

Modified:
  head/sys/mips/cavium/dev/rgmii/octeon_rgmx.c

Modified: head/sys/mips/cavium/dev/rgmii/octeon_rgmx.c
==
--- head/sys/mips/cavium/dev/rgmii/octeon_rgmx.cFri Mar 12 02:55:10 
2010(r205060)
+++ head/sys/mips/cavium/dev/rgmii/octeon_rgmx.cFri Mar 12 02:56:45 
2010(r205061)
@@ -209,6 +209,7 @@ static int octeon_rgmx_intr(void *arg);
 /* Standard driver entry points.  These can be static.  */
 static void  octeon_rgmx_init(void *);
 //static driver_intr_trgmx_intr;
+static void  octeon_rgmx_config_cam   (struct ifnet *);
 static int   octeon_rgmx_ioctl(struct ifnet *, u_long, caddr_t);
 static void  octeon_rgmx_output_start (struct ifnet *);
 static void  octeon_rgmx_output_start_locked (struct ifnet *);
@@ -1225,6 +1226,8 @@ static void octeon_rgmx_output_start_loc
 for (ii = 0; ii < len; ii++) printf(" %X", dc[ii]); 
printf("\n");
 #endif
 
+   ETHER_BPF_MTAP(ifp, m);
+
IF_ENQUEUE(&sc->tx_pending_queue, m);
 
 /*
@@ -1681,6 +1684,60 @@ static void octeon_rgmx_medstat (struct 
RGMX_UNLOCK(sc);
 }
 
+static void octeon_rgmx_config_cam(struct ifnet *ifp)
+{
+   struct rgmx_softc_dev *sc = ifp->if_softc;
+   u_int port = sc->port;
+   int index = INDEX(port);
+int iface = INTERFACE(port);
+   u_int last_enabled;
+   uint64_t adr_ctl;
+
+   last_enabled = octeon_rgmx_stop_port(port);
+
+   adr_ctl = oct_read64(OCTEON_RGMX_RXX_ADR_CTL(index, iface));
+
+   /*
+* Always accept broadcast traffic.
+*/
+   if ((adr_ctl & OCTEON_RGMX_ADRCTL_ACCEPT_BROADCAST) == 0)
+   adr_ctl |= OCTEON_RGMX_ADRCTL_ACCEPT_BROADCAST;
+
+   /*
+* Accept all multicast in all multicast mode and in
+* promiscuous mode.
+*
+* XXX Since we don't handle programming the CAM for
+* multicast filtering, always accept all multicast.
+*/
+   adr_ctl &= ~OCTEON_RGMX_ADRCTL_REJECT_ALL_MULTICAST;
+   adr_ctl |= OCTEON_RGMX_ADRCTL_ACCEPT_ALL_MULTICAST;
+
+   /*
+* In promiscuous mode, the CAM is shut off, so reject everything.
+* Otherwise, filter using the CAM.
+*/
+   if ((ifp->if_flags & IFF_PROMISC) != 0) {
+   adr_ctl &= ~OCTEON_RGMX_ADRCTL_CAM_MODE_ACCEPT_DMAC;
+   adr_ctl |= OCTEON_RGMX_ADRCTL_CAM_MODE_REJECT_DMAC;
+   } else {
+   adr_ctl &= ~OCTEON_RGMX_ADRCTL_CAM_MODE_REJECT_DMAC;
+   adr_ctl |= OCTEON_RGMX_ADRCTL_CAM_MODE_ACCEPT_DMAC;
+   }
+
+   oct_write64(OCTEON_RGMX_RXX_ADR_CTL(index, iface), adr_ctl);
+
+   /*
+* If in promiscuous mode, disable the CAM.
+*/
+   if ((ifp->if_flags & IFF_PROMISC) != 0)
+   oct_write64(OCTEON_RGMX_RXX_ADR_CAM_EN(index, iface), 0);
+   else
+   oct_write64(OCTEON_RGMX_RXX_ADR_CAM_EN(index, iface), 1);
+
+   if (last_enabled) octeon_rgmx_start_port(port);
+}
+
 static int octeon_rgmx_ioctl (struct ifnet * ifp, u_long command, caddr_t data)
 {
struct rgmx_softc_dev *sc = ifp->if_softc;
@@ -1699,8 +1756,6 @@ static int octeon_rgmx_ioctl (struct ifn
  * "stopped", reflecting the UP flag.
  */
 if (ifp->if_flags & IFF_UP) {
-
-
 /*
  * New state is IFF_UP
  * Restart or Start now, if driver is not running 
currently.
@@ -1708,6 +1763,7 @@ static int octeon_rgmx_ioctl (struct ifn
 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
 octeon_rgmx_init(sc);
 }
+   octeon_rgmx_config_cam(ifp);
 } else {
 /*
  * New state is IFF_DOWN.
___
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: r205057 - stable/7/games/grdc

2010-03-11 Thread Xin LI
Author: delphij
Date: Fri Mar 12 00:51:25 2010
New Revision: 205057
URL: http://svn.freebsd.org/changeset/base/205057

Log:
  MFC r203760: Improve time precision for grdc(6):
  
  Traditionally, grdc would obtain time through time(3) which in turn gets
  only the second part of clock (CLOCK_SECOND), and sleep for 1 second after
  each screen refresh.
  
  This approach would have two problems.  First, we are not guaranteed to
  be waken up at the beginning of a whole second, which will typically
  exhibit as a "lag" on second number.  Second, because we sleep for whole
  second, and the refresh process would take some time, the error would
  accumulate from time to time, making the lag variable.
  
  Make grdc(6) to use time(3) to get time only at the beginning, and sample
  time in CLOCK_REALTIME_FAST granularity after refreshing, and use the
  nanosecond part to caculate how much time we want to sleep.
  
  PR:   bin/120813

Modified:
  stable/7/games/grdc/grdc.c
Directory Properties:
  stable/7/games/grdc/   (props changed)

Modified: stable/7/games/grdc/grdc.c
==
--- stable/7/games/grdc/grdc.c  Fri Mar 12 00:51:13 2010(r205056)
+++ stable/7/games/grdc/grdc.c  Fri Mar 12 00:51:25 2010(r205057)
@@ -59,6 +59,7 @@ main(argc, argv)
 int argc;
 char **argv;
 {
+struct timespec ts;
 long t, a;
 int i, j, s, k;
 int n;
@@ -136,9 +137,9 @@ int t12;
 
attrset(COLOR_PAIR(2));
}
+   time(&now);
do {
mask = 0;
-   time(&now);
tm = localtime(&now);
set(tm->tm_sec%10, 0);
set(tm->tm_sec/10, 4);
@@ -193,7 +194,19 @@ int t12;
}
movto(6, 0);
refresh();
-   sleep(1);
+   clock_gettime(CLOCK_REALTIME_FAST, &ts);
+   if (ts.tv_sec == now) {
+   if (ts.tv_nsec > 0) {
+   ts.tv_sec = 0;
+   ts.tv_nsec = 10 - ts.tv_nsec;
+   } else {
+   ts.tv_sec = 1;
+   ts.tv_nsec = 0;
+   }
+   nanosleep(&ts, NULL);
+   now = ts.tv_sec + 1;
+   } else
+   now = ts.tv_sec;
if (sigtermed) {
standend();
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: r205056 - stable/8/games/grdc

2010-03-11 Thread Xin LI
Author: delphij
Date: Fri Mar 12 00:51:13 2010
New Revision: 205056
URL: http://svn.freebsd.org/changeset/base/205056

Log:
  MFC r203760: Improve time precision for grdc(6):
  
  Traditionally, grdc would obtain time through time(3) which in turn gets
  only the second part of clock (CLOCK_SECOND), and sleep for 1 second after
  each screen refresh.
  
  This approach would have two problems.  First, we are not guaranteed to
  be waken up at the beginning of a whole second, which will typically
  exhibit as a "lag" on second number.  Second, because we sleep for whole
  second, and the refresh process would take some time, the error would
  accumulate from time to time, making the lag variable.
  
  Make grdc(6) to use time(3) to get time only at the beginning, and sample
  time in CLOCK_REALTIME_FAST granularity after refreshing, and use the
  nanosecond part to caculate how much time we want to sleep.
  
  PR:   bin/120813

Modified:
  stable/8/games/grdc/grdc.c
Directory Properties:
  stable/8/games/grdc/   (props changed)

Modified: stable/8/games/grdc/grdc.c
==
--- stable/8/games/grdc/grdc.c  Fri Mar 12 00:25:04 2010(r205055)
+++ stable/8/games/grdc/grdc.c  Fri Mar 12 00:51:13 2010(r205056)
@@ -59,6 +59,7 @@ main(argc, argv)
 int argc;
 char **argv;
 {
+struct timespec ts;
 long t, a;
 int i, j, s, k;
 int n;
@@ -136,9 +137,9 @@ int t12;
 
attrset(COLOR_PAIR(2));
}
+   time(&now);
do {
mask = 0;
-   time(&now);
tm = localtime(&now);
set(tm->tm_sec%10, 0);
set(tm->tm_sec/10, 4);
@@ -193,7 +194,19 @@ int t12;
}
movto(6, 0);
refresh();
-   sleep(1);
+   clock_gettime(CLOCK_REALTIME_FAST, &ts);
+   if (ts.tv_sec == now) {
+   if (ts.tv_nsec > 0) {
+   ts.tv_sec = 0;
+   ts.tv_nsec = 10 - ts.tv_nsec;
+   } else {
+   ts.tv_sec = 1;
+   ts.tv_nsec = 0;
+   }
+   nanosleep(&ts, NULL);
+   now = ts.tv_sec + 1;
+   } else
+   now = ts.tv_sec;
if (sigtermed) {
standend();
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"


Re: svn commit: r205024 - head/sys/net

2010-03-11 Thread Qing Li
>
> If you can think of a way to add some invariants (warn the first time
> a driver receives a packet without having ever set the link state,
> make sure the media status callback sets the valid flag in the
> request, etc) that would probably be very helpful for people who are
> writing network drivers.  If I hadn't been following the threads about
> your changes, I would have had to spend much longer fixing the Octeon
> port's Ethernet driver, wondering why suddenly it broke and
> instrumenting the routing code.  A printf would go a long way.
>

  You definitely have a very good point here.  I was a bit surprised
  during debugging that the link state is not consistently initialized
  and by far not enforced across all of the drivers. Admittedly I checked
  the most commonly deployed devices and they are in good state.

  I certainly appreciate your patience on this one and will try to get
  it resolved quickly.

  -- Qing
___
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: r205024 - head/sys/net

2010-03-11 Thread Juli Mallett
On Thu, Mar 11, 2010 at 15:39, Qing Li  wrote:
> I guess it's a good time to clean things up. The if_link_state code has been
> around for quite some time, either it be fully utilized or not be there at 
> all.
> The inconsistency is the root cause.

Sure.  There is an increasing amount of stuff that network drivers are
expected to do, but they work without doing them.  It's easy to think
you have a functioning network driver and that you can get by without
adding support for media changes and link status reporting, etc.

> I will try going through these tonight and hopefully the fix all take a
> common approach.

If you can think of a way to add some invariants (warn the first time
a driver receives a packet without having ever set the link state,
make sure the media status callback sets the valid flag in the
request, etc) that would probably be very helpful for people who are
writing network drivers.  If I hadn't been following the threads about
your changes, I would have had to spend much longer fixing the Octeon
port's Ethernet driver, wondering why suddenly it broke and
instrumenting the routing code.  A printf would go a long way.

Juli.
___
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: r205024 - head/sys/net

2010-03-11 Thread Qing Li
I guess it's a good time to clean things up. The if_link_state code has been
around for quite some time, either it be fully utilized or not be there at all.
The inconsistency is the root cause.

I will try going through these tonight and hopefully the fix all take a
common approach.

-- Qing


On Thu, Mar 11, 2010 at 3:35 PM, Juli Mallett  wrote:
> On Thu, Mar 11, 2010 at 15:30, Qing Li  wrote:
>>>
>>> A couple of questions:
>>>
>>> (1) It used to be the case that quite a few interface drivers and types
>>> didn't have a notion of "link up" -- especially older ethernet devices.  Do
>>> those all have the same problem?  It was probably a design oversight that
>>> devices don't declare an explicit capability for "can report link state".
>>>
>>
>>  What you raised is definitely a possibility and these fixes take the
>>  similar approach. I am going to try and go through each of these
>>  drivers in /sys/dev/ and converting them, very soon.
>
> Go through drivers in the embedded port directories, too.  The Octeon
> port's Ethernet driver was broken by this, and it looks like the
> Atheros if_arge is probably broken, too.  I would even suggest going
> back to the old behavior briefly while the port maintainers are given
> an opportunity to update their drivers.  Actually, it looks like only
> MIPS has Ethernet drivers outside of dev/ at a quick glance, but I'd
> be surprised if there weren't other broken examples.
>
> Juli.
>
___
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: r205024 - head/sys/net

2010-03-11 Thread Juli Mallett
On Thu, Mar 11, 2010 at 15:30, Qing Li  wrote:
>>
>> A couple of questions:
>>
>> (1) It used to be the case that quite a few interface drivers and types
>> didn't have a notion of "link up" -- especially older ethernet devices.  Do
>> those all have the same problem?  It was probably a design oversight that
>> devices don't declare an explicit capability for "can report link state".
>>
>
>  What you raised is definitely a possibility and these fixes take the
>  similar approach. I am going to try and go through each of these
>  drivers in /sys/dev/ and converting them, very soon.

Go through drivers in the embedded port directories, too.  The Octeon
port's Ethernet driver was broken by this, and it looks like the
Atheros if_arge is probably broken, too.  I would even suggest going
back to the old behavior briefly while the port maintainers are given
an opportunity to update their drivers.  Actually, it looks like only
MIPS has Ethernet drivers outside of dev/ at a quick glance, but I'd
be surprised if there weren't other broken examples.

Juli.
___
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: r205024 - head/sys/net

2010-03-11 Thread Qing Li
>
> A couple of questions:
>
> (1) It used to be the case that quite a few interface drivers and types
> didn't have a notion of "link up" -- especially older ethernet devices.  Do
> those all have the same problem?  It was probably a design oversight that
> devices don't declare an explicit capability for "can report link state".
>

  What you raised is definitely a possibility and these fixes take the
  similar approach. I am going to try and go through each of these
  drivers in /sys/dev/ and converting them, very soon.

>
> (2) While loopback interfaces don't really have a link state, they can be
> administratively down -- should/do you check that as well as link state?
> And more generally, even if link is up, administratively down should be
> obeyed?
>

  For loopback interfaces, althgouth administrative these can be taken down,
  I personally cannot think one practical usage case where ECMP across
  loopback interfaces would be interesting or usefaul. So I can think of
  very little reason to be concerned in the loopback case.

>
> Finally, it would be neat if there were a way to have information beyond
> link state influence the choice to balance to a particular route/interface.
>  For example, imagine if I have a router with ECMP, and on the other side on
> a single ethernet segment, I have two DSL modems.  The ethernet link will
> remain up, but I may (via out-of-band mechanisms, such as SNMP or an active
> probe) be able to tell that one of the DSL lines is down.  Is there a way to
> push that information into the kernel currently without deleting the routes,
> and instead say "yeah, but for ECMP purposes this is 'down'"?
>

  The above really falls into policy based routing. And policy based
  routing infrastrucutre is something I have already been working on
but cannot yet
  push back into -current. In fact Julian and I had a conversation about
  this topic during the FIBs implementation time in late 2008.

  This infrastructure enhancement is definitely coming but I cannot yet prvoide
  a timeline for merge back.

  It's mostly a time issue.

  Let me know if I have answered these questions to your satisfaction.

  -- Qing
___
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: r205050 - in head: sbin/ipfw sys/netinet/ipfw

2010-03-11 Thread Luigi Rizzo
Author: luigi
Date: Thu Mar 11 22:42:33 2010
New Revision: 205050
URL: http://svn.freebsd.org/changeset/base/205050

Log:
  implement listing of a subset of pipes/queues/schedulers.
  The filtering of the output is done in the kernel instead of userland
  to reduce the amount of data transfered.

Modified:
  head/sbin/ipfw/dummynet.c
  head/sys/netinet/ipfw/ip_dn_private.h
  head/sys/netinet/ipfw/ip_dummynet.c

Modified: head/sbin/ipfw/dummynet.c
==
--- head/sbin/ipfw/dummynet.c   Thu Mar 11 22:29:45 2010(r205049)
+++ head/sbin/ipfw/dummynet.c   Thu Mar 11 22:42:33 2010(r205050)
@@ -1234,53 +1234,142 @@ dummynet_flush(void)
do_cmd(IP_DUMMYNET3, &oid, oid.len);
 }
 
+/* Parse input for 'ipfw [pipe|sched|queue] show [range list]'
+ * Returns the number of ranges, and possibly stores them
+ * in the array v of size len.
+ */
+static int
+parse_range(int ac, char *av[], uint32_t *v, int len)
+{
+   int n = 0;
+   char *endptr, *s;
+   uint32_t base[2];
+
+   if (v == NULL || len < 2) {
+   v = base;
+   len = 2;
+   }
+
+   for (s = *av; s != NULL; av++, ac--) {
+   v[0] = strtoul(s, &endptr, 10);
+   v[1] = (*endptr != '-') ? v[0] :
+strtoul(endptr+1, &endptr, 10);
+   if (*endptr == '\0') { /* prepare for next round */
+   s = (ac > 0) ? *(av+1) : NULL;
+   } else {
+   if (*endptr != ',') {
+   warn("invalid number: %s", s);
+   s = ++endptr;
+   continue;
+   }
+   /* continue processing from here */
+   s = ++endptr;
+   ac++;
+   av--;
+   }
+   if (v[1] < v[0] ||
+   v[1] < 0 || v[1] >= DN_MAX_ID-1 ||
+   v[0] < 0 || v[1] >= DN_MAX_ID-1) {
+   continue; /* invalid entry */
+   }
+   n++;
+   /* translate if 'pipe list' */
+   if (co.do_pipe == 1) {
+   v[0] += DN_MAX_ID;
+   v[1] += DN_MAX_ID;
+   }
+   v = (n*2 < len) ? v + 2 : base;
+   }
+   return n;
+}
+
 /* main entry point for dummynet list functions. co.do_pipe indicates
  * which function we want to support.
- * XXX todo- accept filtering arguments.
+ * av may contain filtering arguments, either individual entries
+ * or ranges, or lists (space or commas are valid separators).
+ * Format for a range can be n1-n2 or n3 n4 n5 ...
+ * In a range n1 must be <= n2, otherwise the range is ignored.
+ * A number 'n4' is translate in a range 'n4-n4'
+ * All number must be > 0 and < DN_MAX_ID-1
  */
 void
 dummynet_list(int ac, char *av[], int show_counters)
 {
-   struct dn_id oid, *x = NULL;
-   int ret, i, l = sizeof(oid);
+   struct dn_id *oid, *x = NULL;
+   int ret, i, l;
+   int n;  /* # of ranges */
+   int buflen;
+   int max_size;   /* largest obj passed up */
+
+   ac--;
+   av++;   /* skip 'list' | 'show' word */
+
+   n = parse_range(ac, av, NULL, 0);   /* Count # of ranges. */
+
+   /* Allocate space to store ranges */
+   l = sizeof(*oid) + sizeof(uint32_t) * n * 2;
+   oid = safe_calloc(1, l);
+   oid_fill(oid, l, DN_CMD_GET, DN_API_VERSION);
+
+   if (n > 0)  /* store ranges in idx */
+   parse_range(ac, av, (uint32_t *)(oid + 1), n*2);
+   /*
+* Compute the size of the largest object returned. If the
+* response leaves at least this much spare space in the
+* buffer, then surely the response is complete; otherwise
+* there might be a risk of truncation and we will need to
+* retry with a larger buffer.
+* XXX don't bother with smaller structs.
+*/
+   max_size = sizeof(struct dn_fs);
+   if (max_size < sizeof(struct dn_sch))
+   max_size = sizeof(struct dn_sch);
+   if (max_size < sizeof(struct dn_flow))
+   max_size = sizeof(struct dn_flow);
 
-   oid_fill(&oid, l, DN_CMD_GET, DN_API_VERSION);
switch (co.do_pipe) {
case 1:
-   oid.subtype = DN_LINK;  /* list pipe */
+   oid->subtype = DN_LINK; /* list pipe */
break;
case 2:
-   oid.subtype = DN_FS;/* list queue */
+   oid->subtype = DN_FS;   /* list queue */
break;
case 3:
-   oid.subtype = DN_SCH;   /* list sched */
+   oid->subtype = DN_SCH;  /* list sched */
break;
}
 
-   /* Request the buffer size (in oid.id)*/
-   ret = do_cmd(-IP_DUMMYNET3, &oid, (uintptr_t)&l);
-   // printf("%

svn commit: r205049 - head/sys/mips/conf

2010-03-11 Thread Juli Mallett
Author: jmallett
Date: Thu Mar 11 22:29:45 2010
New Revision: 205049
URL: http://svn.freebsd.org/changeset/base/205049

Log:
  Add bpf and random to Octeon configurations, since they're needed to run
  dhclient and ssh respectively.
  
  Reviewed by:  imp

Modified:
  head/sys/mips/conf/OCTEON1
  head/sys/mips/conf/OCTEON1-32

Modified: head/sys/mips/conf/OCTEON1
==
--- head/sys/mips/conf/OCTEON1  Thu Mar 11 22:25:53 2010(r205048)
+++ head/sys/mips/conf/OCTEON1  Thu Mar 11 22:29:45 2010(r205049)
@@ -81,6 +81,8 @@ nodevice  uart_ns8250
 device rgmii
 #options   VERBOSE_SYSINIT
 
+device bpf
+device random
 
 #
 # Use the following for  Compact Flash file-system

Modified: head/sys/mips/conf/OCTEON1-32
==
--- head/sys/mips/conf/OCTEON1-32   Thu Mar 11 22:25:53 2010
(r205048)
+++ head/sys/mips/conf/OCTEON1-32   Thu Mar 11 22:29:45 2010
(r205049)
@@ -70,6 +70,8 @@ nodevice  uart_ns8250
 device rgmii
 #options   VERBOSE_SYSINIT
 
+device bpf
+device random
 
 #
 # Use the following for  Compact Flash file-system
___
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: r205048 - head/sys/mips/cavium

2010-03-11 Thread Juli Mallett
Author: jmallett
Date: Thu Mar 11 22:25:53 2010
New Revision: 205048
URL: http://svn.freebsd.org/changeset/base/205048

Log:
  Don't force single user on Octeon anymore.

Modified:
  head/sys/mips/cavium/octeon_machdep.c

Modified: head/sys/mips/cavium/octeon_machdep.c
==
--- head/sys/mips/cavium/octeon_machdep.c   Thu Mar 11 22:22:06 2010
(r205047)
+++ head/sys/mips/cavium/octeon_machdep.c   Thu Mar 11 22:25:53 2010
(r205048)
@@ -730,8 +730,6 @@ platform_start(__register_t a0, __regist
 {
uint64_t platform_counter_freq;
 
-   boothowto |= RB_SINGLE;
-
/* Initialize pcpu stuff */
mips_pcpu0_init();
mips_timer_early_init(OCTEON_CLOCK_DEFAULT);
___
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: r205047 - head/sys/mips/cavium/dev/rgmii

2010-03-11 Thread Juli Mallett
Author: jmallett
Date: Thu Mar 11 22:22:06 2010
New Revision: 205047
URL: http://svn.freebsd.org/changeset/base/205047

Log:
  o) Eliminate use of sc->typestr, which is always NULL.
  o) Inline octeon_rgmx_mark_ready into octeon_rgmx_init.
  o) Add a media status handler that reports link and media status.
  o) Set link state when if_init is called.
  o) Remove some printfs related to driver state changes.
  o) Remove some gratuitous comments.
  
  Reviewed by:  imp
  Sponsored by: Packet Forensics

Modified:
  head/sys/mips/cavium/dev/rgmii/octeon_rgmx.c

Modified: head/sys/mips/cavium/dev/rgmii/octeon_rgmx.c
==
--- head/sys/mips/cavium/dev/rgmii/octeon_rgmx.cThu Mar 11 22:14:07 
2010(r205046)
+++ head/sys/mips/cavium/dev/rgmii/octeon_rgmx.cThu Mar 11 22:22:06 
2010(r205047)
@@ -136,7 +136,6 @@ struct rgmx_softc_dev {
u_int   idx;
 u_char  ieee[6];
 
-char const * typestr;   /* printable name of the interface.  */
 u_short txb_size;   /* size of TX buffer, in bytes  */
 
 /* Transmission buffer management.  */
@@ -182,7 +181,6 @@ static u_int get_rgmx_port_ordinal(u_int
 static void octeon_rgmx_set_mac(u_int port);
 static void octeon_rgmx_init_sc(struct rgmx_softc_dev *sc, device_t dev, u_int 
port, u_int num_devices);
 static int octeon_rgmx_init_ifnet(struct rgmx_softc_dev *sc);
-static void octeon_rgmx_mark_ready(struct rgmx_softc_dev *sc);
 static void octeon_rgmx_stop(struct rgmx_softc_dev *sc);
 static void octeon_rgmx_config_speed(u_int port, u_int);
 #ifdef DEBUG_RGMX_DUMP
@@ -349,8 +347,6 @@ static int octeon_rgmx_init_ifnet (struc
 ifmedia_set(&sc->media, bit2media[0]);
 
 ether_ifattach(sc->ifp, sc->ieee);
-/* Print additional info when attached.  */
-device_printf(sc->sc_dev, "type %s, full duplex\n", sc->typestr);
 
 return (0);
 }
@@ -447,12 +443,6 @@ static int rgmii_attach (device_t dev)
device_printf(dev, "  ifinit failed for rgmx 
port %u\n", port);
 return (ENOSPC);
 }
-/*
- * Don't call octeon_rgmx_mark_ready()
- * ifnet will call it indirectly via  octeon_rgmx_init()
- *
- * octeon_rgmx_mark_ready(sc);
- */
 num_devices++;
 }
}
@@ -1648,9 +1638,47 @@ static int octeon_rgmx_medchange (struct
 
 static void octeon_rgmx_medstat (struct ifnet *ifp, struct ifmediareq *ifm)
 {
-/*
- * No support for Media Status callback
- */
+   struct rgmx_softc_dev *sc = ifp->if_softc;
+   octeon_rgmx_rxx_rx_inbnd_t link_status;
+
+   octeon_rgmx_config_speed(sc->port, 1);
+
+   RGMX_LOCK(sc);
+
+   ifm->ifm_status = IFM_AVALID;
+   ifm->ifm_active = IFM_ETHER;
+
+   /*
+* Parse link status.
+*/
+   link_status.word64 = sc->link_status;
+
+   if (!link_status.bits.status) {
+   RGMX_UNLOCK(sc);
+   return;
+   }
+
+   ifm->ifm_status |= IFM_ACTIVE;
+
+   switch (link_status.bits.speed) {
+   case 0:
+   ifm->ifm_active |= IFM_10_T;
+   break;
+   case 1:
+   ifm->ifm_active |= IFM_100_TX;
+   break;
+   case 2:
+   ifm->ifm_active |= IFM_1000_T;;
+   break;
+   default:
+   /* Unknown!  */
+   break;
+   }
+
+   /* Always full duplex.  */
+   ifm->ifm_active |= IFM_FDX;
+
+   RGMX_UNLOCK(sc);
 }
 
 static int octeon_rgmx_ioctl (struct ifnet * ifp, u_long command, caddr_t data)
@@ -1678,10 +1706,7 @@ static int octeon_rgmx_ioctl (struct ifn
  * Restart or Start now, if driver is not running 
currently.
  */
 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) {
-printf(" SIOCSTIFFLAGS  UP/Not-running\n"); break;
 octeon_rgmx_init(sc);
-} else {
-printf(" SIOCSTIFFLAGS  UP/Running\n"); break;
 }
 } else {
 /*
@@ -1689,10 +1714,7 @@ static int octeon_rgmx_ioctl (struct ifn
  * Stop & shut it down now, if driver is running 
currently.
  */
 if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) {
-printf(" SIOCSTIFFLAGS  Down/Running\n"); break;
 octeon_rgmx_stop(sc);
-} else {
-printf(" SIOCSTIFFLAGS  Down/Not-Running\n"); 
break;
 }
 }
 break;
@@ -1734,17 +1756,10 @@ static int octeon_rgmx_ioctl (struct ifn
 return (error);
 

svn commit: r205043 - head/sys/dev/usb

2010-03-11 Thread Andrew Thompson
Author: thompsa
Date: Thu Mar 11 22:09:21 2010
New Revision: 205043
URL: http://svn.freebsd.org/changeset/base/205043

Log:
  Add device ID for the NATURAL4000 keyboard

Modified:
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsThu Mar 11 22:05:12 2010(r205042)
+++ head/sys/dev/usb/usbdevsThu Mar 11 22:09:21 2010(r205043)
@@ -2055,6 +2055,7 @@ product MICROSOFT WLNOTEBOOK2 0x00e1  Wir
 product MICROSOFT WLNOTEBOOK3  0x00d2  Wireless Optical Mouse 3000 (Model 1049)
 product MICROSOFT WLUSBMOUSE   0x00b9  Wireless USB Mouse
 product MICROSOFT XBOX360  0x0292  XBOX 360 WLAN
+product MICROSOFT NATURAL4000  0x00db  Natural Ergonomic Keyboard 4000
 
 /* Microtech products */
 product MICROTECH SCSIDB25 0x0004  USB-SCSI-DB25
___
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: r205042 - in head/sys/dev/usb: . wlan

2010-03-11 Thread Andrew Thompson
Author: thompsa
Date: Thu Mar 11 22:05:12 2010
New Revision: 205042
URL: http://svn.freebsd.org/changeset/base/205042

Log:
  - Integrate latest driver code from OpenBSD
  - Drain our tasks from the ieee80211 taskqueue
  - Add more IDs
  
  Submitted by: Akinori Furukoshi

Modified:
  head/sys/dev/usb/usbdevs
  head/sys/dev/usb/wlan/if_run.c
  head/sys/dev/usb/wlan/if_runreg.h
  head/sys/dev/usb/wlan/if_runvar.h

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsThu Mar 11 22:01:48 2010(r205041)
+++ head/sys/dev/usb/usbdevsThu Mar 11 22:05:12 2010(r205042)
@@ -270,6 +270,7 @@ vendor LACIE0x059f  LaCie
 vendor FUJIFILM0x05a2  Fuji Film
 vendor ARC 0x05a3  ARC
 vendor ORTEK   0x05a4  Ortek
+vendor CISCOLINKSYS3   0x05a6  Cisco-Linksys
 vendor BOSE0x05a7  Bose
 vendor OMNIVISION  0x05a9  OmniVision
 vendor INSYSTEM0x05ab  In-System Design
@@ -539,6 +540,7 @@ vendor RIM  0x0fca  Research In Motion
 vendor DYNASTREAM  0x0fcf  Dynastream Innovations
 vendor QUALCOMM0x1004  Qualcomm
 vendor APACER  0x1005  Apacer
+vendor MOTOROLA4   0x100d  Motorola
 vendor DESKNOTE0x1019  Desknote
 vendor GIGABYTE0x1044  GIGABYTE
 vendor WESTERN 0x1058  Western Digital
@@ -635,6 +637,7 @@ vendor LINKSYS3 0x1915  Linksys
 vendor QUALCOMMINC 0x19d2  Qualcomm, Incorporated
 vendor WCH20x1a86  QinHeng Electronics
 vendor STELERA 0x1a8d  Stelera Wireless
+vendor OVISLINK0x1b75  OvisLink
 vendor TCTMOBILE   0x1bbb  TCT Mobile
 vendor TELIT   0x1bc7  Telit
 vendor MPMAN   0x1cae  MpMan
@@ -676,6 +679,7 @@ vendor 3COM20x6891  3Com
 vendor EDIMAX  0x7392  Edimax
 vendor INTEL   0x8086  Intel
 vendor INTEL2  0x8087  Intel
+vendor ALLWIN  0x8516  ALLWIN Tech
 vendor SITECOM20x9016  Sitecom
 vendor MOSCHIP 0x9710  MosChip Semiconductor
 vendor MARVELL 0x9e88  Marvell Technology Group Ltd.
@@ -755,6 +759,7 @@ product ACCTON RT3070_1 0xa701  RT3070
 productACCTON RT3070_2 0xa702  RT3070
 product ACCTON RT2870_10xb522  RT2870
 productACCTON RT3070_3 0xc522  RT3070
+productACCTON RT3070_5 0xd522  RT3070
 product ACCTON ZD1211B 0xe501  ZD1211B
 
 /* Aceeca products */
@@ -887,6 +892,15 @@ product ALTEC ASC495   0xff05  ASC495 Spea
 /* Allied Telesyn International products */
 product ALLIEDTELESYN ATUSB100 0xb100  AT-USB100
 
+/* ALLWIN Tech products */
+product ALLWIN RT2070  0x2070  RT2070
+product ALLWIN RT2770  0x2770  RT2770
+product ALLWIN RT2870  0x2870  RT2870
+product ALLWIN RT3070  0x3070  RT3070
+product ALLWIN RT3071  0x3071  RT3071
+product ALLWIN RT3072  0x3072  RT3072
+product ALLWIN RT3572  0x3572  RT3572
+
 /* AlphaSmart, Inc. products */
 product ALPHASMART DANA_KB 0xdbac  AlphaSmart Dana Keyboard
 product ALPHASMART DANA_SYNC   0xdf00  AlphaSmart Dana HotSync
@@ -989,7 +1003,8 @@ product ASUS RT2870_2  0x1732  RT2870
 product ASUS RT2870_3  0x1742  RT2870
 product ASUS RT2870_4  0x1760  RT2870
 product ASUS RT2870_5  0x1761  RT2870
-productASUS RT3070 0x1784  RT3070
+productASUS USBN13 0x1784  USB-N13
+productASUS RT3070_1   0x1790  RT3070
 product ASUS P535  0x420f  ASUS P535 PDA
 productASUS GMSC   0x422f  ASUS Generic Mass Storage
 product ASUS RT25700x1706  RT2500USB Wireless Adapter
@@ -1147,7 +1162,8 @@ product CISCOLINKSYS HU200TS  0x001a  HU20
 product CISCOLINKSYS WUSB54GC  0x0020  WUSB54GC
 product CISCOLINKSYS WUSB54GR  0x0023  WUSB54GR
 product CISCOLINKSYS WUSBF54G  0x0024  WUSBF54G
-productCISCOLINKSYS2   RT3070  0x4001  RT3070
+productCISCOLINKSYS2 RT30700x4001  RT3070
+productCISCOLINKSYS3 RT30700x0101  RT3070
 
 /* CMOTECH products */
 product CMOTECH CNU510 0x5141  CDMA Technologies USB modem
@@ -1174,6 +1190,8 @@ product CONCEPTRONIC AR5523_2 0x7811  AR5
 product CONCEPTRONIC AR5523_2_NF   0x7812  AR5523 (no firmware)
 product CONCEPTRONIC2 C54RU0x3c02  C54RU WLAN
 product CONCEPTRONIC2 C54RU2   0x3c22  C54RU
+product CONCEPTRONIC2 RT3070_1 0x3c08  RT3070
+product CONCEPTRONIC2 RT3070_2 0x3c11  RT3070
 product CONCEPTRONIC2 VIGORN61 0x3c25  VIGORN61
 product CONCEPTRONIC2 RT2870_1 0x3c06  RT2870
 product CONCEPTRONIC2 RT2870_2 0x3c07  RT2870
@@ -1326,12 +1344,14 @@ product DLINK2 DWA111   0x3c06  DWA-111
 product DLINK2 RT2870_10x3c09  RT2870
 product DLINK2 DWA110  0x3c07  DWA-110
 product DLINK2 RT3072

Re: svn commit: r205026 - head/sys/dev/usb

2010-03-11 Thread Alexander Best
thanks. this fixes building the kernel with USB_VERBOSE [1].

[1] http://www.mail-archive.com/freebsd-...@freebsd.org/msg06581.html
___
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: r205040 - head/sys/dev/usb/input

2010-03-11 Thread Andrew Thompson
Author: thompsa
Date: Thu Mar 11 21:57:01 2010
New Revision: 205040
URL: http://svn.freebsd.org/changeset/base/205040

Log:
  extend search for Apple Function Key.
  
  PR:   usb/144414
  Submitted by: Hans Petter Selasky

Modified:
  head/sys/dev/usb/input/ukbd.c

Modified: head/sys/dev/usb/input/ukbd.c
==
--- head/sys/dev/usb/input/ukbd.c   Thu Mar 11 21:55:25 2010
(r205039)
+++ head/sys/dev/usb/input/ukbd.c   Thu Mar 11 21:57:01 2010
(r205040)
@@ -876,28 +876,33 @@ ukbd_attach(device_t dev)
err = usbd_req_get_hid_desc(uaa->device, NULL, &hid_ptr,
&hid_len, M_TEMP, uaa->info.bIfaceIndex);
if (err == 0) {
+   uint8_t apple_keys = 0;
uint8_t temp_id;
 
/* investigate if this is an Apple Keyboard */
if (hid_locate(hid_ptr, hid_len,
HID_USAGE2(HUP_CONSUMER, HUG_APPLE_EJECT),
hid_input, 0, &sc->sc_loc_apple_eject, &flags,
-   &sc->sc_kbd_id)) {
+   &temp_id)) {
if (flags & HIO_VARIABLE)
sc->sc_flags |= UKBD_FLAG_APPLE_EJECT | 
UKBD_FLAG_APPLE_SWAP;
-   if (hid_locate(hid_ptr, hid_len,
-   HID_USAGE2(0x, 0x0003),
-   hid_input, 0, &sc->sc_loc_apple_fn, &flags,
-   &temp_id)) {
-   if (flags & HIO_VARIABLE)
-   sc->sc_flags |= UKBD_FLAG_APPLE_FN |
-   UKBD_FLAG_APPLE_SWAP;
-   if (temp_id != sc->sc_kbd_id) {
-   DPRINTF("HID IDs mismatch\n");
-   }
-   }
-   } else {
+   DPRINTFN(1, "Found Apple eject-key\n");
+   apple_keys = 1;
+   sc->sc_kbd_id = temp_id;
+   }
+   if (hid_locate(hid_ptr, hid_len,
+   HID_USAGE2(0x, 0x0003),
+   hid_input, 0, &sc->sc_loc_apple_fn, &flags,
+   &temp_id)) {
+   if (flags & HIO_VARIABLE)
+   sc->sc_flags |= UKBD_FLAG_APPLE_FN |
+   UKBD_FLAG_APPLE_SWAP;
+   DPRINTFN(1, "Found Apple FN-key\n");
+   apple_keys = 1;
+   sc->sc_kbd_id = temp_id;
+   }
+   if (apple_keys == 0) {
/* 
 * Assume the first HID ID contains the
 * keyboard data
___
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: r205039 - head/sys/dev/usb

2010-03-11 Thread Andrew Thompson
Author: thompsa
Date: Thu Mar 11 21:55:25 2010
New Revision: 205039
URL: http://svn.freebsd.org/changeset/base/205039

Log:
  Add new device ID for the SMC 2514HUB
  
  Submitted by: Alexander Best

Modified:
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsThu Mar 11 21:54:23 2010(r205038)
+++ head/sys/dev/usb/usbdevsThu Mar 11 21:55:25 2010(r205039)
@@ -2771,6 +2771,7 @@ product SMC 2202USB   0x0200  10/100 Ether
 product SMC 2206USB0x0201  EZ Connect USB Ethernet
 product SMC 2862WG 0xee13  EZ Connect Wireless Adapter
 product SMC2 2020HUB   0x2020  USB Hub
+product SMC2 2514HUB   0x2514  USB Hub
 product SMC3 2662WUSB  0xa002  2662W-AR Wireless
 
 /* SOHOware products */
___
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: r205038 - head/sys/dev/usb

2010-03-11 Thread Andrew Thompson
Author: thompsa
Date: Thu Mar 11 21:54:23 2010
New Revision: 205038
URL: http://svn.freebsd.org/changeset/base/205038

Log:
  add new vendor ID for APACER
  
  Submitted by: Paul B Mahol

Modified:
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsThu Mar 11 21:54:09 2010(r205037)
+++ head/sys/dev/usb/usbdevsThu Mar 11 21:54:23 2010(r205038)
@@ -538,6 +538,7 @@ vendor FALCOM   0x0f94  Falcom Wireless Co
 vendor RIM 0x0fca  Research In Motion
 vendor DYNASTREAM  0x0fcf  Dynastream Innovations
 vendor QUALCOMM0x1004  Qualcomm
+vendor APACER  0x1005  Apacer
 vendor DESKNOTE0x1019  Desknote
 vendor GIGABYTE0x1044  GIGABYTE
 vendor WESTERN 0x1058  Western Digital
___
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: r205012 - head/sys/kern

2010-03-11 Thread Alexander Best
thanks. :)
___
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: r205036 - head/sys/dev/usb

2010-03-11 Thread Andrew Thompson
Author: thompsa
Date: Thu Mar 11 21:50:36 2010
New Revision: 205036
URL: http://svn.freebsd.org/changeset/base/205036

Log:
  Implement USB kernel driver detach from userland.
  
  Submitted by: Hans Petter Selasky

Modified:
  head/sys/dev/usb/usb_device.c
  head/sys/dev/usb/usb_device.h
  head/sys/dev/usb/usb_generic.c

Modified: head/sys/dev/usb/usb_device.c
==
--- head/sys/dev/usb/usb_device.c   Thu Mar 11 21:49:43 2010
(r205035)
+++ head/sys/dev/usb/usb_device.c   Thu Mar 11 21:50:36 2010
(r205036)
@@ -80,7 +80,6 @@
 static voidusb_init_endpoint(struct usb_device *, uint8_t,
struct usb_endpoint_descriptor *, struct usb_endpoint *);
 static voidusb_unconfigure(struct usb_device *, uint8_t);
-static voidusb_detach_device(struct usb_device *, uint8_t, uint8_t);
 static voidusb_detach_device_sub(struct usb_device *, device_t *,
uint8_t);
 static uint8_t usb_probe_and_attach_sub(struct usb_device *,

Modified: head/sys/dev/usb/usb_device.h
==
--- head/sys/dev/usb/usb_device.h   Thu Mar 11 21:49:43 2010
(r205035)
+++ head/sys/dev/usb/usb_device.h   Thu Mar 11 21:50:36 2010
(r205036)
@@ -196,6 +196,7 @@ struct usb_device *usb_alloc_device(devi
enum usb_dev_speed speed, enum usb_hc_mode mode);
 usb_error_tusb_probe_and_attach(struct usb_device *udev,
uint8_t iface_index);
+void   usb_detach_device(struct usb_device *, uint8_t, uint8_t);
 usb_error_tusb_reset_iface_endpoints(struct usb_device *udev,
uint8_t iface_index);
 usb_error_tusbd_set_config_index(struct usb_device *udev, uint8_t index);

Modified: head/sys/dev/usb/usb_generic.c
==
--- head/sys/dev/usb/usb_generic.c  Thu Mar 11 21:49:43 2010
(r205035)
+++ head/sys/dev/usb/usb_generic.c  Thu Mar 11 21:50:36 2010
(r205036)
@@ -2095,17 +2095,32 @@ ugen_ioctl_post(struct usb_fifo *f, u_lo
break;
 
case USB_IFACE_DRIVER_ACTIVE:
-   /* TODO */
-   *u.pint = 0;
+
+   n = *u.pint & 0xFF;
+
+   iface = usbd_get_iface(f->udev, n);
+
+   if (iface && iface->subdev)
+   error = 0;
+   else
+   error = ENXIO;
break;
 
case USB_IFACE_DRIVER_DETACH:
-   /* TODO */
+
error = priv_check(curthread, PRIV_DRIVER);
-   if (error) {
+
+   if (error)
+   break;
+
+   n = *u.pint & 0xFF;
+
+   if (n == USB_IFACE_INDEX_ANY) {
+   error = EINVAL;
break;
}
-   error = EINVAL;
+
+   usb_detach_device(f->udev, n, 0);
break;
 
case USB_SET_POWER_MODE:
___
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: r205035 - head/sys/dev/usb

2010-03-11 Thread Andrew Thompson
Author: thompsa
Date: Thu Mar 11 21:49:43 2010
New Revision: 205035
URL: http://svn.freebsd.org/changeset/base/205035

Log:
  Make sure there is a way to reset the endpoint FIFO on transfer errors for
  ISOCHRONOUS transfers
  
  Submitted by: Hans Petter Selasky

Modified:
  head/sys/dev/usb/usb_transfer.c

Modified: head/sys/dev/usb/usb_transfer.c
==
--- head/sys/dev/usb/usb_transfer.c Thu Mar 11 21:49:00 2010
(r205034)
+++ head/sys/dev/usb/usb_transfer.c Thu Mar 11 21:49:43 2010
(r205035)
@@ -2410,21 +2410,24 @@ usbd_pipe_start(struct usb_xfer_queue *p
 * Check if we are supposed to stall the endpoint:
 */
if (xfer->flags.stall_pipe) {
+   struct usb_device *udev;
+   struct usb_xfer_root *info;
+
/* clear stall command */
xfer->flags.stall_pipe = 0;
 
+   /* get pointer to USB device */
+   info = xfer->xroot;
+   udev = info->udev;
+
/*
 * Only stall BULK and INTERRUPT endpoints.
 */
type = (ep->edesc->bmAttributes & UE_XFERTYPE);
if ((type == UE_BULK) ||
(type == UE_INTERRUPT)) {
-   struct usb_device *udev;
-   struct usb_xfer_root *info;
uint8_t did_stall;
 
-   info = xfer->xroot;
-   udev = info->udev;
did_stall = 1;
 
if (udev->flags.usb_mode == USB_MODE_DEVICE) {
@@ -2452,6 +2455,17 @@ usbd_pipe_start(struct usb_xfer_queue *p
ep->is_stalled = 1;
return;
}
+   } else if (type == UE_ISOCHRONOUS) {
+
+   /* 
+* Make sure any FIFO overflow or other FIFO
+* error conditions go away by resetting the
+* endpoint FIFO through the clear stall
+* method.
+*/
+   if (udev->flags.usb_mode == USB_MODE_DEVICE) {
+   (udev->bus->methods->clear_stall) (udev, ep);
+   }
}
}
/* Set or clear stall complete - special case */
___
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: r205034 - head/sys/dev/usb/controller

2010-03-11 Thread Andrew Thompson
Author: thompsa
Date: Thu Mar 11 21:49:00 2010
New Revision: 205034
URL: http://svn.freebsd.org/changeset/base/205034

Log:
  For USS820 driver we need to manually reset TX FIFO at each SETUP transaction
  because the chip doesn't do this by itself.
  
  Submitted by: Hans Petter Selasky

Modified:
  head/sys/dev/usb/controller/uss820dci.c

Modified: head/sys/dev/usb/controller/uss820dci.c
==
--- head/sys/dev/usb/controller/uss820dci.c Thu Mar 11 21:48:10 2010
(r205033)
+++ head/sys/dev/usb/controller/uss820dci.c Thu Mar 11 21:49:00 2010
(r205034)
@@ -333,6 +333,14 @@ uss820dci_setup_rx(struct uss820dci_td *
} else {
sc->sc_dv_addr = 0xFF;
}
+
+   /* reset TX FIFO */
+   temp = USS820_READ_1(sc, USS820_TXCON);
+   temp |= USS820_TXCON_TXCLR;
+   USS820_WRITE_1(sc, USS820_TXCON, temp);
+   temp &= ~USS820_TXCON_TXCLR;
+   USS820_WRITE_1(sc, USS820_TXCON, temp);
+
return (0); /* complete */
 
 setup_not_complete:
___
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: r205033 - head/sys/dev/usb/template

2010-03-11 Thread Andrew Thompson
Author: thompsa
Date: Thu Mar 11 21:48:10 2010
New Revision: 205033
URL: http://svn.freebsd.org/changeset/base/205033

Log:
  isochronous endpoint descriptors should have two more bytes which are zero by
  default.
  
  Submitted by: Hans Petter Selasky

Modified:
  head/sys/dev/usb/template/usb_template.c

Modified: head/sys/dev/usb/template/usb_template.c
==
--- head/sys/dev/usb/template/usb_template.cThu Mar 11 21:47:25 2010
(r205032)
+++ head/sys/dev/usb/template/usb_template.cThu Mar 11 21:48:10 2010
(r205033)
@@ -162,15 +162,23 @@ usb_make_endpoint_desc(struct usb_temp_s
const void **rd;
uint16_t old_size;
uint16_t mps;
-   uint8_t ea = 0; /* Endpoint Address */
-   uint8_t et = 0; /* Endpiont Type */
+   uint8_t ea; /* Endpoint Address */
+   uint8_t et; /* Endpiont Type */
 
/* Reserve memory */
old_size = temp->size;
-   temp->size += sizeof(*ed);
 
-   /* Scan all Raw Descriptors first */
+   ea = (ted->bEndpointAddress & (UE_ADDR | UE_DIR_IN | UE_DIR_OUT));
+   et = (ted->bmAttributes & UE_XFERTYPE);
+
+   if (et == UE_ISOCHRONOUS) {
+   /* account for extra byte fields */
+   temp->size += sizeof(*ed) + 2;
+   } else {
+   temp->size += sizeof(*ed);
+   }
 
+   /* Scan all Raw Descriptors first */
rd = ted->ppRawDesc;
if (rd) {
while (*rd) {
@@ -192,8 +200,6 @@ usb_make_endpoint_desc(struct usb_temp_s
/* escape for Zero Max Packet Size */
mps = 0;
}
-   ea = (ted->bEndpointAddress & (UE_ADDR | UE_DIR_IN | UE_DIR_OUT));
-   et = (ted->bmAttributes & UE_XFERTYPE);
 
/*
 * Fill out the real USB endpoint descriptor
@@ -201,7 +207,10 @@ usb_make_endpoint_desc(struct usb_temp_s
 */
if (temp->buf) {
ed = USB_ADD_BYTES(temp->buf, old_size);
-   ed->bLength = sizeof(*ed);
+   if (et == UE_ISOCHRONOUS)
+   ed->bLength = sizeof(*ed) + 2;
+   else
+   ed->bLength = sizeof(*ed);
ed->bDescriptorType = UDESC_ENDPOINT;
ed->bEndpointAddress = ea;
ed->bmAttributes = ted->bmAttributes;
___
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: r205032 - in head/sys/dev/usb: . serial

2010-03-11 Thread Andrew Thompson
Author: thompsa
Date: Thu Mar 11 21:47:25 2010
New Revision: 205032
URL: http://svn.freebsd.org/changeset/base/205032

Log:
  Add new uvisor(4) device ID.
  
  PR:   usb/144201

Modified:
  head/sys/dev/usb/serial/uvisor.c
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/serial/uvisor.c
==
--- head/sys/dev/usb/serial/uvisor.cThu Mar 11 21:46:33 2010
(r205031)
+++ head/sys/dev/usb/serial/uvisor.cThu Mar 11 21:47:25 2010
(r205032)
@@ -256,6 +256,7 @@ MODULE_DEPEND(uvisor, usb, 1, 1, 1);
 static const struct usb_device_id uvisor_devs[] = {
 #defineUVISOR_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, 
USB_PRODUCT_##v##_##p, i) }
UVISOR_DEV(ACEECA, MEZ1000, UVISOR_FLAG_PALM4),
+   UVISOR_DEV(ALPHASMART, DANA_SYNC, UVISOR_FLAG_PALM4),
UVISOR_DEV(GARMIN, IQUE_3600, UVISOR_FLAG_PALM4),
UVISOR_DEV(FOSSIL, WRISTPDA, UVISOR_FLAG_PALM4),
UVISOR_DEV(HANDSPRING, VISOR, UVISOR_FLAG_VISOR),

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsThu Mar 11 21:46:33 2010(r205031)
+++ head/sys/dev/usb/usbdevsThu Mar 11 21:47:25 2010(r205032)
@@ -400,6 +400,7 @@ vendor STSN 0x07ef  STSN
 vendor CENTURY 0x07f7  Century Corp
 vendor ZOOM0x0803  Zoom Telephonics
 vendor PCS 0x0810  Personal Communication Systems
+vendor ALPHASMART  0x081e  AlphaSmart, Inc.
 vendor BROADLOGIC  0x0827  BroadLogic
 vendor HANDSPRING  0x082d  Handspring
 vendor PALM0x0830  Palm Computing
@@ -885,6 +886,10 @@ product ALTEC ASC495   0xff05  ASC495 Spea
 /* Allied Telesyn International products */
 product ALLIEDTELESYN ATUSB100 0xb100  AT-USB100
 
+/* AlphaSmart, Inc. products */
+product ALPHASMART DANA_KB 0xdbac  AlphaSmart Dana Keyboard
+product ALPHASMART DANA_SYNC   0xdf00  AlphaSmart Dana HotSync
+
 /* Amoi products */
 product AMOI H01   0x0800  H01 3G modem
 product AMOI H01A  0x7002  H01A 3G modem
___
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: r205031 - head/sys/dev/usb/serial

2010-03-11 Thread Andrew Thompson
Author: thompsa
Date: Thu Mar 11 21:46:33 2010
New Revision: 205031
URL: http://svn.freebsd.org/changeset/base/205031

Log:
  It appears that some UVISOR devices do not handle when the clear stall command
  is issued at the beginning of the initial IN/OUT data transfers.  Reason
  unknown, probably firmware fault. Now the stall is only cleared on data
  transfer errors.
  
  PR:   usb/144199
  Submitted by: Hans Petter Selasky

Modified:
  head/sys/dev/usb/serial/uvisor.c

Modified: head/sys/dev/usb/serial/uvisor.c
==
--- head/sys/dev/usb/serial/uvisor.cThu Mar 11 21:45:31 2010
(r205030)
+++ head/sys/dev/usb/serial/uvisor.cThu Mar 11 21:46:33 2010
(r205031)
@@ -338,11 +338,6 @@ uvisor_attach(device_t dev)
DPRINTF("could not allocate all pipes\n");
goto detach;
}
-   /* clear stall at first run */
-   mtx_lock(&sc->sc_mtx);
-   usbd_xfer_set_stall(sc->sc_xfer[UVISOR_BULK_DT_WR]);
-   usbd_xfer_set_stall(sc->sc_xfer[UVISOR_BULK_DT_RD]);
-   mtx_unlock(&sc->sc_mtx);
 
error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc,
&uvisor_callback, &sc->sc_mtx);
___
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: r205030 - head/sys/dev/usb/template

2010-03-11 Thread Andrew Thompson
Author: thompsa
Date: Thu Mar 11 21:45:31 2010
New Revision: 205030
URL: http://svn.freebsd.org/changeset/base/205030

Log:
  - make the usb_temp_setup() and usb_temp_unsetup() functions public so that
other modules can generate USB descriptors.
  - extend the vendor specific request function by one length pointer argument,
because not all descriptors store the length in the first byte. For example
HID descriptors.
  
  Submitted by: Hans Petter Selasky

Modified:
  head/sys/dev/usb/template/usb_template.c
  head/sys/dev/usb/template/usb_template.h
  head/sys/dev/usb/template/usb_template_mtp.c

Modified: head/sys/dev/usb/template/usb_template.c
==
--- head/sys/dev/usb/template/usb_template.cThu Mar 11 21:42:09 2010
(r205029)
+++ head/sys/dev/usb/template/usb_template.cThu Mar 11 21:45:31 2010
(r205030)
@@ -98,13 +98,10 @@ static void *usb_temp_get_config_desc(st
 static const void *usb_temp_get_string_desc(struct usb_device *, uint16_t,
uint8_t);
 static const void *usb_temp_get_vendor_desc(struct usb_device *,
-   const struct usb_device_request *);
+   const struct usb_device_request *, uint16_t *plen);
 static const void *usb_temp_get_hub_desc(struct usb_device *);
 static usb_error_t usb_temp_get_desc(struct usb_device *,
struct usb_device_request *, const void **, uint16_t *);
-static usb_error_t usb_temp_setup(struct usb_device *,
-   const struct usb_temp_device_desc *);
-static voidusb_temp_unsetup(struct usb_device *);
 static usb_error_t usb_temp_setup_by_index(struct usb_device *,
uint16_t index);
 static voidusb_temp_init(void *);
@@ -1035,7 +1032,7 @@ usb_temp_get_config_desc(struct usb_devi
  **/
 static const void *
 usb_temp_get_vendor_desc(struct usb_device *udev,
-const struct usb_device_request *req)
+const struct usb_device_request *req, uint16_t *plen)
 {
const struct usb_temp_device_desc *tdd;
 
@@ -1046,7 +1043,7 @@ usb_temp_get_vendor_desc(struct usb_devi
if (tdd->getVendorDesc == NULL) {
return (NULL);
}
-   return ((tdd->getVendorDesc) (req));
+   return ((tdd->getVendorDesc) (req, plen));
 }
 
 /**
@@ -1109,7 +1106,6 @@ usb_temp_get_desc(struct usb_device *ude
default:
goto tr_stalled;
}
-   break;
case UT_READ_CLASS_DEVICE:
switch (req->bRequest) {
case UR_GET_DESCRIPTOR:
@@ -1117,11 +1113,6 @@ usb_temp_get_desc(struct usb_device *ude
default:
goto tr_stalled;
}
-   break;
-   case UT_READ_VENDOR_DEVICE:
-   case UT_READ_VENDOR_OTHER:
-   buf = usb_temp_get_vendor_desc(udev, req);
-   goto tr_valid;
default:
goto tr_stalled;
}
@@ -1158,7 +1149,6 @@ tr_handle_get_descriptor:
default:
goto tr_stalled;
}
-   goto tr_stalled;
 
 tr_handle_get_class_descriptor:
if (req->wValue[0]) {
@@ -1168,17 +1158,20 @@ tr_handle_get_class_descriptor:
goto tr_valid;
 
 tr_valid:
-   if (buf == NULL) {
+   if (buf == NULL)
goto tr_stalled;
-   }
-   if (len == 0) {
+   if (len == 0)
len = buf[0];
-   }
*pPtr = buf;
*pLength = len;
return (0); /* success */
 
 tr_stalled:
+   /* try to get a vendor specific descriptor */
+   len = 0;
+   buf = usb_temp_get_vendor_desc(udev, req, &len);
+   if (buf != NULL)
+   goto tr_valid;
*pPtr = NULL;
*pLength = 0;
return (0); /* we ignore failures */
@@ -1195,7 +1188,7 @@ tr_stalled:
  *0: Success
  * Else: Failure
  **/
-static usb_error_t
+usb_error_t
 usb_temp_setup(struct usb_device *udev,
 const struct usb_temp_device_desc *tdd)
 {
@@ -1285,7 +1278,7 @@ error:
  * This function frees any memory associated with the currently
  * setup template, if any.
  **/
-static void
+void
 usb_temp_unsetup(struct usb_device *udev)
 {
if (udev->usb_template_ptr) {

Modified: head/sys/dev/usb/template/usb_template.h
==
--- head/sys/dev/usb/template/usb_template.hThu Mar 11 21:42:09 2010
(r205029)
+++ head/sys/dev/usb/template/usb_template.hThu Mar 11 21:45:31 2010
(r205030)
@@ -31,7 +31,7 @@
 #define_USB_TEMPLATE_H_
 
 typedef const void *(usb_temp_get_string_desc

svn commit: r205029 - head/sys/dev/usb/serial

2010-03-11 Thread Andrew Thompson
Author: thompsa
Date: Thu Mar 11 21:42:09 2010
New Revision: 205029
URL: http://svn.freebsd.org/changeset/base/205029

Log:
  Use wMaxPacketSize for the uftdi input buffer size.
  
  Submitted by: Hans Petter Selasky

Modified:
  head/sys/dev/usb/serial/uftdi.c

Modified: head/sys/dev/usb/serial/uftdi.c
==
--- head/sys/dev/usb/serial/uftdi.c Thu Mar 11 21:16:54 2010
(r205028)
+++ head/sys/dev/usb/serial/uftdi.c Thu Mar 11 21:42:09 2010
(r205029)
@@ -84,8 +84,6 @@ SYSCTL_INT(_hw_usb_uftdi, OID_AUTO, debu
 #defineUFTDI_CONFIG_INDEX  0
 #defineUFTDI_IFACE_INDEX   0
 
-#defineUFTDI_IBUFSIZE 64   /* bytes, maximum number of 
bytes per
-* frame */
 #defineUFTDI_OBUFSIZE 64   /* bytes, cannot be increased 
due to
 * do size encoding */
 
@@ -166,7 +164,7 @@ static const struct usb_config uftdi_con
.type = UE_BULK,
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_IN,
-   .bufsize = UFTDI_IBUFSIZE,
+   .bufsize = 0,   /* use wMaxPacketSize */
.flags = {.pipe_bof = 1,.short_xfer_ok = 1,},
.callback = &uftdi_read_callback,
},
___
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: r205024 - head/sys/net

2010-03-11 Thread Robert Watson


On Thu, 11 Mar 2010, Qing Li wrote:


 The if_tap interface is of IFT_ETHERNET type, but it
 does not set or update the if_link_state variable.
 As such RT_LINK_IS_UP() fails for the if_tap interface.

 Also, the RT_LINK_IS_UP() needs to bypass all loopback
 interfaces because loopback interfaces are considered
 up logically as long as the system is running.

 This patch fixes the above issues by setting and updating
 the if_link_state variable when the tap interface is
 opened or closed respectively. Similary approach is
 already done in the if_tun device.


A couple of questions:

(1) It used to be the case that quite a few interface drivers and types didn't
have a notion of "link up" -- especially older ethernet devices.  Do those
all have the same problem?  It was probably a design oversight that
devices don't declare an explicit capability for "can report link state".

(2) While loopback interfaces don't really have a link state, they can be
administratively down -- should/do you check that as well as link state?
And more generally, even if link is up, administratively down should be
obeyed?

Finally, it would be neat if there were a way to have information beyond link 
state influence the choice to balance to a particular route/interface.  For 
example, imagine if I have a router with ECMP, and on the other side on a 
single ethernet segment, I have two DSL modems.  The ethernet link will remain 
up, but I may (via out-of-band mechanisms, such as SNMP or an active probe) be 
able to tell that one of the DSL lines is down.  Is there a way to push that 
information into the kernel currently without deleting the routes, and instead 
say "yeah, but for ECMP purposes this is 'down'"?


Robert
___
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: r205028 - head/sys/arm/arm

2010-03-11 Thread Rafal Jaworowski
Author: raj
Date: Thu Mar 11 21:16:54 2010
New Revision: 205028
URL: http://svn.freebsd.org/changeset/base/205028

Log:
  Fix ARM cache handling yet more.
  
  1) vm_machdep.c: remove the dangling allocations so they do not
 un-necessarily turn off the cache upon consecutive access.
  
  2) busdma_machdep.c: remove the same amount than shadow mapped.
  
  Reported by:  Maks Verver
  Submitted by: Mark Tinguely
  Reviewed by:  Grzegorz Bernacki
  MFC after:3 days

Modified:
  head/sys/arm/arm/busdma_machdep.c
  head/sys/arm/arm/vm_machdep.c

Modified: head/sys/arm/arm/busdma_machdep.c
==
--- head/sys/arm/arm/busdma_machdep.c   Thu Mar 11 21:04:29 2010
(r205027)
+++ head/sys/arm/arm/busdma_machdep.c   Thu Mar 11 21:16:54 2010
(r205028)
@@ -649,7 +649,8 @@ bus_dmamem_free(bus_dma_tag_t dmat, void
KASSERT(map->allocbuffer == vaddr,
("Trying to freeing the wrong DMA buffer"));
vaddr = map->origbuffer;
-   arm_unmap_nocache(map->allocbuffer, dmat->maxsize);
+   arm_unmap_nocache(map->allocbuffer,
+   dmat->maxsize + ((vm_offset_t)vaddr & PAGE_MASK));
}
 if (dmat->maxsize <= PAGE_SIZE &&
   dmat->alignment < dmat->maxsize &&

Modified: head/sys/arm/arm/vm_machdep.c
==
--- head/sys/arm/arm/vm_machdep.c   Thu Mar 11 21:04:29 2010
(r205027)
+++ head/sys/arm/arm/vm_machdep.c   Thu Mar 11 21:16:54 2010
(r205028)
@@ -171,6 +171,9 @@ sf_buf_free(struct sf_buf *sf)
 if (sf->ref_count == 0) {
 TAILQ_INSERT_TAIL(&sf_buf_freelist, sf, free_entry);
 nsfbufsused--;
+pmap_kremove(sf->kva);
+sf->m = NULL;
+LIST_REMOVE(sf, list_entry);
 if (sf_buf_alloc_want > 0)
 wakeup_one(&sf_buf_freelist);
 }
@@ -502,9 +505,12 @@ arm_unmap_nocache(void *addr, vm_size_t 
 
size = round_page(size);
i = (raddr - arm_nocache_startaddr) / (PAGE_SIZE);
-   for (; size > 0; size -= PAGE_SIZE, i++)
+   for (; size > 0; size -= PAGE_SIZE, i++) {
arm_nocache_allocated[i / BITS_PER_INT] &= ~(1 << (i % 
BITS_PER_INT));
+   pmap_kremove(raddr);
+   raddr += PAGE_SIZE;
+   }
 }
 
 #ifdef ARM_USE_SMALL_ALLOC
___
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: r205027 - head/sys/arm/arm

2010-03-11 Thread Rafal Jaworowski
Author: raj
Date: Thu Mar 11 21:04:29 2010
New Revision: 205027
URL: http://svn.freebsd.org/changeset/base/205027

Log:
  Let detailed info about CPU features print on Marvell Sheeva CPU as well.
  
  Provide missing entry in the cpu_classes[].
  
  Reported by:  Maks Verver
  MFC after:1 week

Modified:
  head/sys/arm/arm/identcpu.c

Modified: head/sys/arm/arm/identcpu.c
==
--- head/sys/arm/arm/identcpu.c Thu Mar 11 20:41:21 2010(r205026)
+++ head/sys/arm/arm/identcpu.c Thu Mar 11 21:04:29 2010(r205027)
@@ -329,6 +329,7 @@ const struct cpu_classtab cpu_classes[] 
{ "SA-1",   "CPU_SA110" },  /* CPU_CLASS_SA1 */
{ "XScale", "CPU_XSCALE_..." }, /* CPU_CLASS_XSCALE */
{ "ARM11J", "CPU_ARM11" },  /* CPU_CLASS_ARM11J */
+   { "Marvell","CPU_MARVELL" },/* CPU_CLASS_MARVELL */
 };
 
 /*
@@ -404,6 +405,7 @@ identify_arm_cpu(void)
case CPU_CLASS_SA1:
case CPU_CLASS_XSCALE:
case CPU_CLASS_ARM11J:
+   case CPU_CLASS_MARVELL:
if ((ctrl & CPU_CONTROL_DC_ENABLE) == 0)
printf(" DC disabled");
else
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r205026 - head/sys/dev/usb

2010-03-11 Thread Andrew Thompson
Author: thompsa
Date: Thu Mar 11 20:41:21 2010
New Revision: 205026
URL: http://svn.freebsd.org/changeset/base/205026

Log:
  Reapply r185998 which was overwritten at some point.

Modified:
  head/sys/dev/usb/usbdevs

Modified: head/sys/dev/usb/usbdevs
==
--- head/sys/dev/usb/usbdevsThu Mar 11 20:32:28 2010(r205025)
+++ head/sys/dev/usb/usbdevsThu Mar 11 20:41:21 2010(r205026)
@@ -2003,9 +2003,6 @@ product MSI RT3070_7  0x899a  RT3070
 product MSI RT2573_3   0xa861  RT2573
 product MSI RT2573_4   0xa874  RT2573
 
-/* Microdia products */
-product MICRODIA TWINKLECAM0x600d  TwinkleCam USB camera
-
 /* Microsoft products */
 product MICROSOFT SIDEPREC 0x0008  SideWinder Precision Pro
 product MICROSOFT INTELLIMOUSE 0x0009  IntelliMouse
___
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: r205013 - in head/sys: amd64/amd64 i386/i386

2010-03-11 Thread John Baldwin
On Thursday 11 March 2010 12:01:28 pm Alexander Best wrote:
> thanks for the commit. :)
> 
> a few thoughts:
> 
> 1) why does stepping remain to be printed in dec while family and model are in
> hex? is this the way amd/intel cpu docs refer to stepping/model/family?

I just left it the way it was.

> 2) the hex value for "Id" and "(AMD) Features(2)" gets printed with an "0x"
> prepended to indicate it's in hex. maybe this should also be the case here.

Because on a typical Intel system you overflow 80 cols if you do that. :(
Otherwise I would have.  We could maybe add an 'h' suffix as that is what
the manuals and it would only add 2 chars rather than 4.

-- 
John Baldwin
___
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: r205024 - head/sys/net

2010-03-11 Thread Qing Li
Author: qingli
Date: Thu Mar 11 17:56:46 2010
New Revision: 205024
URL: http://svn.freebsd.org/changeset/base/205024

Log:
  The if_tap interface is of IFT_ETHERNET type, but it
  does not set or update the if_link_state variable.
  As such RT_LINK_IS_UP() fails for the if_tap interface.
  
  Also, the RT_LINK_IS_UP() needs to bypass all loopback
  interfaces because loopback interfaces are considered
  up logically as long as the system is running.
  
  This patch fixes the above issues by setting and updating
  the if_link_state variable when the tap interface is
  opened or closed respectively. Similary approach is
  already done in the if_tun device.
  
  MFC after:3 days

Modified:
  head/sys/net/if_tap.c
  head/sys/net/route.h

Modified: head/sys/net/if_tap.c
==
--- head/sys/net/if_tap.c   Thu Mar 11 17:15:40 2010(r205023)
+++ head/sys/net/if_tap.c   Thu Mar 11 17:56:46 2010(r205024)
@@ -502,6 +502,7 @@ tapopen(struct cdev *dev, int flag, int 
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
if (tapuponopen)
ifp->if_flags |= IFF_UP;
+   if_link_state_change(ifp, LINK_STATE_UP);
splx(s);
 
TAPDEBUG("%s is open. minor = %#x\n", ifp->if_xname, dev2unit(dev));
@@ -547,6 +548,7 @@ tapclose(struct cdev *dev, int foo, int 
} else
mtx_unlock(&tp->tap_mtx);
 
+   if_link_state_change(ifp, LINK_STATE_DOWN);
funsetown(&tp->tap_sigio);
selwakeuppri(&tp->tap_rsel, PZERO+1);
KNOTE_UNLOCKED(&tp->tap_rsel.si_note, 0);

Modified: head/sys/net/route.h
==
--- head/sys/net/route.hThu Mar 11 17:15:40 2010(r205023)
+++ head/sys/net/route.hThu Mar 11 17:56:46 2010(r205024)
@@ -319,7 +319,9 @@ struct rt_addrinfo {
 
 #ifdef _KERNEL
 
-#define RT_LINK_IS_UP(ifp) ((ifp)->if_link_state == LINK_STATE_UP)
+#define RT_LINK_IS_UP(ifp) (((ifp)->if_flags & \
+ (IFF_LOOPBACK | IFF_POINTOPOINT)) \
+|| (ifp)->if_link_state == LINK_STATE_UP)
 
 #defineRT_LOCK_INIT(_rt) \
mtx_init(&(_rt)->rt_mtx, "rtentry", NULL, MTX_DEF | MTX_DUPOK)
___
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: r205013 - in head/sys: amd64/amd64 i386/i386

2010-03-11 Thread John Baldwin
On Thursday 11 March 2010 12:01:28 pm Alexander Best wrote:
> thanks for the commit. :)
> 
> a few thoughts:
> 
> 1) why does stepping remain to be printed in dec while family and model are 
in
> hex? is this the way amd/intel cpu docs refer to stepping/model/family?
> 2) the hex value for "Id" and "(AMD) Features(2)" gets printed with an "0x"
> prepended to indicate it's in hex. maybe this should also be the case here.
> 
> cheers.
> alex
> 

-- 
John Baldwin
___
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: r205023 - stable/8/sys/dev/iwn

2010-03-11 Thread Bernhard Schmidt
Author: bschmidt
Date: Thu Mar 11 17:15:40 2010
New Revision: 205023
URL: http://svn.freebsd.org/changeset/base/205023

Log:
  MFC r203934:
  Fix for the Intel WiFi Link 1000.  The EEPROM image is in the OTPROM block
  before the last block, not in the last block itself.
  
  Approved by:  rpaulo (mentor)
  Obtained from:OpenBSD

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

Modified: stable/8/sys/dev/iwn/if_iwn.c
==
--- stable/8/sys/dev/iwn/if_iwn.c   Thu Mar 11 17:11:07 2010
(r205022)
+++ stable/8/sys/dev/iwn/if_iwn.c   Thu Mar 11 17:15:40 2010
(r205023)
@@ -972,8 +972,7 @@ iwn_eeprom_unlock(struct iwn_softc *sc)
 int
 iwn_init_otprom(struct iwn_softc *sc)
 {
-   uint32_t base;
-   uint16_t next;
+   uint16_t prev, base, next;
int count, error;
 
/* Wait for clock stabilization before accessing prph. */
@@ -1000,25 +999,26 @@ iwn_init_otprom(struct iwn_softc *sc)
IWN_OTP_GP_ECC_CORR_STTS | IWN_OTP_GP_ECC_UNCORR_STTS);
 
/*
-* Find last valid OTP block (contains the EEPROM image) for HW
-* without OTP shadow RAM.
+* Find the block before last block (contains the EEPROM image)
+* for HW without OTP shadow RAM.
 */
if (sc->hw_type == IWN_HW_REV_TYPE_1000) {
/* Switch to absolute addressing mode. */
IWN_CLRBITS(sc, IWN_OTP_GP, IWN_OTP_GP_RELATIVE_ACCESS);
-   base = 0;
+   base = prev = 0;
for (count = 0; count < IWN1000_OTP_NBLOCKS; count++) {
error = iwn_read_prom_data(sc, base, &next, 2);
if (error != 0)
return error;
if (next == 0)  /* End of linked-list. */
break;
+   prev = base;
base = le16toh(next);
}
-   if (base == 0 || count == IWN1000_OTP_NBLOCKS)
+   if (count == 0 || count == IWN1000_OTP_NBLOCKS)
return EIO;
/* Skip "next" word. */
-   sc->prom_base = base + 1;
+   sc->prom_base = prev + 1;
}
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: r205022 - stable/8/share/man/man9

2010-03-11 Thread Bernhard Schmidt
Author: bschmidt
Date: Thu Mar 11 17:11:07 2010
New Revision: 205022
URL: http://svn.freebsd.org/changeset/base/205022

Log:
  MFC r204213:
  Fix some typos.
  
  Approved by:  rpaulo (mentor)

Modified:
  stable/8/share/man/man9/ieee80211_scan.9
Directory Properties:
  stable/8/share/man/man9/   (props changed)

Modified: stable/8/share/man/man9/ieee80211_scan.9
==
--- stable/8/share/man/man9/ieee80211_scan.9Thu Mar 11 17:03:32 2010
(r205021)
+++ stable/8/share/man/man9/ieee80211_scan.9Thu Mar 11 17:11:07 2010
(r205022)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 4, 2009
+.Dd February 20, 2010
 .Dt IEEE80211_SCAN 9
 .Os
 .Sh NAME
@@ -177,8 +177,8 @@ Scanning is not tied to the
 state machine that governs vaps except for linkage to the
 .Dv IEEE80211_S_SCAN
 state.
-One one vap at a time may be scanning; this scheduling policy
-is handle in
+Only one vap at a time may be scanning; this scheduling policy
+is handled in
 .Fn ieee80211_new_state
 and is transparent to scanning code.
 .Pp
___
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: r205021 - head/lib/libc/stdio

2010-03-11 Thread John Baldwin
Author: jhb
Date: Thu Mar 11 17:03:32 2010
New Revision: 205021
URL: http://svn.freebsd.org/changeset/base/205021

Log:
  - Use an initializer macro to initialize fields in 'fake' FILE objects used
by *sprintf(), etc.
  - Explicitly initialize _fl_mutex to PTHREAD_MUTEX_INITIALIZER for all FILE
objects.  This is currently a nop on FreeBSD, but is import for other
platforms (or in the future) where PTHREAD_MUTEX_INITIALIZER is not simply
zero.
  
  PR:   threads/141198
  Reported by:  Jeremy Huddleston @ Apple
  MFC after:2 weeks

Modified:
  head/lib/libc/stdio/findfp.c
  head/lib/libc/stdio/local.h
  head/lib/libc/stdio/snprintf.c
  head/lib/libc/stdio/vasprintf.c
  head/lib/libc/stdio/vdprintf.c
  head/lib/libc/stdio/vfprintf.c
  head/lib/libc/stdio/vsnprintf.c
  head/lib/libc/stdio/vsprintf.c
  head/lib/libc/stdio/vsscanf.c
  head/lib/libc/stdio/vswprintf.c
  head/lib/libc/stdio/vswscanf.c
  head/lib/libc/stdio/xprintf.c

Modified: head/lib/libc/stdio/findfp.c
==
--- head/lib/libc/stdio/findfp.cThu Mar 11 16:58:15 2010
(r205020)
+++ head/lib/libc/stdio/findfp.cThu Mar 11 17:03:32 2010
(r205021)
@@ -61,6 +61,7 @@ int   __sdidinit;
._read = __sread,   \
._seek = __sseek,   \
._write = __swrite, \
+   ._fl_mutex = PTHREAD_MUTEX_INITIALIZER, \
 }
/* the usual - (stdin + stdout + stderr) */
 static FILE usual[FOPEN_MAX - 3];
@@ -96,7 +97,7 @@ moreglue(n)
int n;
 {
struct glue *g;
-   static FILE empty;
+   static FILE empty = { ._fl_mutex = PTHREAD_MUTEX_INITIALIZER };
FILE *p;
 
g = (struct glue *)malloc(sizeof(*g) + ALIGNBYTES + n * sizeof(FILE));
@@ -154,7 +155,7 @@ found:
fp->_ub._size = 0;
fp->_lb._base = NULL;   /* no line buffer */
fp->_lb._size = 0;
-/* fp->_lock = NULL; *//* once set always set (reused) */
+/* fp->_fl_mutex = NULL; */ /* once set always set (reused) */
fp->_orientation = 0;
memset(&fp->_mbstate, 0, sizeof(mbstate_t));
return (fp);

Modified: head/lib/libc/stdio/local.h
==
--- head/lib/libc/stdio/local.h Thu Mar 11 16:58:15 2010(r205020)
+++ head/lib/libc/stdio/local.h Thu Mar 11 17:03:32 2010(r205021)
@@ -110,6 +110,14 @@ extern int __sdidinit;
 }
 
 /*
+ * Structure initializations for 'fake' FILE objects.
+ */
+#defineFAKE_FILE { \
+   ._file = -1,\
+   ._fl_mutex = PTHREAD_MUTEX_INITIALIZER, \
+}
+
+/*
  * Set the orientation for a stream. If o > 0, the stream has wide-
  * orientation. If o < 0, the stream has byte-orientation.
  */

Modified: head/lib/libc/stdio/snprintf.c
==
--- head/lib/libc/stdio/snprintf.c  Thu Mar 11 16:58:15 2010
(r205020)
+++ head/lib/libc/stdio/snprintf.c  Thu Mar 11 17:03:32 2010
(r205021)
@@ -48,7 +48,7 @@ snprintf(char * __restrict str, size_t n
size_t on;
int ret;
va_list ap;
-   FILE f;
+   FILE f = FAKE_FILE;
 
on = n;
if (n != 0)
@@ -56,12 +56,9 @@ snprintf(char * __restrict str, size_t n
if (n > INT_MAX)
n = INT_MAX;
va_start(ap, fmt);
-   f._file = -1;
f._flags = __SWR | __SSTR;
f._bf._base = f._p = (unsigned char *)str;
f._bf._size = f._w = n;
-   f._orientation = 0;
-   memset(&f._mbstate, 0, sizeof(mbstate_t));
ret = __vfprintf(&f, fmt, ap);
if (on > 0)
*f._p = '\0';

Modified: head/lib/libc/stdio/vasprintf.c
==
--- head/lib/libc/stdio/vasprintf.c Thu Mar 11 16:58:15 2010
(r205020)
+++ head/lib/libc/stdio/vasprintf.c Thu Mar 11 17:03:32 2010
(r205021)
@@ -42,9 +42,8 @@ vasprintf(str, fmt, ap)
__va_list ap;
 {
int ret;
-   FILE f;
+   FILE f = FAKE_FILE;
 
-   f._file = -1;
f._flags = __SWR | __SSTR | __SALC;
f._bf._base = f._p = (unsigned char *)malloc(128);
if (f._bf._base == NULL) {
@@ -53,8 +52,6 @@ vasprintf(str, fmt, ap)
return (-1);
}
f._bf._size = f._w = 127;   /* Leave room for the NUL */
-   f._orientation = 0;
-   memset(&f._mbstate, 0, sizeof(mbstate_t));
ret = __vfprintf(&f, fmt, ap);
if (ret < 0) {
free(f._bf._base);

Modified: head/lib/libc/stdio/vdprintf.c
==
--- head/lib/libc/stdio/vdprintf.c  Thu Mar 11 16:58:15 2010
(r205020)
+++ head/lib/libc/stdio/vdprintf.c  Thu Mar 11 

Re: svn commit: r205013 - in head/sys: amd64/amd64 i386/i386

2010-03-11 Thread Alexander Best
thanks for the commit. :)

a few thoughts:

1) why does stepping remain to be printed in dec while family and model are in
hex? is this the way amd/intel cpu docs refer to stepping/model/family?
2) the hex value for "Id" and "(AMD) Features(2)" gets printed with an "0x"
prepended to indicate it's in hex. maybe this should also be the case here.

cheers.
alex
___
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: r205020 - head/lib/libc/rpc

2010-03-11 Thread John Baldwin
Author: jhb
Date: Thu Mar 11 16:58:15 2010
New Revision: 205020
URL: http://svn.freebsd.org/changeset/base/205020

Log:
  Fix a bug in the previous change: remove function-local definition of
  tcp_key and udp_key that shadows the global definition.
  
  PR:   threads/144558
  Submitted by: Sam Robb

Modified:
  head/lib/libc/rpc/rpc_generic.c

Modified: head/lib/libc/rpc/rpc_generic.c
==
--- head/lib/libc/rpc/rpc_generic.c Thu Mar 11 15:33:12 2010
(r205019)
+++ head/lib/libc/rpc/rpc_generic.c Thu Mar 11 16:58:15 2010
(r205020)
@@ -248,7 +248,6 @@ __rpc_getconfip(nettype)
static char *netid_udp_main;
struct netconfig *dummy;
int main_thread;
-   static thread_key_t tcp_key, udp_key;
 
if ((main_thread = thr_main())) {
netid_udp = netid_udp_main;
___
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: r205018 - head/sys/dev/pci

2010-03-11 Thread John Baldwin
Author: jhb
Date: Thu Mar 11 15:25:47 2010
New Revision: 205018
URL: http://svn.freebsd.org/changeset/base/205018

Log:
  Small whitespace fixes.

Modified:
  head/sys/dev/pci/vga_pci.c

Modified: head/sys/dev/pci/vga_pci.c
==
--- head/sys/dev/pci/vga_pci.c  Thu Mar 11 15:13:55 2010(r205017)
+++ head/sys/dev/pci/vga_pci.c  Thu Mar 11 15:25:47 2010(r205018)
@@ -232,7 +232,7 @@ vga_pci_read_config(device_t dev, device
 }
 
 static void
-vga_pci_write_config(device_t dev, device_t child, int reg, 
+vga_pci_write_config(device_t dev, device_t child, int reg,
 uint32_t val, int width)
 {
 
@@ -409,7 +409,6 @@ static device_method_t vga_pci_methods[]
DEVMETHOD(bus_write_ivar,   vga_pci_write_ivar),
DEVMETHOD(bus_setup_intr,   vga_pci_setup_intr),
DEVMETHOD(bus_teardown_intr,vga_pci_teardown_intr),
-
DEVMETHOD(bus_alloc_resource,   vga_pci_alloc_resource),
DEVMETHOD(bus_release_resource, vga_pci_release_resource),
DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
___
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: r205017 - head/sys/kern

2010-03-11 Thread John Baldwin
Author: jhb
Date: Thu Mar 11 15:13:55 2010
New Revision: 205017
URL: http://svn.freebsd.org/changeset/base/205017

Log:
  Style fixes.
  
  Submitted by: bde

Modified:
  head/sys/kern/kern_ktr.c

Modified: head/sys/kern/kern_ktr.c
==
--- head/sys/kern/kern_ktr.cThu Mar 11 14:56:59 2010(r205016)
+++ head/sys/kern/kern_ktr.cThu Mar 11 15:13:55 2010(r205017)
@@ -84,25 +84,25 @@ SYSCTL_NODE(_debug, OID_AUTO, ktr, CTLFL
 
 intktr_cpumask = KTR_CPUMASK;
 TUNABLE_INT("debug.ktr.cpumask", &ktr_cpumask);
-SYSCTL_INT(_debug_ktr, OID_AUTO, cpumask, CTLFLAG_RW, &ktr_cpumask, 0,
-"Bitmask of CPUs on which KTR logging is enabled.");
+SYSCTL_INT(_debug_ktr, OID_AUTO, cpumask, CTLFLAG_RW,
+&ktr_cpumask, 0, "Bitmask of CPUs on which KTR logging is enabled");
 
 intktr_mask = KTR_MASK;
 TUNABLE_INT("debug.ktr.mask", &ktr_mask);
-SYSCTL_INT(_debug_ktr, OID_AUTO, mask, CTLFLAG_RW, &ktr_mask, 0,
-"Bitmask of KTR event classes for which logging is enabled.");
+SYSCTL_INT(_debug_ktr, OID_AUTO, mask, CTLFLAG_RW,
+&ktr_mask, 0, "Bitmask of KTR event classes for which logging is enabled");
 
 intktr_compile = KTR_COMPILE;
-SYSCTL_INT(_debug_ktr, OID_AUTO, compile, CTLFLAG_RD, &ktr_compile, 0,
-"Bitmask of KTR event classes compiled into the kernel.");
+SYSCTL_INT(_debug_ktr, OID_AUTO, compile, CTLFLAG_RD,
+&ktr_compile, 0, "Bitmask of KTR event classes compiled into the kernel");
 
 intktr_entries = KTR_ENTRIES;
-SYSCTL_INT(_debug_ktr, OID_AUTO, entries, CTLFLAG_RD, &ktr_entries, 0,
-"Number of entries in the KTR buffer.");
+SYSCTL_INT(_debug_ktr, OID_AUTO, entries, CTLFLAG_RD,
+&ktr_entries, 0, "Number of entries in the KTR buffer");
 
 intktr_version = KTR_VERSION;
-SYSCTL_INT(_debug_ktr, OID_AUTO, version, CTLFLAG_RD, &ktr_version, 0,
-"Version of the KTR interface.");
+SYSCTL_INT(_debug_ktr, OID_AUTO, version, CTLFLAG_RD,
+&ktr_version, 0, "Version of the KTR interface");
 
 volatile int   ktr_idx = 0;
 struct ktr_entry ktr_buf[KTR_ENTRIES];
___
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: r205016 - head/sys/compat/freebsd32

2010-03-11 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Thu Mar 11 14:56:59 2010
New Revision: 205016
URL: http://svn.freebsd.org/changeset/base/205016

Log:
  Regen after big endian compatibility import.

Modified:
  head/sys/compat/freebsd32/freebsd32_proto.h
  head/sys/compat/freebsd32/freebsd32_syscall.h
  head/sys/compat/freebsd32/freebsd32_syscalls.c
  head/sys/compat/freebsd32/freebsd32_sysent.c

Modified: head/sys/compat/freebsd32/freebsd32_proto.h
==
--- head/sys/compat/freebsd32/freebsd32_proto.h Thu Mar 11 14:54:54 2010
(r205015)
+++ head/sys/compat/freebsd32/freebsd32_proto.h Thu Mar 11 14:56:59 2010
(r205016)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 203660 
2010-02-08 10:02:01Z ed 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 205014 
2010-03-11 14:49:06Z nwhitehorn 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_

Modified: head/sys/compat/freebsd32/freebsd32_syscall.h
==
--- head/sys/compat/freebsd32/freebsd32_syscall.h   Thu Mar 11 14:54:54 
2010(r205015)
+++ head/sys/compat/freebsd32/freebsd32_syscall.h   Thu Mar 11 14:56:59 
2010(r205016)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 203660 
2010-02-08 10:02:01Z ed 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 205014 
2010-03-11 14:49:06Z nwhitehorn 
  */
 
 #defineFREEBSD32_SYS_syscall   0

Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c
==
--- head/sys/compat/freebsd32/freebsd32_syscalls.c  Thu Mar 11 14:54:54 
2010(r205015)
+++ head/sys/compat/freebsd32/freebsd32_syscalls.c  Thu Mar 11 14:56:59 
2010(r205016)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 203660 
2010-02-08 10:02:01Z ed 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 205014 
2010-03-11 14:49:06Z nwhitehorn 
  */
 
 const char *freebsd32_syscallnames[] = {

Modified: head/sys/compat/freebsd32/freebsd32_sysent.c
==
--- head/sys/compat/freebsd32/freebsd32_sysent.cThu Mar 11 14:54:54 
2010(r205015)
+++ head/sys/compat/freebsd32/freebsd32_sysent.cThu Mar 11 14:56:59 
2010(r205016)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 203660 
2010-02-08 10:02:01Z ed 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 205014 
2010-03-11 14:49:06Z nwhitehorn 
  */
 
 #include "opt_compat.h"
___
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: r205015 - head/sys/ia64/conf

2010-03-11 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Thu Mar 11 14:54:54 2010
New Revision: 205015
URL: http://svn.freebsd.org/changeset/base/205015

Log:
  Accidentally committed test code. Remove it.
  
  Big pointy hat:   me

Modified:
  head/sys/ia64/conf/GENERIC

Modified: head/sys/ia64/conf/GENERIC
==
--- head/sys/ia64/conf/GENERIC  Thu Mar 11 14:49:06 2010(r205014)
+++ head/sys/ia64/conf/GENERIC  Thu Mar 11 14:54:54 2010(r205015)
@@ -28,7 +28,6 @@ makeoptions   DEBUG=-g# Build kernel with
 optionsAUDIT   # Security event auditing
 optionsCD9660  # ISO 9660 Filesystem
 optionsCOMPAT_43TTY# BSD 4.3 TTY compat (sgtty)
-optionsCOMPAT_FREEBSD32# Compatible with FreeBSD6
 optionsCOMPAT_FREEBSD6 # Compatible with FreeBSD6
 optionsCOMPAT_FREEBSD7 # Compatible with FreeBSD7
 optionsDDB # Support DDB
___
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: r205014 - in head: . sys/amd64/amd64 sys/amd64/conf sys/amd64/include sys/amd64/linux32 sys/compat/freebsd32 sys/compat/ia32 sys/conf sys/fs/procfs sys/ia64/conf sys/ia64/ia64 sys/ia64/...

2010-03-11 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Thu Mar 11 14:49:06 2010
New Revision: 205014
URL: http://svn.freebsd.org/changeset/base/205014

Log:
  Provide groundwork for 32-bit binary compatibility on non-x86 platforms,
  for upcoming 64-bit PowerPC and MIPS support. This renames the COMPAT_IA32
  option to COMPAT_FREEBSD32, removes some IA32-specific code from MI parts
  of the kernel and enhances the freebsd32 compatibility code to support
  big-endian platforms.
  
  Reviewed by:  kib, jhb

Modified:
  head/UPDATING
  head/sys/amd64/amd64/db_trace.c
  head/sys/amd64/amd64/exception.S
  head/sys/amd64/amd64/vm_machdep.c
  head/sys/amd64/conf/GENERIC
  head/sys/amd64/conf/NOTES
  head/sys/amd64/conf/XENHVM
  head/sys/amd64/include/elf.h
  head/sys/amd64/include/reg.h
  head/sys/amd64/linux32/linux32_sysvec.c
  head/sys/compat/freebsd32/freebsd32.h
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/compat/freebsd32/freebsd32_proto.h
  head/sys/compat/freebsd32/freebsd32_syscall.h
  head/sys/compat/freebsd32/freebsd32_syscalls.c
  head/sys/compat/freebsd32/freebsd32_sysent.c
  head/sys/compat/freebsd32/freebsd32_util.h
  head/sys/compat/freebsd32/syscalls.master
  head/sys/compat/ia32/ia32_reg.h
  head/sys/compat/ia32/ia32_sysvec.c
  head/sys/conf/files.amd64
  head/sys/conf/files.ia64
  head/sys/conf/options.amd64
  head/sys/conf/options.ia64
  head/sys/fs/procfs/procfs_dbregs.c
  head/sys/fs/procfs/procfs_fpregs.c
  head/sys/fs/procfs/procfs_ioctl.c
  head/sys/fs/procfs/procfs_map.c
  head/sys/fs/procfs/procfs_regs.c
  head/sys/ia64/conf/GENERIC
  head/sys/ia64/conf/NOTES
  head/sys/ia64/ia64/exception.S
  head/sys/ia64/ia64/genassym.c
  head/sys/ia64/ia64/machdep.c
  head/sys/ia64/include/elf.h
  head/sys/ia64/include/reg.h
  head/sys/kern/imgact_elf.c
  head/sys/kern/kern_jail.c
  head/sys/kern/kern_module.c
  head/sys/kern/kern_thr.c
  head/sys/kern/kern_umtx.c
  head/sys/kern/sys_generic.c
  head/sys/kern/sys_process.c
  head/sys/kern/uipc_socket.c
  head/sys/kern/vfs_aio.c
  head/sys/modules/linux/Makefile
  head/sys/modules/procfs/Makefile
  head/sys/sys/ptrace.h

Modified: head/UPDATING
==
--- head/UPDATING   Thu Mar 11 14:17:37 2010(r205013)
+++ head/UPDATING   Thu Mar 11 14:49:06 2010(r205014)
@@ -22,6 +22,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
machines to maximize performance.  (To disable malloc debugging, run
ln -s aj /etc/malloc.conf.)
 
+20100311:
+   The kernel option COMPAT_IA32 has been replaced with COMPAT_FREEBSD32
+   to allow 32-bit compatibility on non-x86 platforms. All kernel
+   configurations on amd64 and ia64 platforms using these options must
+   be modified accordingly.
+
 20100113:
The utmp user accounting database has been replaced with utmpx,
the user accounting interface standardized by POSIX.

Modified: head/sys/amd64/amd64/db_trace.c
==
--- head/sys/amd64/amd64/db_trace.c Thu Mar 11 14:17:37 2010
(r205013)
+++ head/sys/amd64/amd64/db_trace.c Thu Mar 11 14:49:06 2010
(r205014)
@@ -319,7 +319,7 @@ db_nextframe(struct amd64_frame **fp, db
frame_type = INTERRUPT;
else if (strcmp(name, "Xfast_syscall") == 0)
frame_type = SYSCALL;
-#ifdef COMPAT_IA32
+#ifdef COMPAT_FREEBSD32
else if (strcmp(name, "Xint0x80_syscall") == 0)
frame_type = SYSCALL;
 #endif

Modified: head/sys/amd64/amd64/exception.S
==
--- head/sys/amd64/amd64/exception.SThu Mar 11 14:17:37 2010
(r205013)
+++ head/sys/amd64/amd64/exception.SThu Mar 11 14:49:06 2010
(r205014)
@@ -572,7 +572,7 @@ ENTRY(fork_trampoline)
  * included.
  */
 
-#ifdef COMPAT_IA32
+#ifdef COMPAT_FREEBSD32
.data
.p2align 4
.text

Modified: head/sys/amd64/amd64/vm_machdep.c
==
--- head/sys/amd64/amd64/vm_machdep.c   Thu Mar 11 14:17:37 2010
(r205013)
+++ head/sys/amd64/amd64/vm_machdep.c   Thu Mar 11 14:49:06 2010
(r205014)
@@ -439,7 +439,7 @@ cpu_set_upcall_kse(struct thread *td, vo
 */
cpu_thread_clean(td);
 
-#ifdef COMPAT_IA32
+#ifdef COMPAT_FREEBSD32
if (td->td_proc->p_sysent->sv_flags & SV_ILP32) {
/*
 * Set the trap frame to point at the beginning of the uts
@@ -490,7 +490,7 @@ cpu_set_user_tls(struct thread *td, void
if ((u_int64_t)tls_base >= VM_MAXUSER_ADDRESS)
return (EINVAL);
 
-#ifdef COMPAT_IA32
+#ifdef COMPAT_FREEBSD32
if (td->td_proc->p_sysent->sv_flags & SV_ILP32) {
td->td_pcb->pcb_gsbase = (register_t)tls_base

svn commit: r205013 - in head/sys: amd64/amd64 i386/i386

2010-03-11 Thread John Baldwin
Author: jhb
Date: Thu Mar 11 14:17:37 2010
New Revision: 205013
URL: http://svn.freebsd.org/changeset/base/205013

Log:
  Print out the family and model from the cpu_id.  This is especially useful
  given the advent of the extended family and extended model fields.  The
  values are printed in hex to match their common usage in documentation.
  
  Submitted by: Alexander Best
  MFC after:1 week

Modified:
  head/sys/amd64/amd64/identcpu.c
  head/sys/i386/i386/identcpu.c

Modified: head/sys/amd64/amd64/identcpu.c
==
--- head/sys/amd64/amd64/identcpu.c Thu Mar 11 13:16:06 2010
(r205012)
+++ head/sys/amd64/amd64/identcpu.c Thu Mar 11 14:17:37 2010
(r205013)
@@ -187,7 +187,9 @@ printcpuinfo(void)
if (cpu_vendor_id == CPU_VENDOR_INTEL ||
cpu_vendor_id == CPU_VENDOR_AMD ||
cpu_vendor_id == CPU_VENDOR_CENTAUR) {
-   printf("  Stepping = %u", cpu_id & 0xf);
+   printf("  Family = %x", CPUID_TO_FAMILY(cpu_id));
+   printf("  Model = %x", CPUID_TO_MODEL(cpu_id));
+   printf("  Stepping = %u", cpu_id & CPUID_STEPPING);
if (cpu_high > 0) {
 
/*

Modified: head/sys/i386/i386/identcpu.c
==
--- head/sys/i386/i386/identcpu.c   Thu Mar 11 13:16:06 2010
(r205012)
+++ head/sys/i386/i386/identcpu.c   Thu Mar 11 14:17:37 2010
(r205013)
@@ -672,9 +672,11 @@ printcpuinfo(void)
cpu_vendor_id == CPU_VENDOR_NSC ||
(cpu_vendor_id == CPU_VENDOR_CYRIX &&
 ((cpu_id & 0xf00) > 0x500))) {
-   printf("  Stepping = %u", cpu_id & 0xf);
+   printf("  Family = %x", CPUID_TO_FAMILY(cpu_id));
+   printf("  Model = %x", CPUID_TO_MODEL(cpu_id));
+   printf("  Stepping = %u", cpu_id & CPUID_STEPPING);
if (cpu_vendor_id == CPU_VENDOR_CYRIX)
-   printf("  DIR=0x%04x", cyrix_did);
+   printf("\n  DIR=0x%04x", cyrix_did);
if (cpu_high > 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: r205012 - head/sys/kern

2010-03-11 Thread John Baldwin
Author: jhb
Date: Thu Mar 11 13:16:06 2010
New Revision: 205012
URL: http://svn.freebsd.org/changeset/base/205012

Log:
  Fix a comment nit.
  
  Submitted by: Alexander Best

Modified:
  head/sys/kern/vfs_syscalls.c

Modified: head/sys/kern/vfs_syscalls.c
==
--- head/sys/kern/vfs_syscalls.cThu Mar 11 12:18:52 2010
(r205011)
+++ head/sys/kern/vfs_syscalls.cThu Mar 11 13:16:06 2010
(r205012)
@@ -1060,8 +1060,8 @@ kern_openat(struct thread *td, int fd, c
AUDIT_ARG_MODE(mode);
/* XXX: audit dirfd */
/*
-* Only one of the O_EXEC, O_RDONLY, O_WRONLY and O_RDWR may
-* be specified.
+* Only one of the O_EXEC, O_RDONLY, O_WRONLY and O_RDWR flags
+* may be specified.
 */
if (flags & O_EXEC) {
if (flags & O_ACCMODE)
___
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: r205011 - head/usr.bin/perror

2010-03-11 Thread Joerg Wunsch
Author: joerg
Date: Thu Mar 11 12:18:52 2010
New Revision: 205011
URL: http://svn.freebsd.org/changeset/base/205011

Log:
  The number after the command is *not* optional.
  
  MFC after:1 day

Modified:
  head/usr.bin/perror/perror.1

Modified: head/usr.bin/perror/perror.1
==
--- head/usr.bin/perror/perror.1Thu Mar 11 11:33:04 2010
(r205010)
+++ head/usr.bin/perror/perror.1Thu Mar 11 12:18:52 2010
(r205011)
@@ -34,7 +34,7 @@
 .Nd "print an error number as a string"
 .Sh SYNOPSIS
 .Nm
-.Op Ar number
+.Ar number
 .Sh DESCRIPTION
 The
 .Nm
___
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: r205010 - head/sys/fs/nfsserver

2010-03-11 Thread Robert Watson
Author: rwatson
Date: Thu Mar 11 11:33:04 2010
New Revision: 205010
URL: http://svn.freebsd.org/changeset/base/205010

Log:
  Update nfsrv_getsocksndseq() for changes in TCP internals since FreeBSD 6.x:
  
  - so_pcb is now guaranteed to be non-NULL and valid if a valid socket
reference is held.
  
  - Need to check INP_TIMEWAIT and INP_DROPPED before assuming inp_ppcb is a
tcpcb, as it might be a tcptw or NULL otherwise.
  
  - tp can never be NULL by the end of the function, so only check
TCPS_ESTABLISHED before extracting tcpcb fields.
  
  The NFS server arguably incorporates too many assumptions about TCP
  internals, but fixing that is left for nother day.
  
  MFC after:1 week
  Reviewed by:  bz
  Reviewed and tested by:   rmacklem
  Sponsored by: Juniper Networks

Modified:
  head/sys/fs/nfsserver/nfs_nfsdport.c

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==
--- head/sys/fs/nfsserver/nfs_nfsdport.cThu Mar 11 11:28:29 2010
(r205009)
+++ head/sys/fs/nfsserver/nfs_nfsdport.cThu Mar 11 11:33:04 2010
(r205010)
@@ -2671,24 +2671,23 @@ nfsrv_getsocksndseq(struct socket *so, t
 {
struct inpcb *inp;
struct tcpcb *tp;
-   int error = EPIPE;
 
-   INP_INFO_RLOCK(&V_tcbinfo);
inp = sotoinpcb(so);
-   if (inp == NULL) {
-   INP_INFO_RUNLOCK(&V_tcbinfo);
-   return (error);
-   }
+   KASSERT(inp != NULL, ("nfsrv_getsocksndseq: inp == NULL"));
INP_RLOCK(inp);
-   INP_INFO_RUNLOCK(&V_tcbinfo);
+   if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
+   INP_RUNLOCK(inp);
+   return (EPIPE);
+   }
tp = intotcpcb(inp);
-   if (tp != NULL && tp->t_state == TCPS_ESTABLISHED) {
-   *maxp = tp->snd_max;
-   *unap = tp->snd_una;
-   error = 0;
+   if (tp->t_state != TCPS_ESTABLISHED) {
+   INP_RUNLOCK(inp);
+   return (EPIPE);
}
+   *maxp = tp->snd_max;
+   *unap = tp->snd_una;
INP_RUNLOCK(inp);
-   return (error);
+   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: r205009 - head/usr.bin/script

2010-03-11 Thread Ed Schouten
Author: ed
Date: Thu Mar 11 11:28:29 2010
New Revision: 205009
URL: http://svn.freebsd.org/changeset/base/205009

Log:
  Improve the change made in the previous commit.
  
  doshell() never returns, so there is no need to see whether we are the
  parent process.

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

Modified: head/usr.bin/script/script.c
==
--- head/usr.bin/script/script.cThu Mar 11 11:09:58 2010
(r205008)
+++ head/usr.bin/script/script.cThu Mar 11 11:28:29 2010
(r205009)
@@ -158,8 +158,7 @@ main(int argc, char *argv[])
}
if (child == 0)
doshell(argv);
-   else
-   close(slave);
+   close(slave);
 
if (flushtime > 0)
tvp = &tv;
___
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: r205008 - head/usr.bin/script

2010-03-11 Thread Ed Schouten
Author: ed
Date: Thu Mar 11 11:09:58 2010
New Revision: 205008
URL: http://svn.freebsd.org/changeset/base/205008

Log:
  Make script(1) a little less broken.
  
  Close the file descriptor to the TTY. There is no reason why the parent
  process should keep track of the descriptor. This ensures that the
  application inside properly drains the TTY during exit(2).
  
  Reported by:  alfred
  MFC after:2 weeks

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

Modified: head/usr.bin/script/script.c
==
--- head/usr.bin/script/script.cThu Mar 11 08:58:13 2010
(r205007)
+++ head/usr.bin/script/script.cThu Mar 11 11:09:58 2010
(r205008)
@@ -158,6 +158,8 @@ main(int argc, char *argv[])
}
if (child == 0)
doshell(argv);
+   else
+   close(slave);
 
if (flushtime > 0)
tvp = &tv;
___
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: r205007 - stable/8/sys/dev/acpica

2010-03-11 Thread Andriy Gapon
Author: avg
Date: Thu Mar 11 08:58:13 2010
New Revision: 205007
URL: http://svn.freebsd.org/changeset/base/205007

Log:
  MFC r203785: acpi: drop the second bus_generic_attach pass
  
  X-MFCto7 after: 1 week

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

Modified: stable/8/sys/dev/acpica/acpi.c
==
--- stable/8/sys/dev/acpica/acpi.c  Thu Mar 11 08:55:03 2010
(r205006)
+++ stable/8/sys/dev/acpica/acpi.c  Thu Mar 11 08:58:13 2010
(r205007)
@@ -1659,14 +1659,7 @@ acpi_probe_children(device_t bus)
 bus_generic_probe(bus);
 
 /* Probe/attach all children, created staticly and from the namespace. */
-ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "first bus_generic_attach\n"));
-bus_generic_attach(bus);
-
-/*
- * Some of these children may have attached others as part of their attach
- * process (eg. the root PCI bus driver), so rescan.
- */
-ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "second bus_generic_attach\n"));
+ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "acpi bus_generic_attach\n"));
 bus_generic_attach(bus);
 
 /* Attach wake sysctls. */
___
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: r205006 - stable/8/sys/dev/acpica

2010-03-11 Thread Andriy Gapon
Author: avg
Date: Thu Mar 11 08:55:03 2010
New Revision: 205006
URL: http://svn.freebsd.org/changeset/base/205006

Log:
  MFC r203776: acpi cpu: probe+attach before all other enumerated children
  
  X-MFCto7 after:   1 week

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

Modified: stable/8/sys/dev/acpica/acpi.c
==
--- stable/8/sys/dev/acpica/acpi.c  Thu Mar 11 08:33:39 2010
(r205005)
+++ stable/8/sys/dev/acpica/acpi.c  Thu Mar 11 08:55:03 2010
(r205006)
@@ -1691,14 +1691,14 @@ acpi_probe_order(ACPI_HANDLE handle, int
  * 10. CPUs
  */
 AcpiGetType(handle, &type);
-if (acpi_MatchHid(handle, "PNP0C01") || acpi_MatchHid(handle, "PNP0C02"))
+if (type == ACPI_TYPE_PROCESSOR)
*order = 1;
-else if (acpi_MatchHid(handle, "PNP0C09"))
+else if (acpi_MatchHid(handle, "PNP0C01") || acpi_MatchHid(handle, 
"PNP0C02"))
*order = 2;
-else if (acpi_MatchHid(handle, "PNP0C0F"))
+else if (acpi_MatchHid(handle, "PNP0C09"))
*order = 3;
-else if (type == ACPI_TYPE_PROCESSOR)
-   *order = 10;
+else if (acpi_MatchHid(handle, "PNP0C0F"))
+   *order = 4;
 }
 
 /*

Modified: stable/8/sys/dev/acpica/acpi_cpu.c
==
--- stable/8/sys/dev/acpica/acpi_cpu.c  Thu Mar 11 08:33:39 2010
(r205005)
+++ stable/8/sys/dev/acpica/acpi_cpu.c  Thu Mar 11 08:55:03 2010
(r205006)
@@ -384,13 +384,31 @@ acpi_cpu_attach(device_t dev)
 /* Probe for Cx state support. */
 acpi_cpu_cx_probe(sc);
 
-/* Finally,  call identify and probe/attach for child devices. */
-bus_generic_probe(dev);
-bus_generic_attach(dev);
-
 return (0);
 }
 
+static void
+acpi_cpu_postattach(void *unused __unused)
+{
+device_t *devices;
+int err;
+int i, n;
+
+err = devclass_get_devices(acpi_cpu_devclass, &devices, &n);
+if (err != 0) {
+   printf("devclass_get_devices(acpi_cpu_devclass) failed\n");
+   return;
+}
+for (i = 0; i < n; i++)
+   bus_generic_probe(devices[i]);
+for (i = 0; i < n; i++)
+   bus_generic_attach(devices[i]);
+free(devices, M_TEMP);
+}
+
+SYSINIT(acpi_cpu, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE,
+acpi_cpu_postattach, NULL);
+
 /*
  * Disable any entry to the idle function during suspend and re-enable it
  * during resume.
___
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: r205005 - head/sys/dev/usb/controller

2010-03-11 Thread Andrew Thompson
Author: thompsa
Date: Thu Mar 11 08:33:39 2010
New Revision: 205005
URL: http://svn.freebsd.org/changeset/base/205005

Log:
  Wrap the proc wakeup special case for ddb in ifdef DDB.
  
  Submitted by: Giovanni Trematerra

Modified:
  head/sys/dev/usb/controller/usb_controller.c

Modified: head/sys/dev/usb/controller/usb_controller.c
==
--- head/sys/dev/usb/controller/usb_controller.cThu Mar 11 08:30:05 
2010(r205004)
+++ head/sys/dev/usb/controller/usb_controller.cThu Mar 11 08:33:39 
2010(r205005)
@@ -24,6 +24,8 @@
  * SUCH DAMAGE.
  */
 
+#include "opt_ddb.h"
+
 #include 
 #include 
 #include 
@@ -220,6 +222,7 @@ usb_bus_explore(struct usb_proc_msg *pm)
bus->driver_added_refcount = 1;
}
 
+#ifdef DDB
/*
 * The following three lines of code are only here to
 * recover from DDB:
@@ -227,6 +230,7 @@ usb_bus_explore(struct usb_proc_msg *pm)
usb_proc_rewakeup(&bus->control_xfer_proc);
usb_proc_rewakeup(&bus->giant_callback_proc);
usb_proc_rewakeup(&bus->non_giant_callback_proc);
+#endif
 
USB_BUS_UNLOCK(bus);
 
@@ -289,11 +293,13 @@ usb_power_wdog(void *arg)
usb_callout_reset(&bus->power_wdog,
4 * hz, usb_power_wdog, arg);
 
+#ifdef DDB
/*
 * The following line of code is only here to recover from
 * DDB:
 */
usb_proc_rewakeup(&bus->explore_proc);  /* recover from DDB */
+#endif
 
USB_BUS_UNLOCK(bus);
 
___
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: r205003 - head/sys/dev/siba

2010-03-11 Thread Andrew Thompson
Author: thompsa
Date: Thu Mar 11 08:03:56 2010
New Revision: 205003
URL: http://svn.freebsd.org/changeset/base/205003

Log:
  Revert r204992 and just wrap it all in ifdef INVARIANTS to fix the debug and
  non-debug cases.

Modified:
  head/sys/dev/siba/siba_core.c

Modified: head/sys/dev/siba/siba_core.c
==
--- head/sys/dev/siba/siba_core.c   Thu Mar 11 07:46:17 2010
(r205002)
+++ head/sys/dev/siba/siba_core.c   Thu Mar 11 08:03:56 2010
(r205003)
@@ -2031,11 +2031,13 @@ siba_pcie_mdio_write(struct siba_pci *sp
 uint32_t
 siba_dma_translation(device_t dev)
 {
+#ifdef INVARIANTS
+   struct siba_dev_softc *sd = device_get_ivars(dev);
+   struct siba_softc *siba = sd->sd_bus;
 
-   KASSERT(device_get_ivars(dev)->sd_bus->siba_type == SIBA_TYPE_PCI,
-   ("unsupported bustype %d\n",
-device_get_ivars(dev)->sd_bus->siba_type));
-
+   KASSERT(siba->siba_type == SIBA_TYPE_PCI,
+   ("unsupported bustype %d\n", siba->siba_type));
+#endif
return (SIBA_PCI_DMA);
 }
 
___
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"