Skip to content

Commit

Permalink
Staging: sxg: Ethtool framework and Receive code path changes
Browse files Browse the repository at this point in the history
* Add Ethtool framework to driver
* Makefile changes to fix build redundancy.
* Fix ups to error code paths in receieve buffer allocation as well as receive code path.
* Read MAC address from FLASH/EEPROM

Signed-off-by: LinSysSoft Sahara Team <saharaproj@linsyssoft.com>
Signed-off-by: Christopher Harrer <charrer@alacritech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Mithlesh Thukral authored and Greg Kroah-Hartman committed Apr 3, 2009
1 parent d0128aa commit 371d7a9
Show file tree
Hide file tree
Showing 5 changed files with 355 additions and 9 deletions.
4 changes: 3 additions & 1 deletion drivers/staging/sxg/Makefile
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
obj-$(CONFIG_SXG) += sxg.o
obj-$(CONFIG_SXG) += sxg_nic.o

sxg_nic-y := sxg.o sxg_ethtool.o
12 changes: 5 additions & 7 deletions drivers/staging/sxg/sxg.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,11 @@
#include <linux/dma-mapping.h>
#include <linux/mii.h>

#define SLIC_DUMP_ENABLED 0
#define SLIC_GET_STATS_ENABLED 0
#define LINUX_FREES_ADAPTER_RESOURCES 1
#define SXG_OFFLOAD_IP_CHECKSUM 0
#define SXG_POWER_MANAGEMENT_ENABLED 0
#define VPCI 0
#define DBG 1
#define ATK_DEBUG 1

#include "sxg_os.h"
Expand Down Expand Up @@ -156,8 +154,7 @@ static struct sxgbase_driver sxg_global = {
static int intagg_delay = 100;
static u32 dynamic_intagg = 0;

#define DRV_NAME "sxg"
#define DRV_VERSION "1.0.1"
char sxg_driver_name[] = "sxg";
#define DRV_AUTHOR "Alacritech, Inc. Engineering"
#define DRV_DESCRIPTION \
"Alacritech SLIC Techonology(tm) Non-Accelerated 10Gbe Driver"
Expand Down Expand Up @@ -753,7 +750,7 @@ static int sxg_entry_probe(struct pci_dev *pcidev,

if (sxg_debug > 0 && did_version++ == 0) {
printk(KERN_INFO "%s\n", sxg_banner);
printk(KERN_INFO "%s\n", DRV_VERSION);
printk(KERN_INFO "%s\n", SXG_DRV_VERSION);
}

if (!(err = pci_set_dma_mask(pcidev, DMA_64BIT_MASK))) {
Expand All @@ -770,7 +767,7 @@ static int sxg_entry_probe(struct pci_dev *pcidev,

DBG_ERROR("Call pci_request_regions\n");

err = pci_request_regions(pcidev, DRV_NAME);
err = pci_request_regions(pcidev, sxg_driver_name);
if (err) {
DBG_ERROR("pci_request_regions FAILED err[%x]\n", err);
return err;
Expand Down Expand Up @@ -919,6 +916,7 @@ static int sxg_entry_probe(struct pci_dev *pcidev,
#endif
#endif
netdev->set_multicast_list = sxg_mcast_set_list;
SET_ETHTOOL_OPS(netdev, &sxg_nic_ethtool_ops);

strcpy(netdev->name, "eth%d");
/* strcpy(netdev->name, pci_name(pcidev)); */
Expand Down Expand Up @@ -3857,7 +3855,7 @@ static void sxg_complete_descriptor_blocks(struct adapter_t *adapter,
}

static struct pci_driver sxg_driver = {
.name = DRV_NAME,
.name = sxg_driver_name,
.id_table = sxg_pci_tbl,
.probe = sxg_entry_probe,
.remove = sxg_entry_remove,
Expand Down
8 changes: 7 additions & 1 deletion drivers/staging/sxg/sxg.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@
#ifndef __SXG_DRIVER_H__
#define __SXG_DRIVER_H__

#define p_net_device struct net_device *
#define SLIC_DUMP_ENABLED 0

#define SXG_DRV_NAME "sxg" /* TBD: This might be removed eventually */
#define SXG_DRV_VERSION "1.0.1"

extern char sxg_driver_name[];
/*
* struct sxg_stats - Probably move these to someplace where
* the slicstat (sxgstat?) program can get them.
Expand Down Expand Up @@ -759,4 +764,5 @@ struct slic_crash_info {
#define SIOCSLICSETINTAGG (SIOCDEVPRIVATE+10)
#define SIOCSLICTRACEDUMP (SIOCDEVPRIVATE+11)

extern struct ethtool_ops sxg_nic_ethtool_ops;
#endif /* __SXG_DRIVER_H__ */
Loading

0 comments on commit 371d7a9

Please sign in to comment.