Re: Radeon HD 4250 ati driver

2011-01-09 Thread Claus Assmann
On Sat, Jan 08, 2011, Brynet wrote:

> I'm not sure why the driver in Xenocara is so old, but I think it has to
> do with broken multihead on some cards.

> $ ftp http://ftp.x.org/pub/individual/driver/xf86-video-ati-6.13.2.tar.gz

Thanks for the suggestion. This works fine for me (I changed the
source so it shows 4250 instead of 4290).

[1838387.840] (--) checkDevMem: using aperture driver /dev/xf86
[1838387.848] (--) Using wscons driver on /dev/ttyC4 in pcvt compatibility mode 
(version 3.32)
[1838387.853] 
X.Org X Server 1.8.2
Release Date: 2010-07-01
[1838387.853] X Protocol Version 11, Revision 0
[1838387.853] Build Operating System: OpenBSD 4.8 amd64 
[1838387.853] Current Operating System: OpenBSD x6.esmtp.org 4.8 GENERIC.MP#335 
amd64
[1838387.853] Build Date: 08 August 2010  11:21:57PM
[1838387.853]  
[1838387.853] Current version of pixman: 0.16.6
[1838387.853]   Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
[1838387.853] Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[1838387.854] (==) Log file: "/var/log/Xorg.0.log", Time: Sun Jan  9 17:39:03 
2011
[1838387.854] (II) Loader magic: 0x79c4c0
[1838387.854] (II) Module ABI versions:
[1838387.854]   X.Org ANSI C Emulation: 0.4
[1838387.854]   X.Org Video Driver: 7.0
[1838387.854]   X.Org XInput driver : 9.0
[1838387.854]   X.Org Server Extension : 3.0
[1838387.855] (--) PCI:*(0:1:5:0) 1002:9715:1043:843e ATI rev 0, Mem @ 
0xc000/268435456, 0xfbff/65536, 0xfbe0/1048576, I/O @ 0xb000/256
[1838387.857] (--) PCI: (0:2:0:0) 10de:016a:3842:c411 NVIDIA rev 161, Mem @ 
0xfd00/16777216, 0xd000/268435456, 0xfc00/16777216, BIOS @ 
0x/131072
[1838387.857] (==) Using default built-in configuration (21 lines)
[1838387.857] (==) --- Start of built-in configuration ---
[1838387.857]   Section "Device"
[1838387.857]   Identifier  "Builtin Default ati Device 0"
[1838387.857]   Driver  "ati"
[1838387.857]   EndSection
[1838387.857]   Section "Screen"
[1838387.857]   Identifier  "Builtin Default ati Screen 0"
[1838387.857]   Device  "Builtin Default ati Device 0"
[1838387.857]   EndSection
[1838387.857]   Section "Device"
[1838387.857]   Identifier  "Builtin Default vesa Device 0"
[1838387.857]   Driver  "vesa"
[1838387.857]   EndSection
[1838387.857]   Section "Screen"
[1838387.857]   Identifier  "Builtin Default vesa Screen 0"
[1838387.857]   Device  "Builtin Default vesa Device 0"
[1838387.857]   EndSection
[1838387.857]   Section "ServerLayout"
[1838387.857]   Identifier  "Builtin Default Layout"
[1838387.857]   Screen  "Builtin Default ati Screen 0"
[1838387.857]   Screen  "Builtin Default vesa Screen 0"
[1838387.857]   EndSection
[1838387.857] (==) --- End of built-in configuration ---
[1838387.857] (==) ServerLayout "Builtin Default Layout"
[1838387.857] (**) |-->Screen "Builtin Default ati Screen 0" (0)
[1838387.857] (**) |   |-->Monitor ""
[1838387.857] (**) |   |-->Device "Builtin Default ati Device 0"
[1838387.857] (==) No monitor specified for screen "Builtin Default ati Screen 
0".
Using a default monitor configuration.
[1838387.857] (**) |-->Screen "Builtin Default vesa Screen 0" (1)
[1838387.857] (**) |   |-->Monitor ""
[1838387.858] (**) |   |-->Device "Builtin Default vesa Device 0"
[1838387.858] (==) No monitor specified for screen "Builtin Default vesa Screen 
0".
Using a default monitor configuration.
[1838387.858] (==) Not automatically adding devices
[1838387.858] (==) Not automatically enabling devices
[1838387.858] (==) FontPath set to:
/usr/X11R6/lib/X11/fonts/misc/,
/usr/X11R6/lib/X11/fonts/TTF/,
/usr/X11R6/lib/X11/fonts/OTF/,
/usr/X11R6/lib/X11/fonts/Type1/,
/usr/X11R6/lib/X11/fonts/100dpi/,
/usr/X11R6/lib/X11/fonts/75dpi/
[1838387.858] (==) ModulePath set to "/usr/X11R6/lib/modules"
[1838387.858] (==) |-->Input Device ""
[1838387.858] (==) |-->Input Device ""
[1838387.858] (==) The core pointer device wasn't specified explicitly in the 
layout.
Using the default mouse configuration.
[1838387.858] (==) The core keyboard device wasn't specified explicitly in the 
layout.
Using the default keyboard configuration.
[1838387.858] (II) LoadModule: "extmod"
[1838387.858] (II) Loading /usr/X11R6/lib/modules/extensions/libextmod.so
[1838387.859] (II) Module extmod: vendor="X.Org Foundation"
[1838387.859]   compiled for 1.8.2, module version = 1.0.0
[1838387.859]   Module class: X.Org Server Extension
[1838387.859]   ABI class: X.Org Server Extension, version 3.0
[1838387.859] (II) Loading extension MIT-SCREEN-SAVER
[1838387.859] (II) Loading extension XFree86-VidModeExtension
[1838387.859] (II) Loading extension XFree86-

Re: New acpi challenges! New Dell XPS blows up in acpivideo!

2011-01-09 Thread Kenneth R Westerback
On Sun, Jan 09, 2011 at 10:47:02PM +, Jordan Hargrave wrote:
> It looks like there is a new L06 bios for the L401X, can you try this?

Already did. I'm a compulsive BIOS updater. :-). No behaviour change.

 Ken 

> 
> > Date: Wed, 22 Dec 2010 16:08:54 -0500
> > From: kwesterb...@rogers.com
> > To: tech@openbsd.org
> > CC: jor...@openbsd.org; mlar...@openbsd.org; ma...@openbsd.org;
> kette...@openbsd.org
> > Subject: New acpi challenges! New Dell XPS blows up in acpivideo!
> >
> > Got a new Dell XPS 401 laptop today and booted amd64 -current bsd.mp
> > off of a usb stick. It immediately blew up in acpi. bsd.rd did not
> > blow up.
> >
> > There seems to be a minor (i.e. non ddb> causing) issue prior to
> > acpivideo:
> >
> > acpiec0 at acpi0
> > acpicpu0 at acpi0acpi0: unable to load \\_PR_.CSDT
> > : PSS
> > acpicpu1 at acpi0: PSS
> >
> >
> > Hand transcribed:
> >
> > 
> > acpivideo at acpi0: GFX0
> > 0x801d6788 cnt:01 stk: 00 objref: 0x801c3c08
> > index: 0 opcode: Cond Ref
> > [\HDOS] 0x801c3c08 cnt: 04 stk: 00 method: 08
> > Could not convert 101 to 1
> > 6a58 Called: \_SB_.PCI0.GFX0._DOS
> > arg0: 0x801d1a08 cnt: 01 stk: 00 integer: 4
> > 6a5c Called: \_SB_.PCI0.GFX0._DOS
> > arg0: 0x801d1a08 cnt: 01 stk: 00 integer: 4
> > panic: aml_die aml_xconvert:2052
> >
> > ddb{0}> trace
> > _aml_die
> > aml_xconvert
> > aml_xstore
> > aml_xparse
> > aml_xeval
> > aml_evalnode
> > acpivideo_set_policy
> > acpivideo_attach
> > config_attach
> > acpi_foundvideo
> > aml_found_node
> > aml_found_node
> > aml_found_node
> > aml_found_node
> > aml_found_node
> > acpi_attach
> > config_attach
> > bios_attach
> > config_attach
> > mainbus_attach
> > config_attach
> > cpu_configure
> > main
> >
> > Disabling acpivideo via ukc makes bsd.mp boot.
> >
> > tar of acpidump files attached.
> >
> > Note that the NVidia 425M is only recognized because I added that
> > to pcidevs.
> >
> >  Ken
> >
> > OpenBSD 4.8-current (GENERIC.MP) #3: Wed Dec 22 12:37:54 EST 2010
> > r...@tbay.westerback.ca:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> > real mem = 3151962112 (3005MB)
> > avail mem = 3054088192 (2912MB)
> > User Kernel Config
> > UKC> disable acpivido\^H \^Hep\^H \^Ho
> > 351 acpivideo* disabled
> > UKC> quit
> > Continuing...
> > mainbus0 at root
> > bios0 at mainbus0: SMBIOS rev. 2.6 @ 0xeb6d0 (56 entries)
> > bios0: vendor Dell Inc. version "A04" date 10/15/2010
> > bios0: Dell Inc. XPS L401X
> > acpi0 at bios0: rev 3
> > acpi0: sleep states S0 S1 S3 S4 S5
> > acpi0: tables DSDT FACP APIC SSDT MCFG SLIC HPET OSFR SSDT
> > acpi0: wakeup devices P0P1(S3) P0P2(S3) P0P3(S3) P0P4(S3) P0P5(S3) BR20(S3)
> EUSB(S4) USB0(S3) USB1(S3) USB2(S3) USB3(S3) USBE(S4) USB4(S3) USB5(S3)
> USB6(S3) PEX0(S3) PEX1(S3) PEX2(S3) PEX3(S3) PEX4(S3) PEX5(S3) PEX6(S3)
> PEX7(S3) SLPB(S0) LID0(S3)
> > acpitimer0 at acpi0: 3579545 Hz, 24 bits
> > acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
> > cpu0 at mainbus0: apid 0 (boot processor)
> > cpu0: Intel(R) Core(TM) i7 CPU Q 840 @ 1.87GHz, 1862.26 MHz
> > cpu0:
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUS
> H,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,SMX,EST,TM2,S
> SSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,LONG
> > cpu0: 256KB 64b/line 8-way L2 cache
> > cpu0: apic clock running at 132MHz
> > cpu1 at mainbus0: apid 2 (application processor)
> > cpu1: Intel(R) Core(TM) i7 CPU Q 840 @ 1.87GHz, 1861.99 MHz
> > cpu1:
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUS
> H,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,SMX,EST,TM2,S
> SSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,LONG
> > cpu1: 256KB 64b/line 8-way L2 cache
> > cpu2 at mainbus0: apid 4 (application processor)
> > cpu2: Intel(R) Core(TM) i7 CPU Q 840 @ 1.87GHz, 1861.99 MHz
> > cpu2:
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUS
> H,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,SMX,EST,TM2,S
> SSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,LONG
> > cpu2: 256KB 64b/line 8-way L2 cache
> > cpu3 at mainbus0: apid 6 (application processor)
> > cpu3: Intel(R) Core(TM) i7 CPU Q 840 @ 1.87GHz, 1861.99 MHz
> > cpu3:
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUS
> H,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,SMX,EST,TM2,S
> SSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,LONG
> > cpu3: 256KB 64b/line 8-way L2 cache
> > cpu4 at mainbus0: apid 1 (application processor)
> > cpu4: Intel(R) Core(TM) i7 CPU Q 840 @ 1.87GHz, 1861.99 MHz
> > cpu4:
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUS
> H,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,SMX,EST,TM2,S
> SSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,LONG
> > cpu4: 256KB 64b/line 8-way L2 cache
> > cpu5 at mainbus0: apid 3 (application processor)
> > cpu5: Intel(R) Core(TM) i7 CPU Q 840 @ 1.87G

