]> bbs.cooldavid.org Git - jme.git/commitdiff
Fix bool type on old kernel
authorGuo-Fu Tseng <cooldavid@cooldavid.org>
Fri, 24 Feb 2012 03:35:12 +0000 (11:35 +0800)
committerGuo-Fu Tseng <cooldavid@cooldavid.org>
Fri, 24 Feb 2012 03:35:12 +0000 (11:35 +0800)
jme.c
jme.h

diff --git a/jme.c b/jme.c
index 68aff5f3ba86dc20dfe92913c32c71cbfd52a68a..10f1f040fe24418abe3a168792b62672f38df87f 100644 (file)
--- a/jme.c
+++ b/jme.c
@@ -2069,7 +2069,12 @@ jme_fill_tx_map(struct pci_dev *pdev,
                struct page *page,
                u32 page_offset,
                u32 len,
-               bool hidma)
+#ifdef __NO_BOOL__
+               u8 hidma
+#else
+               bool hidma
+#endif
+               )
 {
        dma_addr_t dmaaddr;
 
@@ -2103,7 +2108,11 @@ jme_map_tx_skb(struct jme_adapter *jme, struct sk_buff *skb, int idx)
        struct jme_ring *txring = &(jme->txring[0]);
        struct txdesc *txdesc = txring->desc, *ctxdesc;
        struct jme_buffer_info *txbi = txring->bufinf, *ctxbi;
+#ifdef __NO_BOOL__
+       u8 hidma = !!(jme->dev->features & NETIF_F_HIGHDMA);
+#else
        bool hidma = jme->dev->features & NETIF_F_HIGHDMA;
+#endif
        int i, nr_frags = skb_shinfo(skb)->nr_frags;
        int mask = jme->tx_ring_mask;
        const struct skb_frag_struct *frag;
diff --git a/jme.h b/jme.h
index 4ee3e0b47c7ae60cc5780f3e2662adb65f1c4c7a..e42b5b915d59a947ee43591575e3b9f82a86826e 100644 (file)
--- a/jme.h
+++ b/jme.h
@@ -112,6 +112,10 @@ do {                                                                       \
 #define NETIF_F_IPV6_CSUM 0
 #endif
 
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,18)
+#define __NO_BOOL__
+#endif
+
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0)
 #define __USE_NDO_FIX_FEATURES__
 #endif