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
/*
* 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));
}
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));
}
}
*/
#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"},
{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)
{
{
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) {
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;
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"
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);
}
{
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);
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);
}
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");