Re: http gzip support for ftp

2011-01-09 Thread Brynet
> If someone can find a server that is broken and barfs on getting a
> request version greater than it expects

Marcus Glocker's nostromo has this problem, among others, I can't seem
to get any feedback out of him though. ;-)

It rejects HTTP/1.2, even though that's nonexistent.. a server must
accept it, as you explained.

As for gzip support for ftp(1), that's awesome, definately a requirement
for a modern HTTP client.. minimalistic or otherwise.

-Bryan.



Re: http gzip support for ftp

2011-01-09 Thread Philip Guenther
On Sun, Jan 9, 2011 at 2:17 PM, Mark Kettenis 
wrote:
>> Date: Sun, 9 Jan 2011 17:08:22 -0500 (EST)
>> From: Ted Unangst 
>
>>  #endif /* !SMALL */
>>   ftp_printf(fin, ssl, "GET /%s %s\r\nHost: ", epath,
>>  #ifndef SMALL
>> - restart_point ? "HTTP/1.1\r\nConnection: close" :
>> + "HTTP/1.1\r\nConnection: close"
>> +#else
>> + "HTTP/1.0"
>>  #endif /* !SMALL */
>> - "HTTP/1.0");
>> + );
>
> Doesn't this mean that servers that only support HTTP/1.0 will stop
> working now?

Only servers that don't actually follow the rules: a HTTP/1.0 servers
should accept HTTP/1.1 requests just fine, returning the HTTP/1.0
interpretation of them.  The version sent by each side is _that_
side's version, or rather, the version to which the request or reply
that it has sent complies.  c.f. RFC 2145.

If someone can find a server that is broken and barfs on getting a
request version greater than it expects, it would be interesting to
see how other common HTTP clients (curl?  netscape?  chrome?) behave
with it.  Do they all auto-retry with a HTTP/1.0?  Adding that, or a
manual option to force HTTP/1.0, to ftp would be annoying...


Philip Guenther



Re: New acpi challenges! New Dell XPS blows up in acpivideo!

2011-01-09 Thread Jordan Hargrave
It looks like there is a new L06 bios for the L401X, can you try this?

> Date: Wed, 22 Dec 2010 16:08:54 -0500
> From: kwesterb...@rogers.com
> To: tech@openbsd.org
> CC: jor...@openbsd.org; mlar...@openbsd.org; ma...@openbsd.org;
kette...@openbsd.org
> Subject: New acpi challenges! New Dell XPS blows up in acpivideo!
>
> Got a new Dell XPS 401 laptop today and booted amd64 -current bsd.mp
> off of a usb stick. It immediately blew up in acpi. bsd.rd did not
> blow up.
>
> There seems to be a minor (i.e. non ddb> causing) issue prior to
> acpivideo:
>
> acpiec0 at acpi0
> acpicpu0 at acpi0acpi0: unable to load \\_PR_.CSDT
> : PSS
> acpicpu1 at acpi0: PSS
>
>
> Hand transcribed:
>
> 
> acpivideo at acpi0: GFX0
>   0x801d6788 cnt:01 stk: 00 objref: 0x801c3c08
>   index: 0 opcode: Cond Ref
> [\HDOS] 0x801c3c08 cnt: 04 stk: 00 method: 08
> Could not convert 101 to 1
> 6a58 Called: \_SB_.PCI0.GFX0._DOS
>   arg0: 0x801d1a08 cnt: 01 stk: 00 integer: 4
> 6a5c Called: \_SB_.PCI0.GFX0._DOS
>   arg0: 0x801d1a08 cnt: 01 stk: 00 integer: 4
> panic: aml_die aml_xconvert:2052
>
> ddb{0}> trace
> _aml_die
> aml_xconvert
> aml_xstore
> aml_xparse
> aml_xeval
> aml_evalnode
> acpivideo_set_policy
> acpivideo_attach
> config_attach
> acpi_foundvideo
> aml_found_node
> aml_found_node
> aml_found_node
> aml_found_node
> aml_found_node
> acpi_attach
> config_attach
> bios_attach
> config_attach
> mainbus_attach
> config_attach
> cpu_configure
> main
>
> Disabling acpivideo via ukc makes bsd.mp boot.
>
> tar of acpidump files attached.
>
> Note that the NVidia 425M is only recognized because I added that
> to pcidevs.
>
>  Ken
>
> OpenBSD 4.8-current (GENERIC.MP) #3: Wed Dec 22 12:37:54 EST 2010
> r...@tbay.westerback.ca:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> real mem = 3151962112 (3005MB)
> avail mem = 3054088192 (2912MB)
> User Kernel Config
> UKC> disable acpivido\^H \^Hep\^H \^Ho
> 351 acpivideo* disabled
> UKC> quit
> Continuing...
> mainbus0 at root
> bios0 at mainbus0: SMBIOS rev. 2.6 @ 0xeb6d0 (56 entries)
> bios0: vendor Dell Inc. version "A04" date 10/15/2010
> bios0: Dell Inc. XPS L401X
> acpi0 at bios0: rev 3
> acpi0: sleep states S0 S1 S3 S4 S5
> acpi0: tables DSDT FACP APIC SSDT MCFG SLIC HPET OSFR SSDT
> acpi0: wakeup devices P0P1(S3) P0P2(S3) P0P3(S3) P0P4(S3) P0P5(S3) BR20(S3)
EUSB(S4) USB0(S3) USB1(S3) USB2(S3) USB3(S3) USBE(S4) USB4(S3) USB5(S3)
USB6(S3) PEX0(S3) PEX1(S3) PEX2(S3) PEX3(S3) PEX4(S3) PEX5(S3) PEX6(S3)
PEX7(S3) SLPB(S0) LID0(S3)
> acpitimer0 at acpi0: 3579545 Hz, 24 bits
> acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
> cpu0 at mainbus0: apid 0 (boot processor)
> cpu0: Intel(R) Core(TM) i7 CPU Q 840 @ 1.87GHz, 1862.26 MHz
> cpu0:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUS
H,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,SMX,EST,TM2,S
SSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,LONG
> cpu0: 256KB 64b/line 8-way L2 cache
> cpu0: apic clock running at 132MHz
> cpu1 at mainbus0: apid 2 (application processor)
> cpu1: Intel(R) Core(TM) i7 CPU Q 840 @ 1.87GHz, 1861.99 MHz
> cpu1:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUS
H,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,SMX,EST,TM2,S
SSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,LONG
> cpu1: 256KB 64b/line 8-way L2 cache
> cpu2 at mainbus0: apid 4 (application processor)
> cpu2: Intel(R) Core(TM) i7 CPU Q 840 @ 1.87GHz, 1861.99 MHz
> cpu2:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUS
H,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,SMX,EST,TM2,S
SSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,LONG
> cpu2: 256KB 64b/line 8-way L2 cache
> cpu3 at mainbus0: apid 6 (application processor)
> cpu3: Intel(R) Core(TM) i7 CPU Q 840 @ 1.87GHz, 1861.99 MHz
> cpu3:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUS
H,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,SMX,EST,TM2,S
SSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,LONG
> cpu3: 256KB 64b/line 8-way L2 cache
> cpu4 at mainbus0: apid 1 (application processor)
> cpu4: Intel(R) Core(TM) i7 CPU Q 840 @ 1.87GHz, 1861.99 MHz
> cpu4:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUS
H,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,SMX,EST,TM2,S
SSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,LONG
> cpu4: 256KB 64b/line 8-way L2 cache
> cpu5 at mainbus0: apid 3 (application processor)
> cpu5: Intel(R) Core(TM) i7 CPU Q 840 @ 1.87GHz, 1861.99 MHz
> cpu5:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUS
H,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,VMX,SMX,EST,TM2,S
SSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT,NXE,LONG
> cpu5: 256KB 64b/line 8-way L2 cache
> cpu6 at mainbus0: apid 5 (application processor)
> cpu6: Intel(R) Core(TM) i7 CPU Q 840 @ 1.87GHz, 1861.99 MHz
> cpu6:
FPU,VME,DE,

http gzip support for ftp

2011-01-09 Thread Ted Unangst
Downloading things can go a lot faster if the server and client support 
http compression.  This is easily added to the ftp program's http support.

It consists of two parts.  Support for deflating the data we receive and 
support for the chunked transfer the server will use to send data to us.  
The chunked supported is probably useful in its own right as well.

Everything is ifndef small, of course.

Index: Makefile
===
RCS file: /home/tedu/cvs/src/usr.bin/ftp/Makefile,v
retrieving revision 1.25
diff -u -r1.25 Makefile
--- Makefile5 May 2009 19:35:30 -   1.25
+++ Makefile9 Jan 2011 21:14:51 -
@@ -17,8 +17,8 @@
 
 CPPFLAGS+= -DINET6
 
