diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-11 16:02:05 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-11 16:02:05 -0700 |
commit | 9ce3075c20d458040138690edfdf6446664ec3ee (patch) | |
tree | 7431fd54ce8ea8ee9224a86fa5f4cc69226ea216 | |
parent | b3b7cc7b4138f4171da5813b5ec2a14835e02482 (diff) | |
parent | 17cf8cc9439262cd90421435e0e8c7ab0af26833 (diff) |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (35 commits)
Add support for the Davicom DM9161A PHY
sky2: only disable 88e8056 on some boards
sky2: 88e8071 support not ready
skge: crash on shutdown/suspend
sky2: fix oops on shutdown
mlx4: don't use deprecated IRQ flags
netxen_nic_main don't use deprecated irq flags
Use menuconfig objects II - netdev/wan
Use menuconfig objects II - netdev/pcmcia
Use menuconfig objects II - netdev/atm
Use menuconfig objects: netdev
Use menuconfig objects: PHY
spidernet: remove unnecessary accesses to phy
S2IO: Statistics for link up/down and memory allocated/freed
S2IO: statistics for memory allocation failuers
S2IO: getringparam ethtool option
[PATCH] libertas: 64-bit cleanups
[PATCH] libertas: sparse fixes
[PATCH] libertas: fix missing unlock in TX error path
[PATCH] libertas: make debugfs.c sparse-clean
...
35 files changed, 750 insertions, 3099 deletions
diff --git a/drivers/atm/Kconfig b/drivers/atm/Kconfig index 33687454eb3..f5a47a48c3b 100644 --- a/drivers/atm/Kconfig +++ b/drivers/atm/Kconfig @@ -2,19 +2,22 @@ # ATM device configuration # -menu "ATM drivers" +menuconfig ATM_DRIVERS + bool "ATM drivers" depends on NETDEVICES && ATM + default y + +if ATM_DRIVERS config ATM_DUMMY tristate "Dummy ATM driver" - depends on ATM help Dummy ATM driver. Useful for proxy signalling, testing, and development. If unsure, say N. config ATM_TCP tristate "ATM over TCP" - depends on INET && ATM + depends on INET help ATM over TCP driver. Useful mainly for development and for experiments. If unsure, say N. @@ -30,7 +33,7 @@ config ATM_LANAI config ATM_ENI tristate "Efficient Networks ENI155P" - depends on PCI && ATM + depends on PCI ---help--- Driver for the Efficient Networks ENI155p series and SMC ATM Power155 155 Mbps ATM adapters. Both, the versions with 512KB and @@ -139,7 +142,7 @@ config ATM_ENI_BURST_RX_2W config ATM_FIRESTREAM tristate "Fujitsu FireStream (FS50/FS155) " - depends on PCI && ATM + depends on PCI help Driver for the Fujitsu FireStream 155 (MB86697) and FireStream 50 (MB86695) ATM PCI chips. @@ -149,7 +152,7 @@ config ATM_FIRESTREAM config ATM_ZATM tristate "ZeitNet ZN1221/ZN1225" - depends on PCI && ATM + depends on PCI help Driver for the ZeitNet ZN1221 (MMF) and ZN1225 (UTP-5) 155 Mbps ATM adapters. @@ -169,7 +172,7 @@ config ATM_ZATM_DEBUG config ATM_NICSTAR tristate "IDT 77201 (NICStAR) (ForeRunnerLE)" - depends on PCI && ATM && !64BIT + depends on PCI && !64BIT help The NICStAR chipset family is used in a large number of ATM NICs for 25 and for 155 Mbps, including IDT cards and the Fore ForeRunnerLE @@ -202,7 +205,7 @@ config ATM_NICSTAR_USE_IDT77105 config ATM_IDT77252 tristate "IDT 77252 (NICStAR II)" - depends on PCI && ATM + depends on PCI help Driver for the IDT 77252 ATM PCI chips. @@ -237,7 +240,7 @@ config ATM_IDT77252_USE_SUNI config ATM_AMBASSADOR tristate "Madge Ambassador (Collage PCI 155 Server)" - depends on PCI && ATM + depends on PCI select BITREVERSE help This is a driver for ATMizer based ATM card produced by Madge @@ -262,7 +265,7 @@ config ATM_AMBASSADOR_DEBUG config ATM_HORIZON tristate "Madge Horizon [Ultra] (Collage PCI 25 and Collage PCI 155 Client)" - depends on PCI && ATM + depends on PCI help This is a driver for the Horizon chipset ATM adapter cards once produced by Madge Networks Ltd. Say Y (or M to compile as a module @@ -286,7 +289,7 @@ config ATM_HORIZON_DEBUG config ATM_IA tristate "Interphase ATM PCI x575/x525/x531" - depends on PCI && ATM && !64BIT + depends on PCI && !64BIT ---help--- This is a driver for the Interphase (i)ChipSAR adapter cards which include a variety of variants in term of the size of the @@ -319,7 +322,7 @@ config ATM_IA_DEBUG config ATM_FORE200E_MAYBE tristate "FORE Systems 200E-series" - depends on (PCI || SBUS) && ATM + depends on PCI || SBUS ---help--- This is a driver for the FORE Systems 200E-series ATM adapter cards. It simultaneously supports PCA-200E and SBA-200E models @@ -436,7 +439,7 @@ config ATM_FORE200E config ATM_HE tristate "ForeRunner HE Series" - depends on PCI && ATM + depends on PCI help This is a driver for the Marconi ForeRunner HE-series ATM adapter cards. It simultaneously supports the 155 and 622 versions. @@ -448,5 +451,4 @@ config ATM_HE_USE_SUNI Support for the S/UNI-Ultra and S/UNI-622 found in the ForeRunner HE cards. This driver provides carrier detection some statistics. -endmenu - +endif # ATM diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index fa489b10c38..8a7f9e9fb8d 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -1898,8 +1898,12 @@ endmenu # Gigabit Ethernet # -menu "Ethernet (1000 Mbit)" +menuconfig NETDEV_1000 + bool "Ethernet (1000 Mbit)" depends on !UML + default y + +if NETDEV_1000 config ACENIC tristate "Alteon AceNIC/3Com 3C985/NetGear GA620 Gigabit support" @@ -2326,14 +2330,18 @@ config ATL1 To compile this driver as a module, choose M here. The module will be called atl1. -endmenu +endif # NETDEV_1000 # # 10 Gigabit Ethernet # -menu "Ethernet (10000 Mbit)" +menuconfig NETDEV_10000 + bool "Ethernet (10000 Mbit)" depends on !UML + default y + +if NETDEV_10000 config CHELSIO_T1 tristate "Chelsio 10Gb Ethernet support" @@ -2507,7 +2515,7 @@ config MLX4_DEBUG debug_level module parameter (which can also be set after the driver is loaded through sysfs). -endmenu +endif # NETDEV_10000 source "drivers/net/tokenring/Kconfig" diff --git a/drivers/net/mlx4/eq.c b/drivers/net/mlx4/eq.c index acf1c801a1b..af016d0ea1c 100644 --- a/drivers/net/mlx4/eq.c +++ b/drivers/net/mlx4/eq.c @@ -623,7 +623,7 @@ int __devinit mlx4_init_eq_table(struct mlx4_dev *dev) priv->eq_table.eq[MLX4_EQ_CATAS].have_irq = 1; } else { err = request_irq(dev->pdev->irq, mlx4_interrupt, - SA_SHIRQ, DRV_NAME, dev); + IRQF_SHARED, DRV_NAME, dev); if (err) goto err_out_async; diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 4e32bb678ea..2c5c6d20e6e 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c @@ -735,7 +735,7 @@ static int netxen_nic_open(struct net_device *netdev) } adapter->irq = adapter->ahw.pdev->irq; err = request_irq(adapter->ahw.pdev->irq, netxen_intr, - SA_SHIRQ | SA_SAMPLE_RANDOM, netdev->name, + IRQF_SHARED|IRQF_SAMPLE_RANDOM, netdev->name, adapter); if (err) { printk(KERN_ERR "request_irq failed with: %d\n", err); diff --git a/drivers/net/pcmcia/Kconfig b/drivers/net/pcmcia/Kconfig index 74f86200124..5d658bc9791 100644 --- a/drivers/net/pcmcia/Kconfig +++ b/drivers/net/pcmcia/Kconfig @@ -2,11 +2,9 @@ # PCMCIA Network device configuration # -menu "PCMCIA network device support" - depends on NETDEVICES && PCMCIA!=n - -config NET_PCMCIA +menuconfig NET_PCMCIA bool "PCMCIA network device support" + depends on PCMCIA ---help--- Say Y if you would like to include support for any PCMCIA or CardBus network adapters, then say Y to the driver for your particular card @@ -21,9 +19,10 @@ config NET_PCMCIA If unsure, say N. +if NET_PCMCIA + config PCMCIA_3C589 tristate "3Com 3c589 PCMCIA support" - depends on NET_PCMCIA && PCMCIA help Say Y here if you intend to attach a 3Com 3c589 or compatible PCMCIA (PC-card) Ethernet card to your computer. @@ -33,7 +32,6 @@ config PCMCIA_3C589 config PCMCIA_3C574 tristate "3Com 3c574 PCMCIA support" - depends on NET_PCMCIA && PCMCIA help Say Y here if you intend to attach a 3Com 3c574 or compatible PCMCIA (PC-card) Fast Ethernet card to your computer. @@ -43,7 +41,6 @@ config PCMCIA_3C574 config PCMCIA_FMVJ18X tristate "Fujitsu FMV-J18x PCMCIA support" - depends on NET_PCMCIA && PCMCIA select CRC32 help Say Y here if you intend to attach a Fujitsu FMV-J18x or compatible @@ -54,7 +51,6 @@ config PCMCIA_FMVJ18X config PCMCIA_PCNET tristate "NE2000 compatible PCMCIA support" - depends on NET_PCMCIA && PCMCIA select CRC32 help Say Y here if you intend to attach an NE2000 compatible PCMCIA @@ -65,7 +61,6 @@ config PCMCIA_PCNET config PCMCIA_NMCLAN tristate "New Media PCMCIA support" - depends on NET_PCMCIA && PCMCIA help Say Y here if you intend to attach a New Media Ethernet or LiveWire PCMCIA (PC-card) Ethernet card to your computer. @@ -75,7 +70,6 @@ config PCMCIA_NMCLAN config PCMCIA_SMC91C92 tristate "SMC 91Cxx PCMCIA support" - depends on NET_PCMCIA && PCMCIA select CRC32 select MII help @@ -87,7 +81,6 @@ config PCMCIA_SMC91C92 config PCMCIA_XIRC2PS tristate "Xircom 16-bit PCMCIA support" - depends on NET_PCMCIA && PCMCIA help Say Y here if you intend to attach a Xircom 16-bit PCMCIA (PC-card) Ethernet or Fast Ethernet card to your computer. @@ -97,7 +90,6 @@ config PCMCIA_XIRC2PS config PCMCIA_AXNET tristate "Asix AX88190 PCMCIA support" - depends on NET_PCMCIA && PCMCIA ---help--- Say Y here if you intend to attach an Asix AX88190-based PCMCIA (PC-card) Fast Ethernet card to your computer. These cards are @@ -109,7 +101,7 @@ config PCMCIA_AXNET config ARCNET_COM20020_CS tristate "COM20020 ARCnet PCMCIA support" - depends on NET_PCMCIA && ARCNET_COM20020 && PCMCIA + depends on ARCNET_COM20020 help Say Y here if you intend to attach this type of ARCnet PCMCIA card to your computer. @@ -119,7 +111,7 @@ config ARCNET_COM20020_CS config PCMCIA_IBMTR tristate "IBM PCMCIA tokenring adapter support" - depends on NET_PCMCIA && IBMTR!=y && TR && PCMCIA && !64BIT + depends on IBMTR!=y && TR && !64BIT help Say Y here if you intend to attach this type of Token Ring PCMCIA card to your computer. You then also need to say Y to "Token Ring @@ -128,5 +120,4 @@ config PCMCIA_IBMTR To compile this driver as a module, choose M here: the module will be called ibmtr_cs. -endmenu - +endif # NET_PCMCIA diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index c0d3101eb6a..09b6f259eb9 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -2,70 +2,61 @@ # PHY Layer Configuration # -menu "PHY device support" - depends on !S390 - -config PHYLIB +menuconfig PHYLIB tristate "PHY Device support and infrastructure" + depends on !S390 depends on NET_ETHERNET && (BROKEN || !S390) help Ethernet controllers are usually attached to PHY devices. This option provides infrastructure for managing PHY devices. +if PHYLIB + comment "MII PHY device drivers" - depends on PHYLIB config MARVELL_PHY tristate "Drivers for Marvell PHYs" - depends on PHYLIB ---help--- Currently has a driver for the 88E1011S config DAVICOM_PHY tristate "Drivers for Davicom PHYs" - depends on PHYLIB ---help--- Currently supports dm9161e and dm9131 config QSEMI_PHY tristate "Drivers for Quality Semiconductor PHYs" - depends on PHYLIB ---help--- Currently supports the qs6612 config LXT_PHY tristate "Drivers for the Intel LXT PHYs" - depends on PHYLIB ---help--- Currently supports the lxt970, lxt971 config CICADA_PHY tristate "Drivers for the Cicada PHYs" - depends on PHYLIB ---help--- Currently supports the cis8204 + config VITESSE_PHY tristate "Drivers for the Vitesse PHYs" - depends on PHYLIB ---help--- Currently supports the vsc8244 config SMSC_PHY tristate "Drivers for SMSC PHYs" - depends on PHYLIB ---help--- Currently supports the LAN83C185 PHY config BROADCOM_PHY tristate "Drivers for Broadcom PHYs" - depends on PHYLIB ---help--- Currently supports the BCM5411, BCM5421 and BCM5461 PHYs. config FIXED_PHY tristate "Drivers for PHY emulation on fixed speed/link" - depends on PHYLIB ---help--- Adds the driver to PHY layer to cover the boards that do not have any PHY bound, but with the ability to manipulate the speed/link in software. The relevant MII @@ -80,5 +71,4 @@ config FIXED_MII_100_FDX bool "Emulation for 100M Fdx fixed PHY behavior" depends on FIXED_PHY -endmenu - +endif # PHYLIB diff --git a/drivers/net/phy/davicom.c b/drivers/net/phy/davicom.c index 519baa38be8..7ed632db00d 100644 --- a/drivers/net/phy/davicom.c +++ b/drivers/net/phy/davicom.c @@ -139,7 +139,7 @@ static int dm9161_ack_interrupt(struct phy_device *phydev) return (err < 0) ? err : 0; } -static struct phy_driver dm9161_driver = { +static struct phy_driver dm9161e_driver = { .phy_id = 0x0181b880, .name = "Davicom DM9161E", .phy_id_mask = 0x0ffffff0, @@ -147,7 +147,18 @@ static struct phy_driver dm9161_driver = { .config_init = dm9161_config_init, .config_aneg = dm9161_config_aneg, .read_status = genphy_read_status, - .driver = { .owner = THIS_MODULE,}, + .driver = { .owner = THIS_MODULE,}, +}; + +static struct phy_driver dm9161a_driver = { + .phy_id = 0x0181b8a0, + .name = "Davicom DM9161A", + .phy_id_mask = 0x0ffffff0, + .features = PHY_BASIC_FEATURES, + .config_init = dm9161_config_init, + .config_aneg = dm9161_config_aneg, + .read_status = genphy_read_status, + .driver = { .owner = THIS_MODULE,}, }; static struct phy_driver dm9131_driver = { @@ -160,31 +171,38 @@ static struct phy_driver dm9131_driver = { .read_status = genphy_read_status, .ack_interrupt = dm9161_ack_interrupt, .config_intr = dm9161_config_intr, - .driver = { .owner = THIS_MODULE,}, + .driver = { .owner = THIS_MODULE,}, }; static int __init davicom_init(void) { int ret; - ret = phy_driver_register(&dm9161_driver); + ret = phy_driver_register(&dm9161e_driver); if (ret) goto err1; - ret = phy_driver_register(&dm9131_driver); + ret = phy_driver_register(&dm9161a_driver); if (ret) goto err2; + + ret = phy_driver_register(&dm9131_driver); + if (ret) + goto err3; return 0; - err2: - phy_driver_unregister(&dm9161_driver); + err3: + phy_driver_unregister(&dm9161a_driver); + err2: + phy_driver_unregister(&dm9161e_driver); err1: return ret; } static void __exit davicom_exit(void) { - phy_driver_unregister(&dm9161_driver); + phy_driver_unregister(&dm9161e_driver); + phy_driver_unregister(&dm9161a_driver); phy_driver_unregister(&dm9131_driver); } diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 290e1c1f30c..e3e6d410d72 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c @@ -84,7 +84,7 @@ #include "s2io.h" #include "s2io-regs.h" -#define DRV_VERSION "2.0.22.1" +#define DRV_VERSION "2.0.23.1" /* S2io Driver name & version. */ static char s2io_driver_name[] = "Neterion"; @@ -281,6 +281,28 @@ static char ethtool_driver_stats_keys[][ETH_GSTRING_LEN] = { ("lro_out_of_sequence_pkts"), ("lro_flush_due_to_max_pkts"), ("lro_avg_aggr_pkts"), + ("mem_alloc_fail_cnt"), + ("watchdog_timer_cnt"), + ("mem_allocated"), + ("mem_freed"), + ("link_up_cnt"), + ("link_down_cnt"), + ("link_up_time"), + ("link_down_time"), + ("tx_tcode_buf_abort_cnt"), + ("tx_tcode_desc_abort_cnt"), + ("tx_tcode_parity_err_cnt"), + ("tx_tcode_link_loss_cnt"), + ("tx_tcode_list_proc_err_cnt"), + ("rx_tcode_parity_err_cnt"), + ("rx_tcode_abort_cnt"), + ("rx_tcode_parity_abort_cnt"), + ("rx_tcode_rda_fail_cnt"), + ("rx_tcode_unkn_prot_cnt"), + ("rx_tcode_fcs_err_cnt"), + ("rx_tcode_buf_size_err_cnt"), + ("rx_tcode_rxd_corrupt_cnt"), + ("rx_tcode_unkn_err_cnt") }; #define S2IO_XENA_STAT_LEN sizeof(ethtool_xena_stats_keys)/ ETH_GSTRING_LEN @@ -490,6 +512,7 @@ static int init_shared_mem(struct s2io_nic *nic) struct mac_info *mac_control; struct config_param *config; + unsigned long long mem_allocated = 0; mac_control = &nic->mac_control; config = &nic->config; @@ -519,6 +542,7 @@ static int init_shared_mem(struct s2io_nic *nic) "Malloc failed for list_info\n"); return -ENOMEM; } + mem_allocated += list_holder_size; memset(mac_control->fifos[i].list_info, 0, list_holder_size); } for (i = 0; i < config->tx_fifo_num; i++) { @@ -565,6 +589,7 @@ static int init_shared_mem(struct s2io_nic *nic) DBG_PRINT(INFO_DBG, "failed for TxDL\n"); return -ENOMEM; } + mem_allocated += PAGE_SIZE; } while (k < lst_per_page) { int l = (j * lst_per_page) + k; @@ -582,6 +607,7 @@ static int init_shared_mem(struct s2io_nic *nic) nic->ufo_in_band_v = kcalloc(size, sizeof(u64), GFP_KERNEL); if (!nic->ufo_in_band_v) return -ENOMEM; + mem_allocated += (size * sizeof(u64)); /* Allocation and initialization of RXDs in Rings */ size = 0; @@ -639,6 +665,7 @@ static int init_shared_mem(struct s2io_nic *nic) rx_blocks->block_virt_addr = tmp_v_addr; return -ENOMEM; } + mem_allocated += size; memset(tmp_v_addr, 0, size); rx_blocks->block_virt_addr = tmp_v_addr; rx_blocks->block_dma_addr = tmp_p_addr; @@ -647,6 +674,8 @@ static int init_shared_mem(struct s2io_nic *nic) GFP_KERNEL); if (!rx_blocks->rxds) return -ENOMEM; + mem_allocated += + (sizeof(struct rxd_info)* rxd_count[nic->rxd_mode]); for (l=0; l<rxd_count[nic->rxd_mode];l++) { rx_blocks->rxds[l].virt_addr = rx_blocks->block_virt_addr + @@ -689,6 +718,7 @@ static int init_shared_mem(struct s2io_nic *nic) GFP_KERNEL); if (!mac_control->rings[i].ba) return -ENOMEM; + mem_allocated +=(sizeof(struct buffAdd *) * blk_cnt); for (j = 0; j < blk_cnt; j++) { int k = 0; mac_control->rings[i].ba[j] = @@ -697,6 +727,8 @@ static int init_shared_mem(struct s2io_nic *nic) GFP_KERNEL); if (!mac_control->rings[i].ba[j]) return -ENOMEM; + mem_allocated += (sizeof(struct buffAdd) * \ + (rxd_count[nic->rxd_mode] + 1)); while (k != rxd_count[nic->rxd_mode]) { ba = &mac_control->rings[i].ba[j][k]; @@ -704,6 +736,8 @@ static int init_shared_mem(struct s2io_nic *nic) (BUF0_LEN + ALIGN_SIZE, GFP_KERNEL); if (!ba->ba_0_org) return -ENOMEM; + mem_allocated += + (BUF0_LEN + ALIGN_SIZE); tmp = (unsigned long)ba->ba_0_org; tmp += ALIGN_SIZE; tmp &= ~((unsigned long) ALIGN_SIZE); @@ -713,6 +747,8 @@ static int init_shared_mem(struct s2io_nic *nic) (BUF1_LEN + ALIGN_SIZE, GFP_KERNEL); if (!ba->ba_1_org) return -ENOMEM; + mem_allocated + += (BUF1_LEN + ALIGN_SIZE); tmp = (unsigned long) ba->ba_1_org; tmp += ALIGN_SIZE; tmp &= ~((unsigned long) ALIGN_SIZE); @@ -736,6 +772,7 @@ static int init_shared_mem(struct s2io_nic *nic) */ return -ENOMEM; } + mem_allocated += size; mac_control->stats_mem_sz = size; tmp_v_addr = mac_control->stats_mem; @@ -743,7 +780,7 @@ static int init_shared_mem(struct s2io_nic *nic) memset(tmp_v_addr, 0, size); DBG_PRINT(INIT_DBG, "%s:Ring Mem PHY: 0x%llx\n", dev->name, (unsigned long long) tmp_p_addr); - + mac_control->stats_info->sw_stat.mem_allocated += mem_allocated; return SUCCESS; } @@ -757,12 +794,14 @@ static int init_shared_mem(struct s2io_nic *nic) static void free_shared_mem(struct s2io_nic *nic) { int i, j, blk_cnt, size; + u32 ufo_size = 0; void *tmp_v_addr; dma_addr_t tmp_p_addr; struct mac_info *mac_control; struct config_param *config; int lst_size, lst_per_page; struct net_device *dev = nic->dev; + int page_num = 0; if (!nic) return; @@ -774,8 +813,9 @@ static void free_shared_mem(struct s2io_nic *nic) lst_per_page = PAGE_SIZE / lst_size; for (i = 0; i < config->tx_fifo_num; i++) { - int page_num = TXD_MEM_PAGE_CNT(config->tx_cfg[i].fifo_len, - lst_per_page); + ufo_size += config->tx_cfg[i].fifo_len; + page_num = TXD_MEM_PAGE_CNT(config->tx_cfg[i].fifo_len, + lst_per_page); for (j = 0; j < page_num; j++) { int mem_blks = (j * lst_per_page); if (!mac_control->fifos[i].list_info) @@ -790,6 +830,8 @@ static void free_shared_mem(struct s2io_nic *nic) mac_control->fifos[i]. list_info[mem_blks]. list_phy_addr); + nic->mac_control.stats_info->sw_stat.mem_freed + += PAGE_SIZE; } /* If we got a zero DMA address during allocation, * free the page now @@ -803,8 +845,12 @@ static void free_shared_mem(struct s2io_nic *nic) dev->name); DBG_PRINT(INIT_DBG, "Virtual address %p\n", mac_control->zerodma_virt_addr); + nic->mac_control.stats_info->sw_stat.mem_freed + += PAGE_SIZE; } kfree(mac_control->fifos[i].list_info); + nic->mac_control.stats_info->sw_stat.mem_freed += + (nic->config.tx_cfg[i].fifo_len *sizeof(struct list_info_hold)); } size = SIZE_OF_BLOCK; @@ -819,7 +865,10 @@ static void free_shared_mem(struct s2io_nic *nic) break; pci_free_consistent(nic->pdev, size, tmp_v_addr, tmp_p_addr); + nic->mac_control.stats_info->sw_stat.mem_freed += size; kfree(mac_control->rings[i].rx_blocks[j].rxds); + nic->mac_control.stats_info->sw_stat.mem_freed += + ( sizeof(struct rxd_info)* rxd_count[nic->rxd_mode]); } } @@ -836,12 +885,20 @@ static void free_shared_mem(struct s2io_nic *nic) struct buffAdd *ba = &mac_control->rings[i].ba[j][k]; kfree(ba->ba_0_org); + nic->mac_control.stats_info->sw_stat.\ + mem_freed += (BUF0_LEN + ALIGN_SIZE); kfree(ba->ba_1_org); + nic->mac_control.stats_info->sw_stat.\ + mem_freed += (BUF1_LEN + ALIGN_SIZE); k++; } kfree(mac_control->rings[i].ba[j]); + nic->mac_control.stats_info->sw_stat.mem_freed += (sizeof(struct buffAdd) * + (rxd_count[nic->rxd_mode] + 1)); } kfree(mac_control->rings[i].ba); + nic->mac_control.stats_info->sw_stat.mem_freed += + (sizeof(struct buffAdd *) * blk_cnt); } } @@ -850,9 +907,14 @@ static void free_shared_mem(struct s2io_nic *nic) mac_control->stats_mem_sz, mac_control->stats_mem, mac_control->stats_mem_phy); + nic->mac_control.stats_info->sw_stat.mem_freed += + mac_control->stats_mem_sz; } - if (nic->ufo_in_band_v) + if (nic->ufo_in_band_v) { kfree(nic->ufo_in_band_v); + nic->mac_control.stats_info->sw_stat.mem_freed + += (ufo_size * sizeof(u64)); + } } /** @@ -2122,10 +2184,12 @@ static void free_tx_buffers(struct s2io_nic *nic) for (i = 0; i < config->tx_fifo_num; i++) { for (j = 0; j < config->tx_cfg[i].fifo_len - 1; j++) { - txdp = (struct TxD *) mac_control->fifos[i].list_info[j]. - list_virt_addr; + txdp = (struct TxD *) \ + mac_control->fifos[i].list_info[j].list_virt_addr; skb = s2io_txdl_getskb(&mac_control->fifos[i], txdp, j); if (skb) { + nic->mac_control.stats_info->sw_stat.mem_freed + += skb->truesize; dev_kfree_skb(skb); cnt++; } @@ -2186,11 +2250,14 @@ static int fill_rxd_3buf(struct s2io_nic *nic, struct RxD_t *rxdp, struct \ /* skb_shinfo(skb)->frag_list will have L4 data payload */ skb_shinfo(skb)->frag_list = dev_alloc_skb(dev->mtu + ALIGN_SIZE); if (skb_shinfo(skb)->frag_list == NULL) { + nic->mac_control.stats_info->sw_stat.mem_alloc_fail_cnt++; DBG_PRINT(INFO_DBG, "%s: dev_alloc_skb failed\n ", dev->name); return -ENOMEM ; } frag_list = skb_shinfo(skb)->frag_list; skb->truesize += frag_list->truesize; + nic->mac_control.stats_info->sw_stat.mem_allocated + += frag_list->truesize; frag_list->next = NULL; tmp = (void *)ALIGN((long)frag_list->data, ALIGN_SIZE + 1); frag_list->data = tmp; @@ -2319,8 +2386,12 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no) wmb(); first_rxdp->Control_1 |= RXD_OWN_XENA; } + nic->mac_control.stats_info->sw_stat. \ + mem_alloc_fail_cnt++; return -ENOMEM ; } + nic->mac_control.stats_info->sw_stat.mem_allocated + += skb->truesize; if (nic->rxd_mode == RXD_MODE_1) { /* 1 buffer mode - normal operation mode */ memset(rxdp, 0, sizeof(struct RxD1)); @@ -2328,7 +2399,8 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no) ((struct RxD1*)rxdp)->Buffer0_ptr = pci_map_single (nic->pdev, skb->data, size - NET_IP_ALIGN, PCI_DMA_FROMDEVICE); - rxdp->Control_2 = SET_BUFFER0_SIZE_1(size - NET_IP_ALIGN); + rxdp->Control_2 = + SET_BUFFER0_SIZE_1(size - NET_IP_ALIGN); } else if (nic->rxd_mode >= RXD_MODE_3A) { /* @@ -2342,7 +2414,7 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no) * payload */ - /* save the buffer pointers to avoid frequent dma mapping */ + /* save buffer pointers to avoid frequent dma mapping */ Buffer0_ptr = ((struct RxD3*)rxdp)->Buffer0_ptr; Buffer1_ptr = ((struct RxD3*)rxdp)->Buffer1_ptr; memset(rxdp, 0, sizeof(struct RxD3)); @@ -2364,7 +2436,7 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no) PCI_DMA_FROMDEVICE); else pci_dma_sync_single_for_device(nic->pdev, - (dma_addr_t) ((struct RxD3*)rxdp)->Buffer0_ptr, + (dma_addr_t) ((struct RxD3*)rxdp)->Buffer0_ptr, BUF0_LEN, PCI_DMA_FROMDEVICE); rxdp->Control_2 = SET_BUFFER0_SIZE_3(BUF0_ |