mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-13 22:14:20 +08:00
[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>
This commit is contained in:
parent
e8a2b6a420
commit
71bd7877d4
@ -343,7 +343,6 @@ typedef enum {
|
||||
NETXEN_BRDTYPE_P2_SB31_10G_HMEZ = 0x000e,
|
||||
NETXEN_BRDTYPE_P2_SB31_10G_CX4 = 0x000f
|
||||
} netxen_brdtype_t;
|
||||
#define NUM_SUPPORTED_BOARDS (sizeof(netxen_boards)/sizeof(netxen_brdinfo_t))
|
||||
|
||||
typedef enum {
|
||||
NETXEN_BRDMFG_INVENTEC = 1
|
||||
@ -937,9 +936,7 @@ static inline void netxen_nic_disable_int(struct netxen_adapter *adapter)
|
||||
/*
|
||||
* ISR_INT_MASK: Can be read from window 0 or 1.
|
||||
*/
|
||||
writel(0x7ff,
|
||||
(void __iomem
|
||||
*)(PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK)));
|
||||
writel(0x7ff, PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK));
|
||||
|
||||
}
|
||||
|
||||
@ -959,14 +956,12 @@ static inline void netxen_nic_enable_int(struct netxen_adapter *adapter)
|
||||
break;
|
||||
}
|
||||
|
||||
writel(mask,
|
||||
(void __iomem
|
||||
*)(PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK)));
|
||||
writel(mask, PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_MASK));
|
||||
|
||||
if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) {
|
||||
mask = 0xbff;
|
||||
writel(mask, (void __iomem *)
|
||||
(PCI_OFFSET_SECOND_RANGE(adapter, ISR_INT_TARGET_MASK)));
|
||||
writel(mask, PCI_OFFSET_SECOND_RANGE(adapter,
|
||||
ISR_INT_TARGET_MASK));
|
||||
}
|
||||
}
|
||||
|
||||
@ -975,13 +970,13 @@ static inline void netxen_nic_enable_int(struct netxen_adapter *adapter)
|
||||
*/
|
||||
|
||||
#define NETXEN_MAX_SHORT_NAME 16
|
||||
typedef struct {
|
||||
struct netxen_brdinfo {
|
||||
netxen_brdtype_t brdtype; /* type of board */
|
||||
long ports; /* max no of physical ports */
|
||||
char short_name[NETXEN_MAX_SHORT_NAME];
|
||||
} netxen_brdinfo_t;
|
||||
};
|
||||
|
||||
static const netxen_brdinfo_t netxen_boards[] = {
|
||||
static const struct netxen_brdinfo netxen_boards[] = {
|
||||
{NETXEN_BRDTYPE_P2_SB31_10G_CX4, 1, "XGb CX4"},
|
||||
{NETXEN_BRDTYPE_P2_SB31_10G_HMEZ, 1, "XGb HMEZ"},
|
||||
{NETXEN_BRDTYPE_P2_SB31_10G_IMEZ, 2, "XGb IMEZ"},
|
||||
@ -990,24 +985,7 @@ static const netxen_brdinfo_t netxen_boards[] = {
|
||||
{NETXEN_BRDTYPE_P2_SB31_2G, 2, "Dual Gb"},
|
||||
};
|
||||
|
||||
#define NUM_SUPPORTED_BOARDS (sizeof(netxen_boards)/sizeof(netxen_brdinfo_t))
|
||||
|
||||
static inline void get_brd_ports_name_by_type(u32 type, int *ports, char *name)
|
||||
{
|
||||
int i, found = 0;
|
||||
for (i = 0; i < NUM_SUPPORTED_BOARDS; ++i) {
|
||||
if (netxen_boards[i].brdtype == type) {
|
||||
*ports = netxen_boards[i].ports;
|
||||
strcpy(name, netxen_boards[i].short_name);
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
*ports = 0;
|
||||
name = "Unknown";
|
||||
}
|
||||
}
|
||||
#define NUM_SUPPORTED_BOARDS (sizeof(netxen_boards)/sizeof(struct netxen_brdinfo))
|
||||
|
||||
static inline void get_brd_port_by_type(u32 type, int *ports)
|
||||
{
|
||||
|
@ -139,8 +139,7 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
|
||||
{
|
||||
struct netxen_port *port = netdev_priv(dev);
|
||||
struct netxen_adapter *adapter = port->adapter;
|
||||
struct netxen_board_info *boardinfo;
|
||||
boardinfo = &adapter->ahw.boardcfg;
|
||||
struct netxen_board_info *boardinfo = &adapter->ahw.boardcfg;
|
||||
|
||||
/* read which mode */
|
||||
if (adapter->ahw.board_type == NETXEN_NIC_GBE) {
|
||||
@ -208,7 +207,7 @@ netxen_nic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
|
||||
ecmd->autoneg = AUTONEG_DISABLE;
|
||||
break;
|
||||
default:
|
||||
printk("ERROR: Unsupported board model %d\n",
|
||||
printk(KERN_ERR "netxen-nic: Unsupported board model %d\n",
|
||||
(netxen_brdtype_t) boardinfo->board_type);
|
||||
return -EIO;
|
||||
|
||||
|
@ -275,10 +275,8 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter)
|
||||
rcv_desc->desc_head = (struct rcv_desc *)addr;
|
||||
}
|
||||
|
||||
addr = netxen_alloc(adapter->ahw.pdev,
|
||||
STATUS_DESC_RINGSIZE,
|
||||
&recv_ctx->
|
||||
rcv_status_desc_phys_addr,
|
||||
addr = netxen_alloc(adapter->ahw.pdev, STATUS_DESC_RINGSIZE,
|
||||
&recv_ctx->rcv_status_desc_phys_addr,
|
||||
&recv_ctx->rcv_status_desc_pdev);
|
||||
if (addr == NULL) {
|
||||
DPRINTK(ERR, "bad return from"
|
||||
@ -675,7 +673,7 @@ void netxen_nic_write_w0(struct netxen_adapter *adapter, u32 index, u32 value)
|
||||
void __iomem *addr;
|
||||
|
||||
netxen_nic_pci_change_crbwindow(adapter, 0);
|
||||
addr = (void __iomem *)(pci_base_offset(adapter, index));
|
||||
addr = pci_base_offset(adapter, index);
|
||||
writel(value, addr);
|
||||
netxen_nic_pci_change_crbwindow(adapter, 1);
|
||||
}
|
||||
@ -685,7 +683,7 @@ void netxen_nic_read_w0(struct netxen_adapter *adapter, u32 index, u32 * value)
|
||||
{
|
||||
void __iomem *addr;
|
||||
|
||||
addr = (void __iomem *)(pci_base_offset(adapter, index));
|
||||
addr = pci_base_offset(adapter, index);
|
||||
|
||||
netxen_nic_pci_change_crbwindow(adapter, 0);
|
||||
*value = readl(addr);
|
||||
@ -865,7 +863,7 @@ netxen_crb_writelit_adapter(struct netxen_adapter *adapter, unsigned long off,
|
||||
writel(data, NETXEN_CRB_NORMALIZE(adapter, off));
|
||||
} else {
|
||||
netxen_nic_pci_change_crbwindow(adapter, 0);
|
||||
addr = (void __iomem *)(pci_base_offset(adapter, off));
|
||||
addr = pci_base_offset(adapter, off);
|
||||
writel(data, addr);
|
||||
netxen_nic_pci_change_crbwindow(adapter, 1);
|
||||
}
|
||||
|
@ -969,11 +969,9 @@ netxen_handle_int(struct netxen_adapter *adapter, struct net_device *netdev)
|
||||
netxen_nic_disable_int(adapter);
|
||||
/* Window = 0 or 1 */
|
||||
do {
|
||||
writel(0xffffffff, (void __iomem *)
|
||||
(PCI_OFFSET_SECOND_RANGE
|
||||
(adapter, ISR_INT_TARGET_STATUS)));
|
||||
mask = readl((void __iomem *)
|
||||
pci_base_offset(adapter, ISR_INT_VECTOR));
|
||||
writel(0xffffffff, PCI_OFFSET_SECOND_RANGE(adapter,
|
||||
ISR_INT_TARGET_STATUS));
|
||||
mask = readl(pci_base_offset(adapter, ISR_INT_VECTOR));
|
||||
} while (((mask & 0x80) != 0) && (++count < 32));
|
||||
if ((mask & 0x80) != 0)
|
||||
printk("Could not disable interrupt completely\n");
|
||||
|
Loading…
Reference in New Issue
Block a user