Any further suggestions? I am going to have to ditch openbsd because of this bug I am afraid fw needs more interfaces ;-/ -current isn't building for me either at the moment.
On 2 June 2011 01:55, Joel Wiramu Pauling <[email protected]> wrote: > Not compiling cleanly against -stable I guess there have been extra > definitions elsewhere. > > ET -DALTQ -DINET6 -DIPSEC -DPPP_BSDCOMP -DPPP_DEFLATE -DMROUTING -DMPLS > -DBOOT_CONFIG -DSUN4US -DSUN4V -DPCIVERBOSE -DUSER_PCICONF -DAPERTURE > -DUSBVERBOSE -DWSEMUL_SUN -DWSEMUL_NO_VT100 -DWSEMUL_DUMB > -DWSDISPLAY_COMPAT_RAWKBD -DONEWIREVERBOSE -DMAXUSERS=64 -D_KERNEL -c > ../../../../dev/pci/if_em.c > ../../../../dev/pci/if_em.c:131: error: 'PCI_PRODUCT_INTEL_82579LM' > undeclared here (not in a function) > ../../../../dev/pci/if_em.c:132: error: 'PCI_PRODUCT_INTEL_82579V' > undeclared here (not in a function) > ../../../../dev/pci/if_em.c: In function 'em_attach': > ../../../../dev/pci/if_em.c:397: error: 'em_82580' undeclared (first use in > this function) > ../../../../dev/pci/if_em.c:397: error: (Each undeclared identifier is > reported only once > ../../../../dev/pci/if_em.c:397: error: for each function it appears in.) > ../../../../dev/pci/if_em.c: In function 'em_init': > ../../../../dev/pci/if_em.c:742: error: 'em_82580' undeclared (first use in > this function) > ../../../../dev/pci/if_em.c:761: error: 'em_pch2lan' undeclared (first use > in this function) > ../../../../dev/pci/if_em.c: In function 'em_update_link_status': > ../../../../dev/pci/if_em.c:1442: error: 'em_82580' undeclared (first use > in this function) > cc1: warnings being treated as errors > ../../../../dev/pci/if_em.c:1442: warning: comparison between pointer and > integer > ../../../../dev/pci/if_em.c: In function 'em_allocate_pci_resources': > ../../../../dev/pci/if_em.c:1603: error: 'em_pch2lan' undeclared (first use > in this function) > ../../../../dev/pci/if_em.c:1603: warning: comparison between pointer and > integer > ../../../../dev/pci/if_em.c: In function 'em_hardware_init': > ../../../../dev/pci/if_em.c:1733: error: 'em_82580' undeclared (first use > in this function) > ../../../../dev/pci/if_em.c:1733: warning: comparison between pointer and > integer > *** Error code 1 > > Stop in /usr/src/sys/arch/sparc64/compile/GENERIC (line 92 of > /usr/share/mk/sys.mk). > > > > > On 2 June 2011 00:57, Joel Wiramu Pauling <[email protected]> wrote: > >> Hrm does not apply cleanly - Maybe I should just grab the CVS of if_em.c ? >> >> >> bash-4.1# patch -i if_em.c.patch >> Hmm... Looks like a unified diff to me... >> The text leading up to this was: >> -------------------------- >> >> |Index: if_em.c >> |=================================================================== >> |RCS file: /cvs/src/sys/dev/pci/if_em.c,v >> |retrieving revision 1.256 >> |diff -u -p -r1.256 if_em.c >> |--- if_em.c 22 Apr 2011 10:09:57 -0000 1.256 >> |+++ if_em.c 1 Jun 2011 09:40:53 -0000 >> -------------------------- >> Patching file if_em.c using Plan A... >> Hunk #1 failed at 3014. >> Hunk #2 failed at 3053. >> 2 out of 2 hunks failed--saving rejects to if_em.c.rej >> done >> bash-4.1# cat if_em.c.rej >> @@ -3014,26 +3014,38 @@ >> >> em_write_pci_cfg(struct em_hw *hw, uint32_t reg, uint16_t *value) >> { >> struct pci_attach_args *pa = &((struct em_osdep *)hw->back)->em_pa; >> - pci_chipset_tag_t pc = pa->pa_pc; >> - /* Should we do read/mask/write...? 16 vs 32 bit!!! */ >> - pci_conf_write(pc, pa->pa_tag, reg, *value); >> + pcireg_t val; >> + >> + val = pci_conf_read(pa->pa_pc, pa->pa_tag, reg & ~0x3); >> + if (reg & 0x2) { >> + val &= 0x0000ffff; >> + val |= (*value << 16); >> + } else { >> + val &= 0xffff0000; >> + val |= *value; >> + } >> + pci_conf_write(pa->pa_pc, pa->pa_tag, reg & ~0x3, val); >> } >> >> void >> em_read_pci_cfg(struct em_hw *hw, uint32_t reg, uint16_t *value) >> { >> struct pci_attach_args *pa = &((struct em_osdep *)hw->back)->em_pa; >> - pci_chipset_tag_t pc = pa->pa_pc; >> - *value = pci_conf_read(pc, pa->pa_tag, reg); >> + pcireg_t val; >> + >> + val = pci_conf_read(pa->pa_pc, pa->pa_tag, reg & ~0x3); >> + if (reg & 0x2) >> + *value = (val >> 16) & 0xffff; >> + else >> + *value = val & 0xffff; >> } >> >> void >> em_pci_set_mwi(struct em_hw *hw) >> { >> struct pci_attach_args *pa = &((struct em_osdep *)hw->back)->em_pa; >> - pci_chipset_tag_t pc = pa->pa_pc; >> - /* Should we do read/mask/write...? 16 vs 32 bit!!! */ >> - pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, >> + >> + pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, >> (hw->pci_cmd_word | CMD_MEM_WRT_INVALIDATE)); >> } >> >> @@ -3041,9 +3053,8 @@ >> em_pci_clear_mwi(struct em_hw *hw) >> { >> struct pci_attach_args *pa = &((struct em_osdep *)hw->back)->em_pa; >> - pci_chipset_tag_t pc = pa->pa_pc; >> - /* Should we do read/mask/write...? 16 vs 32 bit!!! */ >> - pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, >> + >> + pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, >> (hw->pci_cmd_word & ~CMD_MEM_WRT_INVALIDATE)); >> } >> >> On 1 June 2011 21:41, Mark Kettenis <[email protected]> wrote: >> >>> Can you try the diff below? >>> >>> Index: if_em.c >>> =================================================================== >>> RCS file: /cvs/src/sys/dev/pci/if_em.c,v >>> retrieving revision 1.256 >>> diff -u -p -r1.256 if_em.c >>> --- if_em.c 22 Apr 2011 10:09:57 -0000 1.256 >>> +++ if_em.c 1 Jun 2011 09:40:53 -0000 >>> @@ -3014,26 +3014,38 @@ void >>> em_write_pci_cfg(struct em_hw *hw, uint32_t reg, uint16_t *value) >>> { >>> struct pci_attach_args *pa = &((struct em_osdep >>> *)hw->back)->em_pa; >>> - pci_chipset_tag_t pc = pa->pa_pc; >>> - /* Should we do read/mask/write...? 16 vs 32 bit!!! */ >>> - pci_conf_write(pc, pa->pa_tag, reg, *value); >>> + pcireg_t val; >>> + >>> + val = pci_conf_read(pa->pa_pc, pa->pa_tag, reg & ~0x3); >>> + if (reg & 0x2) { >>> + val &= 0x0000ffff; >>> + val |= (*value << 16); >>> + } else { >>> + val &= 0xffff0000; >>> + val |= *value; >>> + } >>> + pci_conf_write(pa->pa_pc, pa->pa_tag, reg & ~0x3, val); >>> } >>> >>> void >>> em_read_pci_cfg(struct em_hw *hw, uint32_t reg, uint16_t *value) >>> { >>> struct pci_attach_args *pa = &((struct em_osdep >>> *)hw->back)->em_pa; >>> - pci_chipset_tag_t pc = pa->pa_pc; >>> - *value = pci_conf_read(pc, pa->pa_tag, reg); >>> + pcireg_t val; >>> + >>> + val = pci_conf_read(pa->pa_pc, pa->pa_tag, reg & ~0x3); >>> + if (reg & 0x2) >>> + *value = (val >> 16) & 0xffff; >>> + else >>> + *value = val & 0xffff; >>> } >>> >>> void >>> em_pci_set_mwi(struct em_hw *hw) >>> { >>> struct pci_attach_args *pa = &((struct em_osdep >>> *)hw->back)->em_pa; >>> - pci_chipset_tag_t pc = pa->pa_pc; >>> - /* Should we do read/mask/write...? 16 vs 32 bit!!! */ >>> - pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, >>> + >>> + pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, >>> (hw->pci_cmd_word | CMD_MEM_WRT_INVALIDATE)); >>> } >>> >>> @@ -3041,9 +3053,8 @@ void >>> em_pci_clear_mwi(struct em_hw *hw) >>> { >>> struct pci_attach_args *pa = &((struct em_osdep >>> *)hw->back)->em_pa; >>> - pci_chipset_tag_t pc = pa->pa_pc; >>> - /* Should we do read/mask/write...? 16 vs 32 bit!!! */ >>> - pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, >>> + >>> + pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, >>> (hw->pci_cmd_word & ~CMD_MEM_WRT_INVALIDATE)); >>> }
