diff options
author | Amit S. Kale <amitkale@netxen.com> | 2006-12-04 12:18:00 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-04 18:36:03 -0500 |
commit | 80922fbcb6f00127e91580e7565bb665947ac5d3 (patch) | |
tree | e7847240ca0813c217cb1d21dd94833c39845120 /drivers/net/netxen/netxen_nic.h | |
parent | 59dc76a4e3bed66f5be474dcdc81cc39c7290cec (diff) |
[PATCH] NetXen: whitespace cleaup and more cleanup fixes
Signed-off-by: Amit S. Kale <amitkale@netxen.com>
netxen_nic.h | 56 ++++++++++++++++++++--------------------------
netxen_nic_ethtool.c | 53 +++++++++++++++++++++-----------------------
netxen_nic_hdr.h | 6 ++---
netxen_nic_hw.c | 54 +++++++++++++++++++++------------------------
netxen_nic_hw.h | 10 ++++----
netxen_nic_init.c | 61 +++++++++++++++++++++++++--------------------------
netxen_nic_ioctl.h | 6 ++---
netxen_nic_isr.c | 48 +++++++++++++++++-----------------------
netxen_nic_main.c | 54 +++++++++++++++++----------------------------
netxen_nic_niu.c | 10 ++++----
10 files changed, 165 insertions(+), 193 deletions(-)
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/netxen/netxen_nic.h')
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 56 |
1 files changed, 25 insertions, 31 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index d925053fe597..d51f43709cb5 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -1,25 +1,25 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2003 - 2006 NetXen, Inc. | 2 | * Copyright (C) 2003 - 2006 NetXen, Inc. |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or | 5 | * This program is free software; you can redistribute it and/or |
6 | * modify it under the terms of the GNU General Public License | 6 | * modify it under the terms of the GNU General Public License |
7 | * as published by the Free Software Foundation; either version 2 | 7 | * as published by the Free Software Foundation; either version 2 |
8 | * of the License, or (at your option) any later version. | 8 | * of the License, or (at your option) any later version. |
9 | * | 9 | * |
10 | * This program is distributed in the hope that it will be useful, but | 10 | * This program is distributed in the hope that it will be useful, but |
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, write to the Free Software |
17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, | 17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
18 | * MA 02111-1307, USA. | 18 | * MA 02111-1307, USA. |
19 | * | 19 | * |
20 | * The full GNU General Public License is included in this distribution | 20 | * The full GNU General Public License is included in this distribution |
21 | * in the file called LICENSE. | 21 | * in the file called LICENSE. |
22 | * | 22 | * |
23 | * Contact Information: | 23 | * Contact Information: |
24 | * info@netxen.com | 24 | * info@netxen.com |
25 | * NetXen, | 25 | * NetXen, |
@@ -89,8 +89,8 @@ | |||
89 | * normalize a 64MB crb address to 32MB PCI window | 89 | * normalize a 64MB crb address to 32MB PCI window |
90 | * To use NETXEN_CRB_NORMALIZE, window _must_ be set to 1 | 90 | * To use NETXEN_CRB_NORMALIZE, window _must_ be set to 1 |
91 | */ | 91 | */ |
92 | #define NETXEN_CRB_NORMAL(reg) \ | 92 | #define NETXEN_CRB_NORMAL(reg) \ |
93 | (reg) - NETXEN_CRB_PCIX_HOST2 + NETXEN_CRB_PCIX_HOST | 93 | ((reg) - NETXEN_CRB_PCIX_HOST2 + NETXEN_CRB_PCIX_HOST) |
94 | 94 | ||
95 | #define NETXEN_CRB_NORMALIZE(adapter, reg) \ | 95 | #define NETXEN_CRB_NORMALIZE(adapter, reg) \ |
96 | pci_base_offset(adapter, NETXEN_CRB_NORMAL(reg)) | 96 | pci_base_offset(adapter, NETXEN_CRB_NORMAL(reg)) |
@@ -164,7 +164,7 @@ enum { | |||
164 | 164 | ||
165 | #define MAX_CMD_DESCRIPTORS 1024 | 165 | #define MAX_CMD_DESCRIPTORS 1024 |
166 | #define MAX_RCV_DESCRIPTORS 32768 | 166 | #define MAX_RCV_DESCRIPTORS 32768 |
167 | #define MAX_JUMBO_RCV_DESCRIPTORS 1024 | 167 | #define MAX_JUMBO_RCV_DESCRIPTORS 4096 |
168 | #define MAX_RCVSTATUS_DESCRIPTORS MAX_RCV_DESCRIPTORS | 168 | #define MAX_RCVSTATUS_DESCRIPTORS MAX_RCV_DESCRIPTORS |
169 | #define MAX_JUMBO_RCV_DESC MAX_JUMBO_RCV_DESCRIPTORS | 169 | #define MAX_JUMBO_RCV_DESC MAX_JUMBO_RCV_DESCRIPTORS |
170 | #define MAX_RCV_DESC MAX_RCV_DESCRIPTORS | 170 | #define MAX_RCV_DESC MAX_RCV_DESCRIPTORS |
@@ -559,7 +559,7 @@ typedef enum { | |||
559 | #define PRIMARY_START (BOOTLD_START) | 559 | #define PRIMARY_START (BOOTLD_START) |
560 | #define FLASH_CRBINIT_SIZE (0x4000) | 560 | #define FLASH_CRBINIT_SIZE (0x4000) |
561 | #define FLASH_BRDCFG_SIZE (sizeof(struct netxen_board_info)) | 561 | #define FLASH_BRDCFG_SIZE (sizeof(struct netxen_board_info)) |
562 | #define FLASH_USER_SIZE (sizeof(netxen_user_info)/sizeof(u32)) | 562 | #define FLASH_USER_SIZE (sizeof(struct netxen_user_info)/sizeof(u32)) |
563 | #define FLASH_SECONDARY_SIZE (USER_START-SECONDARY_START) | 563 | #define FLASH_SECONDARY_SIZE (USER_START-SECONDARY_START) |
564 | #define NUM_PRIMARY_SECTORS (0x20) | 564 | #define NUM_PRIMARY_SECTORS (0x20) |
565 | #define NUM_CONFIG_SECTORS (1) | 565 | #define NUM_CONFIG_SECTORS (1) |
@@ -572,7 +572,7 @@ typedef enum { | |||
572 | #else | 572 | #else |
573 | #define DPRINTK(klevel, fmt, args...) do { \ | 573 | #define DPRINTK(klevel, fmt, args...) do { \ |
574 | printk(KERN_##klevel PFX "%s: %s: " fmt, __FUNCTION__,\ | 574 | printk(KERN_##klevel PFX "%s: %s: " fmt, __FUNCTION__,\ |
575 | (adapter != NULL && adapter->port != NULL && \ | 575 | (adapter != NULL && \ |
576 | adapter->port[0] != NULL && \ | 576 | adapter->port[0] != NULL && \ |
577 | adapter->port[0]->netdev != NULL) ? \ | 577 | adapter->port[0]->netdev != NULL) ? \ |
578 | adapter->port[0]->netdev->name : NULL, \ | 578 | adapter->port[0]->netdev->name : NULL, \ |
@@ -703,8 +703,6 @@ struct netxen_recv_context { | |||
703 | 703 | ||
704 | #define NETXEN_NIC_MSI_ENABLED 0x02 | 704 | #define NETXEN_NIC_MSI_ENABLED 0x02 |
705 | 705 | ||
706 | struct netxen_drvops; | ||
707 | |||
708 | struct netxen_adapter { | 706 | struct netxen_adapter { |
709 | struct netxen_hardware_context ahw; | 707 | struct netxen_hardware_context ahw; |
710 | int port_count; /* Number of configured ports */ | 708 | int port_count; /* Number of configured ports */ |
@@ -746,8 +744,21 @@ struct netxen_adapter { | |||
746 | struct netxen_recv_context recv_ctx[MAX_RCV_CTX]; | 744 | struct netxen_recv_context recv_ctx[MAX_RCV_CTX]; |
747 | 745 | ||
748 | int is_up; | 746 | int is_up; |
749 | int work_done; | 747 | int (*enable_phy_interrupts) (struct netxen_adapter *, int); |
750 | struct netxen_drvops *ops; | 748 | int (*disable_phy_interrupts) (struct netxen_adapter *, int); |
749 | void (*handle_phy_intr) (struct netxen_adapter *); | ||
750 | int (*macaddr_set) (struct netxen_port *, netxen_ethernet_macaddr_t); | ||
751 | int (*set_mtu) (struct netxen_port *, int); | ||
752 | int (*set_promisc) (struct netxen_adapter *, int, | ||
753 | netxen_niu_prom_mode_t); | ||
754 | int (*unset_promisc) (struct netxen_adapter *, int, | ||
755 | netxen_niu_prom_mode_t); | ||
756 | int (*phy_read) (struct netxen_adapter *, long phy, long reg, u32 *); | ||
757 | int (*phy_write) (struct netxen_adapter *, long phy, long reg, u32 val); | ||
758 | int (*init_port) (struct netxen_adapter *, int); | ||
759 | void (*init_niu) (struct netxen_adapter *); | ||
760 | int (*stop_port) (struct netxen_adapter *, int); | ||
761 | |||
751 | }; /* netxen_adapter structure */ | 762 | }; /* netxen_adapter structure */ |
752 | 763 | ||
753 | /* Max number of xmit producer threads that can run simultaneously */ | 764 | /* Max number of xmit producer threads that can run simultaneously */ |
@@ -829,23 +840,6 @@ static inline void __iomem *pci_base(struct netxen_adapter *adapter, | |||
829 | return NULL; | 840 | return NULL; |
830 | } | 841 | } |
831 | 842 | ||
832 | struct netxen_drvops { | ||
833 | int (*enable_phy_interrupts) (struct netxen_adapter *, int); | ||
834 | int (*disable_phy_interrupts) (struct netxen_adapter *, int); | ||
835 | void (*handle_phy_intr) (struct netxen_adapter *); | ||
836 | int (*macaddr_set) (struct netxen_port *, netxen_ethernet_macaddr_t); | ||
837 | int (*set_mtu) (struct netxen_port *, int); | ||
838 | int (*set_promisc) (struct netxen_adapter *, int, | ||
839 | netxen_niu_prom_mode_t); | ||
840 | int (*unset_promisc) (struct netxen_adapter *, int, | ||
841 | netxen_niu_prom_mode_t); | ||
842 | int (*phy_read) (struct netxen_adapter *, long phy, long reg, u32 *); | ||
843 | int (*phy_write) (struct netxen_adapter *, long phy, long reg, u32 val); | ||
844 | int (*init_port) (struct netxen_adapter *, int); | ||
845 | void (*init_niu) (struct netxen_adapter *); | ||
846 | int (*stop_port) (struct netxen_adapter *, int); | ||
847 | }; | ||
848 | |||
849 | extern char netxen_nic_driver_name[]; | 843 | extern char netxen_nic_driver_name[]; |
850 | 844 | ||
851 | int netxen_niu_xgbe_enable_phy_interrupts(struct netxen_adapter *adapter, | 845 | int netxen_niu_xgbe_enable_phy_interrupts(struct netxen_adapter *adapter, |