X-Git-Url: http://bbs.cooldavid.org/git/?p=jme.git;a=blobdiff_plain;f=jme.h;h=536a7f7b598e33d7f6e103a9e546f374bdec0449;hp=34f77a1906d2cdace5e8e297c129e88c94b61d1f;hb=f6d5c552ae8da4c81052642d05d0a7e84912d418;hpb=d1d139de76f9097ed5f4e4e457aeb9c627a25d5a diff --git a/jme.h b/jme.h index 34f77a1..536a7f7 100644 --- a/jme.h +++ b/jme.h @@ -24,9 +24,10 @@ #ifndef __JME_H_INCLUDED__ #define __JME_H_INCLUDED__ +#include #define DRV_NAME "jme" -#define DRV_VERSION "1.0.8-jmmod" +#define DRV_VERSION "1.0.8.2-jmmod" #define PFX DRV_NAME ": " #define PCI_DEVICE_ID_JMICRON_JMC250 0x0250 @@ -42,11 +43,11 @@ NETIF_MSG_TX_ERR | \ NETIF_MSG_HW) -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23) +#ifndef pr_err #define pr_err(fmt, arg...) \ printk(KERN_ERR fmt, ##arg) #endif -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,33) +#ifndef netdev_err #define netdev_err(netdev, fmt, arg...) \ pr_err(fmt, ##arg) #endif @@ -94,11 +95,15 @@ do { \ #define msg_hw(priv, fmt, args...) \ jme_msg(KERN_ERR, hw, priv, fmt, ## args) +#ifndef netif_info #define netif_info(priv, type, dev, fmt, args...) \ msg_ ## type(priv, fmt, ## args) +#endif +#ifndef netif_err #define netif_err(priv, type, dev, fmt, args...) \ msg_ ## type(priv, fmt, ## args) #endif +#endif #ifndef NETIF_F_TSO6 #define NETIF_F_TSO6 0 @@ -530,6 +535,17 @@ static inline struct tcphdr *tcp_hdr(const struct sk_buff *skb) __napi_schedule(&priv->napi); #endif +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,38) +#define JME_NEW_PM_API +#endif + +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,26) +static inline __u32 ethtool_cmd_speed(struct ethtool_cmd *ep) +{ + return ep->speed; +} +#endif + /* * Jmac Adapter Private data */ @@ -993,6 +1009,7 @@ enum jme_ghc_txmac_clk { * Power management control and status register */ enum jme_pmcs_bit_masks { + PMCS_STMASK = 0xFFFF0000, PMCS_WF7DET = 0x80000000, PMCS_WF6DET = 0x40000000, PMCS_WF5DET = 0x20000000, @@ -1004,6 +1021,7 @@ enum jme_pmcs_bit_masks { PMCS_LFDET = 0x00040000, PMCS_LRDET = 0x00020000, PMCS_MFDET = 0x00010000, + PMCS_ENMASK = 0x0000FFFF, PMCS_WF7EN = 0x00008000, PMCS_WF6EN = 0x00004000, PMCS_WF5EN = 0x00002000,