Enabling io/mem space on pci devices

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Enabling io/mem space on pci devices

Mark Kettenis
We have some serious problems with enabling io and/or mem space
decoding on pci devices where we shouldn't.  We have seen this with
pci bridge devices that weren't properly initialized by the firmware,
but we have some evidence that vga legacy decodings are giving is
problems too.  The attached patch is a possible way to fix this, but
might cause problems for people.  To assess the impact we need to test
this patch on as many systems as possible.  If you see any changes in
your dmesg, please mail me the before and after dmesg.  Please also do
this if your machine starts printing "enabling io space" or "enabling
mem space" in dmesg.

Thanks,

Mark

Index: pci.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/pci.c,v
retrieving revision 1.45
diff -u -p -r1.45 pci.c
- --- pci.c 22 Mar 2006 00:36:03 -0000 1.45
+++ pci.c 26 Jun 2006 17:52:52 -0000
@@ -233,6 +233,7 @@ pcisubmatch(struct device *parent, void
 
  success = (*cf->cf_attach->ca_match)(parent, match, aux);
 
+#if 0
  /*
  * My Dell BIOS does not enable certain non-critical PCI devices
  * for IO and memory cycles (e.g. network card). This is
@@ -247,6 +248,7 @@ pcisubmatch(struct device *parent, void
     csr | PCI_COMMAND_MASTER_ENABLE |
     PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE);
  }
+#endif
 
  return (success);
 }
Index: pci_map.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/pci_map.c,v
retrieving revision 1.16
diff -u -p -r1.16 pci_map.c
- --- pci_map.c 31 May 2006 08:58:05 -0000 1.16
+++ pci_map.c 26 Jun 2006 17:52:52 -0000
@@ -306,8 +306,21 @@ pci_mapreg_map(struct pci_attach_args *p
  bus_space_handle_t handle;
  bus_addr_t base;
  bus_size_t size;
+ pcireg_t csr;
  int flags;
  int rv;
+
+ csr = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
+ if (PCI_MAPREG_TYPE(type) == PCI_MAPREG_TYPE_IO) {
+ if ((csr & PCI_COMMAND_IO_ENABLE) == 0)
+ printf(": enabling io space");
+ csr |= PCI_COMMAND_IO_ENABLE;
+ } else {
+ if ((csr & PCI_COMMAND_MEM_ENABLE) == 0)
+ printf(": enabling mem space");
+ csr |= PCI_COMMAND_MEM_ENABLE;
+ }
+ pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, csr);
 
  if (PCI_MAPREG_TYPE(type) == PCI_MAPREG_TYPE_IO) {
  if ((pa->pa_flags & PCI_FLAGS_IO_ENABLED) == 0)

Reply | Threaded
Open this post in threaded view
|

Re: Enabling io/mem space on pci devices

Maxim Bourmistrov
Tested on Dell PowerEdge 1550(GENERIC.MP).
No changes in dmesg.
Moved around some files, kernel compile - stable so far.
dmesg below.

I'm however having a strange iic-output after upgrading to -current.
It has nothing to do with this diff, so ignore it or pass it over.
On -stable iic-output was:
iixpm0 at pci0 dev 15 function 0 "ServerWorks OSB4" rev 0x50: SMI
iic0 at piixpm0
admtemp0 at iic0 addr 0x18: max1617
"unknown" at iic0 addr 0x1a not configured
"unknown" at iic0 addr 0x20 not configured
"unknown" at iic0 addr 0x21 not configured
"unknown" at iic0 addr 0x22 not configured
"unknown" at iic0 addr 0x23 not configured
"unknown" at iic0 addr 0x24 not configured
"unknown" at iic0 addr 0x25 not configured
"unknown" at iic0 addr 0x26 not configured
"unknown" at iic0 addr 0x27 not configured
"unknown" at iic0 addr 0x28 not configured
"unknown" at iic0 addr 0x29 not configured
"unknown" at iic0 addr 0x2a not configured
"unknown" at iic0 addr 0x2b not configured
lmenv0 at iic0 addr 0x2c: lm81 rev 3
lmenv1 at iic0 addr 0x2d: lm81 rev 3
lmenv2 at iic0 addr 0x2e: lm81 rev 3
"unknown" at iic0 addr 0x2f not configured
"unknown" at iic0 addr 0x48 not configured
"unknown" at iic0 addr 0x49 not configured
"unknown" at iic0 addr 0x4a not configured
"unknown" at iic0 addr 0x4b not configured
admtemp1 at iic0 addr 0x4c: max1617
"unknown" at iic0 addr 0x4d not configured
"unknown" at iic0 addr 0x4e not configured
pciide0 at pci0 dev 15 function 1 "ServerWorks OSB4 IDE" rev 0x00: DMA


OpenBSD 3.9-current (GENERIC.MP) #1: Thu Jun 29 09:02:27 CEST 2006
    [hidden email]:/usr/src/sys/arch/i386/compile/GENERIC.MP
cpu0: Intel Pentium III ("GenuineIntel" 686-class) 994 MHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE
real mem  = 536379392 (523808K)
avail mem = 483463168 (472132K)
using 4256 buffers containing 26923008 bytes (26292K) of memory
mainbus0 (root)
bios0 at mainbus0: AT/286+(00) BIOS, date 02/21/03, BIOS32 rev. 0 @ 0xffe90, SMBIOS rev. 2.3 @ 0xfb060 (55 entries)
bios0: Dell Computer Corporation PowerEdge 1550/1000
pcibios0 at bios0: rev 2.1 @ 0xf0000/0x10000
pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xfc730/128 (6 entries)
pcibios0: PCI Interrupt Router at 000:15:0 ("ServerWorks OSB4" rev 0x00)
pcibios0: PCI bus #0 is the last bus
bios0: ROM list: 0xc0000/0x8000 0xc8000/0x6000
mainbus0: Intel MP Specification (Version 1.4) (DELL     POWEREDGE DF)
cpu0 at mainbus0: apid 1 (boot processor)
cpu0: apic clock running at 132 MHz
cpu1 at mainbus0: apid 0 (application processor)
cpu1: Intel Pentium III ("GenuineIntel" 686-class) 994 MHz
cpu1: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE
mainbus0: bus 0 is type PCI
mainbus0: bus 1 is type PCI
mainbus0: bus 2 is type PCI
mainbus0: bus 3 is type ISA
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 11, 16 pins
ioapic0: misconfigured as apic 0, remapped to apid 2
ioapic1 at mainbus0: apid 3 pa 0xfec01000, version 11, 16 pins
ioapic1: misconfigured as apic 0, remapped to apid 3
pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
pchb0 at pci0 dev 0 function 0 "ServerWorks CNB20HE Host" rev 0x23
pci1 at pchb0 bus 1
pchb1 at pci0 dev 0 function 1 "ServerWorks CNB20HE Host" rev 0x01
pchb2 at pci0 dev 0 function 2 "ServerWorks CNB20HE Host" rev 0x01
pchb3 at pci0 dev 0 function 3 "ServerWorks CNB20HE Host" rev 0x01
pci2 at pchb3 bus 2
ahc0 at pci2 dev 5 function 0 "Adaptec AIC-7899 U160" rev 0x01: apic 3 int 11 (irq 7)
scsibus0 at ahc0: 16 targets
sd0 at scsibus0 targ 1 lun 0: <SEAGATE, ST39204LC, 0005> SCSI3 0/direct fixed
sd0: 8683MB, 14384 cyl, 3 head, 412 sec, 512 bytes/sec, 17783239 sec total
sd1 at scsibus0 targ 2 lun 0: <SEAGATE, ST39204LC, 0005> SCSI3 0/direct fixed
sd1: 8683MB, 14384 cyl, 3 head, 412 sec, 512 bytes/sec, 17783239 sec total
safte0 at scsibus0 targ 6 lun 0: <DELL, 1x3 U2W SCSI BP, 1.21> SCSI2 3/processor fixed
ahc1 at pci2 dev 5 function 1 "Adaptec AIC-7899 U160" rev 0x01: apic 3 int 12 (irq 5)
scsibus1 at ahc1: 16 targets
fxp0 at pci0 dev 1 function 0 "Intel 8255x" rev 0x08, i82559: apic 3 int 0 (irq 11), address 00:b0:d0:e1:bf:79
inphy0 at fxp0 phy 1: i82555 10/100 PHY, rev. 4
fxp1 at pci0 dev 2 function 0 "Intel 8255x" rev 0x08, i82559: apic 3 int 1 (irq 10), address 00:b0:d0:e1:bf:7a
inphy1 at fxp1 phy 1: i82555 10/100 PHY, rev. 4
vga1 at pci0 dev 3 function 0 "ATI Rage XL" rev 0x27
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
piixpm0 at pci0 dev 15 function 0 "ServerWorks OSB4" rev 0x50: SMI
iic0 at piixpm0
admtemp0 at iic0 addr 0x18: max1617
lmenv0 at iic0 addr 0x2c: lm81 rev 3
lmenv1 at iic0 addr 0x2d: lm81 rev 3
lmenv2 at iic0 addr 0x2e: lm81 rev 3
iic0: addr 0x48 00=d0 01=d0 02=d0 03=d0 04=d0 05=d0 06=d0 07=d0 08=d0 09=d0 0a=d0 0b=d0 0c=d0 0d=d0 0e=d0 0f=d0 10=d0 11=d0 12=d0 13=d0 14=d0 15=d0 16=d0 17=d0 18=d0 19=d0 1a=d0 1b=d0 1c=d0 1d=d0 1e=d0 1f=d0 20=d0 21=d0 22=d0 23=d0 24=d0 25=d0 26=d0 27=d0 28=d0 29=d0 2a=d0 2b=d0 2c=d0 2d=d0 2e=d0 2f=d0 30=d0 31=d0 32=d0 33=d0 34=d0 35=d0 36=d0 37=d0 38=d0 39=d0 3a=d0 3b=d0 3c=d0 3d=d0 3e=00 3f=d0 40=d0 41=d0 42=d0 43=d0 44=d0 45=d0 46=d0 47=d0 48=00 49=d0 4a=00 4b=d0 4c=d0 4d=d0 4e=00 4f=d0 50=d0 51=d0 52=d0 53=d0 54=d0 55=d0 56=d0 57=d0 58=d0 59=d0 5a=d0 5b=d0 5c=d0 5d=d0 5e=d0 5f=d0 60=d0 61=d0 62=d0 63=d0 64=d0 65=d0 66=d0 67=d0 68=d0 69=d0 6a=d0 6b=d0 6c=d0 6d=d0 6e=d0 6f=d0 70=d0 71=d0 72=d0 73=d0 74=d0 75=d0 76=d0 77=d0 78=d0 79=d0 7a=d0 7b=d0 7c=d0 7d=d0 7e=d0 7f=d0 80=d0 81=d0 82=d0 83=d0 84=d0 85=d0 86=d0 87=d0 88=d0 89=d0 8a=d0 8b=d0 8c=d0 8d=d0 8e=d0 8f=d0 90=d0 91=d0 92=d0 93=d0 94=d0 95=d0 96=d0 97=d0 98=d0 99=d0 9a=d0 9b=d0 9c=d0 9d=d0 9e=d0 9f=d0 a0=d0 a1=d0 a!
 2=d0 a3=d0 a4=d0 a5=d0 a6=d0 a7=d0 a8=d0 a9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0a 32=37 33=3c 34=3c 35=3c 36=3c 37=3c 38=18 39=0a 3a=37 3b=3c 3c=3c 3d=3c 3e=18 3f=3c 40=18 41=0a 42=37 43=3c 44=3c 45=3c 46=3c 47=3c 48=18 49=0a 4a=37 4b=3c 4c=3c 4d=3c 4e=18 4f=3c 50=18 51=0a 52=37 53=3c 54=3c 55=3c 56=3c 57=3c 58=18 59=0a 5a=37 5b=3c 5c=3c 5d=3c 5e=3c 5f=3c 60=18 61=0a 62=37 63=3c 64=3c 65=3c 66=3c 67=3c 68=18 69=0a 6a=37 6b=3c 6c=3c 6d=3c 6e=3c 6f=3c 70=18 71=0a 72=37 73=3c 74=3c 75=3c 76=3c 77=3c 78=18 79=0a 7a=37 7b=3c 7c=3c 7d=3c 7e=3c 7f=3c 80=18 81=0a 82=37 83=3c 84=3c 85=3c 86=3c 87=3c 88=18 89=0a 8a=37 8b=3c 8c=3c 8d=3c 8e=3c 8f=3c 90=18 91=0a 92=37 93=3c 94=3c 95=3c 96=3c 97=3c 98=18 99=0a 9a=37 9b=3c 9c=3c 9d=3c 9e=3c 9f=3c a0=18 a1=0a a!
 2=37 a3=3c a4=3c a5=3c a6=3c a7=3c a8=18 a9=0a aa=37 ab=3c ac=3c ad=3c ae=3c af=3c b0=18 b1=0a b2=37 b3=3c b4=3c b5=3c b6=3c b7=3c b8=18 b9=0a ba=37 bb=3c bc=3c bd=3c be=3c bf=3c c0=18 c1=0a c2=37 c3=3c c4=3c c5=3c c6=3c c7=3c c8=18 c9=0a ca=37 cb=3c cc=3c cd=3c ce=3c cf=3c d0=18 d1=0a d2=37 d3=3c d4=3c d5=3c d6=3c d7=3c d8=18 d9=0a da=37 db=3c dc=3c dd=3c de=3c df=3c e0=18 e1=0a e2=37 e3=3c e4=3c e5=3c e6=3c e7=3c e8=18 e9=0a ea=37 eb=3c ec=3c ed=3c ee=3c ef=3c f0=18 f1=0a f2=37 f3=3c f4=3c f5=3c f6=3c f7=3c f8=18 f9=0a fa=37 fb=3c fc=3c fd=3c fe=18 ff=3c
pciide0 at pci0 dev 15 function 1 "ServerWorks OSB4 IDE" rev 0x00: DMA
atapiscsi0 at pciide0 channel 0 drive 0
scsibus2 at atapiscsi0: 2 targets
cd0 at scsibus2 targ 0 lun 0: <TEAC, CD-224E, 3.7D> SCSI0 5/cdrom removable
cd0(pciide0:0:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 2
isa0 at mainbus0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
spkr0 at pcppi0
npx0 at isa0 port 0xf0/16: using exception 16
pccom0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
biomask 0 netmask 0 ttymask 0
pctr: 686-class user-level performance counters enabled
mtrr: Pentium Pro MTRR support
ahc0: target 1 using 16bit transfers
ahc0: target 1 synchronous at 80.0MHz DT, offset = 0x3f
dkcsum: sd0 matches BIOS drive 0x80
ahc0: target 2 using 16bit transfers
ahc0: target 2 synchronous at 80.0MHz DT, offset = 0x3f
dkcsum: sd1 matches BIOS drive 0x81
root on sd0a
rootdev=0x400 rrootdev=0xd00 rawdev=0xd02

Reply | Threaded
Open this post in threaded view
|

Re: Enabling io/mem space on pci devices

Graham Gower
In reply to this post by Mark Kettenis
On Thu, 29 Jun 2006 00:37:55 +0200 (CEST)
Mark Kettenis <[hidden email]> wrote:

> We have some serious problems with enabling io and/or mem space
> decoding on pci devices where we shouldn't.  We have seen this with
> pci bridge devices that weren't properly initialized by the firmware,
> but we have some evidence that vga legacy decodings are giving is
> problems too.  The attached patch is a possible way to fix this, but
> might cause problems for people.  To assess the impact we need to test
> this patch on as many systems as possible.  If you see any changes in
> your dmesg, please mail me the before and after dmesg.  Please also do
> this if your machine starts printing "enabling io space" or "enabling
> mem space" in dmesg.
>
> Thanks,
>
> Mark

Morning,

No change here either. I'm running current as of about 30 minutes ago
with your patch + "zyd*    at uhub?". Everything works great, except for
the cardbus slot which mocks me with
pccom4 at pcmcia0 function 0: can't allocate i/o space
When I insert a pcmcia card (some random Xircom 100MBit + 56k modem).

Graham


OpenBSD 3.9-current (build) #13: Sat Jul  1 00:41:36 CST 2006
    grg@evo.twenty8:/usr/local/home/grg/OpenBSD/build
cpu0: Intel(R) Pentium(R) 4 Mobile CPU 1.80GHz ("GenuineIntel" 686-class) 1.20 GHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM
real mem  = 536244224 (523676K)
avail mem = 483356672 (472028K)
using 4256 buffers containing 26914816 bytes (26284K) of memory
mainbus0 (root)
bios0 at mainbus0: AT/286+(ff) BIOS, date 05/09/03, SMBIOS rev. 2.3 @ 0xff0dc (29 entries)
bios0: Compaq 07F8
apm0 at bios0: Power Management spec V1.2 (BIOS managing devices)
apm0: battery life expectancy 100%
apm0: AC on, battery charge high
apm0: flags 130102 dobusy 0 doidle 1
pcibios at bios0 function 0x1a not configured
bios0: ROM list: 0xc0000/0x10000
cpu0 at mainbus0
pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
pchb0 at pci0 dev 0 function 0 "Intel 82845 Host" rev 0x04
ppb0 at pci0 dev 1 function 0 "Intel 82845 AGP" rev 0x04
pci1 at ppb0 bus 1
vga1 at pci1 dev 0 function 0 "ATI Radeon Mobility M7 LW" rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
ppb1 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0x42
pci2 at ppb1 bus 2
"Conexant HSF 56k HSFi" rev 0x01 at pci2 dev 4 function 0 not configured
"Texas Instruments TSB43AB22 FireWire" rev 0x00 at pci2 dev 5 function 0 not configured
cbb0 at pci2 dev 6 function 0 "Texas Instruments PCI1410 CardBus" rev 0x02: irq 11
fxp0 at pci2 dev 8 function 0 "Intel PRO/100 VE" rev 0x42, i82562: irq 10, address 00:08:02:ba:a9:3e
inphy0 at fxp0 phy 1: i82562ET 10/100 PHY, rev. 0
ohci0 at pci2 dev 14 function 0 "NEC USB" rev 0x41: irq 10, version 1.0, legacy support
usb0 at ohci0: USB revision 1.0
uhub0 at usb0
uhub0: NEC OHCI root hub, rev 1.00/1.00, addr 1
uhub0: 3 ports with 3 removable, self powered
ohci1 at pci2 dev 14 function 1 "NEC USB" rev 0x41: irq 10, version 1.0, legacy support
usb1 at ohci1: USB revision 1.0
uhub1 at usb1
uhub1: NEC OHCI root hub, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
ehci0 at pci2 dev 14 function 2 "NEC USB" rev 0x02: irq 10
usb2 at ehci0: USB revision 2.0
uhub2 at usb2
uhub2: NEC EHCI root hub, rev 2.00/1.00, addr 1
uhub2: 5 ports with 5 removable, self powered
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 3 device 0 cacheline 0x8, lattimer 0x20
pcmcia0 at cardslot0
ichpcib0 at pci0 dev 31 function 0 "Intel 82801CAM LPC" rev 0x02: SpeedStep
pciide0 at pci0 dev 31 function 1 "Intel 82801CAM IDE" rev 0x02: DMA, channel 0 configured to compatibility, channel 1 configured to compatibility
wd0 at pciide0 channel 0 drive 0: <HITACHI_DK23EA-30>
wd0: 16-sector PIO, LBA, 28615MB, 58605120 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 5
atapiscsi0 at pciide0 channel 1 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: <TOSHIBA, DVD-ROM SD-R2102, 1A16> SCSI0 5/cdrom removable
cd0(pciide0:1:0): using PIO mode 4, DMA mode 2
auich0 at pci0 dev 31 function 5 "Intel 82801CA/CAM AC97" rev 0x02: irq 5, ICH3 AC97
ac97: codec id 0x41445363 (Analog Devices AD1886A)
ac97: codec features headphone, Analog Devices Phat Stereo
audio0 at auich0
isa0 at ichpcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
spkr0 at pcppi0
npx0 at isa0 port 0xf0/16: using exception 16
biomask efdd netmask efdd ttymask ffdf
pctr: user-level cycle counter enabled
pccom3 at pcmcia0 function 0: can't allocate i/o space
zyd0 at uhub2 port 3 configuration 1 interface 0
zyd0: ZyDAS USB2.0 WLAN, rev 2.00/43.30, addr 2
Setting debug flags
dkcsum: wd0 matches BIOS drive 0x80
root on wd0a
rootdev=0x0 rrootdev=0x300 rawdev=0x302
Firmware upload: imgsize=5120
Firmware upload: tlen=4096, value=ee00
Firmware upload: tlen=1024, value=f600
zyd0: Firmware successfully uploaded
A total of 4 endpoints available
Endpoint 0: out bulk
Endpoint 1: in bulk
Endpoint 2: in int
Endpoint 3: out int
zydintr: status=0
zyd_hw_init: firmware_base = 0xF7D4
zydintr: status=0
zydintr: status=0
zydintr: status=0
zydintr: status=0
zydintr: status=0
rf_init(): ir1 = 75, ir2 = 17
Entering zyd_rfwrite()
zydintr: status=0
Finished zyd_rfwrite(): rv = 0, wrote 24 bits
Entering zyd_rfwrite()
zydintr: status=0
Finished zyd_rfwrite(): rv = 0, wrote 24 bits
Entering zyd_rfwrite()
zydintr: status=0
Finished zyd_rfwrite(): rv = 0, wrote 24 bits
Entering zyd_rfwrite()
zydintr: status=0
Finished zyd_rfwrite(): rv = 0, wrote 24 bits
Entering zyd_rfwrite()
zydintr: status=0
Finished zyd_rfwrite(): rv = 0, wrote 24 bits
Entering zyd_rfwrite()
zydintr: status=0
Finished zyd_rfwrite(): rv = 0, wrote 24 bits
Entering zyd_rfwrite()
zydintr: status=0
Finished zyd_rfwrite(): rv = 0, wrote 24 bits
Entering zyd_rfwrite()
zydintr: status=0
Finished zyd_rfwrite(): rv = 0, wrote 24 bits
Entering zyd_rfwrite()
zydintr: status=0
Finished zyd_rfwrite(): rv = 0, wrote 24 bits
Entering zyd_rfwrite()
zydintr: status=0
Finished zyd_rfwrite(): rv = 0, wrote 24 bits
Entering zyd_rfwrite()
zydintr: status=0
Finished zyd_rfwrite(): rv = 0, wrote 24 bits
Entering zyd_rfwrite()
zydintr: status=0
Finished zyd_rfwrite(): rv = 0, wrote 24 bits
Entering zyd_rfwrite()
zydintr: status=0
Finished zyd_rfwrite(): rv = 0, wrote 24 bits
Entering zyd_rfwrite()
zydintr: status=0
Finished zyd_rfwrite(): rv = 0, wrote 24 bits
Entering zyd_rfwrite()
zydintr: status=0
Finished zyd_rfwrite(): rv = 0, wrote 24 bits
Entering zyd_rfwrite()
zydintr: status=0
Finished zyd_rfwrite(): rv = 0, wrote 24 bits
Entering zyd_rfwrite()
zydintr: status=0
Finished zyd_rfwrite(): rv = 0, wrote 24 bits
rf_init(). rv = 0
zydintr: status=0
zydintr: status=0
aw 0 pt 0 bi 0
zyd_hw_init: rv = 0, stage = 9
zydintr: status=0
zydintr: status=0
zyd0: Firmware 0x4605, Radio RFMD, PA 0, address 00:0b:9d:01:6c:a2
zydintr: status=0
zydintr: status=0
zydintr: status=0
zydintr: status=0
zydintr: status=0
zydintr: status=0
zydintr: status=0
zydintr: status=0
zydintr: status=0
zydintr: status=0
zydintr: status=0
zydintr: status=0
zydintr: status=0
zydintr: status=0
zydintr: status=0
zydintr: status=0
zydintr: status=0
zydintr: status=0
zydintr: status=0
zydintr: status=0
Loading regdomain
zydintr: status=0
Regdomain supported?
EXITING complete_attach(): Status = 0
Executing next_scan