-LDADD+=-ledit -lcurses -lutil -lssl -lcrypto
-DPADD+=${LIBEDIT} ${LIBCURSES} ${LIBUTIL}
+LDADD+=-ledit -lcurses -lutil -lssl -lcrypto -lz
+DPADD+=${LIBEDIT} ${LIBCURSES} ${LIBUTIL} ${LIBZ}
 LDSTATIC= ${STATIC}
 
 #COPTS+= -Wall -Wconversion -Wstrict-prototypes -Wmissing-prototypes
Index: fetch.c
===
RCS file: /home/tedu/cvs/src/usr.bin/ftp/fetch.c,v
retrieving revision 1.103
diff -u -r1.103 fetch.c
--- fetch.c 25 Aug 2010 20:32:37 -  1.103
+++ fetch.c 9 Jan 2011 21:15:42 -
@@ -63,6 +63,7 @@
 #ifndef SMALL
 #include 
 #include 
+#include 
 #else /* !SMALL */
 #define SSL void
 #endif /* !SMALL */
@@ -167,6 +168,74 @@
return (epath);
 }
 
+#ifndef SMALL
+static size_t
+chunked_read(FILE *fin, SSL *ssl, unsigned char *buf, size_t amt, int gzipped)
+{
+   static int chunksize;
+   static int zinit;
+   static z_stream zctx;
+   static unsigned char zbuf[4096];
+
+   size_t chunkbuflen;
+   char *chunkbuf;
+   size_t len, zlen, zamt;
+   int rv;
+
+   if (!chunksize) {
+   chunkbuf = ftp_readline(fin, ssl, &chunkbuflen);
+   if (!chunkbuf) {
+   warnx("no chunk size");
+   return 0;
+   }
+   chunksize = strtol(chunkbuf, NULL, 16);
+   }
+   if (gzipped) {
+   if (zinit == -1) {
+   zinit = 0;
+   return 0;
+   }
+   if (zctx.avail_in == 0) {
+   zamt = sizeof(zbuf);
+   if (zamt > chunksize)
+   zamt = chunksize;
+   zlen = ftp_read(fin, ssl, zbuf, zamt);
+   chunksize -= zlen;
+   if (chunksize == 0) /* eat empty line after chunk */
+   ftp_readline(fin, ssl, &chunkbuflen);
+   zctx.avail_in = zlen;
+   zctx.next_in = zbuf;
+   }
+   if (!zinit) {
+   rv = inflateInit2(&zctx, 15 + 32);
+   zinit = 1;
+   }
+   zctx.next_out = buf;
+   zctx.avail_out = amt;
+   if ((rv = inflate(&zctx, Z_NO_FLUSH)) != Z_OK) {
+   if (rv == Z_STREAM_END) {
+   inflateEnd(&zctx);
+   zinit = -1;
+   } else {
+   warnx("inflate failed %d", rv);
+   return 0;
+   }
+   }
+   len = zctx.next_out - buf;
+   } else {
+   if (amt > chunksize)
+   amt = chunksize;
+   len = ftp_read(fin, ssl, buf, amt);
+   chunksize -= len;
+   if (chunksize == 0) /* eat empty line after chunk */
+   ftp_readline(fin, ssl, &chunkbuflen);
+   }
+
+   return len;
+}
+#endif /* SMALL */
+
+
 /*
  * Retrieve URL, via the proxy in $proxyvar if necessary.
  * Modifies the string argument given.
@@ -195,6 +264,8 @@
const char *scheme;
int ishttpsurl = 0;
SSL_CTX *ssl_ctx = NULL;
+   int chunked = 0;
+   int gzipped = 1;
 #endif /* !SMALL */
SSL *ssl = NULL;
int status;
@@ -607,9 +678,11 @@
 #endif /* !SMALL */
ftp_printf(fin, ssl, "GET /%s %s\r\nHost: ", epath,
 #ifndef SMALL
-   restart_point ? "HTTP/1.1\r\nConnection: close" :
+   "HTTP/1.1\r\nConnection: close"
+#else
+   "HTTP/1.0"
 #endif /* !SMALL */
-   "HTTP/1.0");
+   );
if (strchr(host, ':')) {
char *h, *p;
 
@@ -638,6 +711,7 @@
if (restart_point)
ftp_printf(fin, ssl, "\r\nRange: bytes=%lld-",
(long long)restart_point);
+   ftp_printf(fin, ssl, "\r\nAccept-Encoding: gzip");
 #else /* !SMALL */
if (port && strcmp(port, "80") != 0)
ftp_printf(fin

Re: http gzip support for ftp

2011-01-09 Thread Ted Unangst
On Sun, Jan 9, 2011 at 5:17 PM, Mark Kettenis 
wrote:
>> Date: Sun, 9 Jan 2011 17:08:22 -0500 (EST)
>> From: Ted Unangst 
>
>>  #endif /* !SMALL */
>>   ftp_printf(fin, ssl, "GET /%s %s\r\nHost: ", epath,
>>  #ifndef SMALL
>> - restart_point ? "HTTP/1.1\r\nConnection: close" :
>> + "HTTP/1.1\r\nConnection: close"
>> +#else
>> + "HTTP/1.0"
>>  #endif /* !SMALL */
>> - "HTTP/1.0");
>> + );
>
> Doesn't this mean that servers that only support HTTP/1.0 will stop
> working now?

Do you know of one to test against?



Re: http gzip support for ftp

2011-01-09 Thread Mark Kettenis
> Date: Sun, 9 Jan 2011 17:08:22 -0500 (EST)
> From: Ted Unangst 

>  #endif /* !SMALL */
>   ftp_printf(fin, ssl, "GET /%s %s\r\nHost: ", epath,
>  #ifndef SMALL
> - restart_point ? "HTTP/1.1\r\nConnection: close" :
> + "HTTP/1.1\r\nConnection: close"
> +#else
> + "HTTP/1.0"
>  #endif /* !SMALL */
> - "HTTP/1.0");
> + );

Doesn't this mean that servers that only support HTTP/1.0 will stop
working now?



Re: http gzip support for ftp

2011-01-09 Thread Ted Unangst
On Sun, 9 Jan 2011, Ted Unangst wrote:

> Downloading things can go a lot faster if the server and client support 
> http compression.  This is easily added to the ftp program's http support.

poopers, I hard coded gzipped to 1 by accident.  3rd time's a charm.  
Please test, as there are obviously lots of different web servers out 
there.

Index: Makefile
===
RCS file: /home/tedu/cvs/src/usr.bin/ftp/Makefile,v
retrieving revision 1.25
diff -u -r1.25 Makefile
--- Makefile5 May 2009 19:35:30 -   1.25
+++ Makefile9 Jan 2011 21:14:51 -
@@ -17,8 +17,8 @@
 
 CPPFLAGS+= -DINET6
 
-LDADD+=-ledit -lcurses -lutil -lssl -lcrypto
-DPADD+=${LIBEDIT} ${LIBCURSES} ${LIBUTIL}
+LDADD+=-ledit -lcurses -lutil -lssl -lcrypto -lz
+DPADD+=${LIBEDIT} ${LIBCURSES} ${LIBUTIL} ${LIBZ}
 LDSTATIC= ${STATIC}
 
 #COPTS+= -Wall -Wconversion -Wstrict-prototypes -Wmissing-prototypes
Index: fetch.c
===
RCS file: /home/tedu/cvs/src/usr.bin/ftp/fetch.c,v
retrieving revision 1.103
diff -u -r1.103 fetch.c
--- fetch.c 25 Aug 2010 20:32:37 -  1.103
+++ fetch.c 9 Jan 2011 22:07:12 -
@@ -63,6 +63,7 @@
 #ifndef SMALL
 #include 
 #include 
+#include 
 #else /* !SMALL */
 #define SSL void
 #endif /* !SMALL */
@@ -167,6 +168,80 @@
return (epath);
 }
 
+#ifndef SMALL
+static size_t
+chunked_read(FILE *fin, SSL *ssl, unsigned char *buf, size_t amt,
+int chunked, int gzipped)
+{
+   static int chunksize;
+   static int zinit;
+   static z_stream zctx;
+   static unsigned char zbuf[4096];
+
+   size_t chunkbuflen;
+   char *chunkbuf;
+   size_t len, zlen, zamt;
+   int rv;
+
+   if (chunked && !chunksize) {
+   chunkbuf = ftp_readline(fin, ssl, &chunkbuflen);
+   if (!chunkbuf) {
+   warnx("no chunk size");
+   return 0;
+   }
+   chunksize = strtol(chunkbuf, NULL, 16);
+   }
+   if (gzipped) {
+   if (zinit == -1) {
+   zinit = 0;
+   return 0;
+   }
+   if (zctx.avail_in == 0) {
+   zamt = sizeof(zbuf);
+   if (chunked && zamt > chunksize)
+   zamt = chunksize;
+   zlen = ftp_read(fin, ssl, zbuf, zamt);
+   if (chunked) {
+   chunksize -= zlen;
+   /* eat empty line after chunk */
+   if (chunksize == 0)
+   ftp_readline(fin, ssl, &chunkbuflen);
+   }
+   zctx.avail_in = zlen;
+   zctx.next_in = zbuf;
+   }
+   if (!zinit) {
+   rv = inflateInit2(&zctx, 15 + 32);
+   zinit = 1;
+   }
+   zctx.next_out = buf;
+   zctx.avail_out = amt;
+   if ((rv = inflate(&zctx, Z_NO_FLUSH)) != Z_OK) {
+   if (rv == Z_STREAM_END) {
+   inflateEnd(&zctx);
+   zinit = -1;
+   } else {
+   warnx("inflate failed %d", rv);
+   return 0;
+   }
+   }
+   len = zctx.next_out - buf;
+   } else if (chunked) {
+   if (amt > chunksize)
+   amt = chunksize;
+   len = ftp_read(fin, ssl, buf, amt);
+   chunksize -= len;
+   if (chunksize == 0) /* eat empty line after chunk */
+   ftp_readline(fin, ssl, &chunkbuflen);
+   } else {
+   len = ftp_read(fin, ssl, buf, amt);
+   }
+
+   return len;
+}
+#endif /* SMALL */
+
+
 /*
  * Retrieve URL, via the proxy in $proxyvar if necessary.
  * Modifies the string argument given.
@@ -195,6 +270,8 @@
const char *scheme;
int ishttpsurl = 0;
SSL_CTX *ssl_ctx = NULL;
+   int chunked = 0;
+   int gzipped = 0;
 #endif /* !SMALL */
