Commit 4d5d6f8e authored by Mirko Lindner's avatar Mirko Lindner Committed by Stephen Hemminger

[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
parent 827a0c52
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* *
* Name: skdrv1st.h * Name: skdrv1st.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter * Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.15 $ * Version: $Revision: 1.1 $
* Date: $Date: 2003/07/17 14:54:09 $ * Date: $Date: 2003/07/21 07:22:43 $
* Purpose: First header file for driver and all other modules * Purpose: First header file for driver and all other modules
* *
******************************************************************************/ ******************************************************************************/
...@@ -26,6 +26,9 @@ ...@@ -26,6 +26,9 @@
* History: * History:
* *
* $Log: skdrv1st.h,v $ * $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 * Revision 1.15 2003/07/17 14:54:09 rroesler
* Fix: Corrected SK_PNMI_READ macros to copy right amount of bytes * Fix: Corrected SK_PNMI_READ macros to copy right amount of bytes
* *
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* *
* Name: skdrv2nd.h * Name: skdrv2nd.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter * Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.19 $ * Version: $Revision: 1.3 $
* Date: $Date: 2003/07/07 09:53:10 $ * Date: $Date: 2003/08/12 16:51:18 $
* Purpose: Second header file for driver and all other modules * Purpose: Second header file for driver and all other modules
* *
******************************************************************************/ ******************************************************************************/
...@@ -26,6 +26,16 @@ ...@@ -26,6 +26,16 @@
* History: * History:
* *
* $Log: skdrv2nd.h,v $ * $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 * Revision 1.19 2003/07/07 09:53:10 rroesler
* Fix: Removed proprietary RxTx defines and used the ones from skgehw.h instead * Fix: Removed proprietary RxTx defines and used the ones from skgehw.h instead
* *
...@@ -315,12 +325,13 @@ struct s_IOCTL { ...@@ -315,12 +325,13 @@ struct s_IOCTL {
#define C_OFFSET_IPHEADER C_LEN_ETHERMAC_HEADER #define C_OFFSET_IPHEADER C_LEN_ETHERMAC_HEADER
#define C_OFFSET_IPHEADER_IPPROTO 9 #define C_OFFSET_IPHEADER_IPPROTO 9
#define C_OFFSET_TCPHEADER_TCPCS 16 #define C_OFFSET_TCPHEADER_TCPCS 16
#define C_OFFSET_UDPHEADER_UDPCS 6
#define C_OFFSET_IPPROTO ( (C_LEN_ETHERMAC_HEADER) + \ #define C_OFFSET_IPPROTO ( (C_LEN_ETHERMAC_HEADER) + \
(C_OFFSET_IPHEADER_IPPROTO) ) (C_OFFSET_IPHEADER_IPPROTO) )
#define C_PROTO_ID_UDP 6 /* refer to RFC 790 or Stevens' */ #define C_PROTO_ID_UDP 17 /* refer to RFC 790 or Stevens' */
#define C_PROTO_ID_TCP 17 /* TCP/IP illustrated for details */ #define C_PROTO_ID_TCP 6 /* TCP/IP illustrated for details */
/* TX and RX descriptors *****************************************************/ /* TX and RX descriptors *****************************************************/
...@@ -390,6 +401,7 @@ struct s_TxD { ...@@ -390,6 +401,7 @@ struct s_TxD {
typedef struct s_DevNet DEV_NET; typedef struct s_DevNet DEV_NET;
struct s_DevNet { struct s_DevNet {
struct proc_dir_entry *proc;
int PortNr; int PortNr;
int NetNr; int NetNr;
int Mtu; int Mtu;
...@@ -550,6 +562,10 @@ struct s_AC { ...@@ -550,6 +562,10 @@ struct s_AC {
/* Only for tests */ /* Only for tests */
int PortUp; int PortUp;
int PortDown; int PortDown;
int ChipsetType; /* Chipset family type
* 0 == Genesis family support
* 1 == Yukon family support
*/
}; };
......
...@@ -722,15 +722,14 @@ typedef struct s_GeInit { ...@@ -722,15 +722,14 @@ typedef struct s_GeInit {
/* /*
* Error numbers and messages for skxmac2.c and skgeinit.c * Error numbers and messages for skxmac2.c and skgeinit.c
*/ */
#define SKERR_HWI_E001 (SK_ERRBASE_HWINIT) #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_E002 (SKERR_HWI_E001+1)
#define SKERR_HWI_E002MSG "SkGeInit(): Level 1 call missing" #define SKERR_HWI_E002MSG "SkGeInit(): Level 1 call missing"
#define SKERR_HWI_E003 (SKERR_HWI_E002+1) #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_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_E005 (SKERR_HWI_E004+1)
#define SKERR_HWI_E005MSG "SkGeInitPort(): cannot init running ports" #define SKERR_HWI_E005MSG "SkGeInitPort(): cannot init running ports"
#define SKERR_HWI_E006 (SKERR_HWI_E005+1) #define SKERR_HWI_E006 (SKERR_HWI_E005+1)
...@@ -752,21 +751,21 @@ typedef struct s_GeInit { ...@@ -752,21 +751,21 @@ typedef struct s_GeInit {
#define SKERR_HWI_E014 (SKERR_HWI_E013+1) #define SKERR_HWI_E014 (SKERR_HWI_E013+1)
#define SKERR_HWI_E014MSG "SkGeInitPort(): unknown GIPortUsage specified" #define SKERR_HWI_E014MSG "SkGeInitPort(): unknown GIPortUsage specified"
#define SKERR_HWI_E015 (SKERR_HWI_E014+1) #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_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_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_E018 (SKERR_HWI_E017+1)
#define SKERR_HWI_E018MSG "FATAL: SkGeStopPort() does not terminate (Tx)" #define SKERR_HWI_E018MSG "FATAL: SkGeStopPort() does not terminate (Tx)"
#define SKERR_HWI_E019 (SKERR_HWI_E018+1) #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_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_E021 (SKERR_HWI_E020+1)
#define SKERR_HWI_E021MSG "MacUpdateStats(): cannot update statistic counter" #define SKERR_HWI_E021MSG "MacUpdateStats(): cannot update statistic counter"
#define SKERR_HWI_E022 (SKERR_HWI_E021+1) #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_E023 (SKERR_HWI_E022+1)
#define SKERR_HWI_E023MSG "SkGeInitPort(): Transmit Queue Size too small" #define SKERR_HWI_E023MSG "SkGeInitPort(): Transmit Queue Size too small"
#define SKERR_HWI_E024 (SKERR_HWI_E023+1) #define SKERR_HWI_E024 (SKERR_HWI_E023+1)
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* *
* Name: sktypes.h * Name: sktypes.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter * Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.3 $ * Version: $Revision: 1.1 $
* Date: $Date: 2003/02/25 14:16:40 $ * Date: $Date: 2003/07/21 07:26:01 $
* Purpose: Define data types for Linux * Purpose: Define data types for Linux
* *
******************************************************************************/ ******************************************************************************/
...@@ -26,6 +26,9 @@ ...@@ -26,6 +26,9 @@
* History: * History:
* *
* $Log: sktypes.h,v $ * $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 * Revision 1.3 2003/02/25 14:16:40 mlindner
* Fix: Copyright statement * Fix: Copyright statement
* *
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* *
* Name: version.h * Name: version.h
* Project: GEnesis, PCI Gigabit Ethernet Adapter * Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.4 $ * Version: $Revision: 1.2 $
* Date: $Date: 2003/02/25 14:16:40 $ * Date: $Date: 2003/08/13 12:01:01 $
* Purpose: SK specific Error log support * Purpose: SK specific Error log support
* *
******************************************************************************/ ******************************************************************************/
...@@ -25,6 +25,12 @@ ...@@ -25,6 +25,12 @@
* *
* History: * History:
* $Log: skversion.h,v $ * $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 * Revision 1.4 2003/02/25 14:16:40 mlindner
* Fix: Copyright statement * Fix: Copyright statement
* *
...@@ -42,13 +48,15 @@ ...@@ -42,13 +48,15 @@
******************************************************************************/ ******************************************************************************/
#ifdef lint
static const char SysKonnectFileId[] = "@(#) (C) SysKonnect GmbH."; static const char SysKonnectFileId[] = "@(#) (C) SysKonnect GmbH.";
static const char SysKonnectBuildNumber[] = 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)." "(C)Copyright 1999-2003 Marvell(R)."
#define VER_STRING "6.14" #define VER_STRING "6.17"
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* *
* Name: skdim.c * Name: skdim.c
* Project: GEnesis, PCI Gigabit Ethernet Adapter * Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.4 $ * Version: $Revision: 1.2 $
* Date: $Date: 2003/07/07 09:45:47 $ * Date: $Date: 2003/08/21 12:35:05 $
* Purpose: All functions to maintain interrupt moderation * Purpose: All functions to maintain interrupt moderation
* *
******************************************************************************/ ******************************************************************************/
...@@ -26,6 +26,12 @@ ...@@ -26,6 +26,12 @@
* History: * History:
* *
* $Log: skdim.c,v $ * $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 * Revision 1.4 2003/07/07 09:45:47 rroesler
* Fix: Compiler warnings corrected * Fix: Compiler warnings corrected
* *
...@@ -56,7 +62,7 @@ ...@@ -56,7 +62,7 @@
#ifndef lint #ifndef lint
static const char SysKonnectFileId[] = 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 #endif
#define __SKADDR_C #define __SKADDR_C
...@@ -312,6 +318,12 @@ GetCurrentSystemLoad(SK_AC *pAC) { ...@@ -312,6 +318,12 @@ GetCurrentSystemLoad(SK_AC *pAC) {
unsigned int TotalTime = 0; unsigned int TotalTime = 0;
unsigned int UsedTime = 0; unsigned int UsedTime = 0;
unsigned int SystemLoad = 0; unsigned int SystemLoad = 0;
#ifdef CONFIG_SMP
unsigned int SKNumCpus = smp_num_cpus;
#else
unsigned int SKNumCpus = 1;
#endif
/* unsigned int NbrCpu = 0; */ /* unsigned int NbrCpu = 0; */
/* /*
......
/****************************************************************************** /******************************************************************************
* *
* Name: skge.c * Name: skge.c
* Project: GEnesis, PCI Gigabit Ethernet Adapter * Project: GEnesis, PCI Gigabit Ethernet Adapter
* Version: $Revision: 1.63 $ * Version: $Revision: 1.11 $
* Date: $Date: 2003/07/15 09:26:23 $ * Date: $Date: 2003/08/26 16:05:19 $
* Purpose: The main driver source module * Purpose: The main driver source module
* *
******************************************************************************/ ******************************************************************************/
...@@ -57,6 +56,40 @@ ...@@ -57,6 +56,40 @@
* History: * History:
* *
* $Log: skge.c,v $ * $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 * Revision 1.63 2003/07/15 09:26:23 rroesler
* Fix: Removed memory leak when sending short padded frames * Fix: Removed memory leak when sending short padded frames
* *
...@@ -407,7 +440,10 @@ ...@@ -407,7 +440,10 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#ifdef CONFIG_PROC_FS
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#endif
#include "h/skdrv1st.h" #include "h/skdrv1st.h"
#include "h/skdrv2nd.h" #include "h/skdrv2nd.h"
...@@ -524,14 +560,17 @@ static int XmitFrameSG(SK_AC*, TX_PORT*, struct sk_buff*); ...@@ -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 const char SK_Root_Dir_entry[] = "sk98lin";
static struct proc_dir_entry *pSkRootDir; static struct proc_dir_entry *pSkRootDir;
extern int sk_proc_read( char *buffer, extern int sk_proc_read( char *buffer,
char **buffer_location, char **buffer_location,
off_t offset, off_t offset,
int buffer_length, int buffer_length,
int *eof, int *eof,
void *data); void *data);
#endif
extern void SkDimEnableModerationIfNeeded(SK_AC *pAC); extern void SkDimEnableModerationIfNeeded(SK_AC *pAC);
extern void SkDimDisplayModerationSettings(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}}; ...@@ -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}; static uintptr_t RxQueueAddr[SK_MAX_MACS] = {0x400, 0x480};
#ifdef CONFIG_PROC_FS
static struct proc_dir_entry *pSkRootDir; static struct proc_dir_entry *pSkRootDir;
#endif
/***************************************************************************** /*****************************************************************************
...@@ -572,17 +614,19 @@ static struct proc_dir_entry *pSkRootDir; ...@@ -572,17 +614,19 @@ static struct proc_dir_entry *pSkRootDir;
*/ */
static int __init skge_probe (void) static int __init skge_probe (void)
{ {
int proc_root_initialized = 0;
int boards_found = 0; int boards_found = 0;
int vendor_flag = SK_FALSE; int vendor_flag = SK_FALSE;
SK_AC *pAC; SK_AC *pAC;
DEV_NET *pNet = NULL; DEV_NET *pNet = NULL;
struct proc_dir_entry *pProcFile;
struct pci_dev *pdev = NULL; struct pci_dev *pdev = NULL;
unsigned long base_address; unsigned long base_address;
struct SK_NET_DEVICE *dev = NULL; struct SK_NET_DEVICE *dev = NULL;
SK_BOOL DeviceFound = SK_FALSE; SK_BOOL DeviceFound = SK_FALSE;
SK_BOOL BootStringCount = SK_FALSE; SK_BOOL BootStringCount = SK_FALSE;
#ifdef CONFIG_PROC_FS
int proc_root_initialized = 0;
struct proc_dir_entry *pProcFile;
#endif
if (probed) if (probed)
return -ENODEV; return -ENODEV;
...@@ -603,7 +647,7 @@ static int __init skge_probe (void) ...@@ -603,7 +647,7 @@ static int __init skge_probe (void)
continue; continue;
/* Configure DMA attributes. */ /* 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)) pci_set_dma_mask(pdev, (u64) 0xffffffff))
continue; continue;
...@@ -664,7 +708,7 @@ static int __init skge_probe (void) ...@@ -664,7 +708,7 @@ static int __init skge_probe (void)
#ifdef SK_ZEROCOPY #ifdef SK_ZEROCOPY
#ifdef USE_SK_TX_CHECKSUM #ifdef USE_SK_TX_CHECKSUM
if (pAC->GIni.GIChipId == CHIP_ID_YUKON) { if (pAC->ChipsetType) {
/* Use only if yukon hardware */ /* Use only if yukon hardware */
/* SK and ZEROCOPY - fly baby... */ /* SK and ZEROCOPY - fly baby... */
dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
...@@ -718,6 +762,7 @@ static int __init skge_probe (void) ...@@ -718,6 +762,7 @@ static int __init skge_probe (void)
(caddr_t) &pAC->Addr.Net[0].CurrentMacAddress, 6); (caddr_t) &pAC->Addr.Net[0].CurrentMacAddress, 6);
/* First adapter... Create proc and print message */ /* First adapter... Create proc and print message */
#ifdef CONFIG_PROC_FS
if (!DeviceFound) { if (!DeviceFound) {
DeviceFound = SK_TRUE; DeviceFound = SK_TRUE;
SK_MEMCPY(&SK_Root_Dir_entry, BootString, SK_MEMCPY(&SK_Root_Dir_entry, BootString,
...@@ -730,11 +775,8 @@ static int __init skge_probe (void) ...@@ -730,11 +775,8 @@ static int __init skge_probe (void)
pSkRootDir->owner = THIS_MODULE; pSkRootDir->owner = THIS_MODULE;
proc_root_initialized = 1; proc_root_initialized = 1;
} }
} }
/* Create proc file */ /* Create proc file */
pProcFile = create_proc_entry(dev->name, pProcFile = create_proc_entry(dev->name,
S_IFREG | S_IXUSR | S_IWGRP | S_IROTH, S_IFREG | S_IXUSR | S_IWGRP | S_IROTH,
...@@ -747,13 +789,15 @@ static int __init skge_probe (void) ...@@ -747,13 +789,15 @@ static int __init skge_probe (void)
pProcFile->size = sizeof(dev->name + 1); pProcFile->size = sizeof(dev->name + 1);
pProcFile->data = (void *)pProcFile; pProcFile->data = (void *)pProcFile;
pProcFile->owner = THIS_MODULE; pProcFile->owner = THIS_MODULE;
#endif
pNet->PortNr = 0; pNet->PortNr = 0;
pNet->NetNr = 0; pNet->NetNr = 0;
#ifdef SK_ZEROCOPY #ifdef SK_ZEROCOPY
#ifdef USE_SK_TX_CHECKSUM #ifdef USE_SK_TX_CHECKSUM
if (pAC->GIni.GIChipId == CHIP_ID_YUKON) { if (pAC->ChipsetType) {
/* SG and ZEROCOPY - fly baby... */ /* SG and ZEROCOPY - fly baby... */
dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
} }
...@@ -790,13 +834,14 @@ static int __init skge_probe (void) ...@@ -790,13 +834,14 @@ static int __init skge_probe (void)
#ifdef SK_ZEROCOPY #ifdef SK_ZEROCOPY
#ifdef USE_SK_TX_CHECKSUM #ifdef USE_SK_TX_CHECKSUM
if (pAC->GIni.GIChipId == CHIP_ID_YUKON) { if (pAC->ChipsetType) {
/* SG and ZEROCOPY - fly baby... */ /* SG and ZEROCOPY - fly baby... */
dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
} }
#endif #endif
#endif #endif
#ifdef CONFIG_PROC_FS
pProcFile = create_proc_entry(dev->name, pProcFile = create_proc_entry(dev->name,
S_IFREG | S_IXUSR | S_IWGRP | S_IROTH, S_IFREG | S_IXUSR | S_IWGRP | S_IROTH,
pSkRootDir); pSkRootDir);
...@@ -808,6 +853,7 @@ static int __init skge_probe (void) ...@@ -808,6 +853,7 @@ static int __init skge_probe (void)
pProcFile->size = sizeof(dev->name + 1); pProcFile->size = sizeof(dev->name + 1);
pProcFile->data = (void *)pProcFile; pProcFile->data = (void *)pProcFile;
pProcFile->owner = THIS_MODULE; pProcFile->owner = THIS_MODULE;
#endif
memcpy((caddr_t) &dev->dev_addr, memcpy((caddr_t) &dev->dev_addr,
(caddr_t) &pAC->Addr.Net[1].CurrentMacAddress, 6); (caddr_t) &pAC->Addr.Net[1].CurrentMacAddress, 6);
...@@ -1086,8 +1132,10 @@ SK_EVPARA EvPara; ...@@ -1086,8 +1132,10 @@ SK_EVPARA EvPara;
SkGeRootDev = next; SkGeRootDev = next;
} }
#ifdef CONFIG_PROC_FS
/* clear proc-dir */ /* clear proc-dir */
remove_proc_entry(pSkRootDir->name, proc_net); remove_proc_entry(pSkRootDir->name, proc_net);
#endif
} /* skge_cleanup_module */ } /* skge_cleanup_module */
...@@ -1171,6 +1219,13 @@ SK_BOOL DualNet; ...@@ -1171,6 +1219,13 @@ SK_BOOL DualNet;
SkRlmtInit( pAC, pAC->IoBase, SK_INIT_IO); SkRlmtInit( pAC, pAC->IoBase, SK_INIT_IO);
SkTimerInit(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); GetConfiguration(pAC);
if (pAC->RlmtNets == 2) { if (pAC->RlmtNets == 2) {
pAC->GIni.GIPortUsage = SK_MUL_LINK; pAC->GIni.GIPortUsage = SK_MUL_LINK;
...@@ -1185,11 +1240,11 @@ SK_BOOL DualNet; ...@@ -1185,11 +1240,11 @@ SK_BOOL DualNet;
Ret = request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ, Ret = request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ,
pAC->Name, dev); pAC->Name, dev);
} else { } 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); dev->name, pAC->GIni.GIMacsFound);
return -EAGAIN; return -EAGAIN;
} }
if (Ret) { if (Ret) {
printk(KERN_WARNING "%s: Requested IRQ %d is busy.\n", printk(KERN_WARNING "%s: Requested IRQ %d is busy.\n",
dev->name, dev->irq); dev->name, dev->irq);
...@@ -2117,7 +2172,7 @@ struct sk_buff *pMessage) /* pointer to send-message */ ...@@ -2117,7 +2172,7 @@ struct sk_buff *pMessage) /* pointer to send-message */
*/ */
if (BytesSend < C_LEN_ETHERNET_MINSIZE) { if (BytesSend < C_LEN_ETHERNET_MINSIZE) {
skb_put(pMessage, (C_LEN_ETHERNET_MINSIZE-BytesSend)); skb_put(pMessage, (C_LEN_ETHERNET_MINSIZE-BytesSend));
memset( ((void *)(pMessage->data))+BytesSend, memset( ((int *)(pMessage->data))+BytesSend,
0, C_LEN_ETHERNET_MINSIZE-BytesSend); 0, C_LEN_ETHERNET_MINSIZE-BytesSend);
} }
...@@ -2141,7 +2196,7 @@ struct sk_buff *pMessage) /* pointer to send-message */ ...@@ -2141,7 +2196,7 @@ struct sk_buff *pMessage) /* pointer to send-message */
*/ */
PhysAddr = (SK_U64) pci_map_page(pAC->PciDev, PhysAddr = (SK_U64) pci_map_page(pAC->PciDev,
virt_to_page(pMessage->data), virt_to_page(pMessage->data),
offset_in_page(pMessage->data), ((unsigned long) pMessage->data & ~PAGE_MASK),
pMessage->len, pMessage->len,
PCI_DMA_TODEVICE); PCI_DMA_TODEVICE);
pTxd->VDataLow = (SK_U32) (PhysAddr & 0xffffffff); pTxd->VDataLow = (SK_U32) (PhysAddr & 0xffffffff);
...@@ -2149,8 +2204,8 @@ struct sk_buff *pMessage) /* pointer to send-message */ ...@@ -2149,8 +2204,8 @@ struct sk_buff *pMessage) /* pointer to send-message */
pTxd->pMBuf = pMessage; pTxd->pMBuf = pMessage;
if (pMessage->ip_summed == CHECKSUM_HW) { if (pMessage->ip_summed == CHECKSUM_HW) {
Protocol = ((SK_U8)pMessage->data[C_OFFSET_IPPROTO] & 0xf); Protocol = ((SK_U8)pMessage->data[C_OFFSET_IPPROTO] & 0xff);
if ((Protocol == C_PROTO_ID_TCP) && (pAC->GIni.GIChipRev != 0)) { if ((Protocol == C_PROTO_ID_UDP) && (pAC->GIni.GIChipRev != 0)) {
pTxd->TBControl = BMU_UDP_CHECK; pTxd->TBControl = BMU_UDP_CHECK;
} else { } else {
pTxd->TBControl = BMU_TCP_CHECK ; pTxd->TBControl = BMU_TCP_CHECK ;
...@@ -2160,7 +2215,9 @@ struct sk_buff *pMessage) /* pointer to send-message */ ...@@ -2160,7 +2215,9 @@ struct sk_buff *pMessage) /* pointer to send-message */
IpHeaderLength = (IpHeaderLength & 0xf) * 4; IpHeaderLength = (IpHeaderLength & 0xf) * 4;
pTxd->TcpSumOfs = 0; /* PH-Checksum already calculated */ pTxd->TcpSumOfs = 0; /* PH-Checksum already calculated */
pTxd->TcpSumSt = C_LEN_ETHERMAC_HEADER + IpHeaderLength + 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->TcpSumWr = C_LEN_ETHERMAC_HEADER + IpHeaderLength;
pTxd->TBControl |= BMU_OWN | BMU_STF | pTxd->TBControl |= BMU_OWN | BMU_STF |
...@@ -2258,7 +2315,7 @@ struct sk_buff *pMessage) /* pointer to send-message */ ...@@ -2258,7 +2315,7 @@ struct sk_buff *pMessage) /* pointer to send-message */
*/ */
PhysAddr = (SK_U64) pci_map_page(pAC->PciDev, PhysAddr = (SK_U64) pci_map_page(pAC->PciDev,
virt_to_page(pMessage->data), virt_to_page(pMessage->data),
offset_in_page(pMessage->data), ((unsigned long) pMessage->data & ~PAGE_MASK),
skb_headlen(pMessage), skb_headlen(pMessage),
PCI_DMA_TODEVICE); PCI_DMA_TODEVICE);
...@@ -2275,8 +2332,8 @@ struct sk_buff *pMessage) /* pointer to send-message */ ...@@ -2275,8 +2332,8 @@ struct sk_buff *pMessage) /* pointer to send-message */
** opcode for udp is not working in the hardware yet ** opcode for udp is not working in the hardware yet
** (Revision 2.0) ** (Revision 2.0)
*/ */
Protocol = ((SK_U8)pMessage->data[C_OFFSET_IPPROTO] & 0xf); Protocol = ((SK_U8)pMessage->data[C_OFFSET_IPPROTO] & 0xff);
if ((Protocol == C_PROTO_ID_TCP) && (pAC->GIni.GIChipRev != 0)) { if ((Protocol == C_PROTO_ID_UDP) && (pAC->GIni.GIChipRev != 0)) {
pTxd->TBControl |= BMU_UDP_CHECK; pTxd->TBControl |= BMU_UDP_CHECK;
} else { } else {
pTxd->TBControl |= BMU_TCP_CHECK ; pTxd->TBControl |= BMU_TCP_CHECK ;
...@@ -2285,7 +2342,9 @@ struct sk_buff *pMessage) /* pointer to send-message */ ...@@ -2285,7 +2342,9 @@ struct sk_buff *pMessage) /* pointer to send-message */
IpHeaderLength = ((SK_U8)pMessage->data[C_OFFSET_IPHEADER] & 0xf)*4; IpHeaderLength = ((SK_U8)pMessage->data[C_OFFSET_IPHEADER] & 0xf)*4;
pTxd->TcpSumOfs = 0; /* PH-Checksum already claculated */ pTxd->TcpSumOfs = 0; /* PH-Checksum already claculated */
pTxd->TcpSumSt = C_LEN_ETHERMAC_HEADER + IpHeaderLength + 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->TcpSumWr = C_LEN_ETHERMAC_HEADER + IpHeaderLength;
} else { } else {
pTxd->TBControl = BMU_CHECK | BMU_SW | BMU_STF | pTxd->TBControl = BMU_CHECK | BMU_SW | BMU_STF |
...@@ -2324,7 +2383,7 @@ struct sk_buff *pMessage) /* pointer to send-message */ ...@@ -2324,7 +2383,7 @@ struct sk_buff *pMessage) /* pointer to send-message */
** opcode for udp is not working in the hardware yet ** opcode for udp is not working in the hardware yet
** (revision 2.0) ** (revision 2.0)
*/ */
if ( (Protocol == C_PROTO_ID_TCP) && if ( (Protocol == C_PROTO_ID_UDP) &&
(pAC->GIni.GIChipRev != 0) ) { (pAC->GIni.GIChipRev != 0) ) {
pTxd->TBControl |= BMU_UDP_CHECK ; pTxd->TBControl |= BMU_UDP_CHECK ;
} else { } else {
...@@ -2517,7 +2576,8 @@ SK_U64 PhysAddr; /* physical address of a rx buffer */ ...@@ -2517,7 +2576,8 @@ SK_U64 PhysAddr; /* physical address of a rx buffer */
Length = pAC->RxBufSize; Length = pAC->RxBufSize;
PhysAddr = (SK_U64) pci_map_page(pAC->PciDev, PhysAddr = (SK_U64) pci_map_page(pAC->PciDev,
virt_to_page(pMsgBlock->data), virt_to_page(pMsgBlock->data),
offset_in_page(pMsgBlock->data), ((unsigned long) pMsgBlock->data &
~PAGE_MASK),
pAC->RxBufSize - 2, pAC->RxBufSize - 2,
PCI_DMA_FROMDEVICE); PCI_DMA_FROMDEVICE);
...@@ -2789,7 +2849,7 @@ SK_U64 PhysAddr; ...@@ -2789,7 +2849,7 @@ SK_U64 PhysAddr;
/* Frame not padded => TCP offload! */ /* Frame not padded => TCP offload! */
if ((((Csum1 & 0xfffe) && (Csum2 & 0xfffe)) && if ((((Csum1 & 0xfffe) && (Csum2 & 0xfffe)) &&
(pAC->GIni.GIChipId == CHIP_ID_GENESIS)) || (pAC->GIni.GIChipId == CHIP_ID_GENESIS)) ||
(pAC->GIni.GIChipId == CHIP_ID_YUKON)) { (pAC->ChipsetType)) {
Result = SkCsGetReceiveInfo(pAC, Result = SkCsGetReceiveInfo(pAC,
&pMsg->data[14], &pMsg->data[14],
Csum1, Csum2, pRxPort->PortIndex); Csum1, Csum2, pRxPort->PortIndex);
...@@ -3657,6 +3717,7 @@ int AutoNeg = 1; /* autoneg off (0) or on (1) */ ...@@ -3657,6 +3717,7 @@ int AutoNeg = 1; /* autoneg off (0) or on (1) */
int DuplexCap = 0; /* 0=both,1=full,2=half */ int DuplexCap = 0; /* 0=both,1=full,2=half */
int FlowCtrl = SK_FLOW_MODE_SYM_OR_REM; /* FlowControl */ int FlowCtrl = SK_FLOW_MODE_SYM_OR_REM; /* FlowControl */
int MSMode = SK_MS_MODE_AUTO; /* master/slave mode */ int MSMode = SK_MS_MODE_AUTO; /* master/slave mode */
SK_BOOL IsConTypeDefined = SK_TRUE; SK_BOOL IsConTypeDefined = SK_TRUE;
SK_BOOL IsLinkSpeedDefined = SK_TRUE; SK_BOOL IsLinkSpeedDefined = SK_TRUE;
SK_BOOL IsFlowCtrlDefined = SK_TRUE; SK_BOOL IsFlowCtrlDefined = SK_TRUE;
...@@ -3687,6 +3748,7 @@ int Capabilities[3][3] = ...@@ -3687,6 +3748,7 @@ int Capabilities[3][3] =
#define AN_SENS 2 #define AN_SENS 2
#define M_CurrPort pAC->GIni.GP[Port] #define M_CurrPort pAC->GIni.GP[Port]
/* /*
** Set the default values first for both ports! ** Set the default values first for both ports!
*/ */
...@@ -3720,9 +3782,24 @@ int Capabilities[3][3] = ...@@ -3720,9 +3782,24 @@ int Capabilities[3][3] =
if ( (ConType != NULL) && if ( (ConType != NULL) &&
(pAC->Index < SK_MAX_CARD_PARAM) && (pAC->Index < SK_MAX_CARD_PARAM) &&
(ConType[pAC->Index] != NULL) ) { (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 */ 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++) { for (Port = 0; Port < SK_MAX_MACS; Port++) {
M_CurrPort.PLinkModeConf = Capabilities[AN_ON][DC_BOTH]; M_CurrPort.PLinkModeConf = Capabilities[AN_ON][DC_BOTH];
M_CurrPort.PFlowCtrlMode = SK_FLOW_MODE_SYM_OR_REM; M_CurrPort.PFlowCtrlMode = SK_FLOW_MODE_SYM_OR_REM;
...@@ -3795,8 +3872,7 @@ int Capabilities[3][3] = ...@@ -3795,8 +3872,7 @@ int Capabilities[3][3] =
** Check speed parameter: ** Check speed parameter:
** Only copper type adapter and GE V2 cards ** Only copper type adapter and GE V2 cards
*/ */
if (((pAC->GIni.GIChipId != CHIP_ID_YUKON) || if (((!pAC->ChipsetType) || (pAC->GIni.GICopperType != SK_TRUE)) &&
(pAC->GIni.GICopperType != SK_TRUE)) &&
((LinkSpeed != SK_LSPEED_AUTO) && ((LinkSpeed != SK_LSPEED_AUTO) &&
(LinkSpeed != SK_LSPEED_1000MBPS))) { (LinkSpeed != SK_LSPEED_1000MBPS))) {
printk("%s: Illegal value for Speed_A. " printk("%s: Illegal value for Speed_A. "
...@@ -3858,6 +3934,16 @@ int Capabilities[3][3] = ...@@ -3858,6 +3934,16 @@ int Capabilities[3][3] =
/* /*
** Check for illegal combinations ** 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) { if ( AutoSet && AutoNeg==AN_SENS && DupSet) {
printk("%s, Port A: DuplexCapabilities" printk("%s, Port A: DuplexCapabilities"
" ignored using Sense mode\n", pAC->dev[0]->name); " ignored using Sense mode\n", pAC->dev[0]->name);
...@@ -3985,8 +4071,7 @@ int Capabilities[3][3] = ...@@ -3985,8 +4071,7 @@ int Capabilities[3][3] =
** Check speed parameter: ** Check speed parameter:
** Only copper type adapter and GE V2 cards ** Only copper type adapter and GE V2 cards
*/ */
if (((pAC->GIni.GIChipId != CHIP_ID_YUKON) || if (((!pAC->ChipsetType) || (pAC->GIni.GICopperType != SK_TRUE)) &&
(pAC->GIni.GICopperType != SK_TRUE)) &&
((LinkSpeed != SK_LSPEED_AUTO) && ((LinkSpeed != SK_LSPEED_AUTO) &&
(LinkSpeed != SK_LSPEED_1000MBPS))) { (LinkSpeed != SK_LSPEED_1000MBPS))) {
printk("%s: Illegal value for Speed_B. " printk("%s: Illegal value for Speed_B. "
...@@ -4044,10 +4129,21 @@ int Capabilities[3][3] = ...@@ -4044,10 +4129,21 @@ int Capabilities[3][3] =
pAC->dev[0]->name, DupCap_B[pAC->Index]); pAC->dev[0]->name, DupCap_B[pAC->Index]);
} }
} }
/* /*
** Check for illegal combinations ** 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) { if (AutoSet && AutoNeg==AN_SENS && DupSet) {
printk("%s, Port B: DuplexCapabilities" printk("%s, Port B: DuplexCapabilities"
" ignored using Sense mode\n", pAC->dev[1]->name); " ignored using Sense mode\n", pAC->dev[1]->name);
...@@ -4754,9 +4850,23 @@ SK_BOOL DualNet; ...@@ -4754,9 +4850,23 @@ SK_BOOL DualNet;
printk(" role: ???\n"); 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 #ifdef SK_ZEROCOPY
if (pAC->GIni.GIChipId == CHIP_ID_YUKON) if (pAC->ChipsetType)
#ifdef USE_SK_TX_CHECKSUM #ifdef USE_SK_TX_CHECKSUM
printk(" scatter-gather: enabled\n"); printk(" scatter-gather: enabled\n");
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment