summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMirko Lindner <mlindner@syskonnect.de>2003-09-25 11:52:03 -0400
committerStephen Hemminger <shemminger@osdl.org>2003-09-25 11:52:03 -0400
commit4d5d6f8ed4bb5db3586e6428cd6d670f7c0e66c8 (patch)
tree67a43d55612a6ecb2cb2c3053d050a4b1b8e49b2
parent827a0c5205edc6f0cca8b79066d20457e2d1b7da (diff)
[netdrvr sk98lin] small updates
Patch 1/5 (Update to version 6.17) * Add: Better parameter check * Add: UDP and TCP HW Csum changes * Add: Interrupt Moderation infos
-rw-r--r--drivers/net/sk98lin/h/skdrv1st.h7
-rw-r--r--drivers/net/sk98lin/h/skdrv2nd.h24
-rw-r--r--drivers/net/sk98lin/h/skgeinit.h19
-rw-r--r--drivers/net/sk98lin/h/sktypes.h7
-rw-r--r--drivers/net/sk98lin/h/skversion.h18
-rw-r--r--drivers/net/sk98lin/skdim.c18
-rw-r--r--drivers/net/sk98lin/skge.c178
7 files changed, 211 insertions, 60 deletions
diff --git a/drivers/net/sk98lin/h/skdrv1st.h b/drivers/net/sk98lin/h/skdrv1st.h
index 8b60183652df..8ee7dfd25ed9 100644
--- a/drivers/net/sk98lin/h/skdrv1st.h
+++ b/drivers/net/sk98lin/h/skdrv1st.h
@@ -2,8 +2,8 @@
*
* Name: skdrv1st.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
- * Version: $Revision: 1.15 $
- * Date: $Date: 2003/07/17 14:54:09 $
+ * Version: $Revision: 1.1 $
+ * Date: $Date: 2003/07/21 07:22:43 $
* Purpose: First header file for driver and all other modules
*
******************************************************************************/
@@ -26,6 +26,9 @@
* History:
*
* $Log: skdrv1st.h,v $
+ * Revision 1.1 2003/07/21 07:22:43 rroesler
+ * Fix: Re-Enter after CVS crash
+ *
* Revision 1.15 2003/07/17 14:54:09 rroesler
* Fix: Corrected SK_PNMI_READ macros to copy right amount of bytes
*
diff --git a/drivers/net/sk98lin/h/skdrv2nd.h b/drivers/net/sk98lin/h/skdrv2nd.h
index 340a39f31874..af6eecd1c79f 100644
--- a/drivers/net/sk98lin/h/skdrv2nd.h
+++ b/drivers/net/sk98lin/h/skdrv2nd.h
@@ -2,8 +2,8 @@
*
* Name: skdrv2nd.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
- * Version: $Revision: 1.19 $
- * Date: $Date: 2003/07/07 09:53:10 $
+ * Version: $Revision: 1.3 $
+ * Date: $Date: 2003/08/12 16:51:18 $
* Purpose: Second header file for driver and all other modules
*
******************************************************************************/
@@ -26,6 +26,16 @@
* History:
*
* $Log: skdrv2nd.h,v $
+ * Revision 1.3 2003/08/12 16:51:18 mlindner
+ * Fix: UDP and TCP Proto checks
+ * Fix: UDP header offset
+ *
+ * Revision 1.2 2003/08/07 10:50:54 mlindner
+ * Add: Speed and HW-Csum support for Yukon Lite chipset
+ *
+ * Revision 1.1 2003/07/21 07:25:29 rroesler
+ * Fix: Re-Enter after CVS crash
+ *
* Revision 1.19 2003/07/07 09:53:10 rroesler
* Fix: Removed proprietary RxTx defines and used the ones from skgehw.h instead
*
@@ -315,12 +325,13 @@ struct s_IOCTL {
#define C_OFFSET_IPHEADER C_LEN_ETHERMAC_HEADER
#define C_OFFSET_IPHEADER_IPPROTO 9
#define C_OFFSET_TCPHEADER_TCPCS 16
+#define C_OFFSET_UDPHEADER_UDPCS 6
#define C_OFFSET_IPPROTO ( (C_LEN_ETHERMAC_HEADER) + \
(C_OFFSET_IPHEADER_IPPROTO) )
-#define C_PROTO_ID_UDP 6 /* refer to RFC 790 or Stevens' */
-#define C_PROTO_ID_TCP 17 /* TCP/IP illustrated for details */
+#define C_PROTO_ID_UDP 17 /* refer to RFC 790 or Stevens' */
+#define C_PROTO_ID_TCP 6 /* TCP/IP illustrated for details */
/* TX and RX descriptors *****************************************************/
@@ -390,6 +401,7 @@ struct s_TxD {
typedef struct s_DevNet DEV_NET;
struct s_DevNet {
+ struct proc_dir_entry *proc;
int PortNr;
int NetNr;
int Mtu;
@@ -550,6 +562,10 @@ struct s_AC {
/* Only for tests */
int PortUp;
int PortDown;
+ int ChipsetType; /* Chipset family type
+ * 0 == Genesis family support
+ * 1 == Yukon family support
+ */
};
diff --git a/drivers/net/sk98lin/h/skgeinit.h b/drivers/net/sk98lin/h/skgeinit.h
index 01fd0dd2cb60..8ccc5c41f24f 100644
--- a/drivers/net/sk98lin/h/skgeinit.h
+++ b/drivers/net/sk98lin/h/skgeinit.h
@@ -722,15 +722,14 @@ typedef struct s_GeInit {
/*
* Error numbers and messages for skxmac2.c and skgeinit.c
*/
-
#define SKERR_HWI_E001 (SK_ERRBASE_HWINIT)
-#define SKERR_HWI_E001MSG "SkXmClrExactAddr() has got invalid parameters"
+#define SKERR_HWI_E001MSG "SkXmClrExactAddr() has got illegal parameters"
#define SKERR_HWI_E002 (SKERR_HWI_E001+1)
#define SKERR_HWI_E002MSG "SkGeInit(): Level 1 call missing"
#define SKERR_HWI_E003 (SKERR_HWI_E002+1)
-#define SKERR_HWI_E003MSG "SkGeInit() called with invalid init Level"
+#define SKERR_HWI_E003MSG "SkGeInit() called with illegal init Level"
#define SKERR_HWI_E004 (SKERR_HWI_E003+1)
-#define SKERR_HWI_E004MSG "SkGeInitPort(): Queue Size invalid configured"
+#define SKERR_HWI_E004MSG "SkGeInitPort(): Queue Size illegal configured"
#define SKERR_HWI_E005 (SKERR_HWI_E004+1)
#define SKERR_HWI_E005MSG "SkGeInitPort(): cannot init running ports"
#define SKERR_HWI_E006 (SKERR_HWI_E005+1)
@@ -752,21 +751,21 @@ typedef struct s_GeInit {
#define SKERR_HWI_E014 (SKERR_HWI_E013+1)
#define SKERR_HWI_E014MSG "SkGeInitPort(): unknown GIPortUsage specified"
#define SKERR_HWI_E015 (SKERR_HWI_E014+1)
-#define SKERR_HWI_E015MSG "Invalid Link mode parameter"
+#define SKERR_HWI_E015MSG "Illegal Link mode parameter"
#define SKERR_HWI_E016 (SKERR_HWI_E015+1)
-#define SKERR_HWI_E016MSG "Invalid Flow control mode parameter"
+#define SKERR_HWI_E016MSG "Illegal Flow control mode parameter"
#define SKERR_HWI_E017 (SKERR_HWI_E016+1)
-#define SKERR_HWI_E017MSG "Invalid value specified for GIPollTimerVal"
+#define SKERR_HWI_E017MSG "Illegal value specified for GIPollTimerVal"
#define SKERR_HWI_E018 (SKERR_HWI_E017+1)
#define SKERR_HWI_E018MSG "FATAL: SkGeStopPort() does not terminate (Tx)"
#define SKERR_HWI_E019 (SKERR_HWI_E018+1)
-#define SKERR_HWI_E019MSG "Invalid Speed parameter"
+#define SKERR_HWI_E019MSG "Illegal Speed parameter"
#define SKERR_HWI_E020 (SKERR_HWI_E019+1)
-#define SKERR_HWI_E020MSG "Invalid Master/Slave parameter"
+#define SKERR_HWI_E020MSG "Illegal Master/Slave parameter"
#define SKERR_HWI_E021 (SKERR_HWI_E020+1)
#define SKERR_HWI_E021MSG "MacUpdateStats(): cannot update statistic counter"
#define SKERR_HWI_E022 (SKERR_HWI_E021+1)
-#define SKERR_HWI_E022MSG "MacStatistic(): invalid statistic base address"
+#define SKERR_HWI_E022MSG "MacStatistic(): illegal statistic base address"
#define SKERR_HWI_E023 (SKERR_HWI_E022+1)
#define SKERR_HWI_E023MSG "SkGeInitPort(): Transmit Queue Size too small"
#define SKERR_HWI_E024 (SKERR_HWI_E023+1)
diff --git a/drivers/net/sk98lin/h/sktypes.h b/drivers/net/sk98lin/h/sktypes.h
index 929eca88e233..0b43cd022c93 100644
--- a/drivers/net/sk98lin/h/sktypes.h
+++ b/drivers/net/sk98lin/h/sktypes.h
@@ -2,8 +2,8 @@
*
* Name: sktypes.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
- * Version: $Revision: 1.3 $
- * Date: $Date: 2003/02/25 14:16:40 $
+ * Version: $Revision: 1.1 $
+ * Date: $Date: 2003/07/21 07:26:01 $
* Purpose: Define data types for Linux
*
******************************************************************************/
@@ -26,6 +26,9 @@
* History:
*
* $Log: sktypes.h,v $
+ * Revision 1.1 2003/07/21 07:26:01 rroesler
+ * Fix: Re-Enter after CVS crash
+ *
* Revision 1.3 2003/02/25 14:16:40 mlindner
* Fix: Copyright statement
*
diff --git a/drivers/net/sk98lin/h/skversion.h b/drivers/net/sk98lin/h/skversion.h
index 9ff60feac6f9..bf8c572dadc8 100644
--- a/drivers/net/sk98lin/h/skversion.h
+++ b/drivers/net/sk98lin/h/skversion.h
@@ -2,8 +2,8 @@
*
* Name: version.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter
- * Version: $Revision: 1.4 $
- * Date: $Date: 2003/02/25 14:16:40 $
+ * Version: $Revision: 1.2 $
+ * Date: $Date: 2003/08/13 12:01:01 $
* Purpose: SK specific Error log support
*
******************************************************************************/
@@ -25,6 +25,12 @@
*
* History:
* $Log: skversion.h,v $
+ * Revision 1.2 2003/08/13 12:01:01 mlindner
+ * Add: Changes for Lint
+ *
+ * Revision 1.1 2003/07/24 09:29:56 rroesler
+ * Fix: Re-Enter after CVS crash
+ *
* Revision 1.4 2003/02/25 14:16:40 mlindner
* Fix: Copyright statement
*
@@ -42,13 +48,15 @@
******************************************************************************/
+#ifdef lint
static const char SysKonnectFileId[] = "@(#) (C) SysKonnect GmbH.";
static const char SysKonnectBuildNumber[] =
- "@(#)SK-BUILD: 6.14 PL: 01";
+ "@(#)SK-BUILD: 6.17 PL: 01";
+#endif /* !defined(lint) */
-#define BOOT_STRING "sk98lin: Network Device Driver v6.14\n" \
+#define BOOT_STRING "sk98lin: Network Device Driver v6.17\n" \
"(C)Copyright 1999-2003 Marvell(R)."
-#define VER_STRING "6.14"
+#define VER_STRING "6.17"
diff --git a/drivers/net/sk98lin/skdim.c b/drivers/net/sk98lin/skdim.c
index e499db3aee21..0a2da479b2d8 100644
--- a/drivers/net/sk98lin/skdim.c
+++ b/drivers/net/sk98lin/skdim.c
@@ -2,8 +2,8 @@
*
* Name: skdim.c
* Project: GEnesis, PCI Gigabit Ethernet Adapter
- * Version: $Revision: 1.4 $
- * Date: $Date: 2003/07/07 09:45:47 $
+ * Version: $Revision: 1.2 $
+ * Date: $Date: 2003/08/21 12:35:05 $
* Purpose: All functions to maintain interrupt moderation
*
******************************************************************************/
@@ -26,6 +26,12 @@
* History:
*
* $Log: skdim.c,v $
+ * Revision 1.2 2003/08/21 12:35:05 mlindner
+ * Fix: Corrected CPU detection and compile errors on single CPU machines
+ *
+ * Revision 1.1 2003/07/18 13:39:55 rroesler
+ * Fix: Re-enter after CVS crash
+ *
* Revision 1.4 2003/07/07 09:45:47 rroesler
* Fix: Compiler warnings corrected
*
@@ -56,7 +62,7 @@
#ifndef lint
static const char SysKonnectFileId[] =
- "@(#) $Id: skdim.c,v 1.4 2003/07/07 09:45:47 rroesler Exp $ (C) SysKonnect.";
+ "@(#) $Id: skdim.c,v 1.2 2003/08/21 12:35:05 mlindner Exp $ (C) SysKonnect.";
#endif
#define __SKADDR_C
@@ -312,6 +318,12 @@ GetCurrentSystemLoad(SK_AC *pAC) {
unsigned int TotalTime = 0;
unsigned int UsedTime = 0;
unsigned int SystemLoad = 0;
+#ifdef CONFIG_SMP
+ unsigned int SKNumCpus = smp_num_cpus;
+#else
+ unsigned int SKNumCpus = 1;
+#endif
+
/* unsigned int NbrCpu = 0; */
/*
diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
index 3fce1a398217..f3813929f572 100644
--- a/drivers/net/sk98lin/skge.c
+++ b/drivers/net/sk98lin/skge.c
@@ -1,10 +1,9 @@
-
/******************************************************************************
*
* Name: skge.c
* Project: GEnesis, PCI Gigabit Ethernet Adapter
- * Version: $Revision: 1.63 $
- * Date: $Date: 2003/07/15 09:26:23 $
+ * Version: $Revision: 1.11 $
+ * Date: $Date: 2003/08/26 16:05:19 $
* Purpose: The main driver source module
*
******************************************************************************/
@@ -57,6 +56,40 @@
* History:
*
* $Log: skge.c,v $
+ * Revision 1.11 2003/08/26 16:05:19 mlindner
+ * Fix: Compiler warnings (void *)
+ *
+ * Revision 1.10 2003/08/25 09:24:08 mlindner
+ * Add: Dynamic Interrupt Moderation (DIM) port up message
+ *
+ * Revision 1.9 2003/08/21 14:09:43 mlindner
+ * Fix: Disable Half Duplex with Gigabit-Speed (Yukon). Enable Full Duplex.
+ *
+ * Revision 1.8 2003/08/19 15:09:18 mlindner
+ * Fix: Ignore ConType parameter if empty value
+ *
+ * Revision 1.7 2003/08/13 12:00:35 mlindner
+ * Fix: Removed useless defines
+ *
+ * Revision 1.6 2003/08/12 16:49:41 mlindner
+ * Fix: UDP and TCP HW-CSum calculation (Kernel 2.5/2.6)
+ * Fix: UDP and TCP Proto checks
+ * Fix: Build without ProcFS
+ * Fix: Kernel 2.6 editorial changes
+ *
+ * Revision 1.5 2003/08/07 12:25:07 mlindner
+ * Fix: ConType parameter check and error detection
+ * Fix: Insert various fixes applied to the kernel tree
+ *
+ * Revision 1.4 2003/08/07 10:50:21 mlindner
+ * Add: Speed and HW-Csum support for Yukon Lite chipset
+ *
+ * Revision 1.3 2003/08/06 11:24:08 mlindner
+ * Add: Kernel updates
+ *
+ * Revision 1.2 2003/07/21 08:28:47 rroesler
+ * Fix: Handle padded bytes using skb_put()
+ *
* Revision 1.63 2003/07/15 09:26:23 rroesler
* Fix: Removed memory leak when sending short padded frames
*
@@ -407,7 +440,10 @@
#include <linux/module.h>
#include <linux/init.h>
+
+#ifdef CONFIG_PROC_FS
#include <linux/proc_fs.h>
+#endif
#include "h/skdrv1st.h"
#include "h/skdrv2nd.h"
@@ -524,14 +560,17 @@ static int XmitFrameSG(SK_AC*, TX_PORT*, struct sk_buff*);
*
******************************************************************************/
+#ifdef CONFIG_PROC_FS
static const char SK_Root_Dir_entry[] = "sk98lin";
static struct proc_dir_entry *pSkRootDir;
+
extern int sk_proc_read( char *buffer,
char **buffer_location,
off_t offset,
int buffer_length,
int *eof,
void *data);
+#endif
extern void SkDimEnableModerationIfNeeded(SK_AC *pAC);
extern void SkDimDisplayModerationSettings(SK_AC *pAC);
@@ -554,7 +593,10 @@ static uintptr_t TxQueueAddr[SK_MAX_MACS][2] = {{0x680, 0x600},{0x780, 0x700}};
static uintptr_t RxQueueAddr[SK_MAX_MACS] = {0x400, 0x480};
+#ifdef CONFIG_PROC_FS
static struct proc_dir_entry *pSkRootDir;
+#endif
+
/*****************************************************************************
@@ -572,17 +614,19 @@ static struct proc_dir_entry *pSkRootDir;
*/
static int __init skge_probe (void)
{
- int proc_root_initialized = 0;
int boards_found = 0;
int vendor_flag = SK_FALSE;
SK_AC *pAC;
DEV_NET *pNet = NULL;
- struct proc_dir_entry *pProcFile;
struct pci_dev *pdev = NULL;
unsigned long base_address;
struct SK_NET_DEVICE *dev = NULL;
SK_BOOL DeviceFound = SK_FALSE;
SK_BOOL BootStringCount = SK_FALSE;
+#ifdef CONFIG_PROC_FS
+ int proc_root_initialized = 0;
+ struct proc_dir_entry *pProcFile;
+#endif
if (probed)
return -ENODEV;
@@ -603,7 +647,7 @@ static int __init skge_probe (void)
continue;
/* Configure DMA attributes. */
- if (pci_set_dma_mask(pdev, (u64) 0xffffffffffffffff) &&
+ if (pci_set_dma_mask(pdev, (u64) 0xffffffffffffffffULL) &&
pci_set_dma_mask(pdev, (u64) 0xffffffff))
continue;
@@ -664,7 +708,7 @@ static int __init skge_probe (void)
#ifdef SK_ZEROCOPY
#ifdef USE_SK_TX_CHECKSUM
- if (pAC->GIni.GIChipId == CHIP_ID_YUKON) {
+ if (pAC->ChipsetType) {
/* Use only if yukon hardware */
/* SK and ZEROCOPY - fly baby... */
dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
@@ -718,6 +762,7 @@ static int __init skge_probe (void)
(caddr_t) &pAC->Addr.Net[0].CurrentMacAddress, 6);
/* First adapter... Create proc and print message */
+#ifdef CONFIG_PROC_FS
if (!DeviceFound) {
DeviceFound = SK_TRUE;
SK_MEMCPY(&SK_Root_Dir_entry, BootString,
@@ -730,11 +775,8 @@ static int __init skge_probe (void)
pSkRootDir->owner = THIS_MODULE;
proc_root_initialized = 1;
}
-
}
-
-
/* Create proc file */
pProcFile = create_proc_entry(dev->name,
S_IFREG | S_IXUSR | S_IWGRP | S_IROTH,
@@ -747,13 +789,15 @@ static int __init skge_probe (void)
pProcFile->size = sizeof(dev->name + 1);
pProcFile->data = (void *)pProcFile;
pProcFile->owner = THIS_MODULE;
+#endif
pNet->PortNr = 0;
pNet->NetNr = 0;
+
#ifdef SK_ZEROCOPY
#ifdef USE_SK_TX_CHECKSUM
- if (pAC->GIni.GIChipId == CHIP_ID_YUKON) {
+ if (pAC->ChipsetType) {
/* SG and ZEROCOPY - fly baby... */
dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
}
@@ -790,13 +834,14 @@ static int __init skge_probe (void)
#ifdef SK_ZEROCOPY
#ifdef USE_SK_TX_CHECKSUM
- if (pAC->GIni.GIChipId == CHIP_ID_YUKON) {
+ if (pAC->ChipsetType) {
/* SG and ZEROCOPY - fly baby... */
dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
}
#endif
#endif
+#ifdef CONFIG_PROC_FS
pProcFile = create_proc_entry(dev->name,
S_IFREG | S_IXUSR | S_IWGRP | S_IROTH,
pSkRootDir);
@@ -808,6 +853,7 @@ static int __init skge_probe (void)
pProcFile->size = sizeof(dev->name + 1);
pProcFile->data = (void *)pProcFile;
pProcFile->owner = THIS_MODULE;
+#endif
memcpy((caddr_t) &dev->dev_addr,
(caddr_t) &pAC->Addr.Net[1].CurrentMacAddress, 6);
@@ -1086,8 +1132,10 @@ SK_EVPARA EvPara;
SkGeRootDev = next;
}
+#ifdef CONFIG_PROC_FS
/* clear proc-dir */
remove_proc_entry(pSkRootDir->name, proc_net);
+#endif
} /* skge_cleanup_module */
@@ -1171,6 +1219,13 @@ SK_BOOL DualNet;
SkRlmtInit( pAC, pAC->IoBase, SK_INIT_IO);
SkTimerInit(pAC, pAC->IoBase, SK_INIT_IO);
+ /* Set chipset type support */
+ pAC->ChipsetType = 0;
+ if ((pAC->GIni.GIChipId == CHIP_ID_YUKON) ||
+ (pAC->GIni.GIChipId == CHIP_ID_YUKON_LITE)) {
+ pAC->ChipsetType = 1;
+ }
+
GetConfiguration(pAC);
if (pAC->RlmtNets == 2) {
pAC->GIni.GIPortUsage = SK_MUL_LINK;
@@ -1185,11 +1240,11 @@ SK_BOOL DualNet;
Ret = request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ,
pAC->Name, dev);
} else {
- printk(KERN_WARNING "%s: Invalid number of ports: %d\n",
+ printk(KERN_WARNING "%s: Illegal number of ports: %d\n",
dev->name, pAC->GIni.GIMacsFound);
return -EAGAIN;
}
-
+
if (Ret) {
printk(KERN_WARNING "%s: Requested IRQ %d is busy.\n",
dev->name, dev->irq);
@@ -2117,7 +2172,7 @@ struct sk_buff *pMessage) /* pointer to send-message */
*/
if (BytesSend < C_LEN_ETHERNET_MINSIZE) {
skb_put(pMessage, (C_LEN_ETHERNET_MINSIZE-BytesSend));
- memset( ((void *)(pMessage->data))+BytesSend,
+ memset( ((int *)(pMessage->data))+BytesSend,
0, C_LEN_ETHERNET_MINSIZE-BytesSend);
}
@@ -2141,7 +2196,7 @@ struct sk_buff *pMessage) /* pointer to send-message */
*/
PhysAddr = (SK_U64) pci_map_page(pAC->PciDev,
virt_to_page(pMessage->data),
- offset_in_page(pMessage->data),
+ ((unsigned long) pMessage->data & ~PAGE_MASK),
pMessage->len,
PCI_DMA_TODEVICE);
pTxd->VDataLow = (SK_U32) (PhysAddr & 0xffffffff);
@@ -2149,8 +2204,8 @@ struct sk_buff *pMessage) /* pointer to send-message */
pTxd->pMBuf = pMessage;
if (pMessage->ip_summed == CHECKSUM_HW) {
- Protocol = ((SK_U8)pMessage->data[C_OFFSET_IPPROTO] & 0xf);
- if ((Protocol == C_PROTO_ID_TCP) && (pAC->GIni.GIChipRev != 0)) {
+ Protocol = ((SK_U8)pMessage->data[C_OFFSET_IPPROTO] & 0xff);
+ if ((Protocol == C_PROTO_ID_UDP) && (pAC->GIni.GIChipRev != 0)) {
pTxd->TBControl = BMU_UDP_CHECK;
} else {
pTxd->TBControl = BMU_TCP_CHECK ;
@@ -2160,7 +2215,9 @@ struct sk_buff *pMessage) /* pointer to send-message */
IpHeaderLength = (IpHeaderLength & 0xf) * 4;
pTxd->TcpSumOfs = 0; /* PH-Checksum already calculated */
pTxd->TcpSumSt = C_LEN_ETHERMAC_HEADER + IpHeaderLength +
- C_OFFSET_TCPHEADER_TCPCS;
+ (Protocol == C_PROTO_ID_UDP ?
+ C_OFFSET_UDPHEADER_UDPCS :
+ C_OFFSET_TCPHEADER_TCPCS);
pTxd->TcpSumWr = C_LEN_ETHERMAC_HEADER + IpHeaderLength;
pTxd->TBControl |= BMU_OWN | BMU_STF |
@@ -2258,7 +2315,7 @@ struct sk_buff *pMessage) /* pointer to send-message */
*/
PhysAddr = (SK_U64) pci_map_page(pAC->PciDev,
virt_to_page(pMessage->data),
- offset_in_page(pMessage->data),
+ ((unsigned long) pMessage->data & ~PAGE_MASK),
skb_headlen(pMessage),
PCI_DMA_TODEVICE);
@@ -2275,8 +2332,8 @@ struct sk_buff *pMessage) /* pointer to send-message */
** opcode for udp is not working in the hardware yet
** (Revision 2.0)
*/
- Protocol = ((SK_U8)pMessage->data[C_OFFSET_IPPROTO] & 0xf);
- if ((Protocol == C_PROTO_ID_TCP) && (pAC->GIni.GIChipRev != 0)) {
+ Protocol = ((SK_U8)pMessage->data[C_OFFSET_IPPROTO] & 0xff);
+ if ((Protocol == C_PROTO_ID_UDP) && (pAC->GIni.GIChipRev != 0)) {
pTxd->TBControl |= BMU_UDP_CHECK;
} else {
pTxd->TBControl |= BMU_TCP_CHECK ;
@@ -2285,7 +2342,9 @@ struct sk_buff *pMessage) /* pointer to send-message */
IpHeaderLength = ((SK_U8)pMessage->data[C_OFFSET_IPHEADER] & 0xf)*4;
pTxd->TcpSumOfs = 0; /* PH-Checksum already claculated */
pTxd->TcpSumSt = C_LEN_ETHERMAC_HEADER + IpHeaderLength +
- C_OFFSET_TCPHEADER_TCPCS;
+ (Protocol == C_PROTO_ID_UDP ?
+ C_OFFSET_UDPHEADER_UDPCS :
+ C_OFFSET_TCPHEADER_TCPCS);
pTxd->TcpSumWr = C_LEN_ETHERMAC_HEADER + IpHeaderLength;
} else {
pTxd->TBControl = BMU_CHECK | BMU_SW | BMU_STF |
@@ -2324,7 +2383,7 @@ struct sk_buff *pMessage) /* pointer to send-message */
** opcode for udp is not working in the hardware yet
** (revision 2.0)
*/
- if ( (Protocol == C_PROTO_ID_TCP) &&
+ if ( (Protocol == C_PROTO_ID_UDP) &&
(pAC->GIni.GIChipRev != 0) ) {
pTxd->TBControl |= BMU_UDP_CHECK ;
} else {
@@ -2517,7 +2576,8 @@ SK_U64 PhysAddr; /* physical address of a rx buffer */
Length = pAC->RxBufSize;
PhysAddr = (SK_U64) pci_map_page(pAC->PciDev,
virt_to_page(pMsgBlock->data),
- offset_in_page(pMsgBlock->data),
+ ((unsigned long) pMsgBlock->data &
+ ~PAGE_MASK),
pAC->RxBufSize - 2,
PCI_DMA_FROMDEVICE);
@@ -2789,7 +2849,7 @@ rx_start:
/* Frame not padded => TCP offload! */
if ((((Csum1 & 0xfffe) && (Csum2 & 0xfffe)) &&
(pAC->GIni.GIChipId == CHIP_ID_GENESIS)) ||
- (pAC->GIni.GIChipId == CHIP_ID_YUKON)) {
+ (pAC->ChipsetType)) {
Result = SkCsGetReceiveInfo(pAC,
&pMsg->data[14],
Csum1, Csum2, pRxPort->PortIndex);
@@ -3657,6 +3717,7 @@ int AutoNeg = 1; /* autoneg off (0) or on (1) */
int DuplexCap = 0; /* 0=both,1=full,2=half */
int FlowCtrl = SK_FLOW_MODE_SYM_OR_REM; /* FlowControl */
int MSMode = SK_MS_MODE_AUTO; /* master/slave mode */
+
SK_BOOL IsConTypeDefined = SK_TRUE;
SK_BOOL IsLinkSpeedDefined = SK_TRUE;
SK_BOOL IsFlowCtrlDefined = SK_TRUE;
@@ -3687,6 +3748,7 @@ int Capabilities[3][3] =
#define AN_SENS 2
#define M_CurrPort pAC->GIni.GP[Port]
+
/*
** Set the default values first for both ports!
*/
@@ -3720,9 +3782,24 @@ int Capabilities[3][3] =
if ( (ConType != NULL) &&
(pAC->Index < SK_MAX_CARD_PARAM) &&
(ConType[pAC->Index] != NULL) ) {
- if (strcmp(ConType[pAC->Index],"")==0) {
+
+ /* Check chipset family */
+ if ((!pAC->ChipsetType) &&
+ (strcmp(ConType[pAC->Index],"Auto")!=0) &&
+ (strcmp(ConType[pAC->Index],"")!=0)) {
+ /* Set the speed parameter back */
+ printk("%s: Illegal value \"%s\" "
+ "for ConType."
+ " Using Auto.\n",
+ pAC->dev[0]->name,
+ ConType[pAC->Index]);
+
+ sprintf(ConType[pAC->Index], "Auto");
+ }
+
+ if (strcmp(ConType[pAC->Index],"")==0) {
IsConTypeDefined = SK_FALSE; /* No ConType defined */
- } else if (strcmp(ConType[pAC->Index],"Auto")==0) {
+ } else if (strcmp(ConType[pAC->Index],"Auto")==0) {
for (Port = 0; Port < SK_MAX_MACS; Port++) {
M_CurrPort.PLinkModeConf = Capabilities[AN_ON][DC_BOTH];
M_CurrPort.PFlowCtrlMode = SK_FLOW_MODE_SYM_OR_REM;
@@ -3795,8 +3872,7 @@ int Capabilities[3][3] =
** Check speed parameter:
** Only copper type adapter and GE V2 cards
*/
- if (((pAC->GIni.GIChipId != CHIP_ID_YUKON) ||
- (pAC->GIni.GICopperType != SK_TRUE)) &&
+ if (((!pAC->ChipsetType) || (pAC->GIni.GICopperType != SK_TRUE)) &&
((LinkSpeed != SK_LSPEED_AUTO) &&
(LinkSpeed != SK_LSPEED_1000MBPS))) {
printk("%s: Illegal value for Speed_A. "
@@ -3858,6 +3934,16 @@ int Capabilities[3][3] =
/*
** Check for illegal combinations
*/
+ if ((LinkSpeed = SK_LSPEED_1000MBPS) &&
+ ((DuplexCap == SK_LMODE_STAT_AUTOHALF) ||
+ (DuplexCap == SK_LMODE_STAT_HALF)) &&
+ (pAC->ChipsetType)) {
+ printk("%s: Half Duplex not possible with Gigabit speed!\n"
+ " Using Full Duplex.\n",
+ pAC->dev[0]->name);
+ DuplexCap = DC_FULL;
+ }
+
if ( AutoSet && AutoNeg==AN_SENS && DupSet) {
printk("%s, Port A: DuplexCapabilities"
" ignored using Sense mode\n", pAC->dev[0]->name);
@@ -3985,8 +4071,7 @@ int Capabilities[3][3] =
** Check speed parameter:
** Only copper type adapter and GE V2 cards
*/
- if (((pAC->GIni.GIChipId != CHIP_ID_YUKON) ||
- (pAC->GIni.GICopperType != SK_TRUE)) &&
+ if (((!pAC->ChipsetType) || (pAC->GIni.GICopperType != SK_TRUE)) &&
((LinkSpeed != SK_LSPEED_AUTO) &&
(LinkSpeed != SK_LSPEED_1000MBPS))) {
printk("%s: Illegal value for Speed_B. "
@@ -4044,10 +4129,21 @@ int Capabilities[3][3] =
pAC->dev[0]->name, DupCap_B[pAC->Index]);
}
}
+
/*
** Check for illegal combinations
*/
+ if ((LinkSpeed = SK_LSPEED_1000MBPS) &&
+ ((DuplexCap == SK_LMODE_STAT_AUTOHALF) ||
+ (DuplexCap == SK_LMODE_STAT_HALF)) &&
+ (pAC->ChipsetType)) {
+ printk("%s: Half Duplex not possible with Gigabit speed!\n"
+ " Using Full Duplex.\n",
+ pAC->dev[1]->name);
+ DuplexCap = DC_FULL;
+ }
+
if (AutoSet && AutoNeg==AN_SENS && DupSet) {
printk("%s, Port B: DuplexCapabilities"
" ignored using Sense mode\n", pAC->dev[1]->name);
@@ -4754,9 +4850,23 @@ SK_BOOL DualNet;
printk(" role: ???\n");
}
}
-
+
+ /*
+ Display dim (dynamic interrupt moderation)
+ informations
+ */
+ if (pAC->DynIrqModInfo.IntModTypeSelect == C_INT_MOD_STATIC)
+ printk(" irq moderation: static (%d ints/sec)\n",
+ pAC->DynIrqModInfo.MaxModIntsPerSec);
+ else if (pAC->DynIrqModInfo.IntModTypeSelect == C_INT_MOD_DYNAMIC)
+ printk(" irq moderation: dynamic (%d ints/sec)\n",
+ pAC->DynIrqModInfo.MaxModIntsPerSec);
+ else
+ printk(" irq moderation: disabled\n");
+
+
#ifdef SK_ZEROCOPY
- if (pAC->GIni.GIChipId == CHIP_ID_YUKON)
+ if (pAC->ChipsetType)
#ifdef USE_SK_TX_CHECKSUM
printk(" scatter-gather: enabled\n");
#else