Re: Safe C

2014-09-25 Thread Matti Karnaattu
Hi Daniel,

I'm aware that and dozen others,
but I'm interested tooling used or attempts to use in OpenBSD.



tplink TL-WN722N (ath ar9271): athn0: could not load firmware (and firmware is there)

2014-09-25 Thread Abel Abraham Camarillo Ojeda
I have this usb dongle:


http://www.tp-link.com/en/products/details/?model=tl-wn722n#over

Tplink TL-WN722N, which according to driver (*.inf) is an atheros ar9271 device.

after inserting in usb slot I get:

athn0 at uhub1 port 3 ATHEROS USB2.0 WLAN rev 2.00/1.08 addr 2
athn0: could not load firmware

and nothing else happens, with it inserted I ran fw_update(1), and
then tried to remove it and insert it again, still same message.

should it work?

Thanks.


$ ls -alsh /etc/firmware
140 -r--r--r--  1 root  bin  69.0K Jul 30 07:04 /etc/firmware/athn-ar7010
140 -r--r--r--  1 root  bin  69.0K Jul 30 07:04 /etc/firmware/athn-ar7010-11
104 -r--r--r--  1 root  bin  50.1K Jul 30 07:04 /etc/firmware/athn-ar9271
  8 -r--r--r--  1 root  bin   2.2K Jul 30 07:04 /etc/firmware/athn-license
$

