X-Git-Url: https://bbs.cooldavid.org/git/?a=blobdiff_plain;f=jme.h;h=3dafe833ba2b284696f8adcb60f47995877fb3ec;hb=61891ee4819d6a95fd1c2c6a6ce0f76d9aee37eb;hp=2011af2543edcefb5f4e6042267a02b6c88784f3;hpb=809b2798849420e302b37de0b9be5a231220a60e;p=jme.git diff --git a/jme.h b/jme.h index 2011af2..3dafe83 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.7-jmmod" +#define DRV_VERSION "1.0.8-jmmod" #define PFX DRV_NAME ": " #define PCI_DEVICE_ID_JMICRON_JMC250 0x0250 @@ -461,10 +462,10 @@ struct jme_ring { netdev->get_stats = fun_ptr #define DECLARE_NET_DEVICE_STATS struct net_device_stats stats; /* - * CentOS 5.5 have *_hdr helpers back-ported + * CentOS 5.2 have *_hdr helpers back-ported */ #ifdef RHEL_RELEASE_CODE -#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5,5) +#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(5,2) #define __DEFINE_IPHDR_HELPERS__ #endif #else @@ -530,6 +531,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 */ @@ -555,6 +567,7 @@ struct jme_adapter { u32 reg_rxmcs; u32 reg_ghc; u32 reg_pmcs; + u32 reg_gpreg1; u32 phylink; u32 tx_ring_size; u32 tx_ring_mask; @@ -961,6 +974,8 @@ static inline u32 smi_phy_addr(int x) */ enum jme_ghc_bit_mask { GHC_SWRST = 0x40000000, + GHC_TO_CLK_SRC = 0x00C00000, + GHC_TXMAC_CLK_SRC = 0x00300000, GHC_DPX = 0x00000040, GHC_SPEED = 0x00000030, GHC_LINK_POLL = 0x00000001, @@ -990,6 +1005,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, @@ -1001,6 +1017,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, @@ -1139,18 +1156,17 @@ enum jme_gpreg0_vals { /* * General Purpose REG-1 - * Note: All theses bits defined here are for - * Chip mode revision 0x11 only */ -enum jme_gpreg1_masks { +enum jme_gpreg1_bit_masks { + GPREG1_RXCLKOFF = 0x04000000, + GPREG1_PCREQN = 0x00020000, + GPREG1_HALFMODEPATCH = 0x00000040, /* For Chip revision 0x11 only */ + GPREG1_RSSPATCH = 0x00000020, /* For Chip revision 0x11 only */ GPREG1_INTRDELAYUNIT = 0x00000018, GPREG1_INTRDELAYENABLE = 0x00000007, }; enum jme_gpreg1_vals { - GPREG1_HALFMODEPATCH = 0x00000040, - GPREG1_RSSPATCH = 0x00000020, - GPREG1_INTDLYUNIT_16NS = 0x00000000, GPREG1_INTDLYUNIT_256NS = 0x00000008, GPREG1_INTDLYUNIT_1US = 0x00000010, @@ -1164,7 +1180,7 @@ enum jme_gpreg1_vals { GPREG1_INTDLYEN_6U = 0x00000006, GPREG1_INTDLYEN_7U = 0x00000007, - GPREG1_DEFAULT = 0x00000000, + GPREG1_DEFAULT = GPREG1_PCREQN, }; /* @@ -1396,6 +1412,7 @@ static inline int new_phy_power_ctrl(u8 chip_main_rev) */ static int jme_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd); +static void jme_set_unicastaddr(struct net_device *netdev); static void jme_set_multi(struct net_device *netdev); #endif