SiS190 driver: How to do pci_get_device and pci_read_config_byte
Hello, I'm trying to port the SiS190 driver from freeBSD. So far I've been quite successful. It compiles without warnings and finds the the MAC and in my case the Realtek PHY. Sadly I only have one PC with one NIC so I can do no real testing. My dsl modem with PPPoE does not yet work. Still I can see some activity on the link when I try to set it up. The driver is attached. It still needs some cleanup, but first I want to get working. Please read on if you have only little knowledge about the pci support in the openBSD kernel. I have none and probably only need a small hint. It probably doesn't yet work because the driver is not able to read the MAC address. On linux the chip works and on dmesg I read: sis190 Gigabit Ethernet driver 1.3 loaded. alloc irq_desc for 19 on node -1 alloc kstat_irqs on node -1 sis190 :00:04.0: PCI INT A - GSI 19 (level, low) - IRQ 19 sis190 :00:04.0: setting latency timer to 64 :00:04.0: Read MAC address from EEPROM :00:04.0: Error EEPROM read 0. Same as above on my ported driver for openBSD. :00:04.0: Read MAC address from APC. :00:04.0: Realtek PHY RTL8201 transceiver at address the relevant parts from the linux driver for Read MAC address from APC can be found below for you convenience. Now my problem is I have very little BSD experience. I now have used it only for four days and have no clue how to port this function. And weather similar functions/macros exist in openBSD. Any little hint is appreciated. Thanks. Cheers, Christopher Zimmermann rc = sis190_get_mac_addr_from_eeprom(pdev, dev); /* This seems to fail */ if (rc 0) { u8 reg; pci_read_config_byte(pdev, 0x73, reg); /* How to do this in openBSD */ if (reg 0x0001) rc = sis190_get_mac_addr_from_apc(pdev, dev); } /** * sis190_get_mac_addr_from_apc - Get MAC address for SiS96x model * @pdev: PCI device * @dev: network device to get address for * * SiS96x model, use APC CMOS RAM to store MAC address. * APC CMOS RAM is accessed through ISA bridge. * MAC address is read into @net_dev-dev_addr. */ static int __devinit sis190_get_mac_addr_from_apc(struct pci_dev *pdev, struct net_device *dev) { static const u16 __devinitdata ids[] = { 0x0965, 0x0966, 0x0968 }; struct sis190_private *tp = netdev_priv(dev); struct pci_dev *isa_bridge; u8 reg, tmp8; unsigned int i; net_probe(tp, KERN_INFO %s: Read MAC address from APC.\n, pci_name(pdev)); /* * Now this is the interesting part. How do I do this on openBSD? * Here's the linux source for pc_get_device: * ** * pci_get_device - begin or continue searching for a PCI device by vendor/device id * @vendor: PCI vendor id to match, or %PCI_ANY_ID to match all vendor ids * @device: PCI device id to match, or %PCI_ANY_ID to match all device ids * @from: Previous PCI device found in search, or %NULL for new search. * * Iterates through the list of known PCI devices. If a PCI device is * found with a matching @vendor and @device, the reference count to the * device is incremented and a pointer to its device structure is returned. * Otherwise, %NULL is returned. A new search is initiated by passing %NULL * as the @from argument. Otherwise if @from is not %NULL, searches continue * from next device on the global list. The reference count for @from is * always decremented if it is not %NULL. */ struct pci_dev * pci_get_device(unsigned int vendor, unsigned int device, struct pci_dev *from) { return pci_get_subsys(vendor, device, PCI_ANY_ID, PCI_ANY_ID, from); } for (i = 0; i ARRAY_SIZE(ids); i++) { isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, ids[i], NULL); if (isa_bridge) break; } if (!isa_bridge) { net_probe(tp, KERN_INFO %s: Can not find ISA bridge.\n, pci_name(pdev)); return -EIO; } /* Enable port 78h 79h to access APC Registers. */ pci_read_config_byte(isa_bridge, 0x48, tmp8); reg = (tmp8 ~0x02); pci_write_config_byte(isa_bridge, 0x48, reg); udelay(50); pci_read_config_byte(isa_bridge, 0x48, reg); for (i = 0; i MAC_ADDR_LEN; i++) { outb(0x9 + i, 0x78); dev-dev_addr[i] = inb(0x79); } outb(0x12, 0x78); reg = inb(0x79); sis190_set_rgmii(tp, reg); /* Restore the value to ISA Bridge */ pci_write_config_byte(isa_bridge, 0x48, tmp8); pci_dev_put(isa_bridge); return 0; } /*- * Copyright (c) 2007, 2008 Alexander Pohoyda alexander.poho...@gmx.net * Copyright (c) 1997, 1998, 1999 * Bill Paul wp...@ctr.columbia.edu. All rights reserved. * * Redistribution and use in
Re: SiS190 driver: How to do pci_get_device and pci_read_config_byte
Date: Mon, 5 Oct 2009 09:51:39 +0200 From: Christopher Zimmermann madro...@zakweb.de rc = sis190_get_mac_addr_from_eeprom(pdev, dev); /* This seems to fail */ if (rc 0) { u8 reg; pci_read_config_byte(pdev, 0x73, reg); /* How to do this in openBSD */ You can't really do byte-access on PCI config space. So to access the byte at offset 0x73, you need to do something like: reg = (pci_conf(pa-pa_pc, pa-pa_tag, 0x70) 24); for (i = 0; i ARRAY_SIZE(ids); i++) { isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, ids[i], NULL); if (isa_bridge) break; } Here you, you'll want to use pci_find_device(). There is a reasonable example in dev/pci/agp.c. You'll need to write your own match function that matches the SiS ISA bridge instead of a generic VGA device and use that in the pci_find_device() call. Cheers, Mark
Re: Broadcom BCM5787
On 2009/10/05 11:21, Daniel Rapp wrote: Hi, hope this is the right mailing list for this question: We have a Acrosser AR-M0898A, great little machine for a firewall but I cant get the Broadcom BCM5787 gigabit network cards to work, from what info I can find on BCM5787 it is supported but the two network cards don't even show up.. Does anybody know if the BCM5787 chip does work or is there any known issues with it ? It should work. Where's the dmesg?
FW: Broadcom BCM5787
Hi, Here are the dmesg and pcidump -v I have asked the developers and they are positive ther is two gigabit network ports with BCM5787 chipset on there, there are also two 10/100 ports with the BCM4401 and those are found.. Phoenix Technologies, LTD System Configurations +=== ===+ | CPU Type : VIA C7 Base Memory :640K | | CPU ID/ucode ID : 06D0Extended Memory : 506880K | | CPU Clock : 1.00GHz Cache Memory : 128K | |--- ---| | Diskette Drive A : NoneDisplay Type : Auto | | Diskette Drive B : NoneSerial Port(s): 3F8 2F8 | | Pri. Master Disk : NoneParallel Port(s) : None | | Pri. Slave Disk : NoneDDR2 SDRAM at Rank : 0 | | Sec. Master Disk : LBA,ATA 33, 4110MB | | Sec. Slave Disk : None | +=== ===+ PCI device listing ... Bus No. Device No. Func No. Vendor/Device Class Device Class IRQ 0 15 0 1106 5287 0101 IDE Cntrlr 14 0 16 0 1106 3038 0C03 USB 1.0/1.1 UHCI Cntrlr 11 0 16 1 1106 3038 0C03 USB 1.0/1.1 UHCI Cntrlr 7 0 16 2 1106 3038 0C03 USB 1.0/1.1 UHCI Cntrlr 10 0 16 3 1106 3038 0C03 USB 1.0/1.1 UHCI Cntrlr 5 OpenBSD/i386 BOOT 3.02... boot booting hd0a:/bsd: 6039964+1059784 [52+336688+318896]=0x7657ec entry point at 0x200120 [ using 656008 bytes of bsd ELF symbol table ] Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. Copyright (c) 1995-2009 OpenBSD. All rights reserved. http://www.OpenBSD.org OpenBSD 4.5 (GENERIC) #1749: Sat Feb 28 14:51:18 MST 2009 dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC cpu0: VIA C7 Processor 1000MHz (CentaurHauls 686-class) 1 GHz cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,CMOV,PAT,CFLUSH,ACP I,MMX,FXSR,SSE,SSE2,TM,SBF,SSE3,EST,TM2,xTPR real mem = 519663616 (495MB) avail mem = 494170112 (471MB) mainbus0 at root bios0 at mainbus0: AT/286+ BIOS, date 05/27/08, BIOS32 rev. 0 @ 0xfb5c0, SMBIOS rev. 2.3 @ 0xf0800 (33 entries) bios0: vendor Phoenix Technologies, LTD version 6.00 PG date 05/27/2008 apm0 at bios0: Power Management spec V1.2 (slowidle) apm0: AC on, battery charge unknown acpi at bios0 function 0x0 not configured pcibios0 at bios0: rev 3.0 @ 0xf/0xdc04 pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xfda50/416 (24 entries) pcibios0: bad IRQ table checksum pcibios0: PCI BIOS has 25 Interrupt Routing table entries pcibios0: PCI Exclusive IRQs: 5 7 10 11 pcibios0: no compatible PCI ICU found pcibios0: Warning, unable to fix up PCI interrupt routing pcibios0: PCI bus #2 is the last bus bios0: ROM list: 0xc/0xf200 0xd/0x8000! cpu0 at mainbus0: (uniprocessor) cpu0: RNG AES AES-CTR SHA1 SHA256 RSA cpu0: unknown Enhanced SpeedStep CPU, msr 0x08100a1308000a13 cpu0: using only highest and lowest power states cpu0: Enhanced SpeedStep 1333 MHz (1004 mV): speeds: 1333, 1067 MHz pci0 at mainbus0 bus 0: configuration mode 1 (bios) pchb0 at pci0 dev 0 function 0 VIA CN700 Host rev 0x00 viaagp0 at pchb0: v3 agp0 at viaagp0: aperture at 0xd000, size 0x1000 pchb1 at pci0 dev 0 function 1 VIA CN700 Host rev 0x00 pchb2 at pci0 dev 0 function 2 VIA CN700 Host rev 0x00 pchb3 at pci0 dev 0 function 3 VIA PT890 Host rev 0x00 pchb4 at pci0 dev 0 function 4 VIA CN700 Host rev 0x00 pchb5 at pci0 dev 0 function 7 VIA CN700 Host rev 0x00 ppb0 at pci0 dev 1 function 0 VIA VT8377 AGP rev 0x00 pci1 at ppb0 bus 1 vga1 at pci1 dev 0 function 0 VIA S3 Unichrome PRO IGP rev 0x01 wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation) wsdisplay0: screen 1-5 added (80x25, vt100 emulation) pciide0 at pci0 dev 15 function 0 vendor VIA, unknown product 0x5287 rev 0x07: DMA (unsupported), channel 0 configured to compatibility, channel 1 configured to compatibility pciide0: channel 0 ignored (not responding; disabled or no drives?) wd0 at pciide0 channel 1 drive 0: SanDisk SDCFX3-004G wd0: 4-sector PIO, LBA, 3919MB, 8027712 sectors uhci0 at pci0 dev 16 function 0 VIA VT83C572 USB rev 0x91: irq 11 uhci1 at pci0 dev 16 function 1 VIA VT83C572 USB rev 0x91: irq 7 uhci2 at pci0 dev 16 function 2 VIA VT83C572 USB rev 0x91: irq 10 uhci3 at pci0 dev 16 function 3 VIA VT83C572 USB rev 0x91: irq 5 ehci0 at pci0 dev 16 function 4 VIA VT6202 USB rev 0x90: irq 7 usb0 at ehci0: USB revision 2.0 uhub0 at usb0 VIA EHCI root hub rev 2.00/1.00 addr 1 viapm0 at pci0 dev 17 function 0 VIA VT8251 ISA rev 0x00 iic0 at viapm0 spdmem0 at iic0 addr 0x50: 512MB DDR2
Re: FW: Broadcom BCM5787
On 2009/10/05 14:03, Daniel Rapp wrote: Hi, Here are the dmesg and pcidump -v I have asked the developers and they are positive ther is two gigabit network ports with BCM5787 chipset on there, there are also two 10/100 ports with the BCM4401 and those are found.. pchb6 at pci0 dev 17 function 7 VIA VT8251 VLINK rev 0x00 you need sys/arch/i386/pci/pchb.c r1.78 - you can either run a snapshot or backport it yourself.
OpenBSD 4.6 crashing on kernel boot due to ahci0 seemingly
Hi, My machine is Running OpenBSD/amd64 4.6 (snapshot 02 Oct 2009) The kernel crashed on AHCI detection. ahci0 at pci0 dev 18 function 0 ATI SB600 SATA rev 0x00: apic 2 int 22 (irq 11), AHCI 1.1 scsibus0 at achci0: 32 targets sd0 at scsibus0 targ 0 lun 0: ATA, Hitachi HDS72161, P220 SCSI3 0/direct fixed sd0: 152627MB, 512 bytes/sec, 312581808 sec total panic: kernel diagnostic assertion ccb-ccb_xa.state == ATA_S_ONCHIP failed: ../../../../dev/pci/ahci.c, line 1812 Stopped at Debugger+0x5: leave Debugger() at Debugger+0x5 panic() at panic+0x122 __assert() at __assert+0x21 ahci_port_intr() at ahci_port_intr+0x218 ahci_poll() at ahci_poll+0x4d ahci_ata_cmd() at ahci_ata_cmd+0x9b atat_exec() at ata_exec+0x19 scsi_xs_exec() at scsi_xs_exec+0x38 scsi_scsi_cmd() at scsi_scsi_cmd+0x98 scsi_test_unit_ready() at scsi_test_unit_ready+0x43 end trace frame: 0x80898a30, count 0 The only way to make the machine boot is boot -c UKC disable ahci then set the fstab to use wd0 (Disable ACPI does not change a thing) Following is dmesg with AHCI disabled: UKC disable ahci 67 ahci* disabled 68 ahci* disabled UKC quit Continuing... mainbus0 at root bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xf06b0 (51 entries) bios0: vendor LENOVO version 2ZKT34AUS date 09/26/2007 bios0: LENOVO 6418A17 acpi0 at bios0: rev 0 acpi0: tables DSDT FACP APIC MCFG SLIC OEMB HPET SSDT acpi0: wakeup devices PCE2(S4) PCE6(S4) PCE7(S4) SBAZ(S4) PS2K(S3) PS2M(S3) P0PC(S4) AC97(S4) MC97(S4) USB1(S4) USB2 (S4) USB3(S4) USB4(S4) USB5(S4) EUSB(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 Athlon(tm) 64 X2 Dual Core Processor BE-235, 2100.39 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,CX16 ,NXE,MMXX,FFXSR,LONG,3DNOW2,3DNOW cpu0: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB 64b/line 16-way L2 cache cpu0: ITLB 32 4KB entries fully associative, 8 4MB entries fully associative cpu0: DTLB 32 4KB entries fully associative, 8 4MB entries fully associative cpu0: apic clock running at 200MHz cpu1 at mainbus0: apid 1 (application processor) cpu1: AMD Athlon(tm) 64 X2 Dual Core Processor BE-235, 2100.08 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,CX16 ,NXE,MMXX,FFXSR,LONG,3DNOW2,3DNOW cpu1: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB 64b/line 16-way L2 cache cpu1: ITLB 32 4KB entries fully associative, 8 4MB entries fully associative cpu1: DTLB 32 4KB entries fully associative, 8 4MB entries fully associative ioapic0 at mainbus0: apid 2 pa 0xfec0, version 21, 24 pins acpihpet0 at acpi0: 14318180 Hz acpiprt0 at acpi0: bus 0 (PCI0) acpiprt1 at acpi0: bus 1 (P0P1) acpiprt2 at acpi0: bus -1 (PCE2) acpiprt3 at acpi0: bus -1 (PCE6) acpiprt4 at acpi0: bus 2 (PCE7) acpicpu0 at acpi0: PSS acpicpu1 at acpi0: PSS acpibtn0 at acpi0: PWRB cpu0: PowerNow! K8 2100 MHz: speeds: 2100 2000 1800 1000 MHz pci0 at mainbus0 bus 0 pchb0 at pci0 dev 0 function 0 ATI RS690 Host rev 0x00 ppb0 at pci0 dev 1 function 0 ATI RS690 PCIE rev 0x00 pci1 at ppb0 bus 1 vga1 at pci1 dev 5 function 0 ATI Radeon X1250 rev 0x00 wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation) wsdisplay0: screen 1-5 added (80x25, vt100 emulation) ppb1 at pci0 dev 7 function 0 ATI RS690 PCIE rev 0x00 pci2 at ppb1 bus 2 bge0 at pci2 dev 0 function 0 Broadcom BCM5786 rev 0x02, BCM5754/5787 A2 (0xb002): apic 2 int 19 (irq 10), address 00:1d:60:fe:82:e9 brgphy0 at bge0 phy 1: BCM5787 10/100/1000baseT PHY, rev. 0 pciide0 at pci0 dev 18 function 0 ATI SB600 SATA rev 0x00: DMA (unsupported), channel 0 configured to compatibility, channel 1 confi gured to compatibility wd0 at pciide0 channel 0 drive 0: Hitachi HDS721616PLA380 wd0: 16-sector PIO, LBA48, 152627MB, 312581808 sectors atapiscsi0 at pciide0 channel 1 drive 0 scsibus0 at atapiscsi0: 2 targets cd0 at scsibus0 targ 0 lun 0: HL-DT-ST, DVD-RAM GSA-H60N, CX04 ATAPI 5/cdrom removable ohci0 at pci0 dev 19 function 0 ATI SB600 USB rev 0x00: apic 2 int 16 (irq 11), version 1.0, legacy support ohci1 at pci0 dev 19 function 1 ATI SB600 USB rev 0x00: apic 2 int 17 (irq 5), version 1.0, legacy support ohci2 at pci0 dev 19 function 2 ATI SB600 USB rev 0x00: apic 2 int 18 (irq 10), version 1.0, legacy support ohci3 at pci0 dev 19 function 3 ATI SB600 USB rev 0x00: apic 2 int 17 (irq 5), version 1.0, legacy support ohci4 at pci0 dev 19 function 4 ATI SB600 USB rev 0x00: apic 2 int 18 (irq 10), version 1.0, legacy support ehci0 at pci0 dev 19 function 5 ATI SB600 USB2 rev 0x00: apic 2 int 19 (irq 10) usb0 at ehci0: USB revision 2.0 uhub0 at usb0 ATI EHCI root hub rev 2.00/1.00 addr 1 piixpm0 at pci0 dev 20 function 0 ATI SBx00 SMBus rev 0x14: SMI iic0 at piixpm0 spdmem0 at iic0 addr 0x50: 1GB DDR2 SDRAM non-parity PC2-5300CL5 SO-DIMM spdmem1 at iic0 addr
Restaurants Increase Sales Without Adding Overhead
Restaurants Increase Sales Without Adding Overhead Savvy restaurants are tapping into the underserved $33 billion market of consumers eating and entertaining at home. Most restaurants offer carry out food, but the appeal is limited as the food cools on the way home. Cold carry out food can quickly resemble leftovers instead of the quality food from a favorite restaurant. The solution is simple and requires zero capital investment: The use of professional quality wire chafers, that allow carry out food to be served hot, yet do not have to be returned by the customer. A newly released DVD offers several tips on how to expand your carry out business, maximize your existing resources, and improve sales without the need for additional overhead or capital. To receive a copy of the free DVD and to receive the article that discusses how many restaurants are expanding into this underserved market click here . Sincerely, Robert Skorr Skorr Products 90 George St. Patterson, NJ 07503 This is a marketing message. We respect your right to be removed from this marketing campaign. Removal from this email distribution list is automatically enforced by our email delivery system. Please click here to be removed. If this hyperlink comes through in text format or is not visible please hit reply to this email and type Remove in the subject line. If you have any problems with this removal link please contact Cindy at 800-757-3715 and we will handle your request immediately.
Re: SiS190 driver: How to do pci_get_device and pci_read_config_byte
On Mon, Oct 05, 2009 at 10:26:32AM +0200, Mark Kettenis wrote: Date: Mon, 5 Oct 2009 09:51:39 +0200 From: Christopher Zimmermann madro...@zakweb.de rc = sis190_get_mac_addr_from_eeprom(pdev, dev); /* This seems to fail */ if (rc 0) { u8 reg; pci_read_config_byte(pdev, 0x73, reg); /* How to do this in openBSD */ You can't really do byte-access on PCI config space. So to access the byte at offset 0x73, you need to do something like: reg = (pci_conf(pa-pa_pc, pa-pa_tag, 0x70) 24); pci_conf_read(), surely? ;) so: u_int8_t reg; reg = (pci_conf_read(pa-pa_pc, pa-pa_tag, 0x70) 24); Also, for completeness, if you want to change the byte then write it back, you need to do a read-modify-write cycle (read the word, OR in what you want to change, then write the whole thing out). Ta, -0- - just being a pain. -- A CONS is an object which cares. -- Bernie Greenberg.
Re: OpenBSD 4.6 crashing on kernel boot due to ahci0 seemingly
On Mon, Oct 05, 2009 at 11:01:24PM +0900, Christophe Prevotaux wrote: Hi, My machine is Running OpenBSD/amd64 4.6 (snapshot 02 Oct 2009) The kernel crashed on AHCI detection. ahci0 at pci0 dev 18 function 0 ATI SB600 SATA rev 0x00: apic 2 int 22 (irq 11), AHCI 1.1 scsibus0 at achci0: 32 targets sd0 at scsibus0 targ 0 lun 0: ATA, Hitachi HDS72161, P220 SCSI3 0/direct fixed sd0: 152627MB, 512 bytes/sec, 312581808 sec total panic: kernel diagnostic assertion ccb-ccb_xa.state == ATA_S_ONCHIP failed: ../../../../dev/pci/ahci.c, line 1812 Stopped at Debugger+0x5: leave Debugger() at Debugger+0x5 panic() at panic+0x122 __assert() at __assert+0x21 ahci_port_intr() at ahci_port_intr+0x218 ahci_poll() at ahci_poll+0x4d ahci_ata_cmd() at ahci_ata_cmd+0x9b atat_exec() at ata_exec+0x19 scsi_xs_exec() at scsi_xs_exec+0x38 scsi_scsi_cmd() at scsi_scsi_cmd+0x98 scsi_test_unit_ready() at scsi_test_unit_ready+0x43 end trace frame: 0x80898a30, count 0 I bet you have a cd drive in that machine. put a data cd in the drive and it should boot (or remove the CD drive). This problem is sadly known (I also hit it), but i'm not qualified to fix the thing. -0- -- Earn cash in your spare time -- blackmail your friends
Re: cwm(1) change on 9/25
On Fri, Oct 02, 2009 at 12:32:42AM +0159, Simon Nicolussi wrote: Hello, as a consequence to the last change to cwm(1) no borders are being drawn for maximized windows. This is fine as long as there's no gap defined in the cwmrc(5), otherwise the borders between window and gaps are missing. Is this behaviour intended? Actually, kinda yes. I use a gap and in the times when I do fullscreen an application, i don't find the lack of a border a problem at all.. There's another strange problem I experienced after this change: Almost every time I try to maximize my Firefox window its whole content freezes and returns back to normal as soon as I resize the window with my mouse. I haven't really looked into this, though. I can't reproduce this here, anymore details? Here's a patch that addresses theses issues: Now maximized windows keep all four borders, but always inside the screen (and thus visible for the user) and Firefox behaves as before the change. Tested on amd64 but unfortunately no multi-monitor configuration. -0- Index: client.c === RCS file: /cvs/xenocara/app/cwm/client.c,v retrieving revision 1.65 diff -u client.c --- client.c 25 Sep 2009 15:57:49 - 1.65 +++ client.c 1 Oct 2009 21:30:27 - @@ -246,8 +246,10 @@ calc: cc-geom.x = x_org + Conf.gap_left; cc-geom.y = y_org + Conf.gap_top; - cc-geom.height = ymax - (Conf.gap_top + Conf.gap_bottom); - cc-geom.width = xmax - (Conf.gap_left + Conf.gap_right); + cc-geom.height = ymax - (cc-bwidth * 2) - + (Conf.gap_top + Conf.gap_bottom); + cc-geom.width = xmax - (cc-bwidth * 2) - + (Conf.gap_left + Conf.gap_right); cc-flags |= CLIENT_DOMAXIMIZE; } @@ -323,7 +325,6 @@ CLIENT_HMAXIMIZED); if (cc-flags CLIENT_DOMAXIMIZE) { - cc-bwidth = 0; cc-flags = ~CLIENT_DOMAXIMIZE; cc-flags |= CLIENT_MAXIMIZED; } else if (cc-flags CLIENT_DOVMAXIMIZE) { @@ -332,11 +333,7 @@ } else if (cc-flags CLIENT_DOHMAXIMIZE) { cc-flags = ~CLIENT_DOHMAXIMIZE; cc-flags |= CLIENT_HMAXIMIZED; - } else { - cc-bwidth = Conf.bwidth; } - - client_draw_border(cc); XMoveResizeWindow(X_Dpy, cc-win, cc-geom.x, cc-geom.y, cc-geom.width, cc-geom.height); -- Simon Nicolussi, simon.nicolu...@student.uibk.ac.at http://homepage.uibk.ac.at/~csag9583/ -- Uncle Ed's Rule of Thumb: Never use your thumb for a rule. You'll either hit it with a hammer or get a splinter in it.