dmesg:
OpenBSD 5.6-current (GENERIC.MP) #364: Thu Sep  4 02:57:22 MDT 2014
t...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 17124114432 (16330MB)
avail mem = 16659546112 (15887MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.7 @ 0xeed90 (55 entries)
bios0: vendor American Megatrends Inc. version 1605 date 10/25/2012
bios0: ASUSTeK COMPUTER INC. M5A97
acpi0 at bios0: rev 2
acpi0: sleep states S0 S1 S3 S4 S5
acpi0: tables DSDT FACP APIC MCFG HPET SSDT IVRS
acpi0: wakeup devices SBAZ(S4) PS2K(S3) PS2M(S3) UAR1(S4) P0PC(S4)
UHC1(S4) UHC2(S4) USB3(S4) UHC4(S4) USB5(S4) UHC6(S4) UHC7(S4)
PE20(S4) PE21(S4) PE22(S4) PE23(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 32 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: AMD Phenom(tm) II X4 955 Processor, 3211.13 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,CX16,POPCNT,NXE,MMXX,FFXSR,PAGE1GB,LONG,3DNOW2,3DNOW,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,NODEID,ITSC
cpu0: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB
64b/line 16-way L2 cache, 6MB 64b/line 48-way L3 cache
cpu0: ITLB 32 4KB entries fully associative, 16 4MB entries fully associative
cpu0: DTLB 48 4KB entries fully associative, 48 4MB entries fully associative
cpu0: AMD erratum 721 detected and fixed
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 200MHz
cpu0: mwait min=64, max=64, C-substates=0.0.0.0.0, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: AMD Phenom(tm) II X4 955 Processor, 3210.72 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,CX16,POPCNT,NXE,MMXX,FFXSR,PAGE1GB,LONG,3DNOW2,3DNOW,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,NODEID,ITSC
cpu1: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB
64b/line 16-way L2 cache, 6MB 64b/line 48-way L3 cache
cpu1: ITLB 32 4KB entries fully associative, 16 4MB entries fully associative
cpu1: DTLB 48 4KB entries fully associative, 48 4MB entries fully associative
cpu1: AMD erratum 721 detected and fixed
cpu1: smt 0, core 1, package 0
cpu2 at mainbus0: apid 2 (application processor)
cpu2: AMD Phenom(tm) II X4 955 Processor, 3210.72 MHz
cpu2: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,CX16,POPCNT,NXE,MMXX,FFXSR,PAGE1GB,LONG,3DNOW2,3DNOW,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,NODEID,ITSC
cpu2: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB
64b/line 16-way L2 cache, 6MB 64b/line 48-way L3 cache
cpu2: ITLB 32 4KB entries fully associative, 16 4MB entries fully associative
cpu2: DTLB 48 4KB entries fully associative, 48 4MB entries fully associative
cpu2: AMD erratum 721 detected and fixed
cpu2: smt 0, core 2, package 0
cpu3 at mainbus0: apid 3 (application processor)
cpu3: AMD Phenom(tm) II X4 955 Processor, 3210.72 MHz
cpu3: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,MWAIT,CX16,POPCNT,NXE,MMXX,FFXSR,PAGE1GB,LONG,3DNOW2,3DNOW,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,NODEID,ITSC
cpu3: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB
64b/line 16-way L2 cache, 6MB 64b/line 48-way L3 cache
cpu3: ITLB 32 4KB entries fully associative, 16 4MB entries fully associative
cpu3: DTLB 48 4KB entries fully associative, 48 4MB entries fully associative
cpu3: AMD erratum 721 detected and fixed
cpu3: smt 0, core 3, package 0
ioapic0 at mainbus0: apid 5 pa 0xfec0, version 21, 24 pins
ioapic1 at mainbus0: apid 6 pa 0xfec2, version 21, 32 pins
acpimcfg0 at acpi0 addr 0xe000, bus 0-255
acpihpet0 at acpi0: 14318180 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 4 (P0PC)
acpiprt2 at acpi0: bus -1 (PE20)
acpiprt3 at acpi0: bus -1 (PE21)
acpiprt4 at acpi0: bus -1 (PE22)
acpiprt5 at acpi0: bus -1 (PE23)
acpiprt6 at acpi0: 

Re: tplink TL-WN722N (ath ar9271): athn0: could not load firmware (and firmware is there)

2014-09-25 Thread Sébastien Marie
Hi,

On Thu, Sep 25, 2014 at 06:18:11PM -0500, Abel Abraham Camarillo Ojeda wrote:
 I have this usb dongle:
 
 http://www.tp-link.com/en/products/details/?model=tl-wn722n#over
 
 Tplink TL-WN722N, which according to driver (*.inf) is an atheros ar9271 
 device.
 
 after inserting in usb slot I get:
 
 athn0 at uhub1 port 3 ATHEROS USB2.0 WLAN rev 2.00/1.08 addr 2
 athn0: could not load firmware
 
 and nothing else happens, with it inserted I ran fw_update(1), and
 then tried to remove it and insert it again, still same message.
 
 should it work?

it should. I have the same device, and it works here (-current, but it
works also in 5.5).

 $ ls -alsh /etc/firmware
 140 -r--r--r--  1 root  bin  69.0K Jul 30 07:04 /etc/firmware/athn-ar7010
 140 -r--r--r--  1 root  bin  69.0K Jul 30 07:04 /etc/firmware/athn-ar7010-11
 104 -r--r--r--  1 root  bin  50.1K Jul 30 07:04 /etc/firmware/athn-ar9271
   8 -r--r--r--  1 root  bin   2.2K Jul 30 07:04 /etc/firmware/athn-license
 $

$ ls -alsh /etc/firmware/athn-*
140 -r--r--r--  1 root  bin  69.0K Jan 11  2014 /etc/firmware/athn-ar7010
140 -r--r--r--  1 root  bin  69.0K Jan 11  2014 /etc/firmware/athn-ar7010-11
104 -r--r--r--  1 root  bin  50.1K Jan 11  2014 /etc/firmware/athn-ar9271
  8 -r--r--r--  1 root  bin   2.2K Jan 11  2014 /etc/firmware/athn-license

$ sha1 /etc/firmware/athn-* 
SHA1 (/etc/firmware/athn-ar7010) = 4712a8674f6d32b3d2bb548d304177a0fea09558
SHA1 (/etc/firmware/athn-ar7010-11) = 08d0587306e965cd7b04c0715114978395b5ac35
SHA1 (/etc/firmware/athn-ar9271) = 494bc6957da8f6d04d68f8594337fee356c190d3
SHA1 (/etc/firmware/athn-license) = 5fc3ee1bec135933fd8b1c73191e7d7556b9eed0

$ pkg_info athn-firmware
Information for inst:athn-firmware-1.1p1
[...]

$ dmesg | grep athn
athn0 at uhub0 port 4 ATHEROS USB2.0 WLAN rev 2.00/1.08 addr 2
athn0: AR9271 rev 1 (1T1R), ROM rev 13, address c0:4a:00:1c:c0:aa

-- 
Sébastien Marie



Fix slow DHCP requests in /etc/netstart

2014-09-25 Thread Alexander Hall
Before performing a dhcp request, /etc/netstart explicitly takes the
interface down. As noted (by me) at g2k14, and also at work, this results
in a significant delay in getting the address.

I'm not all into enterprise switch magic, but someone hinted that this
could come from the switch reinitializing the port, with all kinds of
spanning-tree magic etc involved.

Looking at the history of pre-dhclient ' down' in /etc/netstart
(introduced in -r1.43, 18 Sep 1998 18:42:10), I cannot see a reason
for keeping it.

This cuts 'sh /etc/netstart' time from ~minute to ~nothing at work.

OK?

/Alexander


Index: netstart
===
RCS file: /cvs/src/etc/netstart,v
retrieving revision 1.141
diff -u -p -r1.141 netstart
--- netstart12 Jul 2014 14:39:31 -  1.141
+++ netstart26 Sep 2014 05:32:22 -
@@ -63,7 +63,7 @@ ifstart() {
[ $name = NONE ]  name=
[ $mask = NONE ]  mask=
[ $bcaddr = NONE ]  bcaddr=
-   cmd=ifconfig $if $name $mask $bcaddr $ext1 $ext2 down
+   cmd=ifconfig $if $name $mask $bcaddr $ext1 $ext2
cmd=$cmd;dhclient $if
dhcpif=$dhcpif $if
;;