Author: baggins                      Date: Wed Apr 12 17:00:41 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- latest driver from www.skd.de

---- Files affected:
SOURCES:
   linux-2.6-sk98lin-8.31.2.3.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/linux-2.6-sk98lin-8.31.2.3.patch
diff -u /dev/null SOURCES/linux-2.6-sk98lin-8.31.2.3.patch:1.1
--- /dev/null   Wed Apr 12 19:00:41 2006
+++ SOURCES/linux-2.6-sk98lin-8.31.2.3.patch    Wed Apr 12 19:00:36 2006
@@ -0,0 +1,59522 @@
+diff -ruN linux/drivers/net/sk98lin/Makefile 
linux-new/drivers/net/sk98lin/Makefile
+--- linux/drivers/net/sk98lin/Makefile 2006-04-11 19:19:28.000000000 +0200
++++ linux-new/drivers/net/sk98lin/Makefile     2006-04-12 18:59:11.861752000 
+0200
+@@ -1,6 +1,59 @@
++#******************************************************************************
+ #
+-# Makefile for the SysKonnect SK-98xx device driver.
++# Name:         skge.c
++# Project:      GEnesis, PCI Gigabit Ethernet Adapter
++# Version:      $Revision$
++# Date:         $Date$
++# Purpose:      The main driver source module
+ #
++#******************************************************************************
++
++#******************************************************************************
++#
++#     (C)Copyright 1998-2002 SysKonnect GmbH.
++#     (C)Copyright 2002-2005 Marvell.
++#
++#     Makefile for Marvell Yukon chipset and SysKonnect Gigabit Ethernet 
++#     Server Adapter driver. (Kernel 2.6)
++#
++#     Author: Mirko Lindner ([EMAIL PROTECTED])
++#             Ralph Roesler ([EMAIL PROTECTED])
++#
++#     Address all question to: [EMAIL PROTECTED]
++#
++#     This program is free software; you can redistribute it and/or modify
++#     it under the terms of the GNU General Public License as published by
++#     the Free Software Foundation; either version 2 of the License, or
++#     (at your option) any later version.
++#
++#     The information in this file is provided "AS IS" without warranty.
++# 
++#******************************************************************************
++
++#******************************************************************************
++#
++# History:
++#
++#     $Log$
++#     Revision 1.1  2006/04/12 17:00:36  baggins
++#     - latest driver from www.skd.de
++#     
++#     Revision 1.9.2.1  2005/04/11 09:01:18  mlindner
++#     Fix: Copyright year changed
++#     
++#     Revision 1.9  2004/07/13 15:54:50  rroesler
++#     Add: file skethtool.c
++#     Fix: corrected header regarding copyright
++#     Fix: minor typos corrected
++#     
++#     Revision 1.8  2004/06/08 08:39:38  mlindner
++#     Fix: Add CONFIG_SK98LIN_ZEROCOPY as default
++#     
++#     Revision 1.7  2004/06/03 16:06:56  mlindner
++#     Fix: Added compile flag SK_DIAG_SUPPORT
++#     
++#     Revision 1.6  2004/06/02 08:02:59  mlindner
++#     Add: Changed header information and inserted a GPL statement
++#     
++#
++#******************************************************************************
+ 
+ 
+ #
+@@ -13,20 +66,24 @@
+ obj-$(CONFIG_SK98LIN) += sk98lin.o
+ sk98lin-objs    :=    \
+               skge.o          \
++              sky2.o          \
+               skethtool.o     \
++              sky2le.o        \
+               skdim.o         \
+               skaddr.o        \
+               skgehwt.o       \
+               skgeinit.o      \
+               skgepnmi.o      \
+               skgesirq.o      \
+-              ski2c.o         \
++              sktwsi.o                \
+               sklm80.o        \
+               skqueue.o       \
+               skrlmt.o        \
+               sktimer.o       \
+               skvpd.o         \
+-              skxmac2.o
++              skxmac2.o       \
++              skproc.o        \
++              skcsum.o
+ 
+ # DBGDEF =  \
+ # -DDEBUG
+@@ -75,13 +132,11 @@
+ # SK_DBGCAT_DRV_INT_SRC         0x04000000      interrupts sources
+ # SK_DBGCAT_DRV_EVENT           0x08000000      driver events
+ 
+-EXTRA_CFLAGS += -Idrivers/net/sk98lin -DSK_DIAG_SUPPORT -DGENESIS -DYUKON 
$(DBGDEF) $(SKPARAM)
++EXTRA_CFLAGS += -Idrivers/net/sk98lin -DSK_USE_CSUM -DSK_DIAG_SUPPORT \
++              -DGENESIS -DYUKON -DYUK2 -DCONFIG_SK98LIN_ZEROCOPY \
++              $(DBGDEF) $(SKPARAM)
+ 
+ clean:
+       rm -f core *.o *.a *.s
+ 
+ 
+-
+-
+-
+-
+diff -ruN linux/drivers/net/sk98lin/h/lm80.h 
linux-new/drivers/net/sk98lin/h/lm80.h
+--- linux/drivers/net/sk98lin/h/lm80.h 2006-04-11 19:19:28.000000000 +0200
++++ linux-new/drivers/net/sk98lin/h/lm80.h     2006-01-18 14:37:24.000000000 
+0100
+@@ -2,8 +2,8 @@
+  *
+  * Name:      lm80.h  
+  * Project:   Gigabit Ethernet Adapters, Common Modules
+- * Version:   $Revision$
+- * Date:      $Date$
++ * Version:   $Revision$
++ * Date:      $Date$
+  * Purpose:   Contains all defines for the LM80 Chip
+  *            (National Semiconductor).
+  *
+@@ -11,6 +11,7 @@
+ 
+ 
/******************************************************************************
+  *
++ *    LICENSE:
+  *    (C)Copyright 1998-2002 SysKonnect.
+  *    (C)Copyright 2002-2003 Marvell.
+  *
+@@ -20,6 +21,7 @@
+  *    (at your option) any later version.
+  *
+  *    The information in this file is provided "AS IS" without warranty.
++ *    /LICENSE
+  *
+  
******************************************************************************/
+ 
+diff -ruN linux/drivers/net/sk98lin/h/skaddr.h 
linux-new/drivers/net/sk98lin/h/skaddr.h
+--- linux/drivers/net/sk98lin/h/skaddr.h       2006-04-11 19:19:28.000000000 
+0200
++++ linux-new/drivers/net/sk98lin/h/skaddr.h   2006-01-18 14:37:24.000000000 
+0100
+@@ -2,8 +2,8 @@
+  *
+  * Name:      skaddr.h
+  * Project:   Gigabit Ethernet Adapters, ADDR-Modul
+- * Version:   $Revision$
+- * Date:      $Date$
++ * Version:   $Revision$
++ * Date:      $Date$
+  * Purpose:   Header file for Address Management (MC, UC, Prom).
+  *
+  
******************************************************************************/
+diff -ruN linux/drivers/net/sk98lin/h/skcsum.h 
linux-new/drivers/net/sk98lin/h/skcsum.h
+--- linux/drivers/net/sk98lin/h/skcsum.h       2006-04-11 19:19:28.000000000 
+0200
++++ linux-new/drivers/net/sk98lin/h/skcsum.h   2006-01-18 14:37:24.000000000 
+0100
+@@ -2,8 +2,8 @@
+  *
+  * Name:      skcsum.h
+  * Project:   GEnesis - SysKonnect SK-NET Gigabit Ethernet (SK-98xx)
+- * Version:   $Revision$
+- * Date:      $Date$
++ * Version:   $Revision$
++ * Date:      $Date$
+  * Purpose:   Store/verify Internet checksum in send/receive packets.
+  *
+  
******************************************************************************/
+@@ -157,9 +157,7 @@
+ typedef struct s_Csum {
+       /* Enabled receive SK_PROTO_XXX bit flags. */
+       unsigned ReceiveFlags[SK_MAX_NETS];
+-#ifdef TX_CSUM
+       unsigned TransmitFlags[SK_MAX_NETS];
+-#endif /* TX_CSUM */
+ 
+       /* The protocol statistics structure; one per supported protocol. */
+       SKCS_PROTO_STATS ProtoStats[SK_MAX_NETS][SKCS_NUM_PROTOCOLS];
+diff -ruN linux/drivers/net/sk98lin/h/skdebug.h 
linux-new/drivers/net/sk98lin/h/skdebug.h
+--- linux/drivers/net/sk98lin/h/skdebug.h      2006-04-11 19:19:28.000000000 
+0200
++++ linux-new/drivers/net/sk98lin/h/skdebug.h  2006-01-18 14:37:24.000000000 
+0100
+@@ -2,23 +2,24 @@
+  *
+  * Name:      skdebug.h
+  * Project:   Gigabit Ethernet Adapters, Common Modules
+- * Version:   $Revision$
+- * Date:      $Date$
++ * Version:   $Revision$
++ * Date:      $Date$
+  * Purpose:   SK specific DEBUG support
+  *
+  
******************************************************************************/
+ 
+ 
/******************************************************************************
+  *
++ *    LICENSE:
+  *    (C)Copyright 1998-2002 SysKonnect.
+- *    (C)Copyright 2002-2003 Marvell.
++ *    (C)Copyright 2002-2005 Marvell.
+  *
+  *    This program is free software; you can redistribute it and/or modify
+  *    it under the terms of the GNU General Public License as published by
+  *    the Free Software Foundation; either version 2 of the License, or
+  *    (at your option) any later version.
+- *
+  *    The information in this file is provided "AS IS" without warranty.
++ *    /LICENSE
+  *
+  
******************************************************************************/
+ 
+@@ -28,9 +29,9 @@
+ #ifdef        DEBUG
+ #ifndef SK_DBG_MSG
+ #define SK_DBG_MSG(pAC,comp,cat,arg) \
+-              if ( ((comp) & SK_DBG_CHKMOD(pAC)) &&   \
+-                    ((cat) & SK_DBG_CHKCAT(pAC)) ) {  \
+-                      SK_DBG_PRINTF arg ;             \
++              if ( ((comp) & SK_DBG_CHKMOD(pAC)) &&   \
++                    ((cat) & SK_DBG_CHKCAT(pAC)) ) {  \
++                      SK_DBG_PRINTF arg;              \
+               }
+ #endif
+ #else
+@@ -58,6 +59,13 @@
+ #define SK_DBGMOD_ADDR        0x00000080L     /* ADDR module */
+ #define SK_DBGMOD_PECP        0x00000100L     /* PECP module */
+ #define SK_DBGMOD_POWM        0x00000200L     /* Power Management module */
++#ifdef SK_ASF
++#define SK_DBGMOD_ASF 0x00000400L     /* ASF module */
++#endif
++#ifdef SK_LBFO
++#define SK_DBGMOD_LACP        0x00000800L     /* link aggregation control 
protocol */
++#define SK_DBGMOD_FD  0x00001000L     /* frame distributor (link aggregation) 
*/
++#endif /* SK_LBFO */
+ 
+ /* Debug events */
+ 
+diff -ruN linux/drivers/net/sk98lin/h/skdrv1st.h 
linux-new/drivers/net/sk98lin/h/skdrv1st.h
+--- linux/drivers/net/sk98lin/h/skdrv1st.h     2006-04-11 19:19:28.000000000 
+0200
++++ linux-new/drivers/net/sk98lin/h/skdrv1st.h 2006-01-18 14:37:24.000000000 
+0100
+@@ -2,8 +2,8 @@
+  *
+  * Name:      skdrv1st.h
+  * Project:   GEnesis, PCI Gigabit Ethernet Adapter
+- * Version:   $Revision$
+- * Date:      $Date$
++ * Version:   $Revision$
++ * Date:      $Date$
+  * Purpose:   First header file for driver and all other modules
+  *
+  
******************************************************************************/
+@@ -11,7 +11,7 @@
+ 
/******************************************************************************
+  *
+  *    (C)Copyright 1998-2002 SysKonnect GmbH.
+- *    (C)Copyright 2002-2003 Marvell.
++ *    (C)Copyright 2002-2005 Marvell.
+  *
+  *    This program is free software; you can redistribute it and/or modify
+  *    it under the terms of the GNU General Public License as published by
+@@ -22,23 +22,12 @@
+  *
+  
******************************************************************************/
+ 
+-/******************************************************************************
+- *
+- * Description:
+- *
+- * This is the first include file of the driver, which includes all
+- * neccessary system header files and some of the GEnesis header files.
+- * It also defines some basic items.
+- *
+- * Include File Hierarchy:
+- *
+- *    see skge.c
+- *
+- 
******************************************************************************/
+-
+ #ifndef __INC_SKDRV1ST_H
+ #define __INC_SKDRV1ST_H
+ 
++/* Check kernel version */
++#include <linux/version.h>
++
+ typedef struct s_AC   SK_AC;
+ 
+ /* Set card versions */
+@@ -55,6 +44,9 @@
+ 
+ #define SK_ADDR_EQUAL(a1,a2)          (!memcmp(a1,a2,6))
+ 
++#define SK_STRNCMP(s1,s2,len)         strncmp(s1,s2,len)
++#define SK_STRCPY(dest,src)           strcpy(dest,src)
++
+ #include <linux/types.h>
+ #include <linux/kernel.h>
+ #include <linux/string.h>
+@@ -63,10 +55,9 @@
+ #include <linux/slab.h>
+ #include <linux/interrupt.h>
+ #include <linux/pci.h>
+-#include <linux/bitops.h>
+ #include <asm/byteorder.h>
++#include <asm/bitops.h>
+ #include <asm/io.h>
+-#include <asm/irq.h>
+ #include <linux/netdevice.h>
+ #include <linux/etherdevice.h>
+ #include <linux/skbuff.h>
+@@ -76,11 +67,7 @@
+ #include <net/checksum.h>
+ 
+ #define SK_CS_CALCULATE_CHECKSUM
+-#ifndef CONFIG_X86_64
+-#define SkCsCalculateChecksum(p,l)    ((~ip_compute_csum(p, l)) & 0xffff)
+-#else
+-#define SkCsCalculateChecksum(p,l)    ((~ip_fast_csum(p, l)) & 0xffff)
+-#endif
++#define SkCsCalculateChecksum(p,l)    (~csum_fold(csum_partial(p, l, 0)))
+ 
+ #include      "h/sktypes.h"
+ #include      "h/skerror.h"
+@@ -88,10 +75,15 @@
+ #include      "h/lm80.h"
+ #include      "h/xmac_ii.h"
+ 
++#ifndef SK_BMU_RX_WM_PEX
++#define SK_BMU_RX_WM_PEX 0x80
++#endif
++
+ #ifdef __LITTLE_ENDIAN
+ #define SK_LITTLE_ENDIAN
+ #else
+ #define SK_BIG_ENDIAN
++#define SK_USE_REV_DESC
+ #endif
+ 
+ #define SK_NET_DEVICE net_device
+@@ -107,7 +99,7 @@
+ #define SK_MAX_MACS           2
+ #define SK_MAX_NETS           2
+ 
+-#define SK_IOC                        char __iomem *
++#define SK_IOC                        char*
+ 
+ typedef struct s_DrvRlmtMbuf SK_MBUF;
+ 
+@@ -186,3 +178,8 @@
+ 
+ #endif
+ 
++/*******************************************************************************
++ *
++ * End of file
++ *
++ 
******************************************************************************/
+diff -ruN linux/drivers/net/sk98lin/h/skdrv2nd.h 
linux-new/drivers/net/sk98lin/h/skdrv2nd.h
+--- linux/drivers/net/sk98lin/h/skdrv2nd.h     2006-04-11 19:19:28.000000000 
+0200
++++ linux-new/drivers/net/sk98lin/h/skdrv2nd.h 2006-01-18 14:37:24.000000000 
+0100
+@@ -1,17 +1,17 @@
+ 
/******************************************************************************
+  *
+- * Name:      skdrv2nd.h
+- * Project:   GEnesis, PCI Gigabit Ethernet Adapter
+- * Version:   $Revision$
+- * Date:      $Date$
+- * Purpose:   Second header file for driver and all other modules
++ * Name:        skdrv2nd.h
++ * Project:     GEnesis, PCI Gigabit Ethernet Adapter
++ * Version:     $Revision$
++ * Date:        $Date$
++ * Purpose:     Second header file for driver and all other modules
+  *
+  
******************************************************************************/
+ 
+ 
/******************************************************************************
+  *
+  *    (C)Copyright 1998-2002 SysKonnect GmbH.
+- *    (C)Copyright 2002-2003 Marvell.
++ *    (C)Copyright 2002-2005 Marvell.
+  *
+  *    This program is free software; you can redistribute it and/or modify
+  *    it under the terms of the GNU General Public License as published by
+@@ -42,10 +42,11 @@
+ #include "h/skqueue.h"
+ #include "h/skgehwt.h"
+ #include "h/sktimer.h"
+-#include "h/ski2c.h"
++#include "h/sktwsi.h"
+ #include "h/skgepnmi.h"
+ #include "h/skvpd.h"
+ #include "h/skgehw.h"
++#include "h/sky2le.h"
+ #include "h/skgeinit.h"
+ #include "h/skaddr.h"
+ #include "h/skgesirq.h"
+@@ -53,103 +54,191 @@
+ #include "h/skrlmt.h"
+ #include "h/skgedrv.h"
+ 
++/* Defines for the poll cotroller */
++#define SK_NETDUMP_POLL
+ 
+-extern SK_MBUF                *SkDrvAllocRlmtMbuf(SK_AC*, SK_IOC, unsigned);
+-extern void           SkDrvFreeRlmtMbuf(SK_AC*, SK_IOC, SK_MBUF*);
+-extern SK_U64         SkOsGetTime(SK_AC*);
+-extern int            SkPciReadCfgDWord(SK_AC*, int, SK_U32*);
+-extern int            SkPciReadCfgWord(SK_AC*, int, SK_U16*);
+-extern int            SkPciReadCfgByte(SK_AC*, int, SK_U8*);
+-extern int            SkPciWriteCfgWord(SK_AC*, int, SK_U16);
+-extern int            SkPciWriteCfgByte(SK_AC*, int, SK_U8);
+-extern int            SkDrvEvent(SK_AC*, SK_IOC IoC, SK_U32, SK_EVPARA);
+-
+-#ifdef SK_DIAG_SUPPORT
+-extern int            SkDrvEnterDiagMode(SK_AC *pAc);
+-extern int            SkDrvLeaveDiagMode(SK_AC *pAc);
++#ifdef SK_NETDUMP_POLL
++#ifdef HAVE_POLL_CONTROLLER
++#define SK_POLL_CONTROLLER
++#define CONFIG_SK98LIN_NAPI
++#elif CONFIG_NET_POLL_CONTROLLER
++#define SK_POLL_CONTROLLER
++#define CONFIG_SK98LIN_NAPI
+ #endif
++#endif
++
++
++/******************************************************************************
++ *
++ * Generic driver defines
++ *
++ 
******************************************************************************/
++
++#define USE_TIST_FOR_RESET    /* Use timestamp for reset */
++#define Y2_RECOVERY           /* use specific recovery yukon2 functions */
++#define Y2_LE_CHECK           /* activate check for LE order */
++#define Y2_SYNC_CHECK         /* activate check for receiver in sync */
++#define SK_YUKON2             /* Enable Yukon2 dual net support */
++#define USE_SK_TX_CHECKSUM    /* use the tx hw checksum driver functionality 
*/
++#define USE_SK_RX_CHECKSUM    /* use the rx hw checksum driver functionality 
*/
++#define USE_SK_TSO_FEATURE    /* use TCP segmentation offload if possible */
++#define SK_COPY_THRESHOLD 50  /* threshold for copying small RX frames; 
++                               * 0 avoids copying, 9001 copies all */
++#define SK_MAX_CARD_PARAM 16  /* number of adapters that can be configured 
via 
++                               * command line params */
++//#define USE_TX_COMPLETE     /* use of a transmit complete interrupt */
++#define Y2_RX_CHECK           /* RX Check timestamp */
++
++/*
++ * use those defines for a compile-in version of the driver instead
++ * of command line parameters
++ */
++// #define LINK_SPEED_A       {"Auto",}
++// #define LINK_SPEED_B       {"Auto",}
++// #define AUTO_NEG_A {"Sense",}
++// #define AUTO_NEG_B {"Sense"}
++// #define DUP_CAP_A  {"Both",}
++// #define DUP_CAP_B  {"Both",}
++// #define FLOW_CTRL_A        {"SymOrRem",}
++// #define FLOW_CTRL_B        {"SymOrRem",}
++// #define ROLE_A     {"Auto",}
++// #define ROLE_B     {"Auto",}
++// #define PREF_PORT  {"A",}
++// #define CON_TYPE   {"Auto",}
++// #define RLMT_MODE  {"CheckLinkState",}
++
++#ifdef Y2_RECOVERY
++#define CHECK_TRANSMIT_TIMEOUT
++#define Y2_RESYNC_WATERMARK     1000000L
++#endif
++
++
++/******************************************************************************
++ *
++ * Generic ISR defines
++ *
++ 
******************************************************************************/
++
++#define SkIsrRetVar     irqreturn_t
++#define SkIsrRetNone    IRQ_NONE
++#define SkIsrRetHandled IRQ_HANDLED
++
++#define DEV_KFREE_SKB(skb) dev_kfree_skb(skb)
++#define DEV_KFREE_SKB_IRQ(skb) dev_kfree_skb_irq(skb)
++#define DEV_KFREE_SKB_ANY(skb) dev_kfree_skb_any(skb)
++
++/******************************************************************************
++ *
++ * Global function prototypes
++ *
++ 
******************************************************************************/
++
++extern SK_MBUF *SkDrvAllocRlmtMbuf(SK_AC*, SK_IOC, unsigned);
++extern void SkDrvFreeRlmtMbuf(SK_AC*, SK_IOC, SK_MBUF*);
++extern SK_U64 SkOsGetTime(SK_AC*);
++extern int SkPciReadCfgDWord(SK_AC*, int, SK_U32*);
++extern int SkPciReadCfgWord(SK_AC*, int, SK_U16*);
++extern int SkPciReadCfgByte(SK_AC*, int, SK_U8*);
++extern int SkPciWriteCfgDWord(SK_AC*, int, SK_U32);
++extern int SkPciWriteCfgWord(SK_AC*, int, SK_U16);
++extern int SkPciWriteCfgByte(SK_AC*, int, SK_U8);
++extern int SkDrvEvent(SK_AC*, SK_IOC IoC, SK_U32, SK_EVPARA);
++extern int SkDrvEnterDiagMode(SK_AC *pAc);
++extern int SkDrvLeaveDiagMode(SK_AC *pAc);
++
++/******************************************************************************
++ *
++ * Linux specific RLMT buffer structure (SK_MBUF typedef in skdrv1st)!
++ *
++ 
******************************************************************************/
+ 
+ struct s_DrvRlmtMbuf {
+-      SK_MBUF         *pNext;         /* Pointer to next RLMT Mbuf. */
+-      SK_U8           *pData;         /* Data buffer (virtually contig.). */
+-      unsigned        Size;           /* Data buffer size. */
+-      unsigned        Length;         /* Length of packet (<= Size). */
+-      SK_U32          PortIdx;        /* Receiving/transmitting port. */
++      SK_MBUF         *pNext;    /* Pointer to next RLMT Mbuf.       */
++      SK_U8           *pData;    /* Data buffer (virtually contig.). */
++      unsigned         Size;     /* Data buffer size.                */
++      unsigned         Length;   /* Length of packet (<= Size).      */
++      SK_U32           PortIdx;  /* Receiving/transmitting port.     */
+ #ifdef SK_RLMT_MBUF_PRIVATE
+-      SK_RLMT_MBUF    Rlmt;           /* Private part for RLMT. */
+-#endif  /* SK_RLMT_MBUF_PRIVATE */
+-      struct sk_buff  *pOs;           /* Pointer to message block */
++      SK_RLMT_MBUF     Rlmt;     /* Private part for RLMT.           */
++#endif
++      struct sk_buff  *pOs;      /* Pointer to message block         */
+ };
+ 
++/******************************************************************************
++ *
++ * Linux specific TIME defines
++ *
++ 
******************************************************************************/
+ 
+-/*
+- * Time macros
+- */
+ #if SK_TICKS_PER_SEC == 100
+ #define SK_PNMI_HUNDREDS_SEC(t)       (t)
+ #else
+-#define SK_PNMI_HUNDREDS_SEC(t)       ((((unsigned long)t) * 100) / \
+-                                                                              
(SK_TICKS_PER_SEC))
++#define SK_PNMI_HUNDREDS_SEC(t) ((((unsigned long)t)*100)/(SK_TICKS_PER_SEC))
+ #endif
+ 
+-/*
+- * New SkOsGetTime
+- */
+ #define SkOsGetTimeCurrent(pAC, pUsec) {\
++      static struct timeval prev_t; \
+       struct timeval t;\
+       do_gettimeofday(&t);\
+-      *pUsec = ((((t.tv_sec) * 1000000L)+t.tv_usec)/10000);\
++      if (prev_t.tv_sec == t.tv_sec) { \
++              if (prev_t.tv_usec > t.tv_usec) { \
++                      t.tv_usec = prev_t.tv_usec; \
++              } else { \
++                      prev_t.tv_usec = t.tv_usec; \
++              } \
++      } else { \
++              prev_t = t; \
++      } \
++      *pUsec = ((t.tv_sec*100L)+(t.tv_usec/10000));\
+ }
+ 
++/******************************************************************************
++ *
++ * Linux specific IOCTL defines and typedefs
++ *
++ 
******************************************************************************/
+ 
+-/*
+- * ioctl definitions
+- */
+-#define               SK_IOCTL_BASE           (SIOCDEVPRIVATE)
+-#define               SK_IOCTL_GETMIB         (SK_IOCTL_BASE + 0)
+-#define               SK_IOCTL_SETMIB         (SK_IOCTL_BASE + 1)
+-#define               SK_IOCTL_PRESETMIB      (SK_IOCTL_BASE + 2)
+-#define               SK_IOCTL_GEN            (SK_IOCTL_BASE + 3)
+-#define               SK_IOCTL_DIAG           (SK_IOCTL_BASE + 4)
+-
+-typedef struct s_IOCTL        SK_GE_IOCTL;
++#define       SK_IOCTL_BASE       (SIOCDEVPRIVATE)
++#define       SK_IOCTL_GETMIB     (SK_IOCTL_BASE + 0)
++#define       SK_IOCTL_SETMIB     (SK_IOCTL_BASE + 1)
++#define       SK_IOCTL_PRESETMIB  (SK_IOCTL_BASE + 2)
++#define       SK_IOCTL_GEN        (SK_IOCTL_BASE + 3)
<<Diff was trimmed, longer than 597 lines>>
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to