Use resource_size_t for physical memory addresses
authorproski <proski@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Wed, 19 Mar 2008 21:28:16 +0000 (21:28 +0000)
committerproski <proski@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Wed, 19 Mar 2008 21:28:16 +0000 (21:28 +0000)
PCI resource addresses are 64-bit on i386 with PAE, so they won't fit
unsigned long.  Provide compatibility for older kernels.  Reported by
Diego Dujovne.

git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3399 0192ed92-7a03-0410-a25b-9323aeb14dbd

ath/if_ath_pci.c
include/compat.h

index e90c14c57f9bf62b5c990e5ddbe2b5134c995ecd..62ce4226d0edd5465a3d205a826672eacbe4d54b 100644 (file)
@@ -124,7 +124,7 @@ static u16 ath_devidmap[][2] = {
 static int
 ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
-       unsigned long phymem;
+       resource_size_t phymem;
        void __iomem *mem;
        struct ath_pci_softc *sc;
        struct net_device *dev;
@@ -248,8 +248,9 @@ ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                goto bad4;
 
        athname = ath_hal_probe(id->vendor, vdevice);
-       printk(KERN_INFO "%s: %s: %s: mem=0x%lx, irq=%d\n",
-               dev_info, dev->name, athname ? athname : "Atheros ???", phymem, dev->irq);
+       printk(KERN_INFO "%s: %s: %s: mem=0x%llx, irq=%d\n",
+               dev_info, dev->name, athname ? athname : "Atheros ???",
+               (unsigned long long)phymem, dev->irq);
 
        /* ready to process interrupts */
        sc->aps_sc.sc_invalid = 0;
index 37af1df44bb7a13e42b3e03e893bd4fa5875f1ac..f50b3ca5beb571e1001b9b1c0cbe47d1c25a2e11 100644 (file)
@@ -158,6 +158,10 @@ static inline int timeval_compare(struct timeval *lhs, struct timeval *rhs)
 }
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+typedef unsigned long resource_size_t;
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
 #define IRQF_SHARED SA_SHIRQ
 #endif