aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2007-01-31 14:09:29 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-05 16:58:52 -0500
commit1ee6dd770b2302e32fdae489f4fc58c374399da4 (patch)
tree214cab7727878b153ac0532d653667408fb9d744 /drivers/net
parenta113ae066de6fc7ed33a6f420ea7dd2716a1920a (diff)
s2io: De-typedef driver.
Removed namespace collisions due to usage of nic_t as per Ralf's patch Signed-off-by: Sivakumar Subramani <sivakumar.subramani@neterion.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/s2io-regs.h6
-rw-r--r--drivers/net/s2io.c505
-rw-r--r--drivers/net/s2io.h202
3 files changed, 362 insertions, 351 deletions
diff --git a/drivers/net/s2io-regs.h b/drivers/net/s2io-regs.h
index 518e96d75371..0e345cbc2bf9 100644
--- a/drivers/net/s2io-regs.h
+++ b/drivers/net/s2io-regs.h
@@ -15,7 +15,7 @@
15 15
16#define TBD 0 16#define TBD 0
17 17
18typedef struct _XENA_dev_config { 18struct XENA_dev_config {
19/* Convention: mHAL_XXX is mask, vHAL_XXX is value */ 19/* Convention: mHAL_XXX is mask, vHAL_XXX is value */
20 20
21/* General Control-Status Registers */ 21/* General Control-Status Registers */
@@ -852,9 +852,9 @@ typedef struct _XENA_dev_config {
852#define SPI_CONTROL_DONE BIT(6) 852#define SPI_CONTROL_DONE BIT(6)
853 u64 spi_data; 853 u64 spi_data;
854#define SPI_DATA_WRITE(data,len) vBIT(data,0,len) 854#define SPI_DATA_WRITE(data,len) vBIT(data,0,len)
855} XENA_dev_config_t; 855};
856 856
857#define XENA_REG_SPACE sizeof(XENA_dev_config_t) 857#define XENA_REG_SPACE sizeof(struct XENA_dev_config)
858#define XENA_EEPROM_SPACE (0x01 << 11) 858#define XENA_EEPROM_SPACE (0x01 << 11)
859 859
860#endif /* _REGS_H */ 860#endif /* _REGS_H */
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index b4c4cf467dc6..639fbc0f16f3 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -77,7 +77,7 @@
77#include "s2io.h" 77#include "s2io.h"
78#include "s2io-regs.h" 78#include "s2io-regs.h"
79 79
80#define DRV_VERSION "2.0.15.2" 80#define DRV_VERSION "2.0.16.1"
81 81
82/* S2io Driver name & version. */ 82/* S2io Driver name & version. */
83static char s2io_driver_name[] = "Neterion"; 83static char s2io_driver_name[] = "Neterion";
@@ -86,7 +86,7 @@ static char s2io_driver_version[] = DRV_VERSION;
86static int rxd_size[4] = {32,48,48,64}; 86static int rxd_size[4] = {32,48,48,64};
87static int rxd_count[4] = {127,85,85,63}; 87static int rxd_count[4] = {127,85,85,63};
88 88
89static inline int RXD_IS_UP2DT(RxD_t *rxdp) 89static inline int RXD_IS_UP2DT(struct RxD_t *rxdp)
90{ 90{
91 int ret; 91 int ret;
92 92
@@ -111,9 +111,9 @@ static inline int RXD_IS_UP2DT(RxD_t *rxdp)
111#define TASKLET_IN_USE test_and_set_bit(0, (&sp->tasklet_status)) 111#define TASKLET_IN_USE test_and_set_bit(0, (&sp->tasklet_status))
112#define PANIC 1 112#define PANIC 1
113#define LOW 2 113#define LOW 2
114static inline int rx_buffer_level(nic_t * sp, int rxb_size, int ring) 114static inline int rx_buffer_level(struct s2io_nic * sp, int rxb_size, int ring)
115{ 115{
116 mac_info_t *mac_control; 116 struct mac_info *mac_control;
117 117
118 mac_control = &sp->mac_control; 118 mac_control = &sp->mac_control;
119 if (rxb_size <= rxd_count[sp->rxd_mode]) 119 if (rxb_size <= rxd_count[sp->rxd_mode])
@@ -286,7 +286,7 @@ static char ethtool_stats_keys[][ETH_GSTRING_LEN] = {
286static void s2io_vlan_rx_register(struct net_device *dev, 286static void s2io_vlan_rx_register(struct net_device *dev,
287 struct vlan_group *grp) 287 struct vlan_group *grp)
288{ 288{
289 nic_t *nic = dev->priv; 289 struct s2io_nic *nic = dev->priv;
290 unsigned long flags; 290 unsigned long flags;
291 291
292 spin_lock_irqsave(&nic->tx_lock, flags); 292 spin_lock_irqsave(&nic->tx_lock, flags);
@@ -297,7 +297,7 @@ static void s2io_vlan_rx_register(struct net_device *dev,
297/* Unregister the vlan */ 297/* Unregister the vlan */
298static void s2io_vlan_rx_kill_vid(struct net_device *dev, unsigned long vid) 298static void s2io_vlan_rx_kill_vid(struct net_device *dev, unsigned long vid)
299{ 299{
300 nic_t *nic = dev->priv; 300 struct s2io_nic *nic = dev->priv;
301 unsigned long flags; 301 unsigned long flags;
302 302
303 spin_lock_irqsave(&nic->tx_lock, flags); 303 spin_lock_irqsave(&nic->tx_lock, flags);
@@ -458,14 +458,14 @@ static int init_shared_mem(struct s2io_nic *nic)
458 u32 size; 458 u32 size;
459 void *tmp_v_addr, *tmp_v_addr_next; 459 void *tmp_v_addr, *tmp_v_addr_next;
460 dma_addr_t tmp_p_addr, tmp_p_addr_next; 460 dma_addr_t tmp_p_addr, tmp_p_addr_next;
461 RxD_block_t *pre_rxd_blk = NULL; 461 struct RxD_block *pre_rxd_blk = NULL;
462 int i, j, blk_cnt; 462 int i, j, blk_cnt;
463 int lst_size, lst_per_page; 463 int lst_size, lst_per_page;
464 struct net_device *dev = nic->dev; 464 struct net_device *dev = nic->dev;
465 unsigned long tmp; 465 unsigned long tmp;
466 buffAdd_t *ba; 466 struct buffAdd *ba;
467 467
468 mac_info_t *mac_control; 468 struct mac_info *mac_control;
469 struct config_param *config; 469 struct config_param *config;
470 470
471 mac_control = &nic->mac_control; 471 mac_control = &nic->mac_control;
@@ -483,12 +483,12 @@ static int init_shared_mem(struct s2io_nic *nic)
483 return -EINVAL; 483 return -EINVAL;
484 } 484 }
485 485
486 lst_size = (sizeof(TxD_t) * config->max_txds); 486 lst_size = (sizeof(struct TxD) * config->max_txds);
487 lst_per_page = PAGE_SIZE / lst_size; 487 lst_per_page = PAGE_SIZE / lst_size;
488 488
489 for (i = 0; i < config->tx_fifo_num; i++) { 489 for (i = 0; i < config->tx_fifo_num; i++) {
490 int fifo_len = config->tx_cfg[i].fifo_len; 490 int fifo_len = config->tx_cfg[i].fifo_len;
491 int list_holder_size = fifo_len * sizeof(list_info_hold_t); 491 int list_holder_size = fifo_len * sizeof(struct list_info_hold);
492 mac_control->fifos[i].list_info = kmalloc(list_holder_size, 492 mac_control->fifos[i].list_info = kmalloc(list_holder_size,
493 GFP_KERNEL); 493 GFP_KERNEL);
494 if (!mac_control->fifos[i].list_info) { 494 if (!mac_control->fifos[i].list_info) {
@@ -579,9 +579,9 @@ static int init_shared_mem(struct s2io_nic *nic)
579 mac_control->rings[i].block_count; 579 mac_control->rings[i].block_count;
580 } 580 }
581 if (nic->rxd_mode == RXD_MODE_1) 581 if (nic->rxd_mode == RXD_MODE_1)
582 size = (size * (sizeof(RxD1_t))); 582 size = (size * (sizeof(struct RxD1)));
583 else 583 else
584 size = (size * (sizeof(RxD3_t))); 584 size = (size * (sizeof(struct RxD3)));
585 585
586 for (i = 0; i < config->rx_ring_num; i++) { 586 for (i = 0; i < config->rx_ring_num; i++) {
587 mac_control->rings[i].rx_curr_get_info.block_index = 0; 587 mac_control->rings[i].rx_curr_get_info.block_index = 0;
@@ -599,7 +599,7 @@ static int init_shared_mem(struct s2io_nic *nic)
599 (rxd_count[nic->rxd_mode] + 1); 599 (rxd_count[nic->rxd_mode] + 1);
600 /* Allocating all the Rx blocks */ 600 /* Allocating all the Rx blocks */
601 for (j = 0; j < blk_cnt; j++) { 601 for (j = 0; j < blk_cnt; j++) {
602 rx_block_info_t *rx_blocks; 602 struct rx_block_info *rx_blocks;
603 int l; 603 int l;
604 604
605 rx_blocks = &mac_control->rings[i].rx_blocks[j]; 605 rx_blocks = &mac_control->rings[i].rx_blocks[j];
@@ -619,7 +619,7 @@ static int init_shared_mem(struct s2io_nic *nic)
619 memset(tmp_v_addr, 0, size); 619 memset(tmp_v_addr, 0, size);
620 rx_blocks->block_virt_addr = tmp_v_addr; 620 rx_blocks->block_virt_addr = tmp_v_addr;
621 rx_blocks->block_dma_addr = tmp_p_addr; 621 rx_blocks->block_dma_addr = tmp_p_addr;
622 rx_blocks->rxds = kmalloc(sizeof(rxd_info_t)* 622 rx_blocks->rxds = kmalloc(sizeof(struct rxd_info)*
623 rxd_count[nic->rxd_mode], 623 rxd_count[nic->rxd_mode],
624 GFP_KERNEL); 624 GFP_KERNEL);
625 if (!rx_blocks->rxds) 625 if (!rx_blocks->rxds)
@@ -646,7 +646,7 @@ static int init_shared_mem(struct s2io_nic *nic)
646 mac_control->rings[i].rx_blocks[(j + 1) % 646 mac_control->rings[i].rx_blocks[(j + 1) %
647 blk_cnt].block_dma_addr; 647 blk_cnt].block_dma_addr;
648 648
649 pre_rxd_blk = (RxD_block_t *) tmp_v_addr; 649 pre_rxd_blk = (struct RxD_block *) tmp_v_addr;
650 pre_rxd_blk->reserved_2_pNext_RxD_block = 650 pre_rxd_blk->reserved_2_pNext_RxD_block =
651 (unsigned long) tmp_v_addr_next; 651 (unsigned long) tmp_v_addr_next;
652 pre_rxd_blk->pNext_RxD_Blk_physical = 652 pre_rxd_blk->pNext_RxD_Blk_physical =
@@ -662,14 +662,14 @@ static int init_shared_mem(struct s2io_nic *nic)
662 blk_cnt = config->rx_cfg[i].num_rxd / 662 blk_cnt = config->rx_cfg[i].num_rxd /
663 (rxd_count[nic->rxd_mode]+ 1); 663 (rxd_count[nic->rxd_mode]+ 1);
664 mac_control->rings[i].ba = 664 mac_control->rings[i].ba =
665 kmalloc((sizeof(buffAdd_t *) * blk_cnt), 665 kmalloc((sizeof(struct buffAdd *) * blk_cnt),
666 GFP_KERNEL); 666 GFP_KERNEL);
667 if (!mac_control->rings[i].ba) 667 if (!mac_control->rings[i].ba)
668 return -ENOMEM; 668 return -ENOMEM;
669 for (j = 0; j < blk_cnt; j++) { 669 for (j = 0; j < blk_cnt; j++) {
670 int k = 0; 670 int k = 0;
671 mac_control->rings[i].ba[j] = 671 mac_control->rings[i].ba[j] =
672 kmalloc((sizeof(buffAdd_t) * 672 kmalloc((sizeof(struct buffAdd) *
673 (rxd_count[nic->rxd_mode] + 1)), 673 (rxd_count[nic->rxd_mode] + 1)),
674 GFP_KERNEL); 674 GFP_KERNEL);
675 if (!mac_control->rings[i].ba[j]) 675 if (!mac_control->rings[i].ba[j])
@@ -701,7 +701,7 @@ static int init_shared_mem(struct s2io_nic *nic)
701 } 701 }
702 702
703 /* Allocation and initialization of Statistics block */ 703 /* Allocation and initialization of Statistics block */
704 size = sizeof(StatInfo_t); 704 size = sizeof(struct stat_block);
705 mac_control->stats_mem = pci_alloc_consistent 705 mac_control->stats_mem = pci_alloc_consistent
706 (nic->pdev, size, &mac_control->stats_mem_phy); 706 (nic->pdev, size, &mac_control->stats_mem_phy);
707 707
@@ -716,7 +716,7 @@ static int init_shared_mem(struct s2io_nic *nic)
716 mac_control->stats_mem_sz = size; 716 mac_control->stats_mem_sz = size;
717 717
718 tmp_v_addr = mac_control->stats_mem; 718 tmp_v_addr = mac_control->stats_mem;
719 mac_control->stats_info = (StatInfo_t *) tmp_v_addr; 719 mac_control->stats_info = (struct stat_block *) tmp_v_addr;
720 memset(tmp_v_addr, 0, size); 720 memset(tmp_v_addr, 0, size);
721 DBG_PRINT(INIT_DBG, "%s:Ring Mem PHY: 0x%llx\n", dev->name, 721 DBG_PRINT(INIT_DBG, "%s:Ring Mem PHY: 0x%llx\n", dev->name,
722 (unsigned long long) tmp_p_addr); 722 (unsigned long long) tmp_p_addr);
@@ -736,7 +736,7 @@ static void free_shared_mem(struct s2io_nic *nic)
736 int i, j, blk_cnt, size; 736 int i, j, blk_cnt, size;
737 void *tmp_v_addr; 737 void *tmp_v_addr;
738 dma_addr_t tmp_p_addr; 738 dma_addr_t tmp_p_addr;
739 mac_info_t *mac_control; 739 struct mac_info *mac_control;
740 struct config_param *config; 740 struct config_param *config;
741 int lst_size, lst_per_page; 741 int lst_size, lst_per_page;
742 struct net_device *dev = nic->dev; 742 struct net_device *dev = nic->dev;
@@ -747,7 +747,7 @@ static void free_shared_mem(struct s2io_nic *nic)
747 mac_control = &nic->mac_control; 747 mac_control = &nic->mac_control;
748 config = &nic->config; 748 config = &nic->config;
749 749
750 lst_size = (sizeof(TxD_t) * config->max_txds); 750 lst_size = (sizeof(struct TxD) * config->max_txds);
751 lst_per_page = PAGE_SIZE / lst_size; 751 lst_per_page = PAGE_SIZE / lst_size;
752 752
753 for (i = 0; i < config->tx_fifo_num; i++) { 753 for (i = 0; i < config->tx_fifo_num; i++) {
@@ -810,7 +810,7 @@ static void free_shared_mem(struct s2io_nic *nic)
810 if (!mac_control->rings[i].ba[j]) 810 if (!mac_control->rings[i].ba[j])
811 continue; 811 continue;
812 while (k != rxd_count[nic->rxd_mode]) { 812 while (k != rxd_count[nic->rxd_mode]) {
813 buffAdd_t *ba = 813 struct buffAdd *ba =
814 &mac_control->rings[i].ba[j][k]; 814 &mac_control->rings[i].ba[j][k];
815 kfree(ba->ba_0_org); 815 kfree(ba->ba_0_org);
816 kfree(ba->ba_1_org); 816 kfree(ba->ba_1_org);
@@ -836,9 +836,9 @@ static void free_shared_mem(struct s2io_nic *nic)
836 * s2io_verify_pci_mode - 836 * s2io_verify_pci_mode -
837 */ 837 */
838 838
839static int s2io_verify_pci_mode(nic_t *nic) 839static int s2io_verify_pci_mode(struct s2io_nic *nic)
840{ 840{
841 XENA_dev_config_t __iomem *bar0 = nic->bar0; 841 struct XENA_dev_config __iomem *bar0 = nic->bar0;
842 register u64 val64 = 0; 842 register u64 val64 = 0;
843 int mode; 843 int mode;
844 844
@@ -869,9 +869,9 @@ static int bus_speed[8] = {33, 133, 133, 200, 266, 133, 200, 266};
869/** 869/**
870 * s2io_print_pci_mode - 870 * s2io_print_pci_mode -
871 */ 871 */
872static int s2io_print_pci_mode(nic_t *nic) 872static int s2io_print_pci_mode(struct s2io_nic *nic)
873{ 873{
874 XENA_dev_config_t __iomem *bar0 = nic->bar0; 874 struct XENA_dev_config __iomem *bar0 = nic->bar0;
875 register u64 val64 = 0; 875 register u64 val64 = 0;
876 int mode; 876 int mode;
877 struct config_param *config = &nic->config; 877 struct config_param *config = &nic->config;
@@ -939,13 +939,13 @@ static int s2io_print_pci_mode(nic_t *nic)
939 939
940static int init_nic(struct s2io_nic *nic) 940static int init_nic(struct s2io_nic *nic)
941{ 941{
942 XENA_dev_config_t __iomem *bar0 = nic->bar0; 942 struct XENA_dev_config __iomem *bar0 = nic->bar0;
943 struct net_device *dev = nic->dev; 943 struct net_device *dev = nic->dev;
944 register u64 val64 = 0; 944 register u64 val64 = 0;
945 void __iomem *add; 945 void __iomem *add;
946 u32 time; 946 u32 time;
947 int i, j; 947 int i, j;
948 mac_info_t *mac_control; 948 struct mac_info *mac_control;
949 struct config_param *config; 949 struct config_param *config;
950 int dtx_cnt = 0; 950 int dtx_cnt = 0;
951 unsigned long long mem_share; 951 unsigned long long mem_share;
@@ -1628,7 +1628,7 @@ static int init_nic(struct s2io_nic *nic)
1628#define LINK_UP_DOWN_INTERRUPT 1 1628#define LINK_UP_DOWN_INTERRUPT 1
1629#define MAC_RMAC_ERR_TIMER 2 1629#define MAC_RMAC_ERR_TIMER 2
1630 1630
1631static int s2io_link_fault_indication(nic_t *nic) 1631static int s2io_link_fault_indication(struct s2io_nic *nic)
1632{ 1632{
1633 if (nic->intr_type != INTA) 1633 if (nic->intr_type != INTA)
1634 return MAC_RMAC_ERR_TIMER; 1634 return MAC_RMAC_ERR_TIMER;
@@ -1651,7 +1651,7 @@ static int s2io_link_fault_indication(nic_t *nic)
1651 1651
1652static void en_dis_able_nic_intrs(struct s2io_nic *nic, u16 mask, int flag) 1652static void en_dis_able_nic_intrs(struct s2io_nic *nic, u16 mask, int flag)
1653{ 1653{
1654 XENA_dev_config_t __iomem *bar0 = nic->bar0; 1654 struct XENA_dev_config __iomem *bar0 = nic->bar0;
1655 register u64 val64 = 0, temp64 = 0; 1655 register u64 val64 = 0, temp64 = 0;
1656 1656
1657 /* Top level interrupt classification */ 1657 /* Top level interrupt classification */
@@ -1773,10 +1773,10 @@ static void en_dis_able_nic_intrs(struct s2io_nic *nic, u16 mask, int flag)
1773 * Return: 1 If PCC is quiescence 1773 * Return: 1 If PCC is quiescence
1774 * 0 If PCC is not quiescence 1774 * 0 If PCC is not quiescence
1775 */ 1775 */
1776static int verify_pcc_quiescent(nic_t *sp, int flag) 1776static int verify_pcc_quiescent(struct s2io_nic *sp, int flag)
1777{ 1777{
1778 int ret = 0, herc; 1778 int ret = 0, herc;
1779 XENA_dev_config_t __iomem *bar0 = sp->bar0; 1779 struct XENA_dev_config __iomem *bar0 = sp->bar0;
1780 u64 val64 = readq(&bar0->adapter_status); 1780 u64 val64 = readq(&bar0->adapter_status);
1781 1781
1782 herc = (sp->device_type == XFRAME_II_DEVICE); 1782 herc = (sp->device_type == XFRAME_II_DEVICE);
@@ -1813,10 +1813,10 @@ static int verify_pcc_quiescent(nic_t *sp, int flag)
1813 * 0 If Xena is not quiescence 1813 * 0 If Xena is not quiescence
1814 */ 1814 */
1815 1815
1816static int verify_xena_quiescence(nic_t *sp) 1816static int verify_xena_quiescence(struct s2io_nic *sp)
1817{ 1817{
1818 int mode; 1818 int mode;
1819 XENA_dev_config_t __iomem *bar0 = sp->bar0; 1819 struct XENA_dev_config __iomem *bar0 = sp->bar0;
1820 u64 val64 = readq(&bar0->adapter_status); 1820 u64 val64 = readq(&bar0->adapter_status);
1821 mode = s2io_verify_pci_mode(sp); 1821 mode = s2io_verify_pci_mode(sp);
1822 1822
@@ -1880,9 +1880,9 @@ static int verify_xena_quiescence(nic_t *sp)
1880 * 1880 *
1881 */ 1881 */
1882 1882
1883static void fix_mac_address(nic_t * sp) 1883static void fix_mac_address(struct s2io_nic * sp)
1884{ 1884{
1885 XENA_dev_config_t __iomem *bar0 = sp->bar0; 1885 struct XENA_dev_config __iomem *bar0 = sp->bar0;
1886 u64 val64; 1886 u64 val64;
1887 int i = 0; 1887 int i = 0;
1888 1888
@@ -1908,11 +1908,11 @@ static void fix_mac_address(nic_t * sp)
1908 1908
1909static int start_nic(struct s2io_nic *nic) 1909static int start_nic(struct s2io_nic *nic)
1910{ 1910{
1911 XENA_dev_config_t __iomem *bar0 = nic->bar0; 1911 struct XENA_dev_config __iomem *bar0 = nic->bar0;
1912 struct net_device *dev = nic->dev; 1912 struct net_device *dev = nic->dev;
1913 register u64 val64 = 0; 1913 register u64 val64 = 0;
1914 u16 subid, i; 1914 u16 subid, i;
1915 mac_info_t *mac_control; 1915 struct mac_info *mac_control;
1916 struct config_param *config; 1916 struct config_param *config;
1917 1917
1918 mac_control = &nic->mac_control; 1918 mac_control = &nic->mac_control;
@@ -2017,11 +2017,12 @@ static int start_nic(struct s2io_nic *nic)
2017/** 2017/**
2018 * s2io_txdl_getskb - Get the skb from txdl, unmap and return skb 2018 * s2io_txdl_getskb - Get the skb from txdl, unmap and return skb
2019 */ 2019 */
2020static struct sk_buff *s2io_txdl_getskb(fifo_info_t *fifo_data, TxD_t *txdlp, int get_off) 2020static struct sk_buff *s2io_txdl_getskb(struct fifo_info *fifo_data, struct \
2021 TxD *txdlp, int get_off)
2021{ 2022{
2022 nic_t *nic = fifo_data->nic; 2023 struct s2io_nic *nic = fifo_data->nic;
2023 struct sk_buff *skb; 2024 struct sk_buff *skb;
2024 TxD_t *txds; 2025 struct TxD *txds;
2025 u16 j, frg_cnt; 2026 u16 j, frg_cnt;
2026 2027
2027 txds = txdlp; 2028 txds = txdlp;
@@ -2035,7 +2036,7 @@ static struct sk_buff *s2io_txdl_getskb(fifo_info_t *fifo_data, TxD_t *txdlp, in
2035 skb = (struct sk_buff *) ((unsigned long) 2036 skb = (struct sk_buff *) ((unsigned long)
2036 txds->Host_Control); 2037 txds->Host_Control);
2037 if (!skb) { 2038 if (!skb) {
2038 memset(txdlp, 0, (sizeof(TxD_t) * fifo_data->max_txds)); 2039 memset(txdlp, 0, (sizeof(struct TxD) * fifo_data->max_txds));
2039 return NULL; 2040 return NULL;
2040 } 2041 }
2041 pci_unmap_single(nic->pdev, (dma_addr_t) 2042 pci_unmap_single(nic->pdev, (dma_addr_t)
@@ -2054,7 +2055,7 @@ static struct sk_buff *s2io_txdl_getskb(fifo_info_t *fifo_data, TxD_t *txdlp, in
2054 frag->size, PCI_DMA_TODEVICE); 2055 frag->size, PCI_DMA_TODEVICE);
2055 } 2056 }
2056 } 2057 }
2057 memset(txdlp,0, (sizeof(TxD_t) * fifo_data->max_txds)); 2058 memset(txdlp,0, (sizeof(struct TxD) * fifo_data->max_txds));
2058 return(skb); 2059 return(skb);
2059} 2060}
2060 2061
@@ -2070,9 +2071,9 @@ static void free_tx_buffers(struct s2io_nic *nic)
2070{ 2071{
2071 struct net_device *dev = nic->dev; 2072 struct net_device *dev = nic->dev;
2072 struct sk_buff *skb; 2073 struct sk_buff *skb;
2073 TxD_t *txdp; 2074 struct TxD *txdp;
2074 int i, j; 2075 int i, j;
2075 mac_info_t *mac_control; 2076 struct mac_info *mac_control;
2076 struct config_param *config; 2077 struct config_param *config;
2077 int cnt = 0; 2078 int cnt = 0;
2078 2079
@@ -2081,7 +2082,7 @@ static void free_tx_buffers(struct s2io_nic *nic)
2081 2082
2082 for (i = 0; i < config->tx_fifo_num; i++) { 2083 for (i = 0; i < config->tx_fifo_num; i++) {
2083 for (j = 0; j < config->tx_cfg[i].fifo_len - 1; j++) { 2084 for (j = 0; j < config->tx_cfg[i].fifo_len - 1; j++) {
2084 txdp = (TxD_t *) mac_control->fifos[i].list_info[j]. 2085 txdp = (struct TxD *) mac_control->fifos[i].list_info[j].
2085 list_virt_addr; 2086 list_virt_addr;
2086 skb = s2io_txdl_getskb(&mac_control->fifos[i], txdp, j); 2087 skb = s2io_txdl_getskb(&mac_control->fifos[i], txdp, j);
2087 if (skb) { 2088 if (skb) {
@@ -2109,10 +2110,10 @@ static void free_tx_buffers(struct s2io_nic *nic)
2109 2110
2110static void stop_nic(struct s2io_nic *nic) 2111static void stop_nic(struct s2io_nic *nic)
2111{ 2112{
2112 XENA_dev_config_t __iomem *bar0 = nic->bar0; 2113 struct XENA_dev_config __iomem *bar0 = nic->bar0;
2113 register u64 val64 = 0; 2114 register u64 val64 = 0;
2114 u16 interruptible; 2115 u16 interruptible;
2115 mac_info_t *mac_control; 2116 struct mac_info *mac_control;
2116 struct config_param *config; 2117 struct config_param *config;
2117 2118
2118 mac_control = &nic->mac_control; 2119 mac_control = &nic->mac_control;
@@ -2130,14 +2131,15 @@ static void stop_nic(struct s2io_nic *nic)
2130 writeq(val64, &bar0->adapter_control); 2131 writeq(val64, &bar0->adapter_control);
2131} 2132}
2132 2133
2133static int fill_rxd_3buf(nic_t *nic, RxD_t *rxdp, struct sk_buff *skb) 2134static int fill_rxd_3buf(struct s2io_nic *nic, struct RxD_t *rxdp, struct \
2135 sk_buff *skb)
2134{ 2136{
2135 struct net_device *dev = nic->dev; 2137 struct net_device *dev = nic->dev;
2136 struct sk_buff *frag_list; 2138 struct sk_buff *frag_list;
2137 void *tmp; 2139 void *tmp;
2138 2140
2139 /* Buffer-1 receives L3/L4 headers */ 2141 /* Buffer-1 receives L3/L4 headers */
2140 ((RxD3_t*)rxdp)->Buffer1_ptr = pci_map_single 2142 ((struct RxD3*)rxdp)->Buffer1_ptr = pci_map_single
2141 (nic->pdev, skb->data, l3l4hdr_size + 4, 2143 (nic->pdev, skb->data, l3l4hdr_size + 4,
2142 PCI_DMA_FROMDEVICE); 2144 PCI_DMA_FROMDEVICE);
2143 2145
@@ -2155,7 +2157,7 @@ static int fill_rxd_3buf(nic_t *nic, RxD_t *rxdp, struct sk_buff *skb)
2155 frag_list->tail = tmp; 2157 frag_list->tail = tmp;
2156 2158
2157 /* Buffer-2 receives L4 data payload */ 2159 /* Buffer-2 receives L4 data payload */
2158 ((RxD3_t*)rxdp)->Buffer2_ptr = pci_map_single(nic->pdev, 2160 ((struct RxD3*)rxdp)->Buffer2_ptr = pci_map_single(nic->pdev,
2159 frag_list->data, dev->mtu, 2161 frag_list->data, dev->mtu,
2160 PCI_DMA_FROMDEVICE); 2162 PCI_DMA_FROMDEVICE);
2161 rxdp->Control_2 |= SET_BUFFER1_SIZE_3(l3l4hdr_size + 4); 2163 rxdp->Control_2 |= SET_BUFFER1_SIZE_3(l3l4hdr_size + 4);
@@ -2189,16 +2191,16 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no)
2189{ 2191{
2190 struct net_device *dev = nic->dev; 2192 struct net_device *dev = nic->dev;
2191 struct sk_buff *skb; 2193 struct sk_buff *skb;
2192 RxD_t *rxdp; 2194 struct RxD_t *rxdp;
2193 int off, off1, size, block_no, block_no1; 2195 int off, off1, size, block_no, block_no1;
2194 u32 alloc_tab = 0; 2196 u32 alloc_tab = 0;
2195 u32 alloc_cnt; 2197 u32 alloc_cnt;
2196 mac_info_t *mac_control; 2198 struct mac_info *mac_control;
2197 struct config_param *config; 2199 struct config_param *config;
2198 u64 tmp; 2200 u64 tmp;
2199 buffAdd_t *ba; 2201 struct buffAdd *ba;
2200 unsigned long flags; 2202 unsigned long flags;
2201 RxD_t *first_rxdp = NULL; 2203 struct RxD_t *first_rxdp = NULL;
2202 2204
2203 mac_control = &nic->mac_control; 2205 mac_control = &nic->mac_control;
2204 config = &nic->config; 2206 config = &nic->config;
@@ -2280,9 +2282,9 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no)
2280 } 2282 }
2281 if (nic->rxd_mode == RXD_MODE_1) { 2283 if (nic->rxd_mode == RXD_MODE_1) {
2282 /* 1 buffer mode - normal operation mode */ 2284 /* 1 buffer mode - normal operation mode */
2283 memset(rxdp, 0, sizeof(RxD1_t)); 2285 memset(rxdp, 0, sizeof(struct RxD1));
2284 skb_reserve(skb, NET_IP_ALIGN); 2286 skb_reserve(skb, NET_IP_ALIGN);
2285 ((RxD1_t*)rxdp)->Buffer0_ptr = pci_map_single 2287 ((struct RxD1*)rxdp)->Buffer0_ptr = pci_map_single
2286 (nic->pdev, skb->data, size - NET_IP_ALIGN, 2288 (nic->pdev, skb->data, size - NET_IP_ALIGN,
2287 PCI_DMA_FROMDEVICE); 2289 PCI_DMA_FROMDEVICE);
2288 rxdp->Control_2 = SET_BUFFER0_SIZE_1(size - NET_IP_ALIGN); 2290 rxdp->Control_2 = SET_BUFFER0_SIZE_1(size - NET_IP_ALIGN);
@@ -2299,7 +2301,7 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no)
2299 * payload 2301 * payload
2300 */ 2302 */
2301 2303
2302 memset(rxdp, 0, sizeof(RxD3_t)); 2304 memset(rxdp, 0, sizeof(struct RxD3));
2303 ba = &mac_control->rings[ring_no].ba[block_no][off]; 2305 ba = &mac_control->rings[ring_no].ba[block_no][off];
2304 skb_reserve(skb, BUF0_LEN); 2306 skb_reserve(skb, BUF0_LEN);
2305 tmp = (u64)(unsigned long) skb->data; 2307 tmp = (u64)(unsigned long) skb->data;
@@ -2308,13 +2310,13 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no)
2308 skb->data = (void *) (unsigned long)tmp; 2310 skb->data = (void *) (unsigned long)tmp;
2309 skb->tail = (void *) (unsigned long)tmp; 2311 skb->tail = (void *) (unsigned long)tmp;
2310 2312
2311 if (!(((RxD3_t*)rxdp)->Buffer0_ptr)) 2313 if (!(((struct RxD3*)rxdp)->Buffer0_ptr))
2312 ((RxD3_t*)rxdp)->Buffer0_ptr = 2314 ((struct RxD3*)rxdp)->Buffer0_ptr =
2313 pci_map_single(nic->pdev, ba->ba_0, BUF0_LEN, 2315 pci_map_single(nic->pdev, ba->ba_0, BUF0_LEN,
2314 PCI_DMA_FROMDEVICE); 2316 PCI_DMA_FROMDEVICE);
2315 else 2317 else
2316 pci_dma_sync_single_for_device(nic->pdev, 2318 pci_dma_sync_single_for_device(nic->pdev,
2317 (dma_addr_t) ((RxD3_t*)rxdp)->Buffer0_ptr, 2319 (dma_addr_t) ((struct RxD3*)rxdp)->Buffer0_ptr,
2318 BUF0_LEN, PCI_DMA_FROMDEVICE); 2320 BUF0_LEN, PCI_DMA_FROMDEVICE);
2319 rxdp->Control_2 = SET_BUFFER0_SIZE_3(BUF0_LEN); 2321 rxdp->Control_2 = SET_BUFFER0_SIZE_3(BUF0_LEN);
2320 if (nic->rxd_mode == RXD_MODE_3B) { 2322 if (nic->rxd_mode == RXD_MODE_3B) {
@@ -2324,13 +2326,13 @@ static int fill_rx_buffers(struct s2io_nic *nic, int ring_no)
2324 * Buffer2 will have L3/L4 header plus 2326 * Buffer2 will have L3/L4 header plus
2325 * L4 payload 2327 * L4 payload
2326 */ 2328 */
2327 ((RxD3_t*)rxdp)->Buffer2_ptr = pci_map_single 2329 ((struct RxD3*)rxdp)->Buffer2_ptr = pci_map_single
2328 (nic->pdev, skb->data, dev->mtu + 4, 2330 (nic->pdev, skb->data, dev->mtu + 4,
2329 PCI_DMA_FROMDEVICE); 2331 PCI_DMA_FROMDEVICE);
2330 2332
2331 /* Buffer-1 will be dummy buffer. Not used */ 2333 /* Buffer-1 will be dummy buffer. Not used */
2332 if (!(((RxD3_t*)rxdp)->Buffer1_ptr)) { 2334 if (!(((struct RxD3*)rxdp)->Buffer1_ptr)) {
2333 ((RxD3_t*)rxdp)->Buffer1_ptr = 2335 ((struct RxD3*)rxdp)->Buffer1_ptr =
2334 pci_map_single(nic->pdev, 2336 pci_map_single(nic->pdev,
2335 ba->ba_1, BUF1_LEN, 2337 ba->ba_1, BUF1_LEN,
2336 PCI_DMA_FROMDEVICE); 2338 PCI_DMA_FROMDEVICE);
@@ -2390,9 +2392,9 @@ static void free_rxd_blk(struct s2io_nic *sp, int ring_no, int blk)
2390 struct net_device *dev = sp->dev; 2392 struct net_device *dev = sp->dev;
2391 int j; 2393 int j;
2392 struct sk_buff *skb; 2394 struct sk_buff *skb;
2393 RxD_t *rxdp; 2395 struct RxD_t *rxdp;
2394 mac_info_t *mac_control; 2396 struct mac_info *mac_control;
2395 buffAdd_t *ba; 2397 struct buffAdd *ba;
2396 2398
2397 mac_control = &sp->mac_control; 2399 mac_control = &sp->mac_control;
2398 for (j = 0 ; j < rxd_count[sp->rxd_mode]; j++) { 2400 for (j = 0 ; j < rxd_count[sp->rxd_mode]; j++) {
@@ -2405,41 +2407,41 @@ static void free_rxd_blk(struct s2io_nic *sp, int ring_no, int blk)
2405 } 2407 }
2406 if (sp->rxd_mode == RXD_MODE_1) { 2408 if (sp->rxd_mode == RXD_MODE_1) {
2407 pci_unmap_single(sp->pdev, (dma_addr_t) 2409 pci_unmap_single(sp->pdev, (dma_addr_t)
2408 ((RxD1_t*)rxdp)->Buffer0_ptr, 2410 ((struct RxD1*)rxdp)->Buffer0_ptr,
2409 dev->mtu + 2411 dev->mtu +
2410 HEADER_ETHERNET_II_802_3_SIZE 2412 HEADER_ETHERNET_II_802_3_SIZE
2411 + HEADER_802_2_SIZE + 2413 + HEADER_802_2_SIZE +
2412 HEADER_SNAP_SIZE, 2414 HEADER_SNAP_SIZE,
2413 PCI_DMA_FROMDEVICE); 2415 PCI_DMA_FROMDEVICE);
2414 memset(rxdp, 0, sizeof(RxD1_t)); 2416 memset(rxdp, 0, sizeof(struct RxD1));
2415 } else if(sp->rxd_mode == RXD_MODE_3B) { 2417 } else if(sp->rxd_mode == RXD_MODE_3B) {
2416 ba = &mac_control->rings[ring_no]. 2418 ba = &mac_control->rings[ring_no].
2417 ba[blk][j]; 2419 ba[blk][j];
2418 pci_unmap_single(sp->pdev, (dma_addr_t) 2420 pci_unmap_single(sp->pdev, (dma_addr_t)
2419 ((RxD3_t*)rxdp)->Buffer0_ptr, 2421 ((struct RxD3*)rxdp)->Buffer0_ptr,
2420 BUF0_LEN, 2422 BUF0_LEN,
2421 PCI_DMA_FROMDEVICE); 2423 PCI_DMA_FROMDEVICE);
2422 pci_unmap_single(sp->pdev, (dma_addr_t) 2424 pci_unmap_single(sp->pdev, (dma_addr_t)
2423 ((RxD3_t*)rxdp)->Buffer1_ptr, 2425 ((struct RxD3*)rxdp)->Buffer1_ptr,
2424 BUF1_LEN, 2426 BUF1_LEN,
2425 PCI_DMA_FROMDEVICE); 2427 PCI_DMA_FROMDEVICE);
2426 pci_unmap_single(sp->pdev, (dma_addr_t) 2428 pci_unmap_single(sp->pdev, (dma_addr_t)
2427 ((RxD3_t*)rxdp)->Buffer2_ptr, 2429 ((struct RxD3*)rxdp)->Buffer2_ptr,
2428 dev->mtu + 4, 2430 dev->mtu + 4,
2429 PCI_DMA_FROMDEVICE); 2431 PCI_DMA_FROMDEVICE);
2430 memset(rxdp, 0, sizeof(RxD3_t)); 2432 memset(rxdp, 0, sizeof(struct RxD3));
2431 } else { 2433 } else {
2432 pci_unmap_single(sp->pdev, (dma_addr_t) 2434 pci_unmap_single(sp->pdev, (dma_addr_t)
2433 ((RxD3_t*)rxdp)->Buffer0_ptr, BUF0_LEN, 2435 ((struct RxD3*)rxdp)->Buffer0_ptr, BUF0_LEN,
2434 PCI_DMA_FROMDEVICE); 2436 PCI_DMA_FROMDEVICE);
2435 pci_unmap_single(sp->pdev, (dma_addr_t) 2437 pci_unmap_single(sp->pdev, (dma_addr_t)
2436 ((RxD3_t*)rxdp)->Buffer1_ptr, 2438 ((struct RxD3*)rxdp)->Buffer1_ptr,
2437 l3l4hdr_size + 4, 2439 l3l4hdr_size + 4,
2438 PCI_DMA_FROMDEVICE); 2440 PCI_DMA_FROMDEVICE);
2439 pci_unmap_single(sp->pdev, (dma_addr_t) 2441 pci_unmap_single(sp->pdev, (dma_addr_t)
2440 ((RxD3_t*)rxdp)->Buffer2_ptr, dev->mtu, 2442 ((struct RxD3*)rxdp)->Buffer2_ptr, dev->mtu,
2441 PCI_DMA_FROMDEVICE); 2443 PCI_DMA_FROMDEVICE);
2442 memset(rxdp, 0, sizeof(RxD3_t)); 2444 memset(rxdp, 0, sizeof(struct RxD3));
2443 } 2445 }
2444 dev_kfree_skb(skb); 2446 dev_kfree_skb(skb);
2445 atomic_dec(&sp->rx_bufs_left[ring_no]); 2447 atomic_dec(&sp->rx_bufs_left[ring_no]);
@@ -2459,7 +2461,7 @@ static void free_rx_buffers(struct s2io_nic *sp)
2459{ 2461{
2460 struct net_device *dev = sp->dev; 2462 struct net_device *dev = sp->dev;
2461 int i, blk = 0, buf_cnt = 0; 2463 int i, blk = 0, buf_cnt = 0;
2462 mac_info_t *mac_control; 2464 struct mac_info *mac_control;
2463 struct config_param *config; 2465 struct config_param *config;
2464 2466
2465 mac_control = &sp->mac_control; 2467 mac_control = &sp->mac_control;
@@ -2494,11 +2496,11 @@ static void free_rx_buffers(struct s2io_nic *sp)
2494 2496
2495static int s2io_poll(struct net_device *dev, int *budget) 2497static int s2io_poll(struct net_device *dev, int *budget)
2496{ 2498{
2497 nic_t *nic = dev->priv; 2499 struct s2io_nic *nic = dev->priv;
2498 int pkt_cnt = 0, org_pkts_to_process; 2500 int pkt_cnt = 0, org_pkts_to_process;
2499 mac_info_t *mac_control; 2501 struct mac_info *mac_control;
2500 struct config_param *config; 2502 struct config_param *config;
2501 XENA_dev_config_t __iomem *bar0 = nic->bar0; 2503 struct XENA_dev_config __iomem *bar0 = nic->bar0;
2502 int i; 2504 int i;
2503 2505
2504 atomic_inc(&nic->isr_cnt); 2506 atomic_inc(&nic->isr_cnt);
@@ -2568,10 +2570,10 @@ no_rx:
2568 */ 2570 */
2569static void s2io_netpoll(struct net_device *dev) 2571static void s2io_netpoll(struct net_device *dev)
2570{ 2572{
2571 nic_t *nic = dev->priv; 2573 struct s2io_nic *nic = dev->priv;
2572 mac_info_t *mac_control; 2574 struct mac_info *mac_control;
2573 struct config_param *config; 2575 struct config_param *config;
2574 XENA_dev_config_t __iomem *bar0 = nic->bar0; 2576 struct XENA_dev_config __iomem *bar0 = nic->bar0;
2575 u64 val64 = 0xFFFFFFFFFFFFFFFFULL; 2577 u64 val64 = 0xFFFFFFFFFFFFFFFFULL;
2576 int i; 2578 int i;
2577 2579
@@ -2620,13 +2622,13 @@ static void s2io_netpoll(struct net_device *dev)
2620 * Return Value: 2622 * Return Value:
2621 * NONE. 2623 * NONE.
2622 */ 2624 */
2623static void rx_intr_handler(ring_info_t *ring_data) 2625static void rx_intr_handler(struct ring_info *ring_data)
2624{ 2626{
2625 nic_t *nic = ring_data->nic; 2627 struct s2io_nic *nic = ring_data->nic;
2626 struct net_device *dev = (struct net_device *) nic->dev; 2628 struct net_device *dev = (struct net_device *) nic->dev;
2627 int get_block, put_block, put_offset; 2629 int get_block, put_block, put_offset;
2628 rx_curr_get_info_t get_info, put_info; 2630 struct rx_curr_get_info get_info, put_info;
2629 RxD_t *rxdp; 2631 struct RxD_t *rxdp;
2630 struct sk_buff *skb; 2632 struct sk_buff *skb;
2631 int pkt_cnt = 0; 2633 int pkt_cnt = 0;
2632 int i; 2634 int i;
@@ -2641,7 +2643,7 @@ static void rx_intr_handler(ring_info_t *ring_data)
2641 2643
2642 get_info = ring_data->rx_curr_get_info; 2644 get_info = ring_data->rx_curr_get_info;
2643 get_block = get_info.block_index; 2645 get_block = get_info.block_index;
2644 put_info = ring_data->rx_curr_put_info; 2646 memcpy(&put_info, &ring_data->rx_curr_put_info, sizeof(put_info));
2645 put_block = put_info.block_index; 2647 put_block = put_info.block_index;
2646 rxdp = ring_data->rx_blocks[get_block].rxds[get_info.offset].virt_addr; 2648 rxdp = ring_data->rx_blocks[get_block].rxds[get_info.offset].virt_addr;
2647 if (!napi) { 2649 if (!napi) {
@@ -2671,7 +2673,7 @@ static void rx_intr_handler(ring_info_t *ring_data)
2671 } 2673 }
2672 if (nic->rxd_mode == RXD_MODE_1) { 2674 if (nic->rxd_mode == RXD_MODE_1) {
2673 pci_unmap_single(nic->pdev, (dma_addr_t) 2675 pci_unmap_single(nic->pdev, (dma_addr_t)
2674 ((RxD1_t*)rxdp)->Buffer0_ptr, 2676 ((struct RxD1*)rxdp)->Buffer0_ptr,
2675 dev->mtu + 2677 dev->mtu +
2676 HEADER_ETHERNET_II_802_3_SIZE + 2678 HEADER_ETHERNET_II_802_3_SIZE +
2677 HEADER_802_2_SIZE + 2679 HEADER_802_2_SIZE +
@@ -2679,22 +2681,22 @@ static void rx_intr_handler(ring_info_t *ring_data)
2679 PCI_DMA_FROMDEVICE); 2681 PCI_DMA_FROMDEVICE);
2680 } else if (nic->rxd_mode == RXD_MODE_3B) { 2682 } else if (nic->rxd_mode == RXD_MODE_3B) {
2681 pci_dma_sync_single_for_cpu(nic->pdev, (dma_addr_t) 2683 pci_dma_sync_single_for_cpu(nic->pdev, (dma_addr_t)
2682 ((RxD3_t*)rxdp)->Buffer0_ptr, 2684 ((struct RxD3*)rxdp)->Buffer0_ptr,
2683 BUF0_LEN, PCI_DMA_FROMDEVICE); 2685 BUF0_LEN, PCI_DMA_FROMDEVICE);
2684 pci_unmap_single(nic->pdev, (dma_addr_t) 2686 pci_unmap_single(nic->pdev, (dma_addr_t)
2685 ((RxD3_t*)rxdp)->Buffer2_ptr, 2687 ((struct RxD3*)rxdp)->Buffer2_ptr,
2686 dev->mtu + 4, 2688 dev->mtu + 4,
2687 PCI_DMA_FROMDEVICE); 2689 PCI_DMA_FROMDEVICE);
2688 } else { 2690 } else {
2689 pci_dma_sync_single_for_cpu(nic->pdev, (dma_addr_t) 2691 pci_dma_sync_single_for_cpu(nic->pdev, (dma_addr_t)
2690 ((RxD3_t*)rxdp)->Buffer0_ptr, BUF0_LEN, 2692 ((struct RxD3*)rxdp)->Buffer0_ptr, BUF0_LEN,
2691 PCI_DMA_FROMDEVICE); 2693 PCI_DMA_FROMDEVICE);
2692 pci_unmap_single(nic->pdev, (dma_addr_t) 2694 pci_unmap_single(nic->pdev, (dma_addr_t)
2693 ((RxD3_t*)rxdp)->Buffer1_ptr, 2695 ((struct RxD3*)rxdp)->Buffer1_ptr,
2694 l3l4hdr_size + 4, 2696 l3l4hdr_size + 4,
2695 PCI_DMA_FROMDEVICE); 2697 PCI_DMA_FROMDEVICE);
2696 pci_unmap_single(nic->pdev, (dma_addr_t) 2698 pci_unmap_single(nic->pdev, (dma_addr_t)
2697 ((RxD3_t*)rxdp)->Buffer2_ptr, 2699 ((struct RxD3*)rxdp)->Buffer2_ptr,
2698 dev->mtu, PCI_DMA_FROMDEVICE); 2700 dev->mtu, PCI_DMA_FROMDEVICE);
2699 } 2701 }
2700 prefetch(skb->data); 2702 prefetch(skb->data);
@@ -2723,7 +2725,7 @@ static void rx_intr_handler(ring_info_t *ring_data)
2723 if (nic->lro) { 2725 if (nic->lro) {
2724 /* Clear all LRO sessions before exiting */ 2726 /* Clear all LRO sessions before exiting */
2725 for (i=0; i<MAX_LRO_SESSIONS; i++) { 2727 for (i=0; i<MAX_LRO_SESSIONS; i++) {
2726 lro_t *lro = &nic->lro0_n[i]; 2728 struct lro *lro = &nic->lro0_n[i];
2727 if (lro->in_use) { 2729 if (lro->in_use) {
2728 update_L3L4_header(nic, lro); 2730 update_L3L4_header(nic, lro);
2729 queue_rx_frame(lro->parent); 2731 queue_rx_frame(lro->parent);
@@ -2747,17 +2749,17 @@ static void rx_intr_handler(ring_info_t *ring_data)
2747 * NONE 2749 * NONE
2748 */ 2750 */
2749 2751
2750static void tx_intr_handler(fifo_info_t *fifo_data) 2752static void tx_intr_handler(struct fifo_info *fifo_data)
2751{ 2753{
2752 nic_t *nic = fifo_data->nic; 2754 struct s2io_nic *nic = fifo_data->nic;
2753 struct net_device *dev = (struct net_device *) nic->dev; 2755 struct net_device *dev = (struct net_device *) nic->dev;
2754 tx_curr_get_info_t get_info, put_info; 2756 struct tx_curr_get_info get_info, put_info;
2755 struct sk_buff *skb; 2757 struct sk_buff *skb;
2756 TxD_t *txdlp; 2758 struct TxD *txdlp;
2757 2759
2758 get_info = fifo_data->tx_curr_get_info; 2760 get_info = fifo_data->tx_curr_get_info;
2759 put_info = fifo_data->tx_curr_put_info; 2761 memcpy(&put_info, &fifo_data->tx_curr_put_info, sizeof(put_info));
2760 txdlp = (TxD_t *) fifo_data->list_info[get_info.offset]. 2762 txdlp = (struct TxD *) fifo_data->list_info[get_info.offset].
2761 list_virt_addr; 2763 list_virt_addr;
2762 while ((!(txdlp->Control_1 & TXD_LIST_OWN_XENA)) && 2764 while ((!(txdlp->Control_1 & TXD_LIST_OWN_XENA)) &&
2763 (get_info.offset != put_info.offset) && 2765 (get_info.offset != put_info.offset) &&
@@ -2794,7 +2796,7 @@ static void tx_intr_handler(fifo_info_t *fifo_data)
2794 get_info.offset++; 2796 get_info.offset++;
2795 if (get_info.offset == get_info.fifo_len + 1) 2797 if (get_info.offset == get_info.fifo_len + 1)
2796 get_info.offset = 0; 2798 get_info.offset = 0;
2797 txdlp = (TxD_t *) fifo_data->list_info 2799 txdlp = (struct TxD *) fifo_data->list_info
2798 [get_info.offset].list_virt_addr; 2800 [get_info.offset].list_virt_addr;
2799 fifo_data->tx_curr_get_info.offset = 2801 fifo_data->tx_curr_get_info.offset =
2800 get_info.offset; 2802 get_info.offset;
@@ -2819,8 +2821,8 @@ static void tx_intr_handler(fifo_info_t *fifo_data)
2819static void s2io_mdio_write(u32 mmd_type, u64 addr, u16 value, struct net_device *dev) 2821static void s2io_mdio_write(u32 mmd_type, u64 addr, u16 value, struct net_device *dev)
2820{ 2822{
2821 u64 val64 = 0x0; 2823 u64 val64 = 0x0;
2822 nic_t *sp = dev->priv; 2824 struct s2io_nic *sp = dev->priv;
2823 XENA_dev_config_t __iomem *bar0 = sp->bar0; 2825 struct XENA_dev_config __iomem *bar0 = sp->bar0;
2824 2826
2825 //address transaction 2827 //address transaction
2826 val64 = val64 | MDIO_MMD_INDX_ADDR(addr) 2828 val64 = val64 | MDIO_MMD_INDX_ADDR(addr)
@@ -2868,8 +2870,8 @@ static u64 s2io_mdio_read(u32 mmd_type, u64 addr, struct net_device *dev)
2868{ 2870{
2869 u64 val64 = 0x0; 2871 u64 val64 = 0x0;
2870 u64 rval64 = 0x0; 2872 u64 rval64 = 0x0;
2871 nic_t *sp = dev->priv; 2873 struct s2io_nic *sp = dev->priv;
2872 XENA_dev_config_t __iomem *bar0 = sp->bar0; 2874 struct XENA_dev_config __iomem *bar0 = sp->bar0;
2873 2875
2874 /* address transaction */ 2876 /* address transaction */
2875 val64 = val64 | MDIO_MMD_INDX_ADDR(addr) 2877 val64 = val64 | MDIO_MMD_INDX_ADDR(addr)
@@ -2972,8 +2974,8 @@ static void s2io_updt_xpak_counter(struct net_device *dev)
2972 u64 val64 = 0x0; 2974 u64 val64 = 0x0;
2973 u64 addr = 0x0; 2975 u64 addr = 0x0;
2974 2976
2975 nic_t *sp = dev->priv; 2977 struct s2io_nic *sp = dev->priv;
2976 StatInfo_t *stat_info = sp->mac_control.stats_info; 2978 struct stat_block *stat_info = sp->mac_control.stats_info;
2977 2979
2978 /* Check the communication with the MDIO slave */ 2980 /* Check the communication with the MDIO slave */
2979 addr = 0x0000; 2981 addr = 0x0000;
@@ -3071,7 +3073,7 @@ static void s2io_updt_xpak_counter(struct net_device *dev)
3071static void alarm_intr_handler(struct s2io_nic *nic) 3073static void alarm_intr_handler(struct s2io_nic *nic)
3072{ 3074{
3073 struct net_device *dev = (struct net_device *) nic->dev; 3075 struct net_device *dev = (struct net_device *) nic->dev;
3074 XENA_dev_config_t __iomem *bar0 = nic->bar0; 3076 struct XENA_dev_config __iomem *bar0 = nic->bar0;
3075 register u64 val64 = 0, err_reg = 0; 3077 register u64 val64 = 0, err_reg = 0;
3076 u64 cnt; 3078 u64 cnt;
3077 int i; 3079 int i;
@@ -3246,9 +3248,9 @@ static u16 check_pci_device_id(u16 id)
3246 * void. 3248 * void.
3247 */ 3249 */
3248 3250
3249static void s2io_reset(nic_t * sp) 3251static void s2io_reset(struct s2io_nic * sp)
3250{ 3252{
3251 XENA_dev_config_t __iomem *bar0 = sp->bar0; 3253 struct XENA_dev_config __iomem *bar0 = sp->bar0;
3252 u64 val64; 3254 u64 val64;
3253 u16 subid, pci_cmd; 3255 u16 subid, pci_cmd;
3254 int i; 3256 int i;
@@ -3352,10 +3354,10 @@ new_way:
3352 * SUCCESS on success and FAILURE on failure. 3354 * SUCCESS on success and FAILURE on failure.
3353 */ 3355 */
3354 3356
3355static int s2io_set_swapper(nic_t * sp) 3357static int s2io_set_swapper(struct s2io_nic * sp)
3356{ 3358{
3357 struct net_device *dev = sp->dev; 3359 struct net_device *dev = sp->dev;
3358 XENA_dev_config_t __iomem *bar0 = sp->bar0; 3360 struct XENA_dev_config __iomem *bar0 = sp->bar0;
3359 u64 val64, valt, valr; 3361 u64 val64, valt, valr;
3360 3362
3361 /* 3363 /*
@@ -3480,9 +3482,9 @@ static int s2io_set_swapper(nic_t * sp)
3480 return SUCCESS; 3482 return SUCCESS;
3481} 3483}
3482 3484
3483static int wait_for_msix_trans(nic_t *nic, int i) 3485static int wait_for_msix_trans(struct s2io_nic *nic, int i)
3484{ 3486{
3485 XENA_dev_config_t __iomem *bar0 = nic->bar0; 3487 struct XENA_dev_config __iomem *bar0 = nic->bar0;
3486 u64 val64; 3488 u64 val64;
3487 int ret = 0, cnt = 0; 3489 int ret = 0, cnt = 0;
3488 3490
@@ -3501,9 +3503,9 @@ static int wait_for_msix_trans(nic_t *nic, int i)
3501 return ret; 3503 return ret;
3502} 3504}
3503 3505
3504static void restore_xmsi_data(nic_t *nic) 3506static void restore_xmsi_data(struct s2io_nic *nic)
3505{ 3507{
3506 XENA_dev_config_t __iomem *bar0 = nic->bar0; 3508 struct XENA_dev_config __iomem *bar0 = nic->bar0;
3507 u64 val64; 3509 u64 val64;
3508 int i; 3510 int i;
3509 3511
@@ -3519,9 +3521,9 @@ static void restore_xmsi_data(nic_t *nic)
3519 } 3521 }
3520} 3522}
3521 3523
3522static void store_xmsi_data(nic_t *nic) 3524static void store_xmsi_data(struct s2io_nic *nic)
3523{ 3525{
3524 XENA_dev_config_t __iomem *bar0 = nic->bar0; 3526 struct XENA_dev_config __iomem *bar0 = nic->bar0;
3525 u64 val64, addr, data; 3527 u64 val64, addr, data;
3526 int i; 3528 int i;
3527 3529
@@ -3542,9 +3544,9 @@ static void store_xmsi_data(nic_t *nic)
3542 } 3544 }
3543} 3545}
3544 3546
3545int s2io_enable_msi(nic_t *nic) 3547int s2io_enable_msi(struct s2io_nic *nic)
3546{ 3548{
3547 XENA_dev_config_t __iomem *bar0 = nic->bar0; 3549 struct XENA_dev_config __iomem *bar0 = nic->bar0;
3548 u16 msi_ctrl, msg_val; 3550 u16 msi_ctrl, msg_val;
3549 struct config_param *config = &nic->config; 3551 struct config_param *config = &nic->config;
3550 struct net_device *dev = nic->dev; 3552 struct net_device *dev = nic->dev;
@@ -3592,9 +3594,9 @@ int s2io_enable_msi(nic_t *nic)
3592 return 0; 3594 return 0;
3593} 3595}
3594 3596
3595static int s2io_enable_msi_x(nic_t *nic) 3597static int s2io_enable_msi_x(struct s2io_nic *nic)
3596{ 3598{
3597 XENA_dev_config_t __iomem *bar0 = nic->bar0; 3599 struct XENA_dev_config __iomem *bar0 = nic->bar0;
3598 u64 tx_mat, rx_mat; 3600 u64 tx_mat, rx_mat;
3599 u16 msi_control; /* Temp variable */ 3601 u16 msi_control; /* Temp variable */
3600 int ret, i, j, msix_indx = 1; 3602 int ret, i, j, msix_indx = 1;
@@ -3702,7 +3704,7 @@ static int s2io_enable_msi_x(nic_t *nic)
3702 3704
3703static int s2io_open(struct net_device *dev) 3705static int s2io_open(struct net_device *dev)
3704{ 3706{
3705 nic_t *sp = dev->priv; 3707 struct s2io_nic *sp = dev->priv;
3706 int err = 0; 3708 int err = 0;
3707 3709
3708 /* 3710 /*
@@ -3755,7 +3757,7 @@ hw_init_failed:
3755 3757
3756static int s2io_close(struct net_device *dev) 3758static int s2io_close(struct net_device *dev)
3757{ 3759{
3758 nic_t *sp = dev->priv; 3760 struct s2io_nic *sp = dev->priv;
3759 3761
3760 flush_scheduled_work(); 3762 flush_scheduled_work();
3761 netif_stop_queue(dev); 3763 netif_stop_queue(dev);
@@ -3781,15 +3783,15 @@ static int s2io_close(struct net_device *dev)
3781 3783
3782static int s2io_xmit(struct sk_buff *skb, struct net_device *dev) 3784static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
3783{ 3785{
3784 nic_t *sp = dev->priv; 3786 struct s2io_nic *sp = dev->priv;
3785 u16 frg_cnt, frg_len, i, queue, queue_len, put_off, get_off; 3787 u16 frg_cnt, frg_len, i, queue, queue_len, put_off, get_off;
3786 register u64 val64; 3788 register u64 val64;
3787 TxD_t *txdp; 3789 struct TxD *txdp;
3788 TxFIFO_element_t __iomem *tx_fifo; 3790 struct TxFIFO_element __iomem *tx_fifo;
3789 unsigned long flags; 3791 unsigned long flags;
3790 u16 vlan_tag = 0; 3792 u16 vlan_tag = 0;
3791 int vlan_priority = 0; 3793 int vlan_priority = 0;
3792 mac_info_t *mac_control; 3794 struct mac_info *mac_control;
3793 struct config_param *config; 3795 struct config_param *config;
3794 int offload_type; 3796 int offload_type;
3795 3797
@@ -3817,7 +3819,7 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
3817 3819
3818 put_off = (u16) mac_control->fifos[queue].tx_curr_put_info.offset; 3820 put_off = (u16) mac_control->fifos[queue].tx_curr_put_info.offset;
3819 get_off = (u16) mac_control->fifos[queue].tx_curr_get_info.offset; 3821 get_off = (u16) mac_control->fifos[queue].tx_curr_get_info.offset;
3820 txdp = (TxD_t *) mac_control->fifos[queue].list_info[put_off]. 3822 txdp = (struct TxD *) mac_control->fifos[queue].list_info[put_off].
3821 list_virt_addr; 3823 list_virt_addr;
3822 3824
3823 queue_len = mac_control->fifos[queue].tx_curr_put_info.fifo_len + 1; 3825 queue_len = mac_control->fifos[queue].tx_curr_put_info.fifo_len + 1;
@@ -3944,13 +3946,13 @@ static int s2io_xmit(struct sk_buff *skb, struct net_device *dev)
3944static void 3946static void
3945s2io_alarm_handle(unsigned long data) 3947s2io_alarm_handle(unsigned long data)
3946{ 3948{
3947 nic_t *sp = (nic_t *)data; 3949 struct s2io_nic *sp = (struct s2io_nic *)data;
3948 3950
3949 alarm_intr_handler(sp); 3951 alarm_intr_handler(sp);
3950 mod_timer(&sp->alarm_timer, jiffies + HZ / 2); 3952 mod_timer(&sp->alarm_timer, jiffies + HZ / 2);
3951} 3953}
3952 3954
3953static int s2io_chk_rx_buffers(nic_t *sp, int rng_n) 3955static int s2io_chk_rx_buffers(struct s2io_nic *sp, int rng_n)
3954{ 3956{
3955 int rxb_size, level; 3957 int rxb_size, level;
3956 3958
@@ -3982,9 +3984,9 @@ static int s2io_chk_rx_buffers(nic_t *sp, int rng_n)
3982static irqreturn_t s2io_msi_handle(int irq, void *dev_id) 3984static irqreturn_t s2io_msi_handle(int irq, void *dev_id)
3983{ 3985{
3984 struct net_device *dev = (struct net_device *) dev_id; 3986 struct net_device *dev = (struct net_device *) dev_id;
3985 nic_t *sp = dev->priv; 3987 struct s2io_nic *sp = dev->priv;
3986 int i; 3988 int i;
3987 mac_info_t *mac_control; 3989 struct mac_info *mac_control;
3988 struct config_param *config; 3990 struct config_param *config;
3989 3991
3990 atomic_inc(&sp->isr_cnt); 3992 atomic_inc(&sp->isr_cnt);
@@ -4014,8 +4016,8 @@ static irqreturn_t s2io_msi_handle(int irq, void *dev_id)
4014 4016
4015static irqreturn_t s2io_msix_ring_handle(int irq, void *dev_id) 4017static irqreturn_t s2io_msix_ring_handle(int irq, void *dev_id)
4016{ 4018{
4017 ring_info_t *ring = (ring_info_t *)dev_id; 4019 struct ring_info *ring = (struct ring_info *)dev_id;
4018 nic_t *sp = ring->nic; 4020 struct s2io_nic *sp = ring->nic;
4019 4021
4020 atomic_inc(&sp->isr_cnt); 4022 atomic_inc(&sp->isr_cnt);
4021 4023
@@ -4028,17 +4030,17 @@ static irqreturn_t s2io_msix_ring_handle(int irq, void *dev_id)
4028 4030
4029static irqreturn_t s2io_msix_fifo_handle(int irq, void *dev_id) 4031static irqreturn_t s2io_msix_fifo_handle(int irq, void *dev_id)
4030{ 4032{
4031 fifo_info_t *fifo = (fifo_info_t *)dev_id; 4033 struct fifo_info *fifo = (struct fifo_info *)dev_id;
4032 nic_t *sp = fifo->nic; 4034 struct s2io_nic *sp = fifo->nic;
4033 4035
4034 atomic_inc(&sp->isr_cnt); 4036 atomic_inc(&sp->isr_cnt);
4035 tx_intr_handler(fifo); 4037 tx_intr_handler(fifo);
4036 atomic_dec(&sp->isr_cnt); 4038 atomic_dec(&sp->isr_cnt);
4037 return IRQ_HANDLED; 4039 return IRQ_HANDLED;
4038} 4040}
4039static void s2io_txpic_intr_handle(nic_t *sp) 4041static void s2io_txpic_intr_handle(struct s2io_nic *sp)
4040{ 4042{
4041 XENA_dev_config_t __iomem *bar0 = sp->bar0; 4043 struct XENA_dev_config __iomem *bar0 = sp->bar0;
4042 u64 val64; 4044 u64 val64;
4043 4045
4044 val64 = readq(&bar0->pic_int_status); 4046 val64 = readq(&bar0->pic_int_status);
@@ -4108,11 +4110,11 @@ static void s2io_txpic_intr_handle(nic_t *sp)
4108static irqreturn_t s2io_isr(int irq, void *dev_id) 4110static irqreturn_t s2io_isr(int irq, void *dev_id)
4109{ 4111{
4110 struct net_device *dev = (struct net_device *) dev_id; 4112 struct net_device *dev = (struct net_device *) dev_id;
4111 nic_t *sp = dev->priv; 4113 struct s2io_nic *sp = dev->priv;
4112 XENA_dev_config_t __iomem *bar0 = sp->bar0; 4114 struct XENA_dev_config __iomem *bar0 = sp->bar0;
4113 int i; 4115 int i;
4114 u64 reason = 0; 4116 u64 reason = 0;
4115 mac_info_t *mac_control; 4117 struct mac_info *mac_control;
4116 struct config_param *config; 4118 struct config_param *config;
4117 4119
4118 atomic_inc(&sp->isr_cnt); 4120 atomic_inc(&sp->isr_cnt);
@@ -4198,9 +4200,9 @@ static irqreturn_t s2io_isr(int irq, void *dev_id)
4198/** 4200/**
4199 * s2io_updt_stats - 4201 * s2io_updt_stats -
4200 */ 4202 */
4201static void s2io_updt_stats(nic_t *sp) 4203static void s2io_updt_stats(struct s2io_nic *sp)
4202{ 4204{
4203 XENA_dev_config_t __iomem *bar0 = sp->bar0; 4205 struct XENA_dev_config __iomem *bar0 = sp->bar0;
4204 u64 val64; 4206 u64 val64;
4205 int cnt = 0; 4207 int cnt = 0;
4206 4208
@@ -4219,7 +4221,7 @@ static void s2io_updt_stats(nic_t *sp)
4219 break; /* Updt failed */ 4221 break; /* Updt failed */
4220 } while(1); 4222 } while(1);
4221 } else { 4223 } else {
4222 memset(sp->mac_control.stats_info, 0, sizeof(StatInfo_t)); 4224 memset(sp->mac_control.stats_info, 0, sizeof(struct stat_block));
4223 } 4225 }
4224} 4226}
4225 4227
@@ -4235,8 +4237,8 @@ static void s2io_updt_stats(nic_t *sp)
4235 4237
4236static struct net_device_stats *s2io_get_stats(struct net_device *dev) 4238static struct net_device_stats *s2io_get_stats(struct net_device *dev)
4237{ 4239{
4238 nic_t *sp = dev->priv; 4240 struct s2io_nic *sp = dev->priv;
4239 mac_info_t *mac_control; 4241 struct mac_info *mac_control;
4240 struct config_param *config; 4242 struct config_param *config;
4241 4243
4242 4244
@@ -4277,8 +4279,8 @@ static void s2io_set_multicast(struct net_device *dev)
4277{ 4279{
4278 int i, j, prev_cnt; 4280 int i, j, prev_cnt;
4279 struct dev_mc_list *mclist; 4281 struct dev_mc_list *mclist;
4280 nic_t *sp = dev->priv; 4282 struct s2io_nic *sp = dev->priv;
4281 XENA_dev_config_t __iomem *bar0 = sp->bar0; 4283 struct XENA_dev_config __iomem *bar0 = sp->bar0;
4282 u64 val64 = 0, multi_mac = 0x010203040506ULL, mask = 4284 u64 val64 = 0, multi_mac = 0x010203040506ULL, mask =
4283 0xfeffffffffffULL; 4285 0xfeffffffffffULL;
4284 u64 dis_addr = 0xffffffffffffULL, mac_addr = 0; 4286 u64 dis_addr = 0xffffffffffffULL, mac_addr = 0;
@@ -4431,8 +4433,8 @@ static void s2io_set_multicast(struct net_device *dev)
4431 4433
4432static int s2io_set_mac_addr(struct net_device *dev, u8 * addr) 4434static int s2io_set_mac_addr(struct net_device *dev, u8 * addr)
4433{ 4435{
4434 nic_t *sp = dev->priv; 4436 struct s2io_nic *sp = dev->priv;
4435 XENA_dev_config_t __iomem *bar0 = sp->bar0; 4437 struct XENA_dev_config __iomem *bar0 = sp->bar0;
4436 register u64 val64, mac_addr = 0; 4438 register u64 val64, mac_addr = 0;
4437 int i; 4439 int i;
4438 4440
@@ -4478,7 +4480,7 @@ static int s2io_set_mac_addr(struct net_device *dev, u8 * addr)
4478static int s2io_ethtool_sset(struct net_device *dev, 4480static int s2io_ethtool_sset(struct net_device *dev,
4479 struct ethtool_cmd *info) 4481 struct ethtool_cmd *info)
4480{ 4482{
4481 nic_t *sp = dev->priv; 4483 struct s2io_nic *sp = dev->priv;
4482 if ((info->autoneg == AUTONEG_ENABLE) || 4484 if ((info->autoneg == AUTONEG_ENABLE) ||
4483 (info->speed != SPEED_10000) || (info->duplex != DUPLEX_FULL)) 4485 (info->speed != SPEED_10000) || (info->duplex != DUPLEX_FULL))
4484 return -EINVAL; 4486 return -EINVAL;
@@ -4504,7 +4506,7 @@ static int s2io_ethtool_sset(struct net_device *dev,
4504 4506
4505static int s2io_ethtool_gset(struct net_device *dev, struct ethtool_cmd *info) 4507static int s2io_ethtool_gset(struct net_device *dev, struct ethtool_cmd *info)
4506{ 4508{
4507 nic_t *sp = dev->priv; 4509 struct s2io_nic *sp = dev->priv;
4508 info->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE); 4510 info->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE);
4509 info->advertising = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE); 4511 info->advertising = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE);
4510 info->port = PORT_FIBRE; 4512 info->port = PORT_FIBRE;
@@ -4537,7 +4539,7 @@ static int s2io_ethtool_gset(struct net_device *dev, struct ethtool_cmd *info)
4537static void s2io_ethtool_gdrvinfo(struct net_device *dev, 4539static void s2io_ethtool_gdrvinfo(struct net_device *dev,
4538 struct ethtool_drvinfo *info) 4540 struct ethtool_drvinfo *info)
4539{ 4541{
4540 nic_t *sp = dev->priv; 4542 struct s2io_nic *sp = dev->priv;
4541 4543
4542 strncpy(info->driver, s2io_driver_name, sizeof(info->driver)); 4544 strncpy(info->driver, s2io_driver_name, sizeof(info->driver));
4543 strncpy(info->version, s2io_driver_version, sizeof(info->version)); 4545 strncpy(info->version, s2io_driver_version, sizeof(info->version));
@@ -4569,7 +4571,7 @@ static void s2io_ethtool_gregs(struct net_device *dev,
4569 int i; 4571 int i;
4570 u64 reg; 4572 u64 reg;
4571 u8 *reg_space = (u8 *) space; 4573 u8 *reg_space = (u8 *) space;
4572 nic_t *sp = dev->priv; 4574 struct s2io_nic *sp = dev->priv;
4573 4575
4574 regs->len = XENA_REG_SPACE; 4576 regs->len = XENA_REG_SPACE;
4575 regs->version = sp->pdev->subsystem_device; 4577 regs->version = sp->pdev->subsystem_device;
@@ -4591,8 +4593,8 @@ static void s2io_ethtool_gregs(struct net_device *dev,
4591*/ 4593*/
4592static void s2io_phy_id(unsigned long data) 4594static void s2io_phy_id(unsigned long data)
4593{ 4595{
4594 nic_t *sp = (nic_t *) data; 4596 struct s2io_nic *sp = (struct s2io_nic *) data;
4595 XENA_dev_config_t __iomem *bar0 = sp->bar0; 4597 struct XENA_dev_config __iomem *bar0 = sp->bar0;
4596 u64 val64 = 0; 4598 u64 val64 = 0;
4597 u16 subid; 4599 u16 subid;
4598 4600
@@ -4629,8 +4631,8 @@ static void s2io_phy_id(unsigned long data)
4629static int s2io_ethtool_idnic(struct net_device *dev, u32 data) 4631static int s2io_ethtool_idnic(struct net_device *dev, u32 data)
4630{ 4632{
4631 u64 val64 = 0, last_gpio_ctrl_val; 4633 u64 val64 = 0, last_gpio_ctrl_val;
4632 nic_t *sp = dev->priv; 4634 struct s2io_nic *sp = dev->priv;
4633 XENA_dev_config_t __iomem *bar0 = sp->bar0; 4635 struct XENA_dev_config __iomem *bar0 = sp->bar0;
4634 u16 subid; 4636 u16 subid;
4635 4637
4636 subid = sp->pdev->subsystem_device; 4638 subid = sp->pdev->subsystem_device;
@@ -4678,8 +4680,8 @@ static void s2io_ethtool_getpause_data(struct net_device *dev,
4678 struct ethtool_pauseparam *ep) 4680 struct ethtool_pauseparam *ep)
4679{ 4681{
4680 u64 val64; 4682 u64 val64;
4681 nic_t *sp = dev->priv; 4683 struct s2io_nic *sp = dev->priv;
4682 XENA_dev_config_t __iomem *bar0 = sp->bar0; 4684 struct XENA_dev_config __iomem *bar0 = sp->bar0;
4683 4685
4684 val64 = readq(&bar0->rmac_pause_cfg); 4686 val64 = readq(&bar0->rmac_pause_cfg);
4685 if (val64 & RMAC_PAUSE_GEN_ENABLE) 4687 if (val64 & RMAC_PAUSE_GEN_ENABLE)
@@ -4705,8 +4707,8 @@ static int s2io_ethtool_setpause_data(struct net_device *dev,
4705 struct ethtool_pauseparam *ep) 4707 struct ethtool_pauseparam *ep)
4706{ 4708{
4707 u64 val64; 4709 u64 val64;
4708 nic_t *sp = dev->priv; 4710 struct s2io_nic *sp = dev->priv;
4709 XENA_dev_config_t __iomem *bar0 = sp->bar0; 4711 struct XENA_dev_config __iomem *bar0 = sp->bar0;
4710 4712
4711 val64 = readq(&bar0->rmac_pause_cfg); 4713 val64 = readq(&bar0->rmac_pause_cfg);
4712 if (ep->tx_pause) 4714 if (ep->tx_pause)
@@ -4738,12 +4740,12 @@ static int s2io_ethtool_setpause_data(struct net_device *dev,
4738 */ 4740 */
4739 4741
4740#define S2IO_DEV_ID 5 4742#define S2IO_DEV_ID 5
4741static int read_eeprom(nic_t * sp, int off, u64 * data) 4743static int read_eeprom(struct s2io_nic * sp, int off, u64 * data)
4742{ 4744{
4743 int ret = -1; 4745 int ret = -1;
4744 u32 exit_cnt = 0; 4746 u32 exit_cnt = 0;
4745 u64 val64; 4747 u64 val64;
4746 XENA_dev_config_t __iomem *bar0 = sp->bar0; 4748 struct XENA_dev_config __iomem *bar0 = sp->bar0;
4747 4749
4748 if (sp->device_type == XFRAME_I_DEVICE) { 4750 if (sp->device_type == XFRAME_I_DEVICE) {
4749 val64 = I2C_CONTROL_DEV_ID(S2IO_DEV_ID) | I2C_CONTROL_ADDR(off) | 4751 val64 = I2C_CONTROL_DEV_ID(S2IO_DEV_ID) | I2C_CONTROL_ADDR(off) |
@@ -4803,11 +4805,11 @@ static int read_eeprom(nic_t * sp, int off, u64 * data)
4803 * 0 on success, -1 on failure. 4805 * 0 on success, -1 on failure.
4804 */ 4806 */
4805 4807
4806static int write_eeprom(nic_t * sp, int off, u64 data, int cnt) 4808static int write_eeprom(struct s2io_nic * sp, int off, u64 data, int cnt)
4807{ 4809{
4808 int exit_cnt = 0, ret = -1; 4810 int exit_cnt = 0, ret = -1;
4809 u64 val64; 4811 u64 val64;
4810 XENA_dev_config_t __iomem *bar0 = sp->bar0; 4812 struct XENA_dev_config __iomem *bar0 = sp->bar0;
4811 4813
4812 if (sp->device_type == XFRAME_I_DEVICE) { 4814 if (sp->device_type == XFRAME_I_DEVICE) {
4813 val64 = I2C_CONTROL_DEV_ID(S2IO_DEV_ID) | I2C_CONTROL_ADDR(off) | 4815 val64 = I2C_CONTROL_DEV_ID(S2IO_DEV_ID) | I2C_CONTROL_ADDR(off) |
@@ -4852,7 +4854,7 @@ static int write_eeprom(nic_t * sp, int off, u64 data, int cnt)
4852 } 4854 }
4853 return ret; 4855 return ret;
4854} 4856}
4855static void s2io_vpd_read(nic_t *nic) 4857static void s2io_vpd_read(struct s2io_nic *nic)
4856{ 4858{
4857 u8 *vpd_data; 4859 u8 *vpd_data;
4858 u8 data; 4860 u8 data;
@@ -4931,7 +4933,7 @@ static int s2io_ethtool_geeprom(struct net_device *dev,
4931{ 4933{
4932 u32 i, valid; 4934 u32 i, valid;
4933 u64 data; 4935 u64 data;
4934 nic_t *sp = dev->priv; 4936 struct s2io_nic *sp = dev->priv;
4935 4937
4936 eeprom->magic = sp->pdev->vendor | (sp->pdev->device << 16); 4938 eeprom->magic = sp->pdev->vendor | (sp->pdev->device << 16);
4937 4939
@@ -4969,7 +4971,7 @@ static int s2io_ethtool_seeprom(struct net_device *dev,
4969{ 4971{
4970 int len = eeprom->len, cnt = 0; 4972 int len = eeprom->len, cnt = 0;
4971 u64 valid = 0, data; 4973 u64 valid = 0, data;
4972 nic_t *sp = dev->priv; 4974 struct s2io_nic *sp = dev->priv;
4973 4975
4974 if (eeprom->magic != (sp->pdev->vendor | (sp->pdev->device << 16))) { 4976 if (eeprom->magic != (sp->pdev->vendor | (sp->pdev->device << 16))) {
4975 DBG_PRINT(ERR_DBG, 4977 DBG_PRINT(ERR_DBG,
@@ -5013,9 +5015,9 @@ static int s2io_ethtool_seeprom(struct net_device *dev,
5013 * 0 on success. 5015 * 0 on success.
5014 */ 5016 */
5015 5017
5016static int s2io_register_test(nic_t * sp, uint64_t * data) 5018static int s2io_register_test(struct s2io_nic * sp, uint64_t * data)
5017{ 5019{
5018 XENA_dev_config_t __iomem *bar0 = sp->bar0; 5020 struct XENA_dev_config __iomem *bar0 = sp->bar0;
5019 u64 val64 = 0, exp_val; 5021 u64 val64 = 0, exp_val;
5020 int fail = 0; 5022 int fail = 0;
5021 5023
@@ -5080,7 +5082,7 @@ static int s2io_register_test(nic_t * sp, uint64_t * data)
5080 * 0 on success. 5082 * 0 on success.
5081 */ 5083 */
5082 5084
5083static int s2io_eeprom_test(nic_t * sp, uint64_t * data) 5085static int s2io_eeprom_test(struct s2io_nic * sp, uint64_t * data)
5084{ 5086{
5085 int fail = 0; 5087 int fail = 0;
5086 u64 ret_data, org_4F0, org_7F0; 5088 u64 ret_data, org_4F0, org_7F0;
@@ -5182,7 +5184,7 @@ static int s2io_eeprom_test(nic_t * sp, uint64_t * data)
5182 * 0 on success and -1 on failure. 5184 * 0 on success and -1 on failure.
5183 */ 5185 */
5184 5186
5185static int s2io_bist_test(nic_t * sp, uint64_t * data) 5187static int s2io_bist_test(struct s2io_nic * sp, uint64_t * data)
5186{ 5188{
5187 u8 bist = 0; 5189 u8 bist = 0;
5188 int cnt = 0, ret = -1; 5190 int cnt = 0, ret = -1;
@@ -5218,9 +5220,9 @@ static int s2io_bist_test(nic_t * sp, uint64_t * data)
5218 * 0 on success. 5220 * 0 on success.
5219 */ 5221 */
5220 5222
5221static int s2io_link_test(nic_t * sp, uint64_t * data) 5223static int s2io_link_test(struct s2io_nic * sp, uint64_t * data)
5222{ 5224{
5223 XENA_dev_config_t __iomem *bar0 = sp->bar0; 5225 struct XENA_dev_config __iomem *bar0 = sp->bar0;
5224 u64 val64; 5226 u64 val64;
5225 5227
5226 val64 = readq(&bar0->adapter_status); 5228 val64 = readq(&bar0->adapter_status);
@@ -5245,9 +5247,9 @@ static int s2io_link_test(nic_t * sp, uint64_t * data)
5245 * 0 on success. 5247 * 0 on success.
5246 */ 5248 */
5247 5249
5248static int s2io_rldram_test(nic_t * sp, uint64_t * data) 5250static int s2io_rldram_test(struct s2io_nic * sp, uint64_t * data)
5249{ 5251{
5250 XENA_dev_config_t __iomem *bar0 = sp->bar0; 5252 struct XENA_dev_config __iomem *bar0 = sp->bar0;
5251 u64 val64; 5253 u64 val64;
5252 int cnt, iteration = 0, test_fail = 0; 5254 int cnt, iteration = 0, test_fail = 0;
5253 5255
@@ -5349,7 +5351,7 @@ static void s2io_ethtool_test(struct net_device *dev,
5349 struct ethtool_test *ethtest, 5351 struct ethtool_test *ethtest,
5350 uint64_t * data) 5352 uint64_t * data)
5351{ 5353{
5352 nic_t *sp = dev->priv; 5354 struct s2io_nic *sp = dev->priv;
5353 int orig_state = netif_running(sp->dev); 5355 int orig_state = netif_running(sp->dev);
5354 5356
5355 if (ethtest->flags == ETH_TEST_FL_OFFLINE) { 5357 if (ethtest->flags == ETH_TEST_FL_OFFLINE) {
@@ -5405,8 +5407,8 @@ static void s2io_get_ethtool_stats(struct net_device *dev,
5405 u64 * tmp_stats) 5407 u64 * tmp_stats)
5406{ 5408{
5407 int i = 0; 5409 int i = 0;
5408 nic_t *sp = dev->priv; 5410 struct s2io_nic *sp = dev->priv;
5409 StatInfo_t *stat_info = sp->mac_control.stats_info; 5411 struct stat_block *stat_info = sp->mac_control.stats_info;
5410 5412
5411 s2io_updt_stats(sp); 5413 s2io_updt_stats(sp);
5412 tmp_stats[i++] = 5414 tmp_stats[i++] =
@@ -5633,14 +5635,14 @@ static int s2io_ethtool_get_regs_len(struct net_device *dev)
5633 5635
5634static u32 s2io_ethtool_get_rx_csum(struct net_device * dev) 5636static u32 s2io_ethtool_get_rx_csum(struct net_device * dev)
5635{ 5637{
5636 nic_t *sp = dev->priv; 5638 struct s2io_nic *sp = dev->priv;
5637 5639
5638 return (sp->rx_csum); 5640 return (sp->rx_csum);
5639} 5641}
5640 5642
5641static int s2io_ethtool_set_rx_csum(struct net_device *dev, u32 data) 5643static int s2io_ethtool_set_rx_csum(struct net_device *dev, u32 data)
5642{ 5644{
5643 nic_t *sp = dev->priv; 5645 struct s2io_nic *sp = dev->priv;
5644 5646
5645 if (data) 5647 if (data)
5646 sp->rx_csum = 1; 5648 sp->rx_csum = 1;
@@ -5761,7 +5763,7 @@ static int s2io_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
5761 5763
5762static int s2io_change_mtu(struct net_device *dev, int new_mtu) 5764static int s2io_change_mtu(struct net_device *dev, int new_mtu)
5763{ 5765{
5764 nic_t *sp = dev->priv; 5766 struct s2io_nic *sp = dev->priv;
5765 5767
5766 if ((new_mtu < MIN_MTU) || (new_mtu > S2IO_JUMBO_SIZE)) { 5768 if ((new_mtu < MIN_MTU) || (new_mtu > S2IO_JUMBO_SIZE)) {
5767 DBG_PRINT(ERR_DBG, "%s: MTU size is invalid.\n", 5769 DBG_PRINT(ERR_DBG, "%s: MTU size is invalid.\n",
@@ -5780,7 +5782,7 @@ static int s2io_change_mtu(struct net_device *dev, int new_mtu)
5780 if (netif_queue_stopped(dev)) 5782 if (netif_queue_stopped(dev))
5781 netif_wake_queue(dev); 5783 netif_wake_queue(dev);
5782 } else { /* Device is down */ 5784 } else { /* Device is down */
5783 XENA_dev_config_t __iomem *bar0 = sp->bar0; 5785 struct XENA_dev_config __iomem *bar0 = sp->bar0;
5784 u64 val64 = new_mtu; 5786 u64 val64 = new_mtu;
5785 5787
5786 writeq(vBIT(val64, 2, 14), &bar0->rmac_max_pyld_len); 5788 writeq(vBIT(val64, 2, 14), &bar0->rmac_max_pyld_len);
@@ -5805,9 +5807,9 @@ static int s2io_change_mtu(struct net_device *dev, int new_mtu)
5805static void s2io_tasklet(unsigned long dev_addr) 5807static void s2io_tasklet(unsigned long dev_addr)
5806{ 5808{
5807 struct net_device *dev = (struct net_device *) dev_addr; 5809 struct net_device *dev = (struct net_device *) dev_addr;
5808 nic_t *sp = dev->priv; 5810 struct s2io_nic *sp = dev->priv;
5809 int i, ret; 5811 int i, ret;
5810 mac_info_t *mac_control; 5812 struct mac_info *mac_control;
5811 struct config_param *config; 5813 struct config_param *config;
5812 5814
5813 mac_control = &sp->mac_control; 5815 mac_control = &sp->mac_control;
@@ -5840,9 +5842,9 @@ static void s2io_tasklet(unsigned long dev_addr)
5840 5842
5841static void s2io_set_link(struct work_struct *work) 5843static void s2io_set_link(struct work_struct *work)
5842{ 5844{
5843 nic_t *nic = container_of(work, nic_t, set_link_task); 5845 struct s2io_nic *nic = container_of(work, struct s2io_nic, set_link_task);
5844 struct net_device *dev = nic->dev; 5846 struct net_device *dev = nic->dev;
5845 XENA_dev_config_t __iomem *bar0 = nic->bar0; 5847 struct XENA_dev_config __iomem *bar0 = nic->bar0;
5846 register u64 val64; 5848 register u64 val64;
5847 u16 subid; 5849 u16 subid;
5848 5850
@@ -5904,9 +5906,10 @@ static void s2io_set_link(struct work_struct *work)
5904 clear_bit(0, &(nic->link_state)); 5906 clear_bit(0, &(nic->link_state));
5905} 5907}
5906 5908
5907static int set_rxd_buffer_pointer(nic_t *sp, RxD_t *rxdp, buffAdd_t *ba, 5909static int set_rxd_buffer_pointer(struct s2io_nic *sp, struct RxD_t *rxdp,
5908 struct sk_buff **skb, u64 *temp0, u64 *temp1, 5910 struct buffAdd *ba,
5909 u64 *temp2, int size) 5911 struct sk_buff **skb, u64 *temp0, u64 *temp1,
5912 u64 *temp2, int size)
5910{ 5913{
5911 struct net_device *dev = sp->dev; 5914 struct net_device *dev = sp->dev;
5912 struct sk_buff *frag_list; 5915 struct sk_buff *frag_list;
@@ -5920,7 +5923,7 @@ static int set_rxd_buffer_pointer(nic_t *sp, RxD_t *rxdp, buffAdd_t *ba,
5920 * using same mapped address for the Rxd 5923 * using same mapped address for the Rxd
5921 * buffer pointer 5924 * buffer pointer
5922 */ 5925 */
5923 ((RxD1_t*)rxdp)->Buffer0_ptr = *temp0; 5926 ((struct RxD1*)rxdp)->Buffer0_ptr = *temp0;
5924 } else { 5927 } else {
5925 *skb = dev_alloc_skb(size); 5928 *skb = dev_alloc_skb(size);
5926 if (!(*skb)) { 5929 if (!(*skb)) {
@@ -5932,7 +5935,7 @@ static int set_rxd_buffer_pointer(nic_t *sp, RxD_t *rxdp, buffAdd_t *ba,
5932 * such it will be used for next rxd whose 5935 * such it will be used for next rxd whose
5933 * Host Control is NULL 5936 * Host Control is NULL
5934 */ 5937 */
5935 ((RxD1_t*)rxdp)->Buffer0_ptr = *temp0 = 5938 ((struct RxD1*)rxdp)->Buffer0_ptr = *temp0 =
5936 pci_map_single( sp->pdev, (*skb)->data, 5939 pci_map_single( sp->pdev, (*skb)->data,
5937 size - NET_IP_ALIGN, 5940 size - NET_IP_ALIGN,
5938 PCI_DMA_FROMDEVICE); 5941 PCI_DMA_FROMDEVICE);
@@ -5941,9 +5944,9 @@ static int set_rxd_buffer_pointer(nic_t *sp, RxD_t *rxdp, buffAdd_t *ba,
5941 } else if ((sp->rxd_mode == RXD_MODE_3B) && (rxdp->Host_Control == 0)) { 5944 } else if ((sp->rxd_mode == RXD_MODE_3B) && (rxdp->Host_Control == 0)) {
5942 /* Two buffer Mode */ 5945 /* Two buffer Mode */
5943 if (*skb) { 5946 if (*skb) {
5944 ((RxD3_t*)rxdp)->Buffer2_ptr = *temp2; 5947 ((struct RxD3*)rxdp)->Buffer2_ptr = *temp2;
5945 ((RxD3_t*)rxdp)->Buffer0_ptr = *temp0; 5948 ((struct RxD3*)rxdp)->Buffer0_ptr = *temp0;
5946 ((RxD3_t*)rxdp)->Buffer1_ptr = *temp1; 5949 ((struct RxD3*)rxdp)->Buffer1_ptr = *temp1;
5947 } else { 5950 } else {
5948 *skb = dev_alloc_skb(size); 5951 *skb = dev_alloc_skb(size);
5949 if (!(*skb)) { 5952 if (!(*skb)) {
@@ -5951,26 +5954,26 @@ static int set_rxd_buffer_pointer(nic_t *sp, RxD_t *rxdp, buffAdd_t *ba,
5951 dev->name); 5954 dev->name);
5952 return -ENOMEM; 5955 return -ENOMEM;
5953 } 5956 }
5954 ((RxD3_t*)rxdp)->Buffer2_ptr = *temp2 = 5957 ((struct RxD3*)rxdp)->Buffer2_ptr = *temp2 =
5955 pci_map_single(sp->pdev, (*skb)->data, 5958 pci_map_single(sp->pdev, (*skb)->data,
5956 dev->mtu + 4, 5959 dev->mtu + 4,
5957 PCI_DMA_FROMDEVICE); 5960 PCI_DMA_FROMDEVICE);
5958 ((RxD3_t*)rxdp)->Buffer0_ptr = *temp0 = 5961 ((struct RxD3*)rxdp)->Buffer0_ptr = *temp0 =
5959 pci_map_single( sp->pdev, ba->ba_0, BUF0_LEN, 5962 pci_map_single( sp->pdev, ba->ba_0, BUF0_LEN,
5960 PCI_DMA_FROMDEVICE); 5963 PCI_DMA_FROMDEVICE);
5961 rxdp->Host_Control = (unsigned long) (*skb); 5964 rxdp->Host_Control = (unsigned long) (*skb);
5962 5965
5963 /* Buffer-1 will be dummy buffer not used */ 5966 /* Buffer-1 will be dummy buffer not used */
5964 ((RxD3_t*)rxdp)->Buffer1_ptr = *temp1 = 5967 ((struct RxD3*)rxdp)->Buffer1_ptr = *temp1 =
5965 pci_map_single(sp->pdev, ba->ba_1, BUF1_LEN, 5968 pci_map_single(sp->pdev, ba->ba_1, BUF1_LEN,
5966 PCI_DMA_FROMDEVICE); 5969 PCI_DMA_FROMDEVICE);
5967 } 5970 }
5968 } else if ((rxdp->Host_Control == 0)) { 5971 } else if ((rxdp->Host_Control == 0)) {
5969 /* Three buffer mode */ 5972 /* Three buffer mode */
5970 if (*skb) { 5973 if (*skb) {
5971 ((RxD3_t*)rxdp)->Buffer0_ptr = *temp0; 5974 ((struct RxD3*)rxdp)->Buffer0_ptr = *temp0;
5972 ((RxD3_t*)rxdp)->Buffer1_ptr = *temp1; 5975 ((struct RxD3*)rxdp)->Buffer1_ptr = *temp1;
5973 ((RxD3_t*)rxdp)->Buffer2_ptr = *temp2; 5976 ((struct RxD3*)rxdp)->Buffer2_ptr = *temp2;
5974 } else { 5977 } else {
5975 *skb = dev_alloc_skb(size); 5978 *skb = dev_alloc_skb(size);
5976 if (!(*skb)) { 5979 if (!(*skb)) {
@@ -5978,11 +5981,11 @@ static int set_rxd_buffer_pointer(nic_t *sp, RxD_t *rxdp, buffAdd_t *ba,
5978 dev->name); 5981 dev->name);
5979 return -ENOMEM; 5982 return -ENOMEM;
5980 } 5983 }
5981 ((RxD3_t*)rxdp)->Buffer0_ptr = *temp0 = 5984 ((struct RxD3*)rxdp)->Buffer0_ptr = *temp0 =
5982 pci_map_single(sp->pdev, ba->ba_0, BUF0_LEN, 5985 pci_map_single(sp->pdev, ba->ba_0, BUF0_LEN,
5983 PCI_DMA_FROMDEVICE); 5986 PCI_DMA_FROMDEVICE);
5984 /* Buffer-1 receives L3/L4 headers */ 5987 /* Buffer-1 receives L3/L4 headers */
5985 ((RxD3_t*)rxdp)->Buffer1_ptr = *temp1 = 5988 ((struct RxD3*)rxdp)->Buffer1_ptr = *temp1 =
5986 pci_map_single( sp->pdev, (*skb)->data, 5989 pci_map_single( sp->pdev, (*skb)->data,
5987 l3l4hdr_size + 4, 5990 l3l4hdr_size + 4,
5988 PCI_DMA_FROMDEVICE); 5991 PCI_DMA_FROMDEVICE);
@@ -6002,14 +6005,15 @@ static int set_rxd_buffer_pointer(nic_t *sp, RxD_t *rxdp, buffAdd_t *ba,
6002 /* 6005 /*
6003 * Buffer-2 receives L4 data payload 6006 * Buffer-2 receives L4 data payload
6004 */ 6007 */
6005 ((RxD3_t*)rxdp)->Buffer2_ptr = *temp2 = 6008 ((struct RxD3*)rxdp)->Buffer2_ptr = *temp2 =
6006 pci_map_single( sp->pdev, frag_list->data, 6009 pci_map_single( sp->pdev, frag_list->data,
6007 dev->mtu, PCI_DMA_FROMDEVICE); 6010 dev->mtu, PCI_DMA_FROMDEVICE);
6008 } 6011 }
6009 } 6012 }
6010 return 0; 6013 return 0;
6011} 6014}
6012static void set_rxd_buffer_size(nic_t *sp, RxD_t *rxdp, int size) 6015static void set_rxd_buffer_size(struct s2io_nic *sp, struct RxD_t *rxdp,
6016 int size)
6013{ 6017{
6014 struct net_device *dev = sp->dev; 6018 struct net_device *dev = sp->dev;
6015 if (sp->rxd_mode == RXD_MODE_1) { 6019 if (sp->rxd_mode == RXD_MODE_1) {
@@ -6025,15 +6029,15 @@ static void set_rxd_buffer_size(nic_t *sp, RxD_t *rxdp, int size)
6025 } 6029 }
6026} 6030}
6027 6031
6028static int rxd_owner_bit_reset(nic_t *sp) 6032static int rxd_owner_bit_reset(struct s2io_nic *sp)
6029{ 6033{
6030 int i, j, k, blk_cnt = 0, size; 6034 int i, j, k, blk_cnt = 0, size;
6031 mac_info_t * mac_control = &sp->mac_control; 6035 struct mac_info * mac_control = &sp->mac_control;
6032 struct config_param *config = &sp->config; 6036 struct config_param *config = &sp->config;
6033 struct net_device *dev = sp->dev; 6037 struct net_device *dev = sp->dev;
6034 RxD_t *rxdp = NULL; 6038 struct RxD_t *rxdp = NULL;
6035 struct sk_buff *skb = NULL; 6039 struct sk_buff *skb = NULL;
6036 buffAdd_t *ba = NULL; 6040 struct buffAdd *ba = NULL;
6037 u64 temp0_64 = 0, temp1_64 = 0, temp2_64 = 0; 6041 u64 temp0_64 = 0, temp1_64 = 0, temp2_64 = 0;
6038 6042
6039 /* Calculate the size based on ring mode */ 6043 /* Calculate the size based on ring mode */
@@ -6072,7 +6076,7 @@ static int rxd_owner_bit_reset(nic_t *sp)
6072 6076
6073} 6077}
6074 6078
6075static int s2io_add_isr(nic_t * sp) 6079static int s2io_add_isr(struct s2io_nic * sp)
6076{ 6080{
6077 int ret = 0; 6081 int ret = 0;
6078 struct net_device *dev = sp->dev; 6082 struct net_device *dev = sp->dev;
@@ -6087,7 +6091,7 @@ static int s2io_add_isr(nic_t * sp)
6087 sp->intr_type = INTA; 6091 sp->intr_type = INTA;
6088 } 6092 }
6089 6093
6090 /* Store the values of the MSIX table in the nic_t structure */ 6094 /* Store the values of the MSIX table in the struct s2io_nic structure */
6091 store_xmsi_data(sp); 6095 store_xmsi_data(sp);
6092 6096
6093 /* After proper initialization of H/W, register ISR */ 6097 /* After proper initialization of H/W, register ISR */
@@ -6142,7 +6146,7 @@ static int s2io_add_isr(nic_t * sp)
6142 } 6146 }
6143 return 0; 6147 return 0;
6144} 6148}
6145static void s2io_rem_isr(nic_t * sp) 6149static void s2io_rem_isr(struct s2io_nic * sp)
6146{ 6150{
6147 int cnt = 0; 6151 int cnt = 0;
6148 struct net_device *dev = sp->dev; 6152 struct net_device *dev = sp->dev;
@@ -6184,10 +6188,10 @@ static void s2io_rem_isr(nic_t * sp)
6184 } while(cnt < 5); 6188 } while(cnt < 5);
6185} 6189}
6186 6190
6187static void s2io_card_down(nic_t * sp) 6191static void s2io_card_down(struct s2io_nic * sp)
6188{ 6192{
6189 int cnt = 0; 6193 int cnt = 0;
6190 XENA_dev_config_t __iomem *bar0 = sp->bar0; 6194 struct XENA_dev_config __iomem *bar0 = sp->bar0;
6191 unsigned long flags; 6195 unsigned long flags;
6192 register u64 val64 = 0; 6196 register u64 val64 = 0;
6193 6197
@@ -6248,10 +6252,10 @@ static void s2io_card_down(nic_t * sp)
6248 clear_bit(0, &(sp->link_state)); 6252 clear_bit(0, &(sp->link_state));
6249} 6253}
6250 6254
6251static int s2io_card_up(nic_t * sp) 6255static int s2io_card_up(struct s2io_nic * sp)
6252{ 6256{
6253 int i, ret = 0; 6257 int i, ret = 0;
6254 mac_info_t *mac_control; 6258 struct mac_info *mac_control;
6255 struct config_param *config; 6259 struct config_param *config;
6256 struct net_device *dev = (struct net_device *) sp->dev; 6260 struct net_device *dev = (struct net_device *) sp->dev;
6257 u16 interruptible; 6261 u16 interruptible;
@@ -6350,7 +6354,7 @@ static int s2io_card_up(nic_t * sp)
6350 6354
6351static void s2io_restart_nic(struct work_struct *work) 6355static void s2io_restart_nic(struct work_struct *work)
6352{ 6356{
6353 nic_t *sp = container_of(work, nic_t, rst_timer_task); 6357 struct s2io_nic *sp = container_of(work, struct s2io_nic, rst_timer_task);
6354 struct net_device *dev = sp->dev; 6358 struct net_device *dev = sp->dev;
6355 6359
6356 s2io_card_down(sp); 6360 s2io_card_down(sp);
@@ -6379,7 +6383,7 @@ static void s2io_restart_nic(struct work_struct *work)
6379 6383
6380static void s2io_tx_watchdog(struct net_device *dev) 6384static void s2io_tx_watchdog(struct net_device *dev)
6381{ 6385{
6382 nic_t *sp = dev->priv; 6386 struct s2io_nic *sp = dev->priv;
6383 6387
6384 if (netif_carrier_ok(dev)) { 6388 if (netif_carrier_ok(dev)) {
6385 schedule_work(&sp->rst_timer_task); 6389 schedule_work(&sp->rst_timer_task);
@@ -6404,16 +6408,16 @@ static void s2io_tx_watchdog(struct net_device *dev)
6404 * Return value: 6408 * Return value:
6405 * SUCCESS on success and -1 on failure. 6409 * SUCCESS on success and -1 on failure.
6406 */ 6410 */
6407static int rx_osm_handler(ring_info_t *ring_data, RxD_t * rxdp) 6411static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp)
6408{ 6412{
6409 nic_t *sp = ring_data->nic; 6413 struct s2io_nic *sp = ring_data->nic;
6410 struct net_device *dev = (struct net_device *) sp->dev; 6414 struct net_device *dev = (struct net_device *) sp->dev;
6411 struct sk_buff *skb = (struct sk_buff *) 6415 struct sk_buff *skb = (struct sk_buff *)
6412 ((unsigned long) rxdp->Host_Control); 6416 ((unsigned long) rxdp->Host_Control);
6413 int ring_no = ring_data->ring_no; 6417 int ring_no = ring_data->ring_no;
6414 u16 l3_csum, l4_csum; 6418 u16 l3_csum, l4_csum;
6415 unsigned long long err = rxdp->Control_1 & RXD_T_CODE; 6419 unsigned long long err = rxdp->Control_1 & RXD_T_CODE;
6416 lro_t *lro; 6420 struct lro *lro;
6417 6421
6418 skb->dev = dev; 6422 skb->dev = dev;
6419 6423
@@ -6458,7 +6462,7 @@ static int rx_osm_handler(ring_info_t *ring_data, RxD_t * rxdp)
6458 int buf2_len = RXD_GET_BUFFER2_SIZE_3(rxdp->Control_2); 6462 int buf2_len = RXD_GET_BUFFER2_SIZE_3(rxdp->Control_2);
6459 unsigned char *buff = skb_push(skb, buf0_len); 6463 unsigned char *buff = skb_push(skb, buf0_len);
6460 6464
6461 buffAdd_t *ba = &ring_data->ba[get_block][get_off]; 6465 struct buffAdd *ba = &ring_data->ba[get_block][get_off];
6462 sp->stats.rx_bytes += buf0_len + buf2_len; 6466 sp->stats.rx_bytes += buf0_len + buf2_len;
6463 memcpy(buff, ba->ba_0, buf0_len); 6467 memcpy(buff, ba->ba_0, buf0_len);
6464 6468
@@ -6588,7 +6592,7 @@ aggregate:
6588 * void. 6592 * void.
6589 */ 6593 */
6590 6594
6591static void s2io_link(nic_t * sp, int link) 6595static void s2io_link(struct s2io_nic * sp, int link)
6592{ 6596{
6593 struct net_device *dev = (struct net_device *) sp->dev; 6597 struct net_device *dev = (struct net_device *) sp->dev;
6594 6598
@@ -6632,7 +6636,7 @@ static int get_xena_rev_id(struct pci_dev *pdev)
6632 * void 6636 * void
6633 */ 6637 */
6634 6638
6635static void s2io_init_pci(nic_t * sp) 6639static void s2io_init_pci(struct s2io_nic * sp)
6636{ 6640{
6637 u16 pci_cmd = 0, pcix_cmd = 0; 6641 u16 pci_cmd = 0, pcix_cmd = 0;
6638 6642
@@ -6715,15 +6719,15 @@ static int s2io_verify_parm(struct pci_dev *pdev, u8 *dev_intr_type)
6715static int __devinit 6719static int __devinit
6716s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) 6720s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
6717{ 6721{
6718 nic_t *sp; 6722 struct s2io_nic *sp;
6719 struct net_device *dev; 6723 struct net_device *dev;
6720 int i, j, ret; 6724 int i, j, ret;
6721 int dma_flag = FALSE; 6725 int dma_flag = FALSE;
6722 u32 mac_up, mac_down; 6726 u32 mac_up, mac_down;
6723 u64 val64 = 0, tmp64 = 0; 6727 u64 val64 = 0, tmp64 = 0;
6724 XENA_dev_config_t __iomem *bar0 = NULL; 6728 struct XENA_dev_config __iomem *bar0 = NULL;
6725 u16 subid; 6729 u16 subid;
6726 mac_info_t *mac_control; 6730 struct mac_info *mac_control;
6727 struct config_param *config; 6731 struct config_param *config;
6728 int mode; 6732 int mode;
6729 u8 dev_intr_type = intr_type; 6733 u8 dev_intr_type = intr_type;
@@ -6778,7 +6782,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
6778 } 6782 }
6779 } 6783 }
6780 6784
6781 dev = alloc_etherdev(sizeof(nic_t)); 6785 dev = alloc_etherdev(sizeof(struct s2io_nic));
6782 if (dev == NULL) { 6786 if (dev == NULL) {
6783 DBG_PRINT(ERR_DBG, "Device allocation failed\n"); 6787 DBG_PRINT(ERR_DBG, "Device allocation failed\n");
6784 pci_disable_device(pdev); 6788 pci_disable_device(pdev);
@@ -6793,7 +6797,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
6793 6797
6794 /* Private member variable initialized to s2io NIC structure */ 6798 /* Private member variable initialized to s2io NIC structure */
6795 sp = dev->priv; 6799 sp = dev->priv;
6796 memset(sp, 0, sizeof(nic_t)); 6800 memset(sp, 0, sizeof(struct s2io_nic));
6797 sp->dev = dev; 6801 sp->dev = dev;
6798 sp->pdev = pdev; 6802 sp->pdev = pdev;
6799 sp->high_dma_flag = dma_flag; 6803 sp->high_dma_flag = dma_flag;
@@ -6909,7 +6913,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
6909 6913
6910 /* Initializing the BAR1 address as the start of the FIFO pointer. */ 6914 /* Initializing the BAR1 address as the start of the FIFO pointer. */
6911 for (j = 0; j < MAX_TX_FIFOS; j++) { 6915 for (j = 0; j < MAX_TX_FIFOS; j++) {
6912 mac_control->tx_FIFO_start[j] = (TxFIFO_element_t __iomem *) 6916 mac_control->tx_FIFO_start[j] = (struct TxFIFO_element __iomem *)
6913 (sp->bar1 + (j * 0x00020000)); 6917 (sp->bar1 + (j * 0x00020000));
6914 } 6918 }
6915 6919
@@ -7163,7 +7167,7 @@ static void __devexit s2io_rem_nic(struct pci_dev *pdev)
7163{ 7167{
7164 struct net_device *dev = 7168 struct net_device *dev =
7165 (struct net_device *) pci_get_drvdata(pdev); 7169 (struct net_device *) pci_get_drvdata(pdev);
7166 nic_t *sp; 7170 struct s2io_nic *sp;
7167 7171
7168 if (dev == NULL) { 7172 if (dev == NULL) {
7169 DBG_PRINT(ERR_DBG, "Driver Data is NULL!!\n"); 7173 DBG_PRINT(ERR_DBG, "Driver Data is NULL!!\n");
@@ -7215,7 +7219,7 @@ module_init(s2io_starter);
7215module_exit(s2io_closer); 7219module_exit(s2io_closer);
7216 7220
7217static int check_L2_lro_capable(u8 *buffer, struct iphdr **ip, 7221static int check_L2_lro_capable(u8 *buffer, struct iphdr **ip,
7218 struct tcphdr **tcp, RxD_t *rxdp) 7222 struct tcphdr **tcp, struct RxD_t *rxdp)
7219{ 7223{
7220 int ip_off; 7224 int ip_off;
7221 u8 l2_type = (u8)((rxdp->Control_1 >> 37) & 0x7), ip_len; 7225 u8 l2_type = (u8)((rxdp->Control_1 >> 37) & 0x7), ip_len;
@@ -7249,7 +7253,7 @@ static int check_L2_lro_capable(u8 *buffer, struct iphdr **ip,
7249 return 0; 7253 return 0;
7250} 7254}
7251 7255
7252static int check_for_socket_match(lro_t *lro, struct iphdr *ip, 7256static int check_for_socket_match(struct lro *lro, struct iphdr *ip,
7253 struct tcphdr *tcp) 7257 struct tcphdr *tcp)
7254{ 7258{
7255 DBG_PRINT(INFO_DBG,"%s: Been here...\n", __FUNCTION__); 7259 DBG_PRINT(INFO_DBG,"%s: Been here...\n", __FUNCTION__);
@@ -7264,7 +7268,7 @@ static inline int get_l4_pyld_length(struct iphdr *ip, struct tcphdr *tcp)
7264 return(ntohs(ip->tot_len) - (ip->ihl << 2) - (tcp->doff << 2)); 7268 return(ntohs(ip->tot_len) - (ip->ihl << 2) - (tcp->doff << 2));
7265} 7269}
7266 7270
7267static void initiate_new_session(lro_t *lro, u8 *l2h, 7271static void initiate_new_session(struct lro *lro, u8 *l2h,
7268 struct iphdr *ip, struct tcphdr *tcp, u32 tcp_pyld_len) 7272 struct iphdr *ip, struct tcphdr *tcp, u32 tcp_pyld_len)
7269{ 7273{
7270 DBG_PRINT(INFO_DBG,"%s: Been here...\n", __FUNCTION__); 7274 DBG_PRINT(INFO_DBG,"%s: Been here...\n", __FUNCTION__);
@@ -7290,12 +7294,12 @@ static void initiate_new_session(lro_t *lro, u8 *l2h,
7290 lro->in_use = 1; 7294 lro->in_use = 1;
7291} 7295}
7292 7296
7293static void update_L3L4_header(nic_t *sp, lro_t *lro) 7297static void update_L3L4_header(struct s2io_nic *sp, struct lro *lro)
7294{ 7298{
7295 struct iphdr *ip = lro->iph; 7299 struct iphdr *ip = lro->iph;
7296 struct tcphdr *tcp = lro->tcph; 7300 struct tcphdr *tcp = lro->tcph;
7297 u16 nchk; 7301 u16 nchk;
7298 StatInfo_t *statinfo = sp->mac_control.stats_info; 7302 struct stat_block *statinfo = sp->mac_control.stats_info;
7299 DBG_PRINT(INFO_DBG,"%s: Been here...\n", __FUNCTION__); 7303 DBG_PRINT(INFO_DBG,"%s: Been here...\n", __FUNCTION__);
7300 7304
7301 /* Update L3 header */ 7305 /* Update L3 header */
@@ -7321,7 +7325,7 @@ static void update_L3L4_header(nic_t *sp, lro_t *lro)
7321 statinfo->sw_stat.num_aggregations++; 7325 statinfo->sw_stat.num_aggregations++;
7322} 7326}
7323 7327
7324static void aggregate_new_rx(lro_t *lro, struct iphdr *ip, 7328static void aggregate_new_rx(struct lro *lro, struct iphdr *ip,
7325 struct tcphdr *tcp, u32 l4_pyld) 7329 struct tcphdr *tcp, u32 l4_pyld)
7326{ 7330{
7327 DBG_PRINT(INFO_DBG,"%s: Been here...\n", __FUNCTION__); 7331 DBG_PRINT(INFO_DBG,"%s: Been here...\n", __FUNCTION__);
@@ -7343,7 +7347,7 @@ static void aggregate_new_rx(lro_t *lro, struct iphdr *ip,
7343 } 7347 }
7344} 7348}
7345 7349
7346static int verify_l3_l4_lro_capable(lro_t *l_lro, struct iphdr *ip, 7350static int verify_l3_l4_lro_capable(struct lro *l_lro, struct iphdr *ip,
7347 struct tcphdr *tcp, u32 tcp_pyld_len) 7351 struct tcphdr *tcp, u32 tcp_pyld_len)
7348{ 7352{
7349 u8 *ptr; 7353 u8 *ptr;
@@ -7401,8 +7405,8 @@ static int verify_l3_l4_lro_capable(lro_t *l_lro, struct iphdr *ip,
7401} 7405}
7402 7406
7403static int 7407static int
7404s2io_club_tcp_session(u8 *buffer, u8 **tcp, u32 *tcp_len, lro_t **lro, 7408s2io_club_tcp_session(u8 *buffer, u8 **tcp, u32 *tcp_len, struct lro **lro,
7405 RxD_t *rxdp, nic_t *sp) 7409 struct RxD_t *rxdp, struct s2io_nic *sp)
7406{ 7410{
7407 struct iphdr *ip; 7411 struct iphdr *ip;
7408 struct tcphdr *tcph; 7412 struct tcphdr *tcph;
@@ -7419,7 +7423,7 @@ s2io_club_tcp_session(u8 *buffer, u8 **tcp, u32 *tcp_len, lro_t **lro,
7419 tcph = (struct tcphdr *)*tcp; 7423 tcph = (struct tcphdr *)*tcp;
7420 *tcp_len = get_l4_pyld_length(ip, tcph); 7424 *tcp_len = get_l4_pyld_length(ip, tcph);
7421 for (i=0; i<MAX_LRO_SESSIONS; i++) { 7425 for (i=0; i<MAX_LRO_SESSIONS; i++) {
7422 lro_t *l_lro = &sp->lro0_n[i]; 7426 struct lro *l_lro = &sp->lro0_n[i];
7423 if (l_lro->in_use) { 7427 if (l_lro->in_use) {
7424 if (check_for_socket_match(l_lro, ip, tcph)) 7428 if (check_for_socket_match(l_lro, ip, tcph))
7425 continue; 7429 continue;
@@ -7457,7 +7461,7 @@ s2io_club_tcp_session(u8 *buffer, u8 **tcp, u32 *tcp_len, lro_t **lro,
7457 } 7461 }
7458 7462
7459 for (i=0; i<MAX_LRO_SESSIONS; i++) { 7463 for (i=0; i<MAX_LRO_SESSIONS; i++) {
7460 lro_t *l_lro = &sp->lro0_n[i]; 7464 struct lro *l_lro = &sp->lro0_n[i];
7461 if (!(l_lro->in_use)) { 7465 if (!(l_lro->in_use)) {
7462 *lro = l_lro; 7466 *lro = l_lro;
7463 ret = 3; /* Begin anew */ 7467 ret = 3; /* Begin anew */
@@ -7496,9 +7500,9 @@ s2io_club_tcp_session(u8 *buffer, u8 **tcp, u32 *tcp_len, lro_t **lro,
7496 return ret; 7500 return ret;
7497} 7501}
7498 7502
7499static void clear_lro_session(lro_t *lro) 7503static void clear_lro_session(struct lro *lro)
7500{ 7504{
7501 static u16 lro_struct_size = sizeof(lro_t); 7505 static u16 lro_struct_size = sizeof(struct lro);
7502 7506
7503 memset(lro, 0, lro_struct_size); 7507 memset(lro, 0, lro_struct_size);
7504} 7508}
@@ -7514,7 +7518,8 @@ static void queue_rx_frame(struct sk_buff *skb)
7514 netif_rx(skb); 7518 netif_rx(skb);
7515} 7519}
7516 7520
7517static void lro_append_pkt(nic_t *sp, lro_t *lro, struct sk_buff *skb, 7521static void lro_append_pkt(struct s2io_nic *sp, struct lro *lro,
7522 struct sk_buff *skb,
7518 u32 tcp_len) 7523 u32 tcp_len)
7519{ 7524{
7520 struct sk_buff *first = lro->parent; 7525 struct sk_buff *first = lro->parent;
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h
index 8114f4b80e8a..a5e1a513deb5 100644
--- a/drivers/net/s2io.h
+++ b/drivers/net/s2io.h
@@ -39,7 +39,7 @@
39#define MAX_FLICKER_TIME 60000 /* 60 Secs */ 39#define MAX_FLICKER_TIME 60000 /* 60 Secs */
40 40
41/* Maximum outstanding splits to be configured into xena. */ 41/* Maximum outstanding splits to be configured into xena. */
42typedef enum xena_max_outstanding_splits { 42enum {
43 XENA_ONE_SPLIT_TRANSACTION = 0, 43 XENA_ONE_SPLIT_TRANSACTION = 0,
44 XENA_TWO_SPLIT_TRANSACTION = 1, 44 XENA_TWO_SPLIT_TRANSACTION = 1,
45 XENA_THREE_SPLIT_TRANSACTION = 2, 45 XENA_THREE_SPLIT_TRANSACTION = 2,
@@ -48,7 +48,7 @@ typedef enum xena_max_outstanding_splits {
48 XENA_TWELVE_SPLIT_TRANSACTION = 5, 48 XENA_TWELVE_SPLIT_TRANSACTION = 5,
49 XENA_SIXTEEN_SPLIT_TRANSACTION = 6, 49 XENA_SIXTEEN_SPLIT_TRANSACTION = 6,
50 XENA_THIRTYTWO_SPLIT_TRANSACTION = 7 50 XENA_THIRTYTWO_SPLIT_TRANSACTION = 7
51} xena_max_outstanding_splits; 51};
52#define XENA_MAX_OUTSTANDING_SPLITS(n) (n << 4) 52#define XENA_MAX_OUTSTANDING_SPLITS(n) (n << 4)
53 53
54/* OS concerned variables and constants */ 54/* OS concerned variables and constants */
@@ -79,7 +79,7 @@ static int debug_level = ERR_DBG;
79#define S2IO_JUMBO_SIZE 9600 79#define S2IO_JUMBO_SIZE 9600
80 80
81/* Driver statistics maintained by driver */ 81/* Driver statistics maintained by driver */
82typedef struct { 82struct swStat {
83 unsigned long long single_ecc_errs; 83 unsigned long long single_ecc_errs;
84 unsigned long long double_ecc_errs; 84 unsigned long long double_ecc_errs;
85 unsigned long long parity_err_cnt; 85 unsigned long long parity_err_cnt;
@@ -94,10 +94,10 @@ typedef struct {
94 unsigned long long flush_max_pkts; 94 unsigned long long flush_max_pkts;
95 unsigned long long sum_avg_pkts_aggregated; 95 unsigned long long sum_avg_pkts_aggregated;
96 unsigned long long num_aggregations; 96 unsigned long long num_aggregations;
97} swStat_t; 97};
98 98
99/* Xpak releated alarm and warnings */ 99/* Xpak releated alarm and warnings */
100typedef struct { 100struct xpakStat {
101 u64 alarm_transceiver_temp_high; 101 u64 alarm_transceiver_temp_high;
102 u64 alarm_transceiver_temp_low; 102 u64 alarm_transceiver_temp_low;
103 u64 alarm_laser_bias_current_high; 103 u64 alarm_laser_bias_current_high;
@@ -112,11 +112,11 @@ typedef struct {
112 u64 warn_laser_output_power_low; 112 u64 warn_laser_output_power_low;
113 u64 xpak_regs_stat; 113 u64 xpak_regs_stat;
114 u32 xpak_timer_count; 114 u32 xpak_timer_count;
115} xpakStat_t; 115};
116 116
117 117
118/* The statistics block of Xena */ 118/* The statistics block of Xena */
119typedef struct stat_block { 119struct stat_block {
120/* Tx MAC statistics counters. */ 120/* Tx MAC statistics counters. */
121 __le32 tmac_data_octets; 121 __le32 tmac_data_octets;
122 __le32 tmac_frms; 122 __le32 tmac_frms;
@@ -292,9 +292,9 @@ typedef struct stat_block {
292 __le32 reserved_14; 292 __le32 reserved_14;
293 __le32 link_fault_cnt; 293 __le32 link_fault_cnt;
294 u8 buffer[20]; 294 u8 buffer[20];
295 swStat_t sw_stat; 295 struct swStat sw_stat;
296 xpakStat_t xpak_stat; 296 struct xpakStat xpak_stat;
297} StatInfo_t; 297};
298 298
299/* 299/*
300 * Structures representing different init time configuration 300 * Structures representing different init time configuration
@@ -317,7 +317,7 @@ static int fifo_map[][MAX_TX_FIFOS] = {
317}; 317};
318 318
319/* Maintains Per FIFO related information. */ 319/* Maintains Per FIFO related information. */
320typedef struct tx_fifo_config { 320struct tx_fifo_config {
321#define MAX_AVAILABLE_TXDS 8192 321#define MAX_AVAILABLE_TXDS 8192
322 u32 fifo_len; /* specifies len of FIFO upto 8192, ie no of TxDLs */ 322 u32 fifo_len; /* specifies len of FIFO upto 8192, ie no of TxDLs */
323/* Priority definition */ 323/* Priority definition */
@@ -334,11 +334,11 @@ typedef struct tx_fifo_config {
334 u8 f_no_snoop; 334 u8 f_no_snoop;
335#define NO_SNOOP_TXD 0x01 335#define NO_SNOOP_TXD 0x01
336#define NO_SNOOP_TXD_BUFFER 0x02 336#define NO_SNOOP_TXD_BUFFER 0x02
337} tx_fifo_config_t; 337};
338 338
339 339
340/* Maintains per Ring related information */ 340/* Maintains per Ring related information */
341typedef struct rx_ring_config { 341struct rx_ring_config {
342 u32 num_rxd; /*No of RxDs per Rx Ring */ 342 u32 num_rxd; /*No of RxDs per Rx Ring */
343#define RX_RING_PRI_0 0 /* highest */ 343#define RX_RING_PRI_0 0 /* highest */
344#define RX_RING_PRI_1 1 344#define RX_RING_PRI_1 1
@@ -359,7 +359,7 @@ typedef struct rx_ring_config {
359 u8 f_no_snoop; 359 u8 f_no_snoop;
360#define NO_SNOOP_RXD 0x01 360#define NO_SNOOP_RXD 0x01
361#define NO_SNOOP_RXD_BUFFER 0x02 361#define NO_SNOOP_RXD_BUFFER 0x02
362} rx_ring_config_t; 362};
363 363
364/* This structure provides contains values of the tunable parameters 364/* This structure provides contains values of the tunable parameters
365 * of the H/W 365 * of the H/W
@@ -369,7 +369,7 @@ struct config_param {
369 u32 tx_fifo_num; /*Number of Tx FIFOs */ 369 u32 tx_fifo_num; /*Number of Tx FIFOs */
370 370
371 u8 fifo_mapping[MAX_TX_FIFOS]; 371 u8 fifo_mapping[MAX_TX_FIFOS];
372 tx_fifo_config_t tx_cfg[MAX_TX_FIFOS]; /*Per-Tx FIFO config */ 372 struct tx_fifo_config tx_cfg[MAX_TX_FIFOS]; /*Per-Tx FIFO config */
373 u32 max_txds; /*Max no. of Tx buffer descriptor per TxDL */ 373 u32 max_txds; /*Max no. of Tx buffer descriptor per TxDL */
374 u64 tx_intr_type; 374 u64 tx_intr_type;
375 /* Specifies if Tx Intr is UTILZ or PER_LIST type. */ 375 /* Specifies if Tx Intr is UTILZ or PER_LIST type. */
@@ -378,7 +378,7 @@ struct config_param {
378 u32 rx_ring_num; /*Number of receive rings */ 378 u32 rx_ring_num; /*Number of receive rings */
379#define MAX_RX_BLOCKS_PER_RING 150 379#define MAX_RX_BLOCKS_PER_RING 150
380 380
381 rx_ring_config_t rx_cfg[MAX_RX_RINGS]; /*Per-Rx Ring config */ 381 struct rx_ring_config rx_cfg[MAX_RX_RINGS]; /*Per-Rx Ring config */
382 u8 bimodal; /*Flag for setting bimodal interrupts*/ 382 u8 bimodal; /*Flag for setting bimodal interrupts*/
383 383
384#define HEADER_ETHERNET_II_802_3_SIZE 14 384#define HEADER_ETHERNET_II_802_3_SIZE 14
@@ -397,14 +397,14 @@ struct config_param {
397}; 397};
398 398
399/* Structure representing MAC Addrs */ 399/* Structure representing MAC Addrs */
400typedef struct mac_addr { 400struct mac_addr {
401 u8 mac_addr[ETH_ALEN]; 401 u8 mac_addr[ETH_ALEN];
402} macaddr_t; 402};
403 403
404/* Structure that represent every FIFO element in the BAR1 404/* Structure that represent every FIFO element in the BAR1
405 * Address location. 405 * Address location.
406 */ 406 */
407typedef struct _TxFIFO_element { 407struct TxFIFO_element {
408 u64 TxDL_Pointer; 408 u64 TxDL_Pointer;
409 409
410 u64 List_Control; 410 u64 List_Control;
@@ -415,10 +415,10 @@ typedef struct _TxFIFO_element {
415#define TX_FIFO_SPECIAL_FUNC BIT(23) 415#define TX_FIFO_SPECIAL_FUNC BIT(23)
416#define TX_FIFO_DS_NO_SNOOP BIT(31) 416#define TX_FIFO_DS_NO_SNOOP BIT(31)
417#define TX_FIFO_BUFF_NO_SNOOP BIT(30) 417#define TX_FIFO_BUFF_NO_SNOOP BIT(30)
418} TxFIFO_element_t; 418};
419 419
420/* Tx descriptor structure */ 420/* Tx descriptor structure */
421typedef struct _TxD { 421struct TxD {
422 u64 Control_1; 422 u64 Control_1;
423/* bit mask */ 423/* bit mask */
424#define TXD_LIST_OWN_XENA BIT(7) 424#define TXD_LIST_OWN_XENA BIT(7)
@@ -449,16 +449,16 @@ typedef struct _TxD {
449 449
450 u64 Buffer_Pointer; 450 u64 Buffer_Pointer;
451 u64 Host_Control; /* reserved for host */ 451 u64 Host_Control; /* reserved for host */
452} TxD_t; 452};
453 453
454/* Structure to hold the phy and virt addr of every TxDL. */ 454/* Structure to hold the phy and virt addr of every TxDL. */
455typedef struct list_info_hold { 455struct list_info_hold {
456 dma_addr_t list_phy_addr; 456 dma_addr_t list_phy_addr;
457 void *list_virt_addr; 457 void *list_virt_addr;
458} list_info_hold_t; 458};
459 459
460/* Rx descriptor structure for 1 buffer mode */ 460/* Rx descriptor structure for 1 buffer mode */
461typedef struct _RxD_t { 461struct RxD_t {
462 u64 Host_Control; /* reserved for host */ 462 u64 Host_Control; /* reserved for host */
463 u64 Control_1; 463 u64 Control_1;
464#define RXD_OWN_XENA BIT(7) 464#define RXD_OWN_XENA BIT(7)
@@ -483,21 +483,21 @@ typedef struct _RxD_t {
483#define SET_NUM_TAG(val) vBIT(val,16,32) 483#define SET_NUM_TAG(val) vBIT(val,16,32)
484 484
485 485
486} RxD_t; 486};
487/* Rx descriptor structure for 1 buffer mode */ 487/* Rx descriptor structure for 1 buffer mode */
488typedef struct _RxD1_t { 488struct RxD1 {
489 struct _RxD_t h; 489 struct RxD_t h;
490 490
491#define MASK_BUFFER0_SIZE_1 vBIT(0x3FFF,2,14) 491#define MASK_BUFFER0_SIZE_1 vBIT(0x3FFF,2,14)
492#define SET_BUFFER0_SIZE_1(val) vBIT(val,2,14) 492#define SET_BUFFER0_SIZE_1(val) vBIT(val,2,14)
493#define RXD_GET_BUFFER0_SIZE_1(_Control_2) \ 493#define RXD_GET_BUFFER0_SIZE_1(_Control_2) \
494 (u16)((_Control_2 & MASK_BUFFER0_SIZE_1) >> 48) 494 (u16)((_Control_2 & MASK_BUFFER0_SIZE_1) >> 48)
495 u64 Buffer0_ptr; 495 u64 Buffer0_ptr;
496} RxD1_t; 496};
497/* Rx descriptor structure for 3 or 2 buffer mode */ 497/* Rx descriptor structure for 3 or 2 buffer mode */
498 498
499typedef struct _RxD3_t { 499struct RxD3 {
500 struct _RxD_t h; 500 struct RxD_t h;
501 501
502#define MASK_BUFFER0_SIZE_3 vBIT(0xFF,2,14) 502#define MASK_BUFFER0_SIZE_3 vBIT(0xFF,2,14)
503#define MASK_BUFFER1_SIZE_3 vBIT(0xFFFF,16,16) 503#define MASK_BUFFER1_SIZE_3 vBIT(0xFFFF,16,16)
@@ -517,15 +517,15 @@ typedef struct _RxD3_t {
517 u64 Buffer0_ptr; 517 u64 Buffer0_ptr;
518 u64 Buffer1_ptr; 518 u64 Buffer1_ptr;
519 u64 Buffer2_ptr; 519 u64 Buffer2_ptr;
520} RxD3_t; 520};
521 521
522 522
523/* Structure that represents the Rx descriptor block which contains 523/* Structure that represents the Rx descriptor block which contains
524 * 128 Rx descriptors. 524 * 128 Rx descriptors.
525 */ 525 */
526typedef struct _RxD_block { 526struct RxD_block {
527#define MAX_RXDS_PER_BLOCK_1 127 527#define MAX_RXDS_PER_BLOCK_1 127
528 RxD1_t rxd[MAX_RXDS_PER_BLOCK_1]; 528 struct RxD1 rxd[MAX_RXDS_PER_BLOCK_1];
529 529
530 u64 reserved_0; 530 u64 reserved_0;
531#define END_OF_BLOCK 0xFEFFFFFFFFFFFFFFULL 531#define END_OF_BLOCK 0xFEFFFFFFFFFFFFFFULL
@@ -535,7 +535,7 @@ typedef struct _RxD_block {
535 u64 pNext_RxD_Blk_physical; /* Buff0_ptr.In a 32 bit arch 535 u64 pNext_RxD_Blk_physical; /* Buff0_ptr.In a 32 bit arch
536 * the upper 32 bits should 536 * the upper 32 bits should
537 * be 0 */ 537 * be 0 */
538} RxD_block_t; 538};
539 539
540#define SIZE_OF_BLOCK 4096 540#define SIZE_OF_BLOCK 4096
541 541
@@ -545,12 +545,12 @@ typedef struct _RxD_block {
545 545
546/* Structure to hold virtual addresses of Buf0 and Buf1 in 546/* Structure to hold virtual addresses of Buf0 and Buf1 in
547 * 2buf mode. */ 547 * 2buf mode. */
548typedef struct bufAdd { 548struct buffAdd {
549 void *ba_0_org; 549 void *ba_0_org;
550 void *ba_1_org; 550 void *ba_1_org;
551 void *ba_0; 551 void *ba_0;
552 void *ba_1; 552 void *ba_1;
553} buffAdd_t; 553};
554 554
555/* Structure which stores all the MAC control parameters */ 555/* Structure which stores all the MAC control parameters */
556 556
@@ -558,43 +558,46 @@ typedef struct bufAdd {
558 * from which the Rx Interrupt processor can start picking 558 * from which the Rx Interrupt processor can start picking
559 * up the RxDs for processing. 559 * up the RxDs for processing.
560 */ 560 */
561typedef struct _rx_curr_get_info_t { 561struct rx_curr_get_info {
562 u32 block_index; 562 u32 block_index;
563 u32 offset; 563 u32 offset;
564 u32 ring_len; 564 u32 ring_len;
565} rx_curr_get_info_t; 565};
566 566
567typedef rx_curr_get_info_t rx_curr_put_info_t; 567struct rx_curr_put_info {
568 u32 block_index;
569 u32 offset;
570 u32 ring_len;
571};
568 572
569/* This structure stores the offset of the TxDl in the FIFO 573/* This structure stores the offset of the TxDl in the FIFO
570 * from which the Tx Interrupt processor can start picking 574 * from which the Tx Interrupt processor can start picking
571 * up the TxDLs for send complete interrupt processing. 575 * up the TxDLs for send complete interrupt processing.
572 */ 576 */
573typedef struct { 577struct tx_curr_get_info {
574 u32 offset; 578 u32 offset;
575 u32 fifo_len; 579 u32 fifo_len;
576} tx_curr_get_info_t; 580};
577
578typedef tx_curr_get_info_t tx_curr_put_info_t;
579 581
582struct tx_curr_put_info {
583 u32 offset;
584 u32 fifo_len;
585};
580 586
581typedef struct rxd_info { 587struct rxd_info {
582 void *virt_addr; 588 void *virt_addr;
583 dma_addr_t dma_addr; 589 dma_addr_t dma_addr;
584}rxd_info_t; 590};
585 591
586/* Structure that holds the Phy and virt addresses of the Blocks */ 592/* Structure that holds the Phy and virt addresses of the Blocks */
587typedef struct rx_block_info { 593struct rx_block_info {
588 void *block_virt_addr; 594 void *block_virt_addr;
589 dma_addr_t block_dma_addr; 595 dma_addr_t block_dma_addr;
590 rxd_info_t *rxds; 596 struct rxd_info *rxds;
591} rx_block_info_t; 597};
592
593/* pre declaration of the nic structure */
594typedef struct s2io_nic nic_t;
595 598
596/* Ring specific structure */ 599/* Ring specific structure */
597typedef struct ring_info { 600struct ring_info {
598 /* The ring number */ 601 /* The ring number */
599 int ring_no; 602 int ring_no;
600 603
@@ -602,7 +605,7 @@ typedef struct ring_info {
602 * Place holders for the virtual and physical addresses of 605 * Place holders for the virtual and physical addresses of
603 * all the Rx Blocks 606 * all the Rx Blocks
604 */ 607 */
605 rx_block_info_t rx_blocks[MAX_RX_BLOCKS_PER_RING]; 608 struct rx_block_info rx_blocks[MAX_RX_BLOCKS_PER_RING];
606 int block_count; 609 int block_count;
607 int pkt_cnt; 610 int pkt_cnt;
608 611
@@ -610,24 +613,24 @@ typedef struct ring_info {
610 * Put pointer info which indictes which RxD has to be replenished 613 * Put pointer info which indictes which RxD has to be replenished
611 * with a new buffer. 614 * with a new buffer.
612 */ 615 */
613 rx_curr_put_info_t rx_curr_put_info; 616 struct rx_curr_put_info rx_curr_put_info;
614 617
615 /* 618 /*
616 * Get pointer info which indictes which is the last RxD that was 619 * Get pointer info which indictes which is the last RxD that was
617 * processed by the driver. 620 * processed by the driver.
618 */ 621 */
619 rx_curr_get_info_t rx_curr_get_info; 622 struct rx_curr_get_info rx_curr_get_info;
620 623
621 /* Index to the absolute position of the put pointer of Rx ring */ 624 /* Index to the absolute position of the put pointer of Rx ring */
622 int put_pos; 625 int put_pos;
623 626
624 /* Buffer Address store. */ 627 /* Buffer Address store. */
625 buffAdd_t **ba; 628 struct buffAdd **ba;
626 nic_t *nic; 629 struct s2io_nic *nic;
627} ring_info_t; 630};
628 631
629/* Fifo specific structure */ 632/* Fifo specific structure */
630typedef struct fifo_info { 633struct fifo_info {
631 /* FIFO number */ 634 /* FIFO number */
632 int fifo_no; 635 int fifo_no;
633 636
@@ -635,40 +638,40 @@ typedef struct fifo_info {
635 int max_txds; 638 int max_txds;
636 639
637 /* Place holder of all the TX List's Phy and Virt addresses. */ 640 /* Place holder of all the TX List's Phy and Virt addresses. */
638 list_info_hold_t *list_info; 641 struct list_info_hold *list_info;
639 642
640 /* 643 /*
641 * Current offset within the tx FIFO where driver would write 644 * Current offset within the tx FIFO where driver would write
642 * new Tx frame 645 * new Tx frame
643 */ 646 */
644 tx_curr_put_info_t tx_curr_put_info; 647 struct tx_curr_put_info tx_curr_put_info;
645 648
646 /* 649 /*
647 * Current offset within tx FIFO from where the driver would start freeing 650 * Current offset within tx FIFO from where the driver would start freeing
648 * the buffers 651 * the buffers
649 */ 652 */
650 tx_curr_get_info_t tx_curr_get_info; 653 struct tx_curr_get_info tx_curr_get_info;
651 654
652 nic_t *nic; 655 struct s2io_nic *nic;
653}fifo_info_t; 656};
654 657
655/* Information related to the Tx and Rx FIFOs and Rings of Xena 658/* Information related to the Tx and Rx FIFOs and Rings of Xena
656 * is maintained in this structure. 659 * is maintained in this structure.
657 */ 660 */
658typedef struct mac_info { 661struct mac_info {
659/* tx side stuff */ 662/* tx side stuff */
660 /* logical pointer of start of each Tx FIFO */ 663 /* logical pointer of start of each Tx FIFO */
661 TxFIFO_element_t __iomem *tx_FIFO_start[MAX_TX_FIFOS]; 664 struct TxFIFO_element __iomem *tx_FIFO_start[MAX_TX_FIFOS];
662 665
663 /* Fifo specific structure */ 666 /* Fifo specific structure */
664 fifo_info_t fifos[MAX_TX_FIFOS]; 667 struct fifo_info fifos[MAX_TX_FIFOS];
665 668
666 /* Save virtual address of TxD page with zero DMA addr(if any) */ 669 /* Save virtual address of TxD page with zero DMA addr(if any) */
667 void *zerodma_virt_addr; 670 void *zerodma_virt_addr;
668 671
669/* rx side stuff */ 672/* rx side stuff */
670 /* Ring specific structure */ 673 /* Ring specific structure */
671 ring_info_t rings[MAX_RX_RINGS]; 674 struct ring_info rings[MAX_RX_RINGS];
672 675
673 u16 rmac_pause_time; 676 u16 rmac_pause_time;
674 u16 mc_pause_threshold_q0q3; 677 u16 mc_pause_threshold_q0q3;
@@ -677,14 +680,14 @@ typedef struct mac_info {
677 void *stats_mem; /* orignal pointer to allocated mem */ 680 void *stats_mem; /* orignal pointer to allocated mem */
678 dma_addr_t stats_mem_phy; /* Physical address of the stat block */ 681 dma_addr_t stats_mem_phy; /* Physical address of the stat block */
679 u32 stats_mem_sz; 682 u32 stats_mem_sz;
680 StatInfo_t *stats_info; /* Logical address of the stat block */ 683 struct stat_block *stats_info; /* Logical address of the stat block */
681} mac_info_t; 684};
682 685
683/* structure representing the user defined MAC addresses */ 686/* structure representing the user defined MAC addresses */
684typedef struct { 687struct usr_addr {
685 char addr[ETH_ALEN]; 688 char addr[ETH_ALEN];
686 int usage_cnt; 689 int usage_cnt;
687} usr_addr_t; 690};
688 691
689/* Default Tunable parameters of the NIC. */ 692/* Default Tunable parameters of the NIC. */
690#define DEFAULT_FIFO_0_LEN 4096 693#define DEFAULT_FIFO_0_LEN 4096
@@ -717,7 +720,7 @@ struct msix_info_st {
717}; 720};
718 721
719/* Data structure to represent a LRO session */ 722/* Data structure to represent a LRO session */
720typedef struct lro { 723struct lro {
721 struct sk_buff *parent; 724 struct sk_buff *parent;
722 struct sk_buff *last_frag; 725 struct sk_buff *last_frag;
723 u8 *l2h; 726 u8 *l2h;
@@ -733,7 +736,7 @@ typedef struct lro {
733 u32 cur_tsval; 736 u32 cur_tsval;
734 u32 cur_tsecr; 737 u32 cur_tsecr;
735 u8 saw_ts; 738 u8 saw_ts;
736}lro_t; 739};
737 740
738/* Structure representing one instance of the NIC */ 741/* Structure representing one instance of the NIC */
739struct s2io_nic { 742struct s2io_nic {
@@ -744,7 +747,7 @@ struct s2io_nic {
744 */ 747 */
745 int pkts_to_process; 748 int pkts_to_process;
746 struct net_device *dev; 749 struct net_device *dev;
747 mac_info_t mac_control; 750 struct mac_info mac_control;
748 struct config_param config; 751 struct config_param config;
749 struct pci_dev *pdev; 752 struct pci_dev *pdev;
750 void __iomem *bar0; 753 void __iomem *bar0;
@@ -752,8 +755,8 @@ struct s2io_nic {
752#define MAX_MAC_SUPPORTED 16 755#define MAX_MAC_SUPPORTED 16
753#define MAX_SUPPORTED_MULTICASTS MAX_MAC_SUPPORTED 756#define MAX_SUPPORTED_MULTICASTS MAX_MAC_SUPPORTED
754 757
755 macaddr_t def_mac_addr[MAX_MAC_SUPPORTED]; 758 struct mac_addr def_mac_addr[MAX_MAC_SUPPORTED];
756 macaddr_t pre_mac_addr[MAX_MAC_SUPPORTED]; 759 struct mac_addr pre_mac_addr[MAX_MAC_SUPPORTED];
757 760
758 struct net_device_stats stats; 761 struct net_device_stats stats;
759 int high_dma_flag; 762 int high_dma_flag;
@@ -781,7 +784,7 @@ struct s2io_nic {
781#define MAX_ADDRS_SUPPORTED 64 784#define MAX_ADDRS_SUPPORTED 64
782 u16 usr_addr_count; 785 u16 usr_addr_count;
783 u16 mc_addr_count; 786 u16 mc_addr_count;
784 usr_addr_t usr_addrs[MAX_ADDRS_SUPPORTED]; 787 struct usr_addr usr_addrs[MAX_ADDRS_SUPPORTED];
785 788
786 u16 m_cast_flg; 789 u16 m_cast_flg;
787 u16 all_multi_pos; 790 u16 all_multi_pos;
@@ -837,7 +840,7 @@ struct s2io_nic {
837 u8 device_type; 840 u8 device_type;
838 841
839#define MAX_LRO_SESSIONS 32 842#define MAX_LRO_SESSIONS 32
840 lro_t lro0_n[MAX_LRO_SESSIONS]; 843 struct lro lro0_n[MAX_LRO_SESSIONS];
841 unsigned long clubbed_frms_cnt; 844 unsigned long clubbed_frms_cnt;
842 unsigned long sending_both; 845 unsigned long sending_both;
843 u8 lro; 846 u8 lro;
@@ -972,8 +975,8 @@ static void __devexit s2io_rem_nic(struct pci_dev *pdev);
972static int init_shared_mem(struct s2io_nic *sp); 975static int init_shared_mem(struct s2io_nic *sp);
973static void free_shared_mem(struct s2io_nic *sp); 976static void free_shared_mem(struct s2io_nic *sp);
974static int init_nic(struct s2io_nic *nic); 977static int init_nic(struct s2io_nic *nic);
975static void rx_intr_handler(ring_info_t *ring_data); 978static void rx_intr_handler(struct ring_info *ring_data);
976static void tx_intr_handler(fifo_info_t *fifo_data); 979static void tx_intr_handler(struct fifo_info *fifo_data);
977static void alarm_intr_handler(struct s2io_nic *sp); 980static void alarm_intr_handler(struct s2io_nic *sp);
978 981
979static int s2io_starter(void); 982static int s2io_starter(void);
@@ -981,38 +984,41 @@ static void s2io_closer(void);
981static void s2io_tx_watchdog(struct net_device *dev); 984static void s2io_tx_watchdog(struct net_device *dev);
982static void s2io_tasklet(unsigned long dev_addr); 985static void s2io_tasklet(unsigned long dev_addr);
983static void s2io_set_multicast(struct net_device *dev); 986static void s2io_set_multicast(struct net_device *dev);
984static int rx_osm_handler(ring_info_t *ring_data, RxD_t * rxdp); 987static int rx_osm_handler(struct ring_info *ring_data, struct RxD_t * rxdp);
985static void s2io_link(nic_t * sp, int link); 988static void s2io_link(struct s2io_nic * sp, int link);
986static void s2io_reset(nic_t * sp); 989static void s2io_reset(struct s2io_nic * sp);
987static int s2io_poll(struct net_device *dev, int *budget); 990static int s2io_poll(struct net_device *dev, int *budget);
988static void s2io_init_pci(nic_t * sp); 991static void s2io_init_pci(struct s2io_nic * sp);
989static int s2io_set_mac_addr(struct net_device *dev, u8 * addr); 992static int s2io_set_mac_addr(struct net_device *dev, u8 * addr);
990static void s2io_alarm_handle(unsigned long data); 993static void s2io_alarm_handle(unsigned long data);
991static int s2io_enable_msi(nic_t *nic); 994static int s2io_enable_msi(struct s2io_nic *nic);
992static irqreturn_t s2io_msi_handle(int irq, void *dev_id); 995static irqreturn_t s2io_msi_handle(int irq, void *dev_id);
993static irqreturn_t 996static irqreturn_t
994s2io_msix_ring_handle(int irq, void *dev_id); 997s2io_msix_ring_handle(int irq, void *dev_id);
995static irqreturn_t 998static irqreturn_t
996s2io_msix_fifo_handle(int irq, void *dev_id); 999s2io_msix_fifo_handle(int irq, void *dev_id);
997static irqreturn_t s2io_isr(int irq, void *dev_id); 1000static irqreturn_t s2io_isr(int irq, void *dev_id);
998static int verify_xena_quiescence(nic_t *sp); 1001static int verify_xena_quiescence(struct s2io_nic *sp);
999static const struct ethtool_ops netdev_ethtool_ops; 1002static const struct ethtool_ops netdev_ethtool_ops;
1000static void s2io_set_link(struct work_struct *work); 1003static void s2io_set_link(struct work_struct *work);
1001static int s2io_set_swapper(nic_t * sp); 1004static int s2io_set_swapper(struct s2io_nic * sp);
1002static void s2io_card_down(nic_t *nic); 1005static void s2io_card_down(struct s2io_nic *nic);
1003static int s2io_card_up(nic_t *nic); 1006static int s2io_card_up(struct s2io_nic *nic);
1004static int get_xena_rev_id(struct pci_dev *pdev); 1007static int get_xena_rev_id(struct pci_dev *pdev);
1005static int wait_for_cmd_complete(void *addr, u64 busy_bit); 1008static int wait_for_cmd_complete(void *addr, u64 busy_bit);
1006static int s2io_add_isr(nic_t * sp); 1009static int s2io_add_isr(struct s2io_nic * sp);
1007static void s2io_rem_isr(nic_t * sp); 1010static void s2io_rem_isr(struct s2io_nic * sp);
1008 1011
1009static void restore_xmsi_data(nic_t *nic); 1012static void restore_xmsi_data(struct s2io_nic *nic);
1010 1013
1011static int s2io_club_tcp_session(u8 *buffer, u8 **tcp, u32 *tcp_len, lro_t **lro, RxD_t *rxdp, nic_t *sp); 1014static int
1012static void clear_lro_session(lro_t *lro); 1015s2io_club_tcp_session(u8 *buffer, u8 **tcp, u32 *tcp_len, struct lro **lro,
1016 struct RxD_t *rxdp, struct s2io_nic *sp);
1017static void clear_lro_session(struct lro *lro);
1013static void queue_rx_frame(struct sk_buff *skb); 1018static void queue_rx_frame(struct sk_buff *skb);
1014static void update_L3L4_header(nic_t *sp, lro_t *lro); 1019static void update_L3L4_header(struct s2io_nic *sp, struct lro *lro);
1015static void lro_append_pkt(nic_t *sp, lro_t *lro, struct sk_buff *skb, u32 tcp_len); 1020static void lro_append_pkt(struct s2io_nic *sp, struct lro *lro,
1021 struct sk_buff *skb, u32 tcp_len);
1016 1022
1017#define s2io_tcp_mss(skb) skb_shinfo(skb)->gso_size 1023#define s2io_tcp_mss(skb) skb_shinfo(skb)->gso_size
1018#define s2io_udp_mss(skb) skb_shinfo(skb)->gso_size 1024#define s2io_udp_mss(skb) skb_shinfo(skb)->gso_size