SSL *ssl = NULL;
int status;
@@ -607,9 +684,11 @@
 #endif /* !SMALL */
ftp_printf(fin, ssl, "GET /%s %s\r\nHost: ", epath,
 #ifndef SMALL
-   restart_point ? "HTTP/1.1\r\nConnection: close" :
+   "HTTP/1.1\r\nConnection: close"
+#else
+   "HTTP/1.0"
 #endif /* !SMALL */
-   "HTTP/1.0");
+   );
if (strchr(host, ':')) {
char *h, *p;
 
@@ -638,6 +717,7 @@
if (restart_point)
ftp_printf(fin, ssl, "\r\nRange: bytes=%lld-",
(long long)restart_point)

Re: nc -U -u (Unix datagram socket support)

2011-01-09 Thread Nicholas Marriott
Not sure I count as a network developer but this looks fine to me.


On Sun, Jan 09, 2011 at 01:15:51PM -0800, Jeremy Evans wrote:
> jmc@ and I discussed these man page changes. He's OK with this patch,
> but would like another network developer to approve.  So, looking for
> OKs.
> 
> Jeremy
> 
> Index: nc.1
> ===
> RCS file: /cvs/src/usr.bin/nc/nc.1,v
> retrieving revision 1.56
> diff -u -p -r1.56 nc.1
> --- nc.1  8 Jan 2011 00:44:19 -   1.56
> +++ nc.1  9 Jan 2011 21:10:44 -
> @@ -40,7 +40,7 @@
>  .Op Fl O Ar length
>  .Op Fl P Ar proxy_username
>  .Op Fl p Ar source_port
> -.Op Fl s Ar source_ip_address
> +.Op Fl s Ar source
>  .Op Fl T Ar ToS
>  .Op Fl V Ar rtable
>  .Op Fl w Ar timeout
> @@ -49,7 +49,7 @@
>  .Fl x Ar proxy_address Ns Oo : Ns
>  .Ar port Oc
>  .Xc Oc
> -.Op Ar hostname
> +.Op Ar destination
>  .Op Ar port
>  .Ek
>  .Sh DESCRIPTION
> @@ -57,8 +57,10 @@ The
>  .Nm
>  (or
>  .Nm netcat )
> -utility is used for just about anything under the sun involving TCP
> -or UDP.
> +utility is used for just about anything under the sun involving TCP,
> +UDP, or
> +.Ux Ns -domain
> +sockets.
>  It can open TCP connections, send UDP packets, listen on arbitrary
>  TCP and UDP ports, do port scanning, and deal with both IPv4 and
>  IPv6.
> @@ -153,7 +155,7 @@ instead of sequentially within a range o
>  assigns them.
>  .It Fl S
>  Enables the RFC 2385 TCP MD5 signature option.
> -.It Fl s Ar source_ip_address
> +.It Fl s Ar source
>  Specifies the IP of the interface which is used to send the packets.
>  For
>  .Ux Ns -domain
> @@ -234,7 +236,7 @@ If the protocol is not specified, SOCKS 
>  Requests that
>  .Nm
>  should connect to
> -.Ar hostname
> +.Ar destination
>  using a proxy at
>  .Ar proxy_address
>  and
> @@ -252,16 +254,22 @@ It is an error to use this option in con
>  option.
>  .El
>  .Pp
> -.Ar hostname
> +.Ar destination
>  can be a numerical IP address or a symbolic hostname
>  (unless the
>  .Fl n
>  option is given).
> -In general, a hostname must be specified,
> +In general, a destination must be specified,
>  unless the
>  .Fl l
>  option is given
>  (in which case the local host is used).
> +For
> +.Ux Ns -domain
> +sockets, a destination is required and is the socket path to connect to
> +(or listen on if the
> +.Fl l
> +option is given).
>  .Pp
>  .Ar port
>  can be a single integer or a range of ports.
> @@ -270,8 +278,7 @@ In general,
>  a destination port must be specified,
>  unless the
>  .Fl U
> -option is given
> -(in which case a socket must be specified).
> +option is given.
>  .Sh CLIENT/SERVER MODEL
>  It is quite simple to build a very basic client/server model using
>  .Nm .
> @@ -404,7 +411,7 @@ IP for the local end of the connection:
>  .Pp
>  Create and listen on a
>  .Ux Ns -domain
> -socket:
> +stream socket:
>  .Pp
>  .Dl $ nc -lU /var/tmp/dsocket
>  .Pp
> Index: netcat.c
> ===
> RCS file: /cvs/src/usr.bin/nc/netcat.c,v
> retrieving revision 1.99
> diff -u -p -r1.99 netcat.c
> --- netcat.c  8 Jan 2011 00:44:19 -   1.99
> +++ netcat.c  9 Jan 2011 21:10:45 -
> @@ -930,9 +930,9 @@ usage(int ret)
>  {
>   fprintf(stderr,
>   "usage: nc [-46DdhklnrStUuvz] [-I length] [-i interval] [-O 
> length]\n"
> - "\t  [-P proxy_username] [-p source_port] [-s source_ip_address] 
> [-T ToS]\n"
> + "\t  [-P proxy_username] [-p source_port] [-s source] [-T ToS]\n"
>   "\t  [-V rtable] [-w timeout] [-X proxy_protocol]\n"
> - "\t  [-x proxy_address[:port]] [hostname] [port]\n");
> + "\t  [-x proxy_address[:port]] [destination] [port]\n");
>   if (ret)
>   exit(1);
>  }



isakmpd - get CRLs to work

2011-01-09 Thread Martin Pelikan
Hello tech@,
this patch actually enables support for certificate revocation in
isakmpd while using X.509 PKI. Currently the code loads the CRLs, but
when it comes to rejection of the revoked client, the daemon happily
jumps over its verification (if the public key is found at the first
try).
Now it even works if you SIGHUP isakmpd - just wait till the next phase
one is performed and if your client doesn't provide valid key (DNSSEC,
directly on disk), it gets disconnected.

I know it's probably ugly, but I couldn't think of any easier solution
than this one; there's a new XXX comment because I don't really know
why the whole function is written the way it is.
Why do CRLs have to be in two places simultaneously in X509_STORE_CTX?
Yeah, and I dropped support for OpenSSL < 0.9.8 -- isakmpd doesn't claim
to support CRLs there anyway.

I saw you were looking for IPsec bugs, so if anyone is interested...

--
Martin Pelikan

