aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sk98lin/skge.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2006-01-06 16:34:21 -0500
committerLen Brown <len.brown@intel.com>2006-01-06 16:34:21 -0500
commit25da0974601fc8096461f3d3f7ca3aab8e79adfb (patch)
treef9b3c1bfbc63fdb6a94e82177b8c3ae891125422 /drivers/net/sk98lin/skge.c
parent036d25f79ddfbc9878da24ef8e468a6d22caa605 (diff)
parentd99cf9d679a520d67f81d805b7cb91c68e1847f0 (diff)
Auto-update from upstream
Diffstat (limited to 'drivers/net/sk98lin/skge.c')
-rw-r--r--drivers/net/sk98lin/skge.c213
1 files changed, 82 insertions, 131 deletions
diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c
index ae734393475..9a76ac180b1 100644
--- a/drivers/net/sk98lin/skge.c
+++ b/drivers/net/sk98lin/skge.c
@@ -107,10 +107,10 @@
107 107
108#include "h/skversion.h" 108#include "h/skversion.h"
109 109
110#include <linux/in.h>
110#include <linux/module.h> 111#include <linux/module.h>
111#include <linux/moduleparam.h> 112#include <linux/moduleparam.h>
112#include <linux/init.h> 113#include <linux/init.h>
113#include <linux/proc_fs.h>
114#include <linux/dma-mapping.h> 114#include <linux/dma-mapping.h>
115#include <linux/ip.h> 115#include <linux/ip.h>
116 116
@@ -206,7 +206,6 @@ static void SkGeSetRxMode(struct SK_NET_DEVICE *dev);
206static struct net_device_stats *SkGeStats(struct SK_NET_DEVICE *dev); 206static struct net_device_stats *SkGeStats(struct SK_NET_DEVICE *dev);
207static int SkGeIoctl(struct SK_NET_DEVICE *dev, struct ifreq *rq, int cmd); 207static int SkGeIoctl(struct SK_NET_DEVICE *dev, struct ifreq *rq, int cmd);
208static void GetConfiguration(SK_AC*); 208static void GetConfiguration(SK_AC*);
209static void ProductStr(SK_AC*);
210static int XmitFrame(SK_AC*, TX_PORT*, struct sk_buff*); 209static int XmitFrame(SK_AC*, TX_PORT*, struct sk_buff*);
211static void FreeTxDescriptors(SK_AC*pAC, TX_PORT*); 210static void FreeTxDescriptors(SK_AC*pAC, TX_PORT*);
212static void FillRxRing(SK_AC*, RX_PORT*); 211static void FillRxRing(SK_AC*, RX_PORT*);
@@ -235,28 +234,6 @@ static int SkDrvDeInitAdapter(SK_AC *pAC, int devNbr);
235 * Extern Function Prototypes 234 * Extern Function Prototypes
236 * 235 *
237 ******************************************************************************/ 236 ******************************************************************************/
238static const char SKRootName[] = "net/sk98lin";
239static struct proc_dir_entry *pSkRootDir;
240extern struct file_operations sk_proc_fops;
241
242static inline void SkGeProcCreate(struct net_device *dev)
243{
244 struct proc_dir_entry *pe;
245
246 if (pSkRootDir &&
247 (pe = create_proc_entry(dev->name, S_IRUGO, pSkRootDir))) {
248 pe->proc_fops = &sk_proc_fops;
249 pe->data = dev;
250 pe->owner = THIS_MODULE;
251 }
252}
253
254static inline void SkGeProcRemove(struct net_device *dev)
255{
256 if (pSkRootDir)
257 remove_proc_entry(dev->name, pSkRootDir);
258}
259
260extern void SkDimEnableModerationIfNeeded(SK_AC *pAC); 237extern void SkDimEnableModerationIfNeeded(SK_AC *pAC);
261extern void SkDimDisplayModerationSettings(SK_AC *pAC); 238extern void SkDimDisplayModerationSettings(SK_AC *pAC);
262extern void SkDimStartModerationTimer(SK_AC *pAC); 239extern void SkDimStartModerationTimer(SK_AC *pAC);
@@ -279,6 +256,27 @@ static uintptr_t RxQueueAddr[SK_MAX_MACS] = {0x400, 0x480};
279 256
280/***************************************************************************** 257/*****************************************************************************
281 * 258 *
259 * SkPciWriteCfgDWord - write a 32 bit value to pci config space
260 *
261 * Description:
262 * This routine writes a 32 bit value to the pci configuration
263 * space.
264 *
265 * Returns:
266 * 0 - indicate everything worked ok.
267 * != 0 - error indication
268 */
269static inline int SkPciWriteCfgDWord(
270SK_AC *pAC, /* Adapter Control structure pointer */
271int PciAddr, /* PCI register address */
272SK_U32 Val) /* pointer to store the read value */
273{
274 pci_write_config_dword(pAC->PciDev, PciAddr, Val);
275 return(0);
276} /* SkPciWriteCfgDWord */
277
278/*****************************************************************************
279 *
282 * SkGeInitPCI - Init the PCI resources 280 * SkGeInitPCI - Init the PCI resources
283 * 281 *
284 * Description: 282 * Description:
@@ -300,7 +298,7 @@ int SkGeInitPCI(SK_AC *pAC)
300 dev->mem_start = pci_resource_start (pdev, 0); 298 dev->mem_start = pci_resource_start (pdev, 0);
301 pci_set_master(pdev); 299 pci_set_master(pdev);
302 300
303 if (pci_request_regions(pdev, pAC->Name) != 0) { 301 if (pci_request_regions(pdev, "sk98lin") != 0) {
304 retval = 2; 302 retval = 2;
305 goto out_disable; 303 goto out_disable;
306 } 304 }
@@ -578,10 +576,10 @@ SK_BOOL DualNet;
578 spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); 576 spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
579 577
580 if (pAC->GIni.GIMacsFound == 2) { 578 if (pAC->GIni.GIMacsFound == 2) {
581 Ret = request_irq(dev->irq, SkGeIsr, SA_SHIRQ, pAC->Name, dev); 579 Ret = request_irq(dev->irq, SkGeIsr, SA_SHIRQ, "sk98lin", dev);
582 } else if (pAC->GIni.GIMacsFound == 1) { 580 } else if (pAC->GIni.GIMacsFound == 1) {
583 Ret = request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ, 581 Ret = request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ,
584 pAC->Name, dev); 582 "sk98lin", dev);
585 } else { 583 } else {
586 printk(KERN_WARNING "sk98lin: Illegal number of ports: %d\n", 584 printk(KERN_WARNING "sk98lin: Illegal number of ports: %d\n",
587 pAC->GIni.GIMacsFound); 585 pAC->GIni.GIMacsFound);
@@ -1265,7 +1263,6 @@ struct SK_NET_DEVICE *dev)
1265 spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); 1263 spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
1266 1264
1267 pAC->MaxPorts++; 1265 pAC->MaxPorts++;
1268 pNet->Up = 1;
1269 1266
1270 1267
1271 SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY, 1268 SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ENTRY,
@@ -1395,7 +1392,6 @@ struct SK_NET_DEVICE *dev)
1395 sizeof(SK_PNMI_STRUCT_DATA)); 1392 sizeof(SK_PNMI_STRUCT_DATA));
1396 1393
1397 pAC->MaxPorts--; 1394 pAC->MaxPorts--;
1398 pNet->Up = 0;
1399 1395
1400 return (0); 1396 return (0);
1401} /* SkGeClose */ 1397} /* SkGeClose */
@@ -2175,7 +2171,6 @@ rx_start:
2175 pMsg->ip_summed = CHECKSUM_NONE; 2171 pMsg->ip_summed = CHECKSUM_NONE;
2176#endif 2172#endif
2177 2173
2178
2179 SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 1,("V")); 2174 SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 1,("V"));
2180 ForRlmt = SK_RLMT_RX_PROTOCOL; 2175 ForRlmt = SK_RLMT_RX_PROTOCOL;
2181#if 0 2176#if 0
@@ -2550,7 +2545,7 @@ unsigned long Flags;
2550static int SkGeChangeMtu(struct SK_NET_DEVICE *dev, int NewMtu) 2545static int SkGeChangeMtu(struct SK_NET_DEVICE *dev, int NewMtu)
2551{ 2546{
2552DEV_NET *pNet; 2547DEV_NET *pNet;
2553DEV_NET *pOtherNet; 2548struct net_device *pOtherDev;
2554SK_AC *pAC; 2549SK_AC *pAC;
2555unsigned long Flags; 2550unsigned long Flags;
2556int i; 2551int i;
@@ -2580,11 +2575,11 @@ SK_EVPARA EvPara;
2580 } 2575 }
2581#endif 2576#endif
2582 2577
2583 pNet->Mtu = NewMtu; 2578 pOtherDev = pAC->dev[1 - pNet->NetNr];
2584 pOtherNet = netdev_priv(pAC->dev[1 - pNet->NetNr]); 2579
2585 if ((pOtherNet->Mtu>1500) && (NewMtu<=1500) && (pOtherNet->Up==1)) { 2580 if ( netif_running(pOtherDev) && (pOtherDev->mtu > 1500)
2586 return(0); 2581 && (NewMtu <= 1500))
2587 } 2582 return 0;
2588 2583
2589 pAC->RxBufSize = NewMtu + 32; 2584 pAC->RxBufSize = NewMtu + 32;
2590 dev->mtu = NewMtu; 2585 dev->mtu = NewMtu;
@@ -2746,7 +2741,8 @@ SK_EVPARA EvPara;
2746 EvPara.Para32[1] = -1; 2741 EvPara.Para32[1] = -1;
2747 SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_START, EvPara); 2742 SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_START, EvPara);
2748 2743
2749 if (pOtherNet->Up) { 2744 if (netif_running(pOtherDev)) {
2745 DEV_NET *pOtherNet = netdev_priv(pOtherDev);
2750 EvPara.Para32[0] = pOtherNet->PortNr; 2746 EvPara.Para32[0] = pOtherNet->PortNr;
2751 SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_START, EvPara); 2747 SkEventQueue(pAC, SKGE_RLMT, SK_RLMT_START, EvPara);
2752 } 2748 }
@@ -2820,7 +2816,7 @@ unsigned long Flags; /* for spin lock */
2820 pAC->stats.rx_bytes = (SK_U32) pPnmiStruct->RxOctetsDeliveredCts; 2816 pAC->stats.rx_bytes = (SK_U32) pPnmiStruct->RxOctetsDeliveredCts;
2821 pAC->stats.tx_bytes = (SK_U32) pPnmiStat->StatTxOctetsOkCts; 2817 pAC->stats.tx_bytes = (SK_U32) pPnmiStat->StatTxOctetsOkCts;
2822 2818
2823 if (pNet->Mtu <= 1500) { 2819 if (dev->mtu <= 1500) {
2824 pAC->stats.rx_errors = (SK_U32) pPnmiStruct->InErrorsCts & 0xFFFFFFFF; 2820 pAC->stats.rx_errors = (SK_U32) pPnmiStruct->InErrorsCts & 0xFFFFFFFF;
2825 } else { 2821 } else {
2826 pAC->stats.rx_errors = (SK_U32) ((pPnmiStruct->InErrorsCts - 2822 pAC->stats.rx_errors = (SK_U32) ((pPnmiStruct->InErrorsCts -
@@ -3771,25 +3767,21 @@ int Capabilities[3][3] =
3771 * 3767 *
3772 * Returns: N/A 3768 * Returns: N/A
3773 */ 3769 */
3774static void ProductStr( 3770static inline int ProductStr(
3775SK_AC *pAC /* pointer to adapter context */ 3771 SK_AC *pAC, /* pointer to adapter context */
3772 char *DeviceStr, /* result string */
3773 int StrLen /* length of the string */
3776) 3774)
3777{ 3775{
3778int StrLen = 80; /* length of the string, defined in SK_AC */
3779char Keyword[] = VPD_NAME; /* vpd productname identifier */ 3776char Keyword[] = VPD_NAME; /* vpd productname identifier */
3780int ReturnCode; /* return code from vpd_read */ 3777int ReturnCode; /* return code from vpd_read */
3781unsigned long Flags; 3778unsigned long Flags;
3782 3779
3783 spin_lock_irqsave(&pAC->SlowPathLock, Flags); 3780 spin_lock_irqsave(&pAC->SlowPathLock, Flags);
3784 ReturnCode = VpdRead(pAC, pAC->IoBase, Keyword, pAC->DeviceStr, 3781 ReturnCode = VpdRead(pAC, pAC->IoBase, Keyword, DeviceStr, &StrLen);
3785 &StrLen);
3786 spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); 3782 spin_unlock_irqrestore(&pAC->SlowPathLock, Flags);
3787 if (ReturnCode != 0) { 3783
3788 /* there was an error reading the vpd data */ 3784 return ReturnCode;
3789 SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_ERROR,
3790 ("Error reading VPD data: %d\n", ReturnCode));
3791 pAC->DeviceStr[0] = '\0';
3792 }
3793} /* ProductStr */ 3785} /* ProductStr */
3794 3786
3795/***************************************************************************** 3787/*****************************************************************************
@@ -3992,28 +3984,6 @@ SK_U8 *pVal) /* pointer to store the read value */
3992 3984
3993/***************************************************************************** 3985/*****************************************************************************
3994 * 3986 *
3995 * SkPciWriteCfgDWord - write a 32 bit value to pci config space
3996 *
3997 * Description:
3998 * This routine writes a 32 bit value to the pci configuration
3999 * space.
4000 *
4001 * Returns:
4002 * 0 - indicate everything worked ok.
4003 * != 0 - error indication
4004 */
4005int SkPciWriteCfgDWord(
4006SK_AC *pAC, /* Adapter Control structure pointer */
4007int PciAddr, /* PCI register address */
4008SK_U32 Val) /* pointer to store the read value */
4009{
4010 pci_write_config_dword(pAC->PciDev, PciAddr, Val);
4011 return(0);
4012} /* SkPciWriteCfgDWord */
4013
4014
4015/*****************************************************************************
4016 *
4017 * SkPciWriteCfgWord - write a 16 bit value to pci config space 3987 * SkPciWriteCfgWord - write a 16 bit value to pci config space
4018 * 3988 *
4019 * Description: 3989 * Description:
@@ -4150,6 +4120,7 @@ SK_BOOL DualNet;
4150 Flags); 4120 Flags);
4151 break; 4121 break;
4152 case SK_DRV_NET_UP: /* SK_U32 PortIdx */ 4122 case SK_DRV_NET_UP: /* SK_U32 PortIdx */
4123 { struct net_device *dev = pAC->dev[Param.Para32[0]];
4153 /* action list 5 */ 4124 /* action list 5 */
4154 FromPort = Param.Para32[0]; 4125 FromPort = Param.Para32[0];
4155 SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_EVENT, 4126 SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_EVENT,
@@ -4233,22 +4204,12 @@ SK_BOOL DualNet;
4233 printk(" irq moderation: disabled\n"); 4204 printk(" irq moderation: disabled\n");
4234 4205
4235 4206
4236#ifdef SK_ZEROCOPY 4207 printk(" scatter-gather: %s\n",
4237 if (pAC->ChipsetType) 4208 (dev->features & NETIF_F_SG) ? "enabled" : "disabled");
4238#ifdef USE_SK_TX_CHECKSUM 4209 printk(" tx-checksum: %s\n",
4239 printk(" scatter-gather: enabled\n"); 4210 (dev->features & NETIF_F_IP_CSUM) ? "enabled" : "disabled");
4240#else 4211 printk(" rx-checksum: %s\n",
4241 printk(" tx-checksum: disabled\n"); 4212 pAC->RxPort[Param.Para32[0]].RxCsum ? "enabled" : "disabled");
4242#endif
4243 else
4244 printk(" scatter-gather: disabled\n");
4245#else
4246 printk(" scatter-gather: disabled\n");
4247#endif
4248
4249#ifndef USE_SK_RX_CHECKSUM
4250 printk(" rx-checksum: disabled\n");
4251#endif
4252 4213
4253 } else { 4214 } else {
4254 DoPrintInterfaceChange = SK_TRUE; 4215 DoPrintInterfaceChange = SK_TRUE;
@@ -4263,9 +4224,9 @@ SK_BOOL DualNet;
4263 } 4224 }
4264 4225
4265 /* Inform the world that link protocol is up. */ 4226 /* Inform the world that link protocol is up. */
4266 netif_carrier_on(pAC->dev[Param.Para32[0]]); 4227 netif_carrier_on(dev);
4267
4268 break; 4228 break;
4229 }
4269 case SK_DRV_NET_DOWN: /* SK_U32 Reason */ 4230 case SK_DRV_NET_DOWN: /* SK_U32 Reason */
4270 /* action list 7 */ 4231 /* action list 7 */
4271 SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_EVENT, 4232 SK_DBG_MSG(NULL, SK_DBGMOD_DRV, SK_DBGCAT_DRV_EVENT,
@@ -4479,7 +4440,7 @@ SK_AC *pAc) /* pointer to adapter context */
4479 4440
4480 pAC->DiagModeActive = DIAG_ACTIVE; 4441 pAC->DiagModeActive = DIAG_ACTIVE;
4481 if (pAC->BoardLevel > SK_INIT_DATA) { 4442 if (pAC->BoardLevel > SK_INIT_DATA) {
4482 if (pNet->Up) { 4443 if (netif_running(pAC->dev[0])) {
4483 pAC->WasIfUp[0] = SK_TRUE; 4444 pAC->WasIfUp[0] = SK_TRUE;
4484 pAC->DiagFlowCtrl = SK_TRUE; /* for SkGeClose */ 4445 pAC->DiagFlowCtrl = SK_TRUE; /* for SkGeClose */
4485 DoPrintInterfaceChange = SK_FALSE; 4446 DoPrintInterfaceChange = SK_FALSE;
@@ -4489,7 +4450,7 @@ SK_AC *pAc) /* pointer to adapter context */
4489 } 4450 }
4490 if (pNet != netdev_priv(pAC->dev[1])) { 4451 if (pNet != netdev_priv(pAC->dev[1])) {
4491 pNet = netdev_priv(pAC->dev[1]); 4452 pNet = netdev_priv(pAC->dev[1]);
4492 if (pNet->Up) { 4453 if (netif_running(pAC->dev[1])) {
4493 pAC->WasIfUp[1] = SK_TRUE; 4454 pAC->WasIfUp[1] = SK_TRUE;
4494 pAC->DiagFlowCtrl = SK_TRUE; /* for SkGeClose */ 4455 pAC->DiagFlowCtrl = SK_TRUE; /* for SkGeClose */
4495 DoPrintInterfaceChange = SK_FALSE; 4456 DoPrintInterfaceChange = SK_FALSE;
@@ -4815,6 +4776,7 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
4815 struct net_device *dev = NULL; 4776 struct net_device *dev = NULL;
4816 static int boards_found = 0; 4777 static int boards_found = 0;
4817 int error = -ENODEV; 4778 int error = -ENODEV;
4779 char DeviceStr[80];
4818 4780
4819 if (pci_enable_device(pdev)) 4781 if (pci_enable_device(pdev))
4820 goto out; 4782 goto out;
@@ -4842,14 +4804,11 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
4842 memset(pNet->pAC, 0, sizeof(SK_AC)); 4804 memset(pNet->pAC, 0, sizeof(SK_AC));
4843 pAC = pNet->pAC; 4805 pAC = pNet->pAC;
4844 pAC->PciDev = pdev; 4806 pAC->PciDev = pdev;
4845 pAC->PciDevId = pdev->device; 4807
4846 pAC->dev[0] = dev; 4808 pAC->dev[0] = dev;
4847 pAC->dev[1] = dev; 4809 pAC->dev[1] = dev;
4848 sprintf(pAC->Name, "SysKonnect SK-98xx");
4849 pAC->CheckQueue = SK_FALSE; 4810 pAC->CheckQueue = SK_FALSE;
4850 4811
4851 pNet->Mtu = 1500;
4852 pNet->Up = 0;
4853 dev->irq = pdev->irq; 4812 dev->irq = pdev->irq;
4854 error = SkGeInitPCI(pAC); 4813 error = SkGeInitPCI(pAC);
4855 if (error) { 4814 if (error) {
@@ -4872,21 +4831,30 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
4872 SET_NETDEV_DEV(dev, &pdev->dev); 4831 SET_NETDEV_DEV(dev, &pdev->dev);
4873 SET_ETHTOOL_OPS(dev, &SkGeEthtoolOps); 4832 SET_ETHTOOL_OPS(dev, &SkGeEthtoolOps);
4874 4833
4875#ifdef SK_ZEROCOPY 4834 /* Use only if yukon hardware */
4876#ifdef USE_SK_TX_CHECKSUM
4877 if (pAC->ChipsetType) { 4835 if (pAC->ChipsetType) {
4878 /* Use only if yukon hardware */ 4836#ifdef USE_SK_TX_CHECKSUM
4879 /* SK and ZEROCOPY - fly baby... */ 4837 dev->features |= NETIF_F_IP_CSUM;
4880 dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; 4838#endif
4881 } 4839#ifdef SK_ZEROCOPY
4840 dev->features |= NETIF_F_SG;
4882#endif 4841#endif
4842#ifdef USE_SK_RX_CHECKSUM
4843 pAC->RxPort[0].RxCsum = 1;
4883#endif 4844#endif
4845 }
4884 4846
4885 pAC->Index = boards_found++; 4847 pAC->Index = boards_found++;
4886 4848
4887 if (SkGeBoardInit(dev, pAC)) 4849 if (SkGeBoardInit(dev, pAC))
4888 goto out_free_netdev; 4850 goto out_free_netdev;
4889 4851
4852 /* Read Adapter name from VPD */
4853 if (ProductStr(pAC, DeviceStr, sizeof(DeviceStr)) != 0) {
4854 printk(KERN_ERR "sk98lin: Could not read VPD data.\n");
4855 goto out_free_resources;
4856 }
4857
4890 /* Register net device */ 4858 /* Register net device */
4891 if (register_netdev(dev)) { 4859 if (register_netdev(dev)) {
4892 printk(KERN_ERR "sk98lin: Could not register device.\n"); 4860 printk(KERN_ERR "sk98lin: Could not register device.\n");
@@ -4894,8 +4862,7 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
4894 } 4862 }
4895 4863
4896 /* Print adapter specific string from vpd */ 4864 /* Print adapter specific string from vpd */
4897 ProductStr(pAC); 4865 printk("%s: %s\n", dev->name, DeviceStr);
4898 printk("%s: %s\n", dev->name, pAC->DeviceStr);
4899 4866
4900 /* Print configuration settings */ 4867 /* Print configuration settings */
4901 printk(" PrefPort:%c RlmtMode:%s\n", 4868 printk(" PrefPort:%c RlmtMode:%s\n",
@@ -4911,8 +4878,6 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
4911 memcpy(&dev->dev_addr, &pAC->Addr.Net[0].CurrentMacAddress, 6); 4878 memcpy(&dev->dev_addr, &pAC->Addr.Net[0].CurrentMacAddress, 6);
4912 memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); 4879 memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
4913 4880
4914 SkGeProcCreate(dev);
4915
4916 pNet->PortNr = 0; 4881 pNet->PortNr = 0;
4917 pNet->NetNr = 0; 4882 pNet->NetNr = 0;
4918 4883
@@ -4931,8 +4896,6 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
4931 pNet->PortNr = 1; 4896 pNet->PortNr = 1;
4932 pNet->NetNr = 1; 4897 pNet->NetNr = 1;
4933 pNet->pAC = pAC; 4898 pNet->pAC = pAC;
4934 pNet->Mtu = 1500;
4935 pNet->Up = 0;
4936 4899
4937 dev->open = &SkGeOpen; 4900 dev->open = &SkGeOpen;
4938 dev->stop = &SkGeClose; 4901 dev->stop = &SkGeClose;
@@ -4945,26 +4908,28 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
4945 SET_NETDEV_DEV(dev, &pdev->dev); 4908 SET_NETDEV_DEV(dev, &pdev->dev);
4946 SET_ETHTOOL_OPS(dev, &SkGeEthtoolOps); 4909 SET_ETHTOOL_OPS(dev, &SkGeEthtoolOps);
4947 4910
4948#ifdef SK_ZEROCOPY
4949#ifdef USE_SK_TX_CHECKSUM
4950 if (pAC->ChipsetType) { 4911 if (pAC->ChipsetType) {
4951 /* SG and ZEROCOPY - fly baby... */ 4912#ifdef USE_SK_TX_CHECKSUM
4952 dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; 4913 dev->features |= NETIF_F_IP_CSUM;
4953 } 4914#endif
4915#ifdef SK_ZEROCOPY
4916 dev->features |= NETIF_F_SG;
4954#endif 4917#endif
4918#ifdef USE_SK_RX_CHECKSUM
4919 pAC->RxPort[1].RxCsum = 1;
4955#endif 4920#endif
4921 }
4956 4922
4957 if (register_netdev(dev)) { 4923 if (register_netdev(dev)) {
4958 printk(KERN_ERR "sk98lin: Could not register device for seconf port.\n"); 4924 printk(KERN_ERR "sk98lin: Could not register device for seconf port.\n");
4959 free_netdev(dev); 4925 free_netdev(dev);
4960 pAC->dev[1] = pAC->dev[0]; 4926 pAC->dev[1] = pAC->dev[0];
4961 } else { 4927 } else {
4962 SkGeProcCreate(dev);
4963 memcpy(&dev->dev_addr, 4928 memcpy(&dev->dev_addr,
4964 &pAC->Addr.Net[1].CurrentMacAddress, 6); 4929 &pAC->Addr.Net[1].CurrentMacAddress, 6);
4965 memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); 4930 memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
4966 4931
4967 printk("%s: %s\n", dev->name, pAC->DeviceStr); 4932 printk("%s: %s\n", dev->name, DeviceStr);
4968 printk(" PrefPort:B RlmtMode:Dual Check Link State\n"); 4933 printk(" PrefPort:B RlmtMode:Dual Check Link State\n");
4969 } 4934 }
4970 } 4935 }
@@ -5000,10 +4965,7 @@ static void __devexit skge_remove_one(struct pci_dev *pdev)
5000 SK_AC *pAC = pNet->pAC; 4965 SK_AC *pAC = pNet->pAC;
5001 struct net_device *otherdev = pAC->dev[1]; 4966 struct net_device *otherdev = pAC->dev[1];
5002 4967
5003 SkGeProcRemove(dev);
5004 unregister_netdev(dev); 4968 unregister_netdev(dev);
5005 if (otherdev != dev)
5006 SkGeProcRemove(otherdev);
5007 4969
5008 SkGeYellowLED(pAC, pAC->IoBase, 0); 4970 SkGeYellowLED(pAC, pAC->IoBase, 0);
5009 4971
@@ -5088,9 +5050,9 @@ static int skge_resume(struct pci_dev *pdev)
5088 pci_enable_device(pdev); 5050 pci_enable_device(pdev);
5089 pci_set_master(pdev); 5051 pci_set_master(pdev);
5090 if (pAC->GIni.GIMacsFound == 2) 5052 if (pAC->GIni.GIMacsFound == 2)
5091 ret = request_irq(dev->irq, SkGeIsr, SA_SHIRQ, pAC->Name, dev); 5053 ret = request_irq(dev->irq, SkGeIsr, SA_SHIRQ, "sk98lin", dev);
5092 else 5054 else
5093 ret = request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ, pAC->Name, dev); 5055 ret = request_irq(dev->irq, SkGeIsrOnePort, SA_SHIRQ, "sk98lin", dev);
5094 if (ret) { 5056 if (ret) {
5095 printk(KERN_WARNING "sk98lin: unable to acquire IRQ %d\n", dev->irq); 5057 printk(KERN_WARNING "sk98lin: unable to acquire IRQ %d\n", dev->irq);
5096 pAC->AllocFlag &= ~SK_ALLOC_IRQ; 5058 pAC->AllocFlag &= ~SK_ALLOC_IRQ;
@@ -5148,23 +5110,12 @@ static struct pci_driver skge_driver = {
5148 5110
5149static int __init skge_init(void) 5111static int __init skge_init(void)
5150{ 5112{
5151 int error; 5113 return pci_module_init(&skge_driver);
5152
5153 pSkRootDir = proc_mkdir(SKRootName, NULL);
5154 if (pSkRootDir)
5155 pSkRootDir->owner = THIS_MODULE;
5156
5157 error = pci_register_driver(&skge_driver);
5158 if (error)
5159 remove_proc_entry(SKRootName, NULL);
5160 return error;
5161} 5114}
5162 5115
5163static void __exit skge_exit(void) 5116static void __exit skge_exit(void)
5164{ 5117{
5165 pci_unregister_driver(&skge_driver); 5118 pci_unregister_driver(&skge_driver);
5166 remove_proc_entry(SKRootName, NULL);
5167
5168} 5119}
5169 5120
5170module_init(skge_init); 5121module_init(skge_init);