diff options
author | Amit S. Kale <amitkale@netxen.com> | 2006-12-01 08:36:22 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-02 00:33:11 -0500 |
commit | 71bd7877d470b4037c9ef0d060ac39228f0f6289 (patch) | |
tree | 89e740bb45b1841f145bbc78cba34ce884c9fca8 | |
parent | e8a2b6a4207332a2d59628a12cece9e8c1d769e4 (diff) |
[PATCH] NetXen: driver cleanup, removed unnecessary __iomem type casts
Signed-off-by: Amit S. Kale <amitkale@netxen.com>
netxen_nic.h | 38 ++++++++------------------------------
netxen_nic_ethtool.c | 5 ++---
netxen_nic_hw.c | 12 +++++-------
netxen_nic_main.c | 8 +++-----
4 files changed, 18 insertions(+), 45 deletions(-)
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 38 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_ethtool.c | 5 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_hw.c | 12 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 8 |
4 files changed, 18 insertions, 45 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index 1bee560d7d0a..d925053fe597 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -343,7 +343,6 @@ typedef enum { | |||
343 | NETXEN_BRDTYPE_P2_SB31_10G_HMEZ = 0x000e, | 343 | NETXEN_BRDTYPE_P2_SB31_10G_HMEZ = 0x000e, |
344 | NETXEN_BRDTYPE_P2_SB31_10G_CX4 = 0x000f | 344 | NETXEN_BRDTYPE_P2_SB31_10G_CX4 = 0x000f |
345 | } netxen_brdtype_t; | 345 | } netxen_brdtype_t; |
346 | #define NUM_SUPPORTED_BOARDS (sizeof(netxen_boards)/sizeof(netxen_brdinfo_t)) | ||
347 | 346 | ||
348 | typedef enum { | 347 | typedef enum { |
349 | NETXEN_BRDMFG_INVENTEC = 1 | 348 | NETXEN_BRDMFG_INVENTEC = 1 |
@@ -937,9 +936,7 @@ static inline void netxen_nic_disable_int(struct netxen_adapter *adapter) | |||
937 | /* | 936 | /* |
938 | * ISR_INT_MASK: Can be read from window 0 or 1. | 937 | * ISR_INT_MASK: Can be read from window 0 or 1. |
939 | */ | 938 | */ |
940 | writel(0x7ff, | 939 | writel(0x7ff, PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK)); |
941 | (void __iomem | ||
942 | *)(PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK))); | ||
943 | 940 | ||
944 | } | 941 | } |
945 | 942 | ||
@@ -959,14 +956,12 @@ static inline void netxen_nic_enable_int(struct netxen_adapter *adapter) | |||
959 | break; | 956 | break; |
960 | } | 957 | } |
961 | 958 | ||
962 | writel(mask, | 959 | writel(mask, PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK)); |
963 | (void __iomem | ||
964 | *)(PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK))); | ||
965 | 960 | ||
966 | if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) { | 961 | if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) { |
967 | mask = 0xbff; | 962 | mask = 0xbff; |
968 | writel(mask, (void __iomem *) | 963 | writel(mask, PCI_OFFSET_SECOND_RANGE(adapter, |
969 | (PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_TARGET_MASK))); | 964 | ISR_INT_TARGET_MASK)); |
970 | } | 965 | } |
971 | } | 966 | } |
972 | 967 | ||
@@ -975,13 +970,13 @@ static inline void netxen_nic_enable_int(struct netxen_adapter *adapter) | |||
975 | */ | 970 | */ |
976 | 971 | ||
977 | #define NETXEN_MAX_SHORT_NAME 16 | 972 | #define NETXEN_MAX_SHORT_NAME 16 |
978 | typedef struct { | 973 | struct netxen_brdinfo { |
979 | netxen_brdtype_t brdtype; /* type of board */ | 974 | netxen_brdtype_t brdtype; /* type of board */ |
980 | long ports; /* max no of physical ports */ | 975 | long ports; /* max no of physical ports */ |
981 | char short_name[NETXEN_MAX_SHORT_NAME]; | 976 | char short_name[NETXEN_MAX_SHORT_NAME]; |
982 | } netxen_brdinfo_t; | 977 | }; |
983 | 978 | ||
984 | static const netxen_brdinfo_t netxen_boards[] = { | 979 | static const struct netxen_brdinfo netxen_boards[] = { |
985 | {NETXEN_BRDTYPE_P2_SB31_10G_CX4, 1, "XGb CX4"}, | 980 | {NETXEN_BRDTYPE_P2_SB31_10G_CX4, 1, "XGb CX4"}, |
986 | {NETXEN_BRDTYPE_P2_SB31_10G_HMEZ, 1, "XGb HMEZ"}, | 981 | {NETXEN_BRDTYPE_P2_SB31_10G_HMEZ, 1, "XGb HMEZ"}, |
987 | {NETXEN_BRDTYPE_P2_SB31_10G_IMEZ, 2, "XGb IMEZ"}, | 982 | {NETXEN_BRDTYPE_P2_SB31_10G_IMEZ, 2, "XGb IMEZ"}, |
@@ -990,24 +985,7 @@ static const netxen_brdinfo_t netxen_boards[] = { | |||
990 | {NETXEN_BRDTYPE_P2_SB31_2G, 2, "Dual Gb"}, | 985 | {NETXEN_BRDTYPE_P2_SB31_2G, 2, "Dual Gb"}, |
991 | }; | 986 | }; |
992 | 987 | ||
993 | #define NUM_SUPPORTED_BOARDS (sizeof(netxen_boards)/sizeof(netxen_brdinfo_t)) | 988 | #define NUM_SUPPORTED_BOARDS (sizeof(netxen_boards)/sizeof(struct netxen_brdinfo)) |
994 | |||
995 | static inline void get_brd_ports_name_by_type(u32 type, int *ports, char *name) | ||
996 | { | ||
997 | int i, found = 0; | ||
998 | for (i = 0; i < NUM_SUPPORTED_BOARDS; ++i) { | ||
999 | if (netxen_boards[i].brdtype == type) { | ||
1000 | *ports = netxen_boards[i].ports; | ||
1001 | strcpy(name, netxen_boards[i].short_name); | ||
1002 | found = 1; | ||
1003 | break; | ||
1004 | } | ||
1005 | } | ||
1006 | if (!found) { | ||
1007 | *ports = 0; | ||
1008 | name = "Unknown"; | ||
1009 | } | ||
1010 | } | ||
1011 | 989 | ||
1012 | static inline void get_brd_port_by_type(u32 type, int *ports) | 990 | static inline void get_brd_port_by_type(u32 type, int *ports) |
1013 | { | 991 | { |
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c index f3fc35cf8af7..9a914aeba5bc 100644 --- a/drivers/net/netxen/netxen_nic_ethtool.c +++ b/drivers/net/netxen/netxen_nic_ethtool.c | |||
@@ -139,8 +139,7 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
139 | { | 139 | { |
140 | struct netxen_port *port = netdev_priv(dev); | 140 | struct netxen_port *port = netdev_priv(dev); |
141 | struct netxen_adapter *adapter = port->adapter; | 141 | struct netxen_adapter *adapter = port->adapter; |
142 | struct netxen_board_info *boardinfo; | 142 | struct netxen_board_info *boardinfo = &adapter->ahw.boardcfg; |
143 | boardinfo = &adapter->ahw.boardcfg; | ||
144 | 143 | ||
145 | /* read which mode */ | 144 | /* read which mode */ |
146 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { | 145 | if (adapter->ahw.board_type == NETXEN_NIC_GBE) { |
@@ -208,7 +207,7 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
208 | ecmd->autoneg = AUTONEG_DISABLE; | 207 | ecmd->autoneg = AUTONEG_DISABLE; |
209 | break; | 208 | break; |
210 | default: | 209 | default: |
211 | printk("ERROR: Unsupported board model %d\n", | 210 | printk(KERN_ERR "netxen-nic: Unsupported board model %d\n", |
212 | (netxen_brdtype_t) boardinfo->board_type); | 211 | (netxen_brdtype_t) boardinfo->board_type); |
213 | return -EIO; | 212 | return -EIO; |
214 | 213 | ||
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index 99e647a5ae76..105c24f0ad4c 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -275,10 +275,8 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter) | |||
275 | rcv_desc->desc_head = (struct rcv_desc *)addr; | 275 | rcv_desc->desc_head = (struct rcv_desc *)addr; |
276 | } | 276 | } |
277 | 277 | ||
278 | addr = netxen_alloc(adapter->ahw.pdev, | 278 | addr = netxen_alloc(adapter->ahw.pdev, STATUS_DESC_RINGSIZE, |
279 | STATUS_DESC_RINGSIZE, | 279 | &recv_ctx->rcv_status_desc_phys_addr, |
280 | &recv_ctx-> | ||
281 | rcv_status_desc_phys_addr, | ||
282 | &recv_ctx->rcv_status_desc_pdev); | 280 | &recv_ctx->rcv_status_desc_pdev); |
283 | if (addr == NULL) { | 281 | if (addr == NULL) { |
284 | DPRINTK(ERR, "bad return from" | 282 | DPRINTK(ERR, "bad return from" |
@@ -675,7 +673,7 @@ void netxen_nic_write_w0(struct netxen_adapter *adapter, u32 index, u32 value) | |||
675 | void __iomem *addr; | 673 | void __iomem *addr; |
676 | 674 | ||
677 | netxen_nic_pci_change_crbwindow(adapter, 0); | 675 | netxen_nic_pci_change_crbwindow(adapter, 0); |
678 | addr = (void __iomem *)(pci_base_offset(adapter, index)); | 676 | addr = pci_base_offset(adapter, index); |
679 | writel(value, addr); | 677 | writel(value, addr); |
680 | netxen_nic_pci_change_crbwindow(adapter, 1); | 678 | netxen_nic_pci_change_crbwindow(adapter, 1); |
681 | } | 679 | } |
@@ -685,7 +683,7 @@ void netxen_nic_read_w0(struct netxen_adapter *adapter, u32 index, u32 * value) | |||
685 | { | 683 | { |
686 | void __iomem *addr; | 684 | void __iomem *addr; |
687 | 685 | ||
688 | addr = (void __iomem *)(pci_base_offset(adapter, index)); | 686 | addr = pci_base_offset(adapter, index); |
689 | 687 | ||
690 | netxen_nic_pci_change_crbwindow(adapter, 0); | 688 | netxen_nic_pci_change_crbwindow(adapter, 0); |
691 | *value = readl(addr); | 689 | *value = readl(addr); |
@@ -865,7 +863,7 @@ netxen_crb_writelit_adapter(struct netxen_adapter *adapter, unsigned long off, | |||
865 | writel(data, NETXEN_CRB_NORMALIZE(adapter, off)); | 863 | writel(data, NETXEN_CRB_NORMALIZE(adapter, off)); |
866 | } else { | 864 | } else { |
867 | netxen_nic_pci_change_crbwindow(adapter, 0); | 865 | netxen_nic_pci_change_crbwindow(adapter, 0); |
868 | addr = (void __iomem *)(pci_base_offset(adapter, off)); | 866 | addr = pci_base_offset(adapter, off); |
869 | writel(data, addr); | 867 | writel(data, addr); |
870 | netxen_nic_pci_change_crbwindow(adapter, 1); | 868 | netxen_nic_pci_change_crbwindow(adapter, 1); |
871 | } | 869 | } |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index cd1336e899b1..1cb662d5bd76 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -969,11 +969,9 @@ netxen_handle_int(struct netxen_adapter *adapter, struct net_device *netdev) | |||
969 | netxen_nic_disable_int(adapter); | 969 | netxen_nic_disable_int(adapter); |
970 | /* Window = 0 or 1 */ | 970 | /* Window = 0 or 1 */ |
971 | do { | 971 | do { |
972 | writel(0xffffffff, (void __iomem *) | 972 | writel(0xffffffff, PCI_OFFSET_SECOND_RANGE(adapter, |
973 | (PCI_OFFSET_SECOND_RANGE | 973 | ISR_INT_TARGET_STATUS)); |
974 | (adapter, ISR_INT_TARGET_STATUS))); | 974 | mask = readl(pci_base_offset(adapter, ISR_INT_VECTOR)); |
975 | mask = readl((void __iomem *) | ||
976 | pci_base_offset(adapter, ISR_INT_VECTOR)); | ||
977 | } while (((mask & 0x80) != 0) && (++count < 32)); | 975 | } while (((mask & 0x80) != 0) && (++count < 32)); |
978 | if ((mask & 0x80) != 0) | 976 | if ((mask & 0x80) != 0) |
979 | printk("Could not disable interrupt completely\n"); | 977 | printk("Could not disable interrupt completely\n"); |