Index: ike_auth.c
===
RCS file: /cvs/src/sbin/isakmpd/ike_auth.c,v
retrieving revision 1.110
diff -u -p -r1.110 ike_auth.c
--- ike_auth.c  16 Apr 2007 13:01:39 -  1.110
+++ ike_auth.c  9 Jan 2011 21:29:37 -
@@ -623,6 +623,12 @@ rsa_sig_decode_hash(struct message *msg)
LOG_DBG((LOG_CRYPTO, 40,
"rsa_sig_decode_hash: using cert "
"of type %d", handler->id));
+   /*
+* XXX Is this really necessary here?
+* XXX We do it later in the FOREACH
+* XXX and x509_generate_kn() probably 
+* XXX doesn't need it.
+*/
exchange->recv_cert = cert;
exchange->recv_certtype = handler->id;
x509_generate_kn(exchange->policy_id,
@@ -641,13 +647,6 @@ rsa_sig_decode_hash(struct message *msg)
TAILQ_FOREACH(p, &msg->payload[ISAKMP_PAYLOAD_CERT], link) {
p->flags |= PL_MARK;
 
-   /*
-* When we have found a key, just walk over the rest, marking
-* them.
-*/
-   if (found)
-   continue;
-
handler = cert_get(GET_ISAKMP_CERT_ENCODING(p->p));
if (!handler) {
LOG_DBG((LOG_MISC, 30, "rsa_sig_decode_hash: "
@@ -667,6 +666,7 @@ rsa_sig_decode_hash(struct message *msg)
handler->cert_free(cert);
log_print("rsa_sig_decode_hash: received CERT can't "
"be validated");
+   found--;
continue;
}
if (GET_ISAKMP_CERT_ENCODING(p->p) ==
@@ -740,7 +740,7 @@ rsa_sig_decode_hash(struct message *msg)
 * If no certificate provided a key, try to find a validated DNSSEC
 * KEY.
 */
-   if (!found) {
+   if (found <= 0) {
rawkey = dns_get_key(IKE_AUTH_RSA_SIG, msg, &rawkeylen);
 
/* We need to convert 'void *rawkey' into 'RSA *key'.  */
@@ -755,12 +755,12 @@ rsa_sig_decode_hash(struct message *msg)
 #endif /* USE_DNSSEC */
 
/* If we still have not found a key, try to read it from a file. */
-   if (!found)
+   if (found <= 0)
if (get_raw_key_from_file(IKE_AUTH_RSA_SIG, id, id_len, &key)
!= -1)
found++;
 
-   if (!found) {
+   if (found <= 0) {
log_print("rsa_sig_decode_hash: no public key found");
return -1;
}
Index: x509.c
===
RCS file: /cvs/src/sbin/isakmpd/x509.c,v
retrieving revision 1.113
diff -u -p -r1.113 x509.c
--- x509.c  29 Jun 2010 19:50:16 -  1.113
+++ x509.c  9 Jan 2011 21:29:37 -
@@ -825,30 +825,41 @@ x509_cert_validate(void *scert)
X509_NAME   *issuer, *subject;
X509*cert = (X509 *) scert;
EVP_PKEY*key;
+   STACK_OF(X509_CRL) *crls = NULL;
int res, err;
 
+   issuer = X509_get_issuer_name(cert);
+   subject = X509_get_subject_name(cert);
/*
 * Validate the peer certificate by checking with the CA certificates
 * we trust.
 */
-   X509_STORE_CTX_init(&csc, x509_cas, cert, NULL);
-#if OPENSSL_VERSION_NUMBER >= 0x00908000L
-   /* XXX See comment in x509_read_crls_from_dir.  */
-   if (x509_cas->param->flags & X509_V_FLAG_CRL_CHECK) {
-   X509_STORE_CTX_set_flags(&csc, X509_V_FLAG_CRL_CHECK);
-   X509_STORE_CTX_set_flags(&csc, X509_V_F

Re: http gzip support for ftp

2011-01-09 Thread Ted Unangst
On Sun, 9 Jan 2011, Ted Unangst wrote:

> Downloading things can go a lot faster if the server and client support 
> http compression.  This is easily added to the ftp program's http support.
> 
> It consists of two parts.  Support for deflating the data we receive and 
> support for the chunked transfer the server will use to send data to us.  
> The chunked supported is probably useful in its own right as well.

Upon further reflection, I realize it's possible for a server to send 
gzipped data that's not chunked.  The diff below is a better version that 
should be able to handle all combinations of chunked, gzipped, both, or 
none.

Index: Makefile
===
RCS file: /home/tedu/cvs/src/usr.bin/ftp/Makefile,v
retrieving revision 1.25
diff -u -r1.25 Makefile
--- Makefile5 May 2009 19:35:30 -   1.25
+++ Makefile9 Jan 2011 21:14:51 -
@@ -17,8 +17,8 @@
 
 CPPFLAGS+= -DINET6
 
-LDADD+=-ledit -lcurses -lutil -lssl -lcrypto
-DPADD+=${LIBEDIT} ${LIBCURSES} ${LIBUTIL}
+LDADD+=-ledit -lcurses -lutil -lssl -lcrypto -lz
+DPADD+=${LIBEDIT} ${LIBCURSES} ${LIBUTIL} ${LIBZ}
 LDSTATIC= ${STATIC}
 
 #COPTS+= -Wall -Wconversion -Wstrict-prototypes -Wmissing-prototypes
Index: fetch.c
===
RCS file: /home/tedu/cvs/src/usr.bin/ftp/fetch.c,v
retrieving revision 1.103
diff -u -r1.103 fetch.c
--- fetch.c 25 Aug 2010 20:32:37 -  1.103
+++ fetch.c 9 Jan 2011 21:38:27 -
@@ -63,6 +63,7 @@
 #ifndef SMALL
 #include 
 #include 
+#include 
 #else /* !SMALL */
 #define SSL void
 #endif /* !SMALL */
@@ -167,6 +168,80 @@
return (epath);
 }
 
+#ifndef SMALL
+static size_t
+chunked_read(FILE *fin, SSL *ssl, unsigned char *buf, size_t amt,
+int chunked, int gzipped)
+{
+   static int chunksize;
+   static int zinit;
+   static z_stream zctx;
+   static unsigned char zbuf[4096];
+
+   size_t chunkbuflen;
+   char *chunkbuf;
+   size_t len, zlen, zamt;
+   int rv;
+
+   if (chunked && !chunksize) {
+   chunkbuf = ftp_readline(fin, ssl, &chunkbuflen);
+   if (!chunkbuf) {
+   warnx("no chunk size");
+   return 0;
+   }
+   chunksize = strtol(chunkbuf, NULL, 16);
+   }
+   if (gzipped) {
+   if (zinit == -1) {
+   zinit = 0;
+   return 0;
+   }
+   if (zctx.avail_in == 0) {
+   zamt = sizeof(zbuf);
+   if (chunked && zamt > chunksize)
+   zamt = chunksize;
+   zlen = ftp_read(fin, ssl, zbuf, zamt);
+   if (chunked) {
+   chunksize -= zlen;
+   /* eat empty line after chunk */
+   if (chunksize == 0)
+   ftp_readline(fin, ssl, &chunkbuflen);
+   }
+   zctx.avail_in = zlen;
+   zctx.next_in = zbuf;
+   }
+   if (!zinit) {
+   rv = inflateInit2(&zctx, 15 + 32);
+   zinit = 1;
+   }
+   zctx.next_out = buf;
+   zctx.avail_out = amt;
+   if ((rv = inflate(&zctx, Z_NO_FLUSH)) != Z_OK) {
+   if (rv == Z_STREAM_END) {
+   inflateEnd(&zctx);
+   zinit = -1;
+   } else {
+   warnx("inflate failed %d", rv);
+   return 0;
+   }
+   }
+   len = zctx.next_out - buf;
+   } else if (chunked) {
+   if (amt > chunksize)
+   amt = chunksize;
+   len = ftp_read(fin, ssl, buf, amt);
+   chunksize -= len;
+   if (chunksize == 0) /* eat empty line after chunk */
+   ftp_readline(fin, ssl, &chunkbuflen);
+   } else {
+   len = ftp_read(fin, ssl, buf, amt);
+   }
+
+   return len;
+}
+#endif /* SMALL */
+
+
 /*
  * Retrieve URL, via the proxy in $proxyvar if necessary.
  * Modifies the string argument given.
@@ -195,6 +270,8 @@
const char *scheme;
int ishttpsurl = 0;
SSL_CTX *ssl_ctx = NULL;
+   int chunked = 0;
+   int gzipped = 1;
 #endif /* !SMALL */
SSL *ssl = NULL;
int status;
@@ -607,9 +684,11 @@
 #endif /* !SMALL */
ftp_printf(fin, ssl, "GET /%s %s\r\nHost: ", epath,
 #ifndef SMALL
-   restart_point ? "HTTP/1.1\r\nConnection: close" :
+   "HTTP/1.1\r\nConnection: close"
+#else
+   "HTTP/1.0"
 #endif /* !SMALL */
-   "H

Re: nc -U -u (Unix datagram socket support)

2011-01-09 Thread Jeremy Evans
jmc@ and I discussed these man page changes. He's OK with this patch,
but would like another network developer to approve.  So, looking for
OKs.

Jeremy

Index: nc.1
===
RCS file: /cvs/src/usr.bin/nc/nc.1,v
retrieving revision 1.56
diff -u -p -r1.56 nc.1
--- nc.18 Jan 2011 00:44:19 -   1.56
+++ nc.19 Jan 2011 21:10:44 -
@@ -40,7 +40,7 @@
 .Op Fl O Ar length
 .Op Fl P Ar proxy_username
 .Op Fl p Ar source_port
-.Op Fl s Ar source_ip_address
+.Op Fl s Ar source
 .Op Fl T Ar ToS
 .Op Fl V Ar rtable
 .Op Fl w Ar timeout
@@ -49,7 +49,7 @@
 .Fl x Ar proxy_address Ns Oo : Ns
 .Ar port Oc
 .Xc Oc
-.Op Ar hostname
+.Op Ar destination
 .Op Ar port
 .Ek
 .Sh DESCRIPTION
@@ -57,8 +57,10 @@ The
 .Nm
 (or
 .Nm netcat )
-utility is used for just about anything under the sun involving TCP
-or UDP.
+utility is used for just about anything under the sun involving TCP,
+UDP, or
+.Ux Ns -domain
+sockets.
 It can open TCP connections, send UDP packets, listen on arbitrary
 TCP and UDP ports, do port scanning, and deal with both IPv4 and
 IPv6.
@@ -153,7 +155,7 @@ instead of sequentially within a range o
 assigns them.
 .It Fl S
 Enables the RFC 2385 TCP MD5 signature option.
-.It Fl s Ar source_ip_address
+.It Fl s Ar source
 Specifies the IP of the interface which is used to send the packets.
 For
 .Ux Ns -domain
@@ -234,7 +236,7 @@ If the protocol is not specified, SOCKS 
 Requests that
 .Nm
 should connect to
-.Ar hostname
+.Ar destination
 using a proxy at
 .Ar proxy_address
 and
@@ -252,16 +254,22 @@ It is an error to use this option in con
 option.
 .El
 .Pp
-.Ar hostname
+.Ar destination
 can be a numerical IP address or a symbolic hostname
 (unless the
 .Fl n
 option is given).
-In general, a hostname must be specified,
+In general, a destination must be specified,
 unless the
 .Fl l
 option is given
 (in which case the local host is used).
+For
+.Ux Ns -domain
+sockets, a destination is required and is the socket path to connect to
+(or listen on if the
+.Fl l
+option is given).
 .Pp
 .Ar port
 can be a single integer or a range of ports.
@@ -270,8 +278,7 @@ In general,
 a destination port must be specified,
 unless the
 .Fl U
-option is given
-(in which case a socket must be specified).
+option is given.
 .Sh CLIENT/SERVER MODEL
 It is quite simple to build a very basic client/server model using
 .Nm .
@@ -404,7 +411,7 @@ IP for the local end of the connection:
 .Pp
 Create and listen on a
 .Ux Ns -domain
-socket:
+stream socket:
 .Pp
 .Dl $ nc -lU /var/tmp/dsocket
 .Pp
Index: netcat.c
===
RCS file: /cvs/src/usr.bin/nc/netcat.c,v
retrieving revision 1.99
diff -u -p -r1.99 netcat.c
--- netcat.c8 Jan 2011 00:44:19 -   1.99
+++ netcat.c9 Jan 2011 21:10:45 -
@@ -930,9 +930,9 @@ usage(int ret)
 {
fprintf(stderr,
"usage: nc [-46DdhklnrStUuvz] [-I length] [-i interval] [-O 
length]\n"
-   "\t  [-P proxy_username] [-p source_port] [-s source_ip_address] 
[-T ToS]\n"
+   "\t  [-P proxy_username] [-p source_port] [-s source] [-T ToS]\n"
"\t  [-V rtable] [-w timeout] [-X proxy_protocol]\n"
-   "\t  [-x proxy_address[:port]] [hostname] [port]\n");
+   "\t  [-x proxy_address[:port]] [destination] [port]\n");
if (ret)
exit(1);
 }



Re: new radeon driver ids

2011-01-09 Thread Brad
On Sunday 09 January 2011 14:47:57 Nigel Taylor wrote:
> Hi,
>
> The "0x9715","RS880_9715","RS880",,1,,,1,"ATI Radeon HD 4290", that should
> be "ATI Radeon HD 4250". It's wrong in the xf86-video-ati driver. Needs
> reporting upstream.

Then file a bug report upstream. Mentioning it here isn't of any use.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



Re: new radeon driver ids

2011-01-09 Thread Nigel Taylor
On 01/09/11 17:23, Ted Unangst wrote:
> these are some new IDs extracted from version 6.12.7 of the ati driver.  
> they may not all work, depending on kernel support.  untested, i have no 
> hardware.  part 1 of a broken up ati driver update.
> 
> diff -ru xf86-video-ati-orig/src/ati_pciids_gen.h 
> xf86-video-ati/src/ati_pciids_gen.h
> --- xf86-video-ati-orig/src/ati_pciids_gen.h  Sun Jan  9 11:43:11 2011
> +++ xf86-video-ati/src/ati_pciids_gen.h   Sun Jan  9 11:43:36 2011
> @@ -60,6 +60,8 @@
>  #define PCI_CHIP_R420_JN 0x4A4E
>  #define PCI_CHIP_R420_4A4F 0x4A4F
>  #define PCI_CHIP_R420_JP 0x4A50
> +#define PCI_CHIP_R420_JT 0x4A54
> +#define PCI_CHIP_R481_4B48 0x4B48
>  #define PCI_CHIP_R481_4B49 0x4B49
>  #define PCI_CHIP_R481_4B4A 0x4B4A
>  #define PCI_CHIP_R481_4B4B 0x4B4B
> @@ -334,6 +336,7 @@
>  #define PCI_CHIP_RV770_9440 0x9440
>  #define PCI_CHIP_RV770_9441 0x9441
>  #define PCI_CHIP_RV770_9442 0x9442
> +#define PCI_CHIP_RV770_9443 0x9443
>  #define PCI_CHIP_RV770_9444 0x9444
>  #define PCI_CHIP_RV770_9446 0x9446
>  #define PCI_CHIP_RV770_944A 0x944A
> @@ -351,15 +354,26 @@
>  #define PCI_CHIP_RV770_946B 0x946B
>  #define PCI_CHIP_RV770_947A 0x947A
>  #define PCI_CHIP_RV770_947B 0x947B
> +#define PCI_CHIP_RV730_9480 0x9480
>  #define PCI_CHIP_RV730_9487 0x9487
> +#define PCI_CHIP_RV730_9488 0x9488
>  #define PCI_CHIP_RV730_9489 0x9489
>  #define PCI_CHIP_RV730_948F 0x948F
>  #define PCI_CHIP_RV730_9490 0x9490
>  #define PCI_CHIP_RV730_9491 0x9491
> +#define PCI_CHIP_RV730_9495 0x9495
>  #define PCI_CHIP_RV730_9498 0x9498
>  #define PCI_CHIP_RV730_949C 0x949C
>  #define PCI_CHIP_RV730_949E 0x949E
>  #define PCI_CHIP_RV730_949F 0x949F
> +#define PCI_CHIP_RV740_94A0 0x94A0
> +#define PCI_CHIP_RV740_94A1 0x94A1
> +#define PCI_CHIP_RV740_94A3 0x94A3
> +#define PCI_CHIP_RV740_94B1 0x94B1
> +#define PCI_CHIP_RV740_94B3 0x94B3
> +#define PCI_CHIP_RV740_94B4 0x94B4
> +#define PCI_CHIP_RV740_94B5 0x94B5
> +#define PCI_CHIP_RV740_94B9 0x94B9
>  #define PCI_CHIP_RV610_94C0 0x94C0
>  #define PCI_CHIP_RV610_94C1 0x94C1
>  #define PCI_CHIP_RV610_94C3 0x94C3
> @@ -392,6 +406,7 @@
>  #define PCI_CHIP_RV710_9552 0x9552
>  #define PCI_CHIP_RV710_9553 0x9553
>  #define PCI_CHIP_RV710_9555 0x9555
> +#define PCI_CHIP_RV710_9557 0x9557
>  #define PCI_CHIP_RV630_9580 0x9580
>  #define PCI_CHIP_RV630_9581 0x9581
>  #define PCI_CHIP_RV630_9583 0x9583
> @@ -438,3 +453,4 @@
>  #define PCI_CHIP_RS880_9712 0x9712
>  #define PCI_CHIP_RS880_9713 0x9713
>  #define PCI_CHIP_RS880_9714 0x9714
> +#define PCI_CHIP_RS880_9715 0x9715
> diff -ru xf86-video-ati-orig/src/atipciids.h xf86-video-ati/src/atipciids.h
> --- xf86-video-ati-orig/src/atipciids.h   Sun Jan  9 11:43:11 2011
> +++ xf86-video-ati/src/atipciids.hSun Jan  9 11:43:36 2011
> @@ -41,6 +41,9 @@
>  #define PCI_VENDOR_DELL  0x1028
>  #define PCI_VENDOR_VIA   0x1106
>  #define PCI_VENDOR_INTEL 0x8086
> +#ifndef PCI_VENDOR_HP
> +#define PCI_VENDOR_HP0x103c
> +#endif
>  
>  #include "ati_pciids_gen.h"
>  
> diff -ru xf86-video-ati-orig/src/legacy_crtc.c 
> xf86-video-ati/src/legacy_crtc.c
> --- xf86-video-ati-orig/src/legacy_crtc.c Sun Jan  9 11:43:11 2011
> +++ xf86-video-ati/src/legacy_crtc.c  Sun Jan  9 11:43:36 2011
> @@ -649,6 +649,9 @@
>  if (!info->directRenderingEnabled)
>   return;
>  
> +if (info->ChipFamily >= CHIP_FAMILY_R600)
> + return;
> +
>  modeset.crtc = radeon_crtc->crtc_id;
>  modeset.cmd = post ? _DRM_POST_MODESET : _DRM_PRE_MODESET;
>  
> diff -ru xf86-video-ati-orig/src/pcidb/ati_pciids.csv 
> xf86-video-ati/src/pcidb/ati_pciids.csv
> --- xf86-video-ati-orig/src/pcidb/ati_pciids.csv  Sun Jan  9 11:43:11 2011
> +++ xf86-video-ati/src/pcidb/ati_pciids.csv   Sun Jan  9 11:43:36 2011
> @@ -61,6 +61,8 @@
>  "0x4A4E","R420_JN","R420",1,"ATI Radeon Mobility 9800 (M18) JN (AGP)"
>  "0x4A4F","R420_4A4F","R420",,"ATI Radeon X800 SE (R420) (AGP)"
>  "0x4A50","R420_JP","R420",,"ATI Radeon X800XT (R420) JP (AGP)"
> +"0x4A54","R420_JT","R420",,"ATI Radeon X800 VE (R420) JT (AGP)"
> +"0x4B48","R481_4B48","R420",,"ATI Radeon X850 (R480) (AGP)"
>  "0x4B49","R481_4B49","R420",,"ATI Radeon X850 XT (R480) (AGP)"
>  "0x4B4A","R481_4B4A","R420",,"ATI Radeon X850 SE (R480) (AGP)"
>  "0x4B4B","R481_4B4B","R420",,"ATI Radeon X850 PRO (R480) (AGP)"
> @@ -335,6 +337,7 @@
>  "0x9440","RV770_9440","RV770",,"ATI Radeon 4800 Series"
>  "0x9441","RV770_9441","RV770",,"ATI Radeon HD 4870 x2"
>  "0x9442","RV770_9442","RV770",,"ATI Radeon 4800 Series"
> +"0x9443","RV770_9443","RV770",,"ATI Radeon HD 4850 x2"
>  "0x9444","RV770_9444","RV770",,"ATI FirePro V8750 (FireGL)"
>  "0x9446","RV770_9446","RV770",,"ATI FirePro V7760 (FireGL)"
>  "0x944A","RV770_944A","RV770",1,"ATI Mobility RADEON HD 4850"
> @@ -352,15 +355,26 @@
>  "0x946B","RV770_946B","RV770",1,"ATI M98"
>  "0x947A","RV770_947A","RV770",1,"ATI 

Re: add Radeon HD 4250 to sys/dev/pci/pcidevs

2011-01-09 Thread Nigel Taylor
On 01/09/11 01:14, Brynet wrote:
> Nigel wrote:
>> Hi,
>>
>> You might be interested in other patches for the 880 chip set. See OpenBSD 
>> X11
>> mail lists.
>>
>> ATI/AMD driver for 880G chipset
>>
>> http://marc.info/?l=openbsd-x11&m=128975076103964&w=2
>>
>>
>> I am considering attempting updating to xf86-video-ati v6.13.2 driver, as I 
>> have
>> another missing device HD 545v in my laptop, works with basic vesa driver but
>> would like the correct resolution.
>>
>> Regards
>>
>> Nigel Taylor
>>
> 
> Hi,
> 
> I sent in a patch for my ATI Radeon HD 4250 (..shared with others, so
> just called 4200) and it was applied, product ID is 0x9712 but same chip
> family.
> 
> http://marc.info/?l=openbsd-tech&m=128568931313974&w=2
> http://www.openbsd.org/cgi-bin/cvsweb/src/sys/dev/pci/drm/radeon_drv.c.diff?r1=1.51;r2=1.50
> 
> In my case it works with the older driver, but 2D accel was sluggish and
> XVideo doesn't work at all.
> 
> Once you have the relevant drm bits adapted, the newer driver
> compiles/works fine.. no dri module built yet though.
> 
> I'm not sure why the driver in Xenocara is so old, but I think it has to
> do with broken multihead on some cards.
> 
> $ ftp http://ftp.x.org/pub/individual/driver/xf86-video-ati-6.13.2.tar.gz
> $ tar xvzf xf86-video-ati-6.13.2.tar.gz
> $ cd xf86-video-ati-6.13.2; ./configure --prefix=/usr/X11R6
> --sysconfdir=/etc --mandir=/usr/X11R6/man
> --with-xorg-module-dir=/usr/X11R6/lib/modules
> $ make; sudo make install
> 
> This obviously trashes the existing driver.
> 
> -Bryan.
> 
Hi,

Tried that, nearly works, X windows starts with 1600x900 screen. All was fine
until I exited X windows. Screen did't switch back to console. Ctrl-Alt-F1-4,6
switches to blank screen from X windows,  Ctrl-Alt-F5 switches back to X windows
and restores screen. There are some fixes in git after 6.13.2, which looks like
they might cure this. Other than this I have been using without problems.

Regards

Nigel Taylor



Re: more radeon updates

2011-01-09 Thread Ted Unangst
On Sun, Jan 9, 2011 at 1:48 PM, Matthieu Herrb 
wrote:
> On Sun, Jan 09, 2011 at 12:28:13PM -0500, Ted Unangst wrote:
>> this is most of the rest of the difference between our driver and 6.2.17.
>> I don't claim to understand what any of this does, but these changes
>> looked "big" so I didn't include them in previous diffs.  hopefully this
>> is useful in someway to updating the driver without going all or nothing.
>
> Did you test zaphod mode dual-head configuration ? This is what is
> preventing us to upgadre the radeon driver, since several OpenBSD
> developers use it and rely on it (and it has been broken in Xorg since
> after 6.12.0)

I don't have any hardware, so I didn't test anything. :)

I'm only trying to break the update into pieces to maybe support some
more cards without a full update.  To that end, the IDs diff and
possibly the small fixes diff are more interesting.  There are still
more sections that were rewritten I didn't include in any diff.



Re: more radeon updates

2011-01-09 Thread Matthieu Herrb
On Sun, Jan 09, 2011 at 12:28:13PM -0500, Ted Unangst wrote:
> this is most of the rest of the difference between our driver and 6.2.17.  
> I don't claim to understand what any of this does, but these changes 
> looked "big" so I didn't include them in previous diffs.  hopefully this 
> is useful in someway to updating the driver without going all or nothing.

Did you test zaphod mode dual-head configuration ? This is what is 
preventing us to upgadre the radeon driver, since several OpenBSD 
developers use it and rely on it (and it has been broken in Xorg since 
after 6.12.0)

-- 
Matthieu Herrb



Re: netstat default if

2011-01-09 Thread Nicholas Marriott
Maybe want to use IFG_EGRESS instead of "egress" but otherwise reads
fine and works great, ok nicm.



On Fri, Jan 07, 2011 at 09:36:23PM -0500, Ted Unangst wrote:
> On Sat, 8 Jan 2011, Nicholas Marriott wrote:
> 
> > Nice idea, but maybe it could pick the same one that the interface group
> > "egress" defaults to?
> 
> You're lucky that gives me the same answer. :)
> 
> Index: if.c
> ===
> RCS file: /home/tedu/cvs/src/usr.bin/netstat/if.c,v
> retrieving revision 1.62
> diff -u -r1.62 if.c
> --- if.c  22 Nov 2009 22:22:14 -  1.62
> +++ if.c  8 Jan 2011 02:34:33 -
> @@ -32,6 +32,7 @@
>  
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -488,6 +489,46 @@
>   }
>  }
>  
> +
> +static int
> +isegress(char *name)
> +{
> + static int s = -1;
> + int len;
> + struct ifgroupreq ifgr;
> + struct ifg_req *ifg;
> + int rv = 0;
> +
> + if (s == -1) {
> + if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
> + return 0;
> + }
> +
> + memset(&ifgr, 0, sizeof(ifgr));
> + strlcpy(ifgr.ifgr_name, name, IFNAMSIZ);
> +
> + if (ioctl(s, SIOCGIFGROUP, (caddr_t)&ifgr) == -1) {
> + return 0;
> + }
> +
> + len = ifgr.ifgr_len;
> + ifgr.ifgr_groups = calloc(len, 1);
> + if (ifgr.ifgr_groups == NULL)
> + err(1, "getifgroups");
> + if (ioctl(s, SIOCGIFGROUP, (caddr_t)&ifgr) == -1)
> + err(1, "SIOCGIFGROUP");
> +
> + ifg = ifgr.ifgr_groups;
> + for (; ifg && len >= sizeof(struct ifg_req); ifg++) {
> + len -= sizeof(struct ifg_req);
> + if (strcmp(ifg->ifgrq_group, "egress") == 0)
> + rv = 1;
> + }
> +
> + free(ifgr.ifgr_groups);
> + return rv;
> +}
> +
>  static void
>  fetchifs(void)
>  {
> @@ -500,6 +541,8 @@
>   char *buf, *next, *lim;
>   char name[IFNAMSIZ];
>   size_t len;
> + int takeit = 0;
> + int foundone = 0;
>  
>   if (sysctl(mib, 6, NULL, &len, NULL, 0) == -1)
>   err(1, "sysctl");
> @@ -508,6 +551,7 @@
>   if (sysctl(mib, 6, buf, &len, NULL, 0) == -1)
>   err(1, "sysctl");
>  
> + memset(&ip_cur, 0, sizeof(ip_cur));
>   lim = buf + len;
>   for (next = buf; next < lim; next += rtm->rtm_msglen) {
>   rtm = (struct rt_msghdr *)next;
> @@ -531,6 +575,14 @@
>   memcpy(name, sdl->sdl_data, sdl->sdl_nlen);
>  
>   if (interface != NULL && !strcmp(name, interface)) {
> + takeit = 1;
> + } else if (interface == NULL && foundone == 0 &&
> + isegress(name)) {
> + takeit = 1;
> + foundone = 1;
> + } else
> + takeit = 0;
> + if (takeit) {
>   strlcpy(ip_cur.ift_name, name,
>   sizeof(ip_cur.ift_name));
>   ip_cur.ift_ip = ifd->ifi_ipackets;
> @@ -555,7 +607,7 @@
>   break;
>   }
>   }
> - if (interface == NULL) {
> + if (interface == NULL && foundone == 0) {
>   strlcpy(ip_cur.ift_name, name,
>   sizeof(ip_cur.ift_name));
>   ip_cur.ift_ip = ifd->ifi_ipackets;



small radeon driver fixes

2011-01-09 Thread Ted Unangst
these are some "small" fixes I extracted out of the 6.2.17 driver, that 
seemed somewhat safe or independent.  untested.

diff -ru xf86-video-ati-newid/src/atombios_crtc.c 
xf86-video-ati/src/atombios_crtc.c
--- xf86-video-ati-newid/src/atombios_crtc.cSun Jan  9 11:57:52 2011
+++ xf86-video-ati/src/atombios_crtc.c  Sun Jan  9 12:20:16 2011
@@ -171,13 +171,13 @@
 RADEONInfoPtr  info = RADEONPTR(crtc->scrn);
 switch (mode) {
 case DPMSModeOn:
-case DPMSModeStandby:
-case DPMSModeSuspend:
if (IS_DCE3_VARIANT)
atombios_enable_crtc_memreq(info->atomBIOS, radeon_crtc->crtc_id, 
1);
atombios_enable_crtc(info->atomBIOS, radeon_crtc->crtc_id, 1);
atombios_blank_crtc(info->atomBIOS, radeon_crtc->crtc_id, 0);
break;
+case DPMSModeStandby:
+case DPMSModeSuspend:
 case DPMSModeOff:
atombios_blank_crtc(info->atomBIOS, radeon_crtc->crtc_id, 1);
atombios_enable_crtc(info->atomBIOS, radeon_crtc->crtc_id, 0);
diff -ru xf86-video-ati-newid/src/r600_exa.c xf86-video-ati/src/r600_exa.c
--- xf86-video-ati-newid/src/r600_exa.c Sun Jan  9 11:57:52 2011
+++ xf86-video-ati/src/r600_exa.c   Sun Jan  9 12:20:16 2011
@@ -1109,10 +1109,10 @@
 accel_state->src_pitch[unit] = exaGetPixmapPitch(pPix) / 
(pPix->drawable.bitsPerPixel / 8);
 accel_state->src_size[unit] = exaGetPixmapPitch(pPix) * 
pPix->drawable.height;
 
-if (accel_state->src_pitch[1] & 7)
+if (accel_state->src_pitch[unit] & 7)
RADEON_FALLBACK(("Bad pitch %d 0x%x\n", 
(int)accel_state->src_pitch[unit], unit));
 
-if (accel_state->src_mc_addr[1] & 0xff)
+if (accel_state->src_mc_addr[unit] & 0xff)
RADEON_FALLBACK(("Bad offset %d 0x%x\n", 
(int)accel_state->src_mc_addr[unit], unit));
 
 for (i = 0; i < sizeof(R600TexFormats) / sizeof(R600TexFormats[0]); i++) {
diff -ru xf86-video-ati-newid/src/r6xx_accel.c xf86-video-ati/src/r6xx_accel.c
--- xf86-video-ati-newid/src/r6xx_accel.c   Sun Jan  9 11:57:52 2011
+++ xf86-video-ati/src/r6xx_accel.c Sun Jan  9 12:20:16 2011
@@ -976,7 +976,7 @@
 EREG(ib, PA_SU_POLY_OFFSET_FRONT_OFFSET,  0);
 
 EREG(ib, PA_SU_LINE_CNTL, (8 << 
PA_SU_LINE_CNTL__WIDTH_shift)); /* Line width 1 pixel */
-EREG(ib, PA_SU_VTX_CNTL,  ((2 << 
PA_SU_VTX_CNTL__ROUND_MODE_shift) |
+EREG(ib, PA_SU_VTX_CNTL,  ((2 << 
PA_SU_VTX_CNTL__ROUND_MODE_shift) | PIX_CENTER_bit |
   (5 << QUANT_MODE_shift))); 
/* Round to Even, fixed point 1/256 */
 EREG(ib, PA_SU_POLY_OFFSET_CLAMP, 0);
 
diff -ru xf86-video-ati-newid/src/radeon.h xf86-video-ati/src/radeon.h
--- xf86-video-ati-newid/src/radeon.h   Sun Jan  9 11:57:52 2011
+++ xf86-video-ati/src/radeon.h Sun Jan  9 12:20:16 2011
@@ -475,6 +475,9 @@
 
 drm_handle_t  fbHandle;
 
+drmSize   registerSize;
+drm_handle_t  registerHandle;
+
 drmSize   pciSize;
 drm_handle_t  pciMemHandle;
 unsigned char *PCI; /* Map */
diff -ru xf86-video-ati-newid/src/radeon_accel.c 
xf86-video-ati/src/radeon_accel.c
--- xf86-video-ati-newid/src/radeon_accel.c Sun Jan  9 11:57:52 2011
+++ xf86-video-ati/src/radeon_accel.c   Sun Jan  9 12:16:57 2011
@@ -481,12 +481,17 @@
}
 }
 
+/* RV410 SE cards only have 1 quadpipe */
+if ((info->Chipset == PCI_CHIP_RV410_5E4C) ||
+   (info->Chipset == PCI_CHIP_RV410_5E4F))
+   info->accel_state->num_gb_pipes = 1;
+
 if (IS_R300_3D || IS_R500_3D)
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
   "num quad-pipes is %d\n", info->accel_state->num_gb_pipes);
 
 if (IS_R300_3D || IS_R500_3D) {
-   uint32_t gb_tile_config = (R300_ENABLE_TILING | R300_TILE_SIZE_16 | 
R300_SUBPIXEL_1_16);
+   uint32_t gb_tile_config = (R300_ENABLE_TILING | R300_TILE_SIZE_16);
 
switch(info->accel_state->num_gb_pipes) {
case 2: gb_tile_config |= R300_PIPE_COUNT_R300; break;
diff -ru xf86-video-ati-newid/src/radeon_bios.c xf86-video-ati/src/radeon_bios.c
--- xf86-video-ati-newid/src/radeon_bios.c  Sun Jan  9 11:57:52 2011
+++ xf86-video-ati/src/radeon_bios.cSun Jan  9 12:20:16 2011
@@ -273,6 +273,7 @@
 unsigned char *RADEONMMIO = info->MMIO;
 uint32_t reg;
 
+/* first check CRTCs */
 if (IS_AVIVO_VARIANT) {
reg = INREG(AVIVO_D1CRTC_CONTROL) | INREG(AVIVO_D2CRTC_CONTROL);
if (reg & AVIVO_CRTC_EN)
@@ -282,6 +283,15 @@
if (reg & RADEON_CRTC_EN)
return TRUE;
 }
+
+/* then check MEM_SIZE, in case something turned the crtcs off */
+if (info->ChipFamily >= CHIP_FAMILY_R600)
+   reg = INREG(R600_CONFIG_MEMSIZE);
+else
+   reg = INREG(RADEON_CONFIG_MEMSIZE);
+
+if (reg)
+   return TRUE;
 
 return FALSE;
 }
diff -ru xf86-video-ati-newid/src/radeon_commonfuncs.c 
xf86-video-ati/src/radeon_commonfuncs.c
--- xf86-video-ati-newid/s

new radeon driver ids

2011-01-09 Thread Ted Unangst
these are some new IDs extracted from version 6.12.7 of the ati driver.  
they may not all work, depending on kernel support.  untested, i have no 
hardware.  part 1 of a broken up ati driver update.

diff -ru xf86-video-ati-orig/src/ati_pciids_gen.h 
xf86-video-ati/src/ati_pciids_gen.h
--- xf86-video-ati-orig/src/ati_pciids_gen.hSun Jan  9 11:43:11 2011
+++ xf86-video-ati/src/ati_pciids_gen.h Sun Jan  9 11:43:36 2011
@@ -60,6 +60,8 @@
 #define PCI_CHIP_R420_JN 0x4A4E
 #define PCI_CHIP_R420_4A4F 0x4A4F
 #define PCI_CHIP_R420_JP 0x4A50
+#define PCI_CHIP_R420_JT 0x4A54
+#define PCI_CHIP_R481_4B48 0x4B48
 #define PCI_CHIP_R481_4B49 0x4B49
 #define PCI_CHIP_R481_4B4A 0x4B4A
 #define PCI_CHIP_R481_4B4B 0x4B4B
@@ -334,6 +336,7 @@
 #define PCI_CHIP_RV770_9440 0x9440
 #define PCI_CHIP_RV770_9441 0x9441
 #define PCI_CHIP_RV770_9442 0x9442
+#define PCI_CHIP_RV770_9443 0x9443
 #define PCI_CHIP_RV770_9444 0x9444
 #define PCI_CHIP_RV770_9446 0x9446
 #define PCI_CHIP_RV770_944A 0x944A
@@ -351,15 +354,26 @@
 #define PCI_CHIP_RV770_946B 0x946B
 #define PCI_CHIP_RV770_947A 0x947A
 #define PCI_CHIP_RV770_947B 0x947B
+#define PCI_CHIP_RV730_9480 0x9480
 #define PCI_CHIP_RV730_9487 0x9487
+#define PCI_CHIP_RV730_9488 0x9488
 #define PCI_CHIP_RV730_9489 0x9489
 #define PCI_CHIP_RV730_948F 0x948F
 #define PCI_CHIP_RV730_9490 0x9490
 #define PCI_CHIP_RV730_9491 0x9491
+#define PCI_CHIP_RV730_9495 0x9495
 #define PCI_CHIP_RV730_9498 0x9498
 #define PCI_CHIP_RV730_949C 0x949C
 #define PCI_CHIP_RV730_949E 0x949E
 #define PCI_CHIP_RV730_949F 0x949F
+#define PCI_CHIP_RV740_94A0 0x94A0
+#define PCI_CHIP_RV740_94A1 0x94A1
+#define PCI_CHIP_RV740_94A3 0x94A3
+#define PCI_CHIP_RV740_94B1 0x94B1
+#define PCI_CHIP_RV740_94B3 0x94B3
+#define PCI_CHIP_RV740_94B4 0x94B4
+#define PCI_CHIP_RV740_94B5 0x94B5
+#define PCI_CHIP_RV740_94B9 0x94B9
 #define PCI_CHIP_RV610_94C0 0x94C0
 #define PCI_CHIP_RV610_94C1 0x94C1
 #define PCI_CHIP_RV610_94C3 0x94C3
@@ -392,6 +406,7 @@
 #define PCI_CHIP_RV710_9552 0x9552
 #define PCI_CHIP_RV710_9553 0x9553
 #define PCI_CHIP_RV710_9555 0x9555
+#define PCI_CHIP_RV710_9557 0x9557
 #define PCI_CHIP_RV630_9580 0x9580
 #define PCI_CHIP_RV630_9581 0x9581
 #define PCI_CHIP_RV630_9583 0x9583
@@ -438,3 +453,4 @@
 #define PCI_CHIP_RS880_9712 0x9712
 #define PCI_CHIP_RS880_9713 0x9713
 #define PCI_CHIP_RS880_9714 0x9714
+#define PCI_CHIP_RS880_9715 0x9715
diff -ru xf86-video-ati-orig/src/atipciids.h xf86-video-ati/src/atipciids.h
--- xf86-video-ati-orig/src/atipciids.h Sun Jan  9 11:43:11 2011
+++ xf86-video-ati/src/atipciids.h  Sun Jan  9 11:43:36 2011
@@ -41,6 +41,9 @@
 #define PCI_VENDOR_DELL0x1028
 #define PCI_VENDOR_VIA 0x1106
 #define PCI_VENDOR_INTEL   0x8086
+#ifndef PCI_VENDOR_HP
+#define PCI_VENDOR_HP  0x103c
+#endif
 
 #include "ati_pciids_gen.h"
 
diff -ru xf86-video-ati-orig/src/legacy_crtc.c xf86-video-ati/src/legacy_crtc.c
--- xf86-video-ati-orig/src/legacy_crtc.c   Sun Jan  9 11:43:11 2011
+++ xf86-video-ati/src/legacy_crtc.cSun Jan  9 11:43:36 2011
@@ -649,6 +649,9 @@
 if (!info->directRenderingEnabled)
return;
 
+if (info->ChipFamily >= CHIP_FAMILY_R600)
+   return;
+
 modeset.crtc = radeon_crtc->crtc_id;
 modeset.cmd = post ? _DRM_POST_MODESET : _DRM_PRE_MODESET;
 
diff -ru xf86-video-ati-orig/src/pcidb/ati_pciids.csv 
xf86-video-ati/src/pcidb/ati_pciids.csv
--- xf86-video-ati-orig/src/pcidb/ati_pciids.csvSun Jan  9 11:43:11 2011
+++ xf86-video-ati/src/pcidb/ati_pciids.csv Sun Jan  9 11:43:36 2011
@@ -61,6 +61,8 @@
 "0x4A4E","R420_JN","R420",1,"ATI Radeon Mobility 9800 (M18) JN (AGP)"
 "0x4A4F","R420_4A4F","R420",,"ATI Radeon X800 SE (R420) (AGP)"
 "0x4A50","R420_JP","R420",,"ATI Radeon X800XT (R420) JP (AGP)"
+"0x4A54","R420_JT","R420",,"ATI Radeon X800 VE (R420) JT (AGP)"
+"0x4B48","R481_4B48","R420",,"ATI Radeon X850 (R480) (AGP)"
 "0x4B49","R481_4B49","R420",,"ATI Radeon X850 XT (R480) (AGP)"
 "0x4B4A","R481_4B4A","R420",,"ATI Radeon X850 SE (R480) (AGP)"
 "0x4B4B","R481_4B4B","R420",,"ATI Radeon X850 PRO (R480) (AGP)"
@@ -335,6 +337,7 @@
 "0x9440","RV770_9440","RV770",,"ATI Radeon 4800 Series"
 "0x9441","RV770_9441","RV770",,"ATI Radeon HD 4870 x2"
 "0x9442","RV770_9442","RV770",,"ATI Radeon 4800 Series"
+"0x9443","RV770_9443","RV770",,"ATI Radeon HD 4850 x2"
 "0x9444","RV770_9444","RV770",,"ATI FirePro V8750 (FireGL)"
 "0x9446","RV770_9446","RV770",,"ATI FirePro V7760 (FireGL)"
 "0x944A","RV770_944A","RV770",1,"ATI Mobility RADEON HD 4850"
@@ -352,15 +355,26 @@
 "0x946B","RV770_946B","RV770",1,"ATI M98"
 "0x947A","RV770_947A","RV770",1,"ATI M98"
 "0x947B","RV770_947B","RV770",1,"ATI M98"
+"0x9480","RV730_9480","RV730",1,"ATI Mobility Radeon HD 4650"
 "0x9487","RV730_9487","RV730",,"ATI Radeon RV730 (AGP)"
+"0x9488","RV730_9488","RV730",1,"ATI Mobility Radeon HD 4670"
 "0x9489","RV730_9